mirror of
https://github.com/AndorsTrailRelease/ATCS.git
synced 2025-10-27 18:44:03 +01:00
Compare commits
3 Commits
v0.6.24-be
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9654da02c2 | ||
|
|
d5c1ccebce | ||
|
|
0bf6b3f4d1 |
@@ -38,7 +38,7 @@ public class NPC extends JSONElement {
|
||||
public Integer attack_damage_min = null;
|
||||
public String spawngroup_id = null;
|
||||
public String faction_id = null;
|
||||
public Integer spriteFlipChance = null;
|
||||
public Integer horizontalFlipChance = null;
|
||||
public String dialogue_id = null;
|
||||
public String droplist_id = null;
|
||||
public Integer attack_cost = null;
|
||||
@@ -156,7 +156,7 @@ public class NPC extends JSONElement {
|
||||
}
|
||||
this.spawngroup_id = (String) npcJson.get("spawnGroup");
|
||||
this.faction_id = (String) npcJson.get("faction");
|
||||
this.spriteFlipChance = JSONElement.getInteger((Number) npcJson.get("spriteFlipChance"));
|
||||
this.horizontalFlipChance = JSONElement.getInteger((Number) npcJson.get("horizontalFlipChance"));
|
||||
this.dialogue_id = (String) npcJson.get("phraseID");
|
||||
this.droplist_id = (String) npcJson.get("droplistID");
|
||||
this.attack_cost = JSONElement.getInteger((Number) npcJson.get("attackCost"));
|
||||
@@ -246,7 +246,7 @@ public class NPC extends JSONElement {
|
||||
}
|
||||
clone.droplist_id = this.droplist_id;
|
||||
clone.faction_id = this.faction_id;
|
||||
clone.spriteFlipChance = this.spriteFlipChance;
|
||||
clone.horizontalFlipChance = this.horizontalFlipChance;
|
||||
if (this.hit_effect != null) {
|
||||
clone.hit_effect = new HitEffect();
|
||||
copyHitEffectValues(clone.hit_effect, this.hit_effect, clone);
|
||||
@@ -305,7 +305,7 @@ public class NPC extends JSONElement {
|
||||
writeMinMaxToMap(npcJson, "attackDamage", this.attack_damage_min, attack_damage_max, 0);
|
||||
if (this.spawngroup_id != null) npcJson.put("spawnGroup", this.spawngroup_id);
|
||||
if (this.faction_id != null) npcJson.put("faction", this.faction_id);
|
||||
if (this.spriteFlipChance != null) npcJson.put("spriteFlipChance", this.spriteFlipChance);
|
||||
if (this.horizontalFlipChance != null) npcJson.put("horizontalFlipChance", this.horizontalFlipChance);
|
||||
if (this.dialogue != null) {
|
||||
npcJson.put("phraseID", this.dialogue.id);
|
||||
} else if (this.dialogue_id != null) {
|
||||
|
||||
@@ -64,7 +64,8 @@ public class Requirement extends JSONElement {
|
||||
date,
|
||||
dateEquals,
|
||||
time,
|
||||
timeEquals
|
||||
timeEquals,
|
||||
skillIncrease
|
||||
}
|
||||
|
||||
public enum SkillID {
|
||||
@@ -166,6 +167,7 @@ public class Requirement extends JSONElement {
|
||||
case dateEquals:
|
||||
case time:
|
||||
case timeEquals:
|
||||
case skillIncrease:
|
||||
break;
|
||||
}
|
||||
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);
|
||||
|
||||
@@ -610,6 +610,17 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case skillIncrease:
|
||||
skillId = null;
|
||||
try {
|
||||
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
|
||||
} catch (IllegalArgumentException e) {
|
||||
}
|
||||
requirementObj = null;
|
||||
requirementSkill = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
|
||||
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Level up: ", requirement.required_value, false, writable, listener);
|
||||
break;
|
||||
}
|
||||
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
|
||||
}
|
||||
@@ -843,7 +854,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
if (req.required_obj.getIcon() != null) {
|
||||
label.setIcon(new ImageIcon(req.required_obj.getIcon()));
|
||||
}
|
||||
} else if (req.type == Requirement.RequirementType.skillLevel) {
|
||||
} else if (req.type == Requirement.RequirementType.skillLevel || req.type == Requirement.RequirementType.skillIncrease) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.spentGold) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getGoldIcon()));
|
||||
@@ -1008,7 +1019,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
selectedRequirement.required_obj.removeBacklink(dialogue);
|
||||
selectedRequirement.required_obj = null;
|
||||
}
|
||||
if (selectedRequirement.type == Requirement.RequirementType.skillLevel) {
|
||||
if (selectedRequirement.type == Requirement.RequirementType.skillLevel || selectedRequirement.type == Requirement.RequirementType.skillIncrease) {
|
||||
selectedRequirement.required_obj_id = value == null ? null : value.toString();
|
||||
}
|
||||
requirementsListModel.itemChanged(selectedRequirement);
|
||||
|
||||
@@ -37,7 +37,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
private JTextField nameField;
|
||||
private JTextField spawnGroupField;
|
||||
private JTextField factionField;
|
||||
private JSpinner spriteFlipChanceField;
|
||||
private JSpinner horizontalFlipChanceField;
|
||||
private JSpinner experienceField;
|
||||
private MyComboBox dialogueBox;
|
||||
private MyComboBox droplistBox;
|
||||
@@ -129,7 +129,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
nameField = addTranslatableTextField(pane, "Display name: ", npc.name, npc.writable, listener);
|
||||
spawnGroupField = addTextField(pane, "Spawn group ID: ", npc.spawngroup_id, npc.writable, listener);
|
||||
factionField = addTextField(pane, "Faction ID: ", npc.faction_id, npc.writable, listener);
|
||||
spriteFlipChanceField = addIntegerField(pane, "Icon Flip Chance: ", npc.spriteFlipChance, false, npc.writable, listener);
|
||||
horizontalFlipChanceField = addIntegerField(pane, "Horizontal flip chance: ", npc.horizontalFlipChance, false, npc.writable, listener);
|
||||
experienceField = addIntegerField(pane, "Experience reward: ", npc.getMonsterExperience(), false, false, listener);
|
||||
dialogueBox = addDialogueBox(pane, npc.getProject(), "Initial phrase: ", npc.dialogue, npc.writable, listener);
|
||||
droplistBox = addDroplistBox(pane, npc.getProject(), "Droplist / Shop inventory: ", npc.droplist, npc.writable, listener);
|
||||
@@ -207,8 +207,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
npc.spawngroup_id = (String) value;
|
||||
} else if (source == factionField) {
|
||||
npc.faction_id = (String) value;
|
||||
} else if (source == spriteFlipChanceField) {
|
||||
npc.spriteFlipChance = (Integer) value;
|
||||
} else if (source == horizontalFlipChanceField) {
|
||||
npc.horizontalFlipChance = (Integer) value;
|
||||
} else if (source == dialogueBox) {
|
||||
if (npc.dialogue != null) {
|
||||
npc.dialogue.removeBacklink(npc);
|
||||
|
||||
@@ -674,6 +674,16 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
requirementObjId = addTextField(pane, "Time type HHMMSS:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Exact time value: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case skillIncrease:
|
||||
skillId = null;
|
||||
try {
|
||||
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
|
||||
} catch (IllegalArgumentException e) {
|
||||
}
|
||||
requirementObj = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
|
||||
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
||||
break;
|
||||
}
|
||||
}
|
||||
requirementNegated = addBooleanBasedCheckBox(pane, "Negate this requirement.", requirement.negated, writable, listener);
|
||||
@@ -1921,7 +1931,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
} else if (source == requirementObj) {
|
||||
if (selectedMapObject instanceof KeyArea) {
|
||||
KeyArea area = (KeyArea) selectedMapObject;
|
||||
if (area.requirement.type == Requirement.RequirementType.skillLevel) {
|
||||
if (area.requirement.type == Requirement.RequirementType.skillLevel || area.requirement.type == Requirement.RequirementType.skillIncrease) {
|
||||
area.requirement.required_obj_id = value == null ? null : value.toString();
|
||||
} else {
|
||||
area.requirement.required_obj = (GameDataElement) value;
|
||||
@@ -1938,7 +1948,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
if (area.requirement.type == Requirement.RequirementType.skillLevel) {
|
||||
if (area.requirement.type == Requirement.RequirementType.skillLevel || area.requirement.type == Requirement.RequirementType.skillIncrease) {
|
||||
area.requirement.required_obj_id = value == null ? null : value.toString();
|
||||
} else {
|
||||
area.requirement.required_obj = (GameDataElement) value;
|
||||
|
||||
Reference in New Issue
Block a user