From 29241f18b8a811a571cd7d62618bda374f98647d Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Tue, 23 Sep 2025 18:33:53 +0200 Subject: [PATCH 1/8] improve EffectPane generics and usage & fix hitReceivedEffect --- .../ui/gamedataeditors/CommonEditor.java | 70 ++++++++++--------- .../ui/gamedataeditors/ItemEditor.java | 34 ++++----- .../ui/gamedataeditors/NPCEditor.java | 25 +++---- 3 files changed, 56 insertions(+), 73 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java index 02e9926..443a543 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java @@ -26,7 +26,7 @@ public class CommonEditor { private static final long serialVersionUID = 7987880146189575234L; @Override - public Component getListCellRendererComponent(@SuppressWarnings("rawtypes") JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (c instanceof JLabel) { JLabel label = (JLabel) c; @@ -68,7 +68,7 @@ public class CommonEditor { private static final long serialVersionUID = 7987880146189575234L; @Override - public Component getListCellRendererComponent(@SuppressWarnings("rawtypes") JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); if (c instanceof JLabel) { JLabel label = (JLabel) c; @@ -90,7 +90,7 @@ public class CommonEditor { } } - public static class HitRecievedEffectPane> extends HitEffectPane { + public static class HitReceivedEffectPane extends HitEffectPane { /// this should just be a convenience field, to access it, without casting. DO NOT SET WITHOUT ALSO SETTING THE FIELD IN THE SUPER-CLASS! EFFECT effect; private JSpinner hitReceivedEffectHPMinTarget; @@ -98,13 +98,13 @@ public class CommonEditor { private JSpinner hitReceivedEffectAPMinTarget; private JSpinner hitReceivedEffectAPMaxTarget; - public HitRecievedEffectPane(String title, Supplier sourceNewSupplier, Editor editor, String applyToHint, String applyToTargetHint) { - super(title, sourceNewSupplier, editor, applyToHint, applyToTargetHint); + public HitReceivedEffectPane(String title, Editor editor, String applyToHint, String applyToTargetHint) { + super(title, editor, applyToHint, applyToTargetHint); } - void createHitReceivedEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e, MODEL sourceConditionsModelInput, MODEL targetConditionsModelInput) { + void createHitReceivedEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { effect = e; - createHitEffectPaneContent(listener, writable, e, sourceConditionsModelInput, targetConditionsModelInput); + createHitEffectPaneContent(listener, writable, e); } @Override @@ -144,32 +144,34 @@ public class CommonEditor { } } - public static class HitEffectPane> extends DeathEffectPane { + public static class HitEffectPane + + extends DeathEffectPane { /// this should just be a convenience field, to access it, without casting. DO NOT SET WITHOUT ALSO SETTING THE FIELD IN THE SUPER-CLASS! public EFFECT effect; protected final String applyToTargetHint; - private JList hitTargetConditionsList; - private final ConditionEffectEditorPane hitTargetConditionPane; + private JList hitTargetConditionsList; + private final ConditionEffectEditorPane hitTargetConditionPane; /* * create a new HitEffectPane with the selections (probably passed in from last time) */ - public HitEffectPane(String title, Supplier sourceNewSupplier, Editor editor, String applyToHint, String applyToTargetHint) { - super(title, sourceNewSupplier, editor, applyToHint); + public HitEffectPane(String title, Editor editor, String applyToHint, String applyToTargetHint) { + super(title, editor, applyToHint); hitTargetConditionPane = new ConditionEffectEditorPane<>(editor); - if (applyToTargetHint == null || applyToTargetHint == "") { + if (applyToTargetHint == null || applyToTargetHint.isEmpty()) { this.applyToTargetHint = ""; } else { this.applyToTargetHint = String.format(" (%s)", applyToTargetHint); } } - void createHitEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e, MODEL sourceConditionsModelInput, MODEL targetConditionsListModel) { + void createHitEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { effect = e; - hitTargetConditionPane.conditionsModel = targetConditionsListModel; - createDeathEffectPaneContent(listener, writable, e, sourceConditionsModelInput); + hitTargetConditionPane.conditionsModel = new TargetTimedConditionsListModel(e); + createDeathEffectPaneContent(listener, writable, e); } @Override @@ -178,8 +180,8 @@ public class CommonEditor { String titleTarget = String.format("Actor Conditions applied to the target%s: ", applyToTargetHint); CommonEditor.TimedConditionsCellRenderer cellRendererTarget = new CommonEditor.TimedConditionsCellRenderer(); - BasicLambdaWithArg selectedSetTarget = (value) -> hitTargetConditionPane.selectedCondition = value; - BasicLambdaWithReturn selectedGetTarget = () -> hitTargetConditionPane.selectedCondition; + BasicLambdaWithArg selectedSetTarget = (value) -> hitTargetConditionPane.selectedCondition = value; + BasicLambdaWithReturn selectedGetTarget = () -> hitTargetConditionPane.selectedCondition; BasicLambda selectedResetTarget = () -> hitTargetConditionPane.selectedCondition = null; BasicLambdaWithArg updatePaneTarget = (editorPane) -> hitTargetConditionPane.updateEffectTimedConditionEditorPane( editorPane, hitTargetConditionPane.selectedCondition, listener); @@ -212,8 +214,8 @@ public class CommonEditor { } } - public static class DeathEffectPane> { - protected final Supplier conditionSupplier; + public static class DeathEffectPane { + protected final Supplier conditionSupplier; protected final String title; protected final String applyToHint; @@ -224,28 +226,28 @@ public class CommonEditor { private JSpinner effectHPMax; private JSpinner effectAPMin; private JSpinner effectAPMax; - private JList sourceConditionsList; + private JList sourceConditionsList; - private final ConditionEffectEditorPane sourceConditionPane; + private final ConditionEffectEditorPane sourceConditionPane; /* * create a new DeatchEffectPane with the selections (probably passed in from last time) */ - public DeathEffectPane(String title, Supplier conditionSupplier, Editor editor, String applyToHint) { + public DeathEffectPane(String title, Editor editor, String applyToHint) { this.title = title; - this.conditionSupplier = conditionSupplier; + this.conditionSupplier = Common.TimedActorConditionEffect::new; this.sourceConditionPane = new ConditionEffectEditorPane<>(editor); - if (applyToHint == null || applyToHint == "") { + if (applyToHint == null || applyToHint.isEmpty()) { this.applyToHint = ""; } else { this.applyToHint = String.format(" (%s)", applyToHint); } } - void createDeathEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e, MODEL sourceConditionsModel) { + void createDeathEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { effect = e; - sourceConditionPane.conditionsModel = sourceConditionsModel; + sourceConditionPane.conditionsModel = new SourceTimedConditionsListModel(e); effectPane = new CollapsiblePanel(title); effectPane.setLayout(new JideBoxLayout(effectPane, JideBoxLayout.PAGE_AXIS)); @@ -269,8 +271,8 @@ public class CommonEditor { protected void addLists(FieldUpdateListener listener, boolean writable) { String titleSource = String.format("Actor Conditions applied to the source%s: ", applyToHint); TimedConditionsCellRenderer cellRendererSource = new TimedConditionsCellRenderer(); - BasicLambdaWithArg selectedSetSource = (value) -> sourceConditionPane.selectedCondition = value; - BasicLambdaWithReturn selectedGetSource = () -> sourceConditionPane.selectedCondition; + BasicLambdaWithArg selectedSetSource = (value) -> sourceConditionPane.selectedCondition = value; + BasicLambdaWithReturn selectedGetSource = () -> sourceConditionPane.selectedCondition; BasicLambda selectedResetSource = () -> sourceConditionPane.selectedCondition = null; BasicLambdaWithArg updatePaneSource = (editorPane) -> sourceConditionPane.updateEffectTimedConditionEditorPane( editorPane, sourceConditionPane.selectedCondition, listener); @@ -309,9 +311,9 @@ public class CommonEditor { } } - static class ConditionEffectEditorPane> { + static class ConditionEffectEditorPane > { private final Editor editor; - ELEMENT selectedCondition; + Common.TimedActorConditionEffect selectedCondition; MODEL conditionsModel; Editor.MyComboBox conditionBox; @@ -328,7 +330,7 @@ public class CommonEditor { this.editor = editor; } - public void updateEffectTimedConditionWidgets(ELEMENT condition) { + public void updateEffectTimedConditionWidgets(Common.TimedActorConditionEffect condition) { boolean writable = editor.target.writable; boolean immunity = condition.isImmunity(); @@ -352,7 +354,7 @@ public class CommonEditor { conditionForever.setEnabled(!clear && writable); } - public void updateEffectTimedConditionEditorPane(JPanel pane, ELEMENT condition, final FieldUpdateListener listener) { + public void updateEffectTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) { pane.removeAll(); if (conditionBox != null) { editor.removeElementListener(conditionBox); @@ -495,7 +497,7 @@ public class CommonEditor { } private void setDurationToDefaultIfNone() { - if (selectedCondition.duration == null || selectedCondition.duration == ActorCondition.DURATION_NONE) { + if (selectedCondition.duration == null || selectedCondition.duration.equals(ActorCondition.DURATION_NONE)) { selectedCondition.duration = 1; } } diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java index 4a27929..3557bf2 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java @@ -76,9 +76,9 @@ public class ItemEditor extends JSONElementEditor { private JRadioButton equipConditionImmunity; private JSpinner equipConditionMagnitude; - private CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", TimedActorConditionEffect::new, this, null, null); - private CommonEditor.DeathEffectPane killEffectPane = new CommonEditor.DeathEffectPane(killLabel, TimedActorConditionEffect::new, this, null); - private CommonEditor.HitRecievedEffectPane hitReceivedEffectPane = new CommonEditor.HitRecievedEffectPane("Effect on every hit received: ", TimedActorConditionEffect::new, this, null, null); + private final CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane<>("Effect on every hit: ", this, null, "npc"); + private final CommonEditor.DeathEffectPane killEffectPane = new CommonEditor.DeathEffectPane<>(killLabel, this, null); + private final CommonEditor.HitReceivedEffectPane hitReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every hit received: ", this, "player", "npc"); public ItemEditor(Item item) { super(item, item.getDesc(), item.getIcon()); @@ -86,7 +86,6 @@ public class ItemEditor extends JSONElementEditor { addEditorTab(json_view_id, getJSONView()); } - @SuppressWarnings({"unchecked", "rawtypes"}) @Override public void insertFormViewDataField(JPanel pane) { @@ -111,11 +110,7 @@ public class ItemEditor extends JSONElementEditor { equipEffectPane = new CollapsiblePanel("Effect when equipped: "); equipEffectPane.setLayout(new JideBoxLayout(equipEffectPane, JideBoxLayout.PAGE_AXIS)); - if (item.equip_effect == null) { - equipEffect = new Item.EquipEffect(); - } else { - equipEffect = item.equip_effect; - } + equipEffect = Objects.requireNonNullElseGet(item.equip_effect, Item.EquipEffect::new); equipDmgMin = addIntegerField(equipEffectPane, "Attack Damage min: ", equipEffect.damage_boost_min, true, item.writable, listener); equipDmgMax = addIntegerField(equipEffectPane, "Attack Damage max: ", equipEffect.damage_boost_max, true, item.writable, listener); equipSetDM = addIntegerField(equipEffectPane, "Damage modifier %: ", equipEffect.damage_modifier, 100, false, item.writable, listener); @@ -164,33 +159,27 @@ public class ItemEditor extends JSONElementEditor { } HitEffect hitEffect = Objects.requireNonNullElseGet(item.hit_effect, HitEffect::new); - hitEffectPane.createHitEffectPaneContent(listener, item.writable, hitEffect, - new CommonEditor.SourceTimedConditionsListModel(hitEffect), - new CommonEditor.TargetTimedConditionsListModel(hitEffect)); + hitEffectPane.createHitEffectPaneContent(listener, item.writable, hitEffect); pane.add(hitEffectPane.effectPane, JideBoxLayout.FIX); DeathEffect killEffect = Objects.requireNonNullElseGet(item.kill_effect, DeathEffect::new); - killEffectPane.createDeathEffectPaneContent(listener, item.writable, killEffect, - new CommonEditor.SourceTimedConditionsListModel(killEffect)); + killEffectPane.createDeathEffectPaneContent(listener, item.writable, killEffect); pane.add(killEffectPane.effectPane, JideBoxLayout.FIX); - HitReceivedEffect hitReceivedEffect = Objects.requireNonNullElseGet(item.hit_received_effect, - HitReceivedEffect::new); - hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, hitReceivedEffect, - new CommonEditor.SourceTimedConditionsListModel( - hitReceivedEffect), - new CommonEditor.TargetTimedConditionsListModel( - hitReceivedEffect)); - pane.add(killEffectPane.effectPane, JideBoxLayout.FIX); + HitReceivedEffect hitReceivedEffect = Objects.requireNonNullElseGet(item.hit_received_effect, HitReceivedEffect::new); + hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, hitReceivedEffect); + pane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX); if (item.category == null || item.category.action_type == null || item.category.action_type == ItemCategory.ActionType.none) { equipEffectPane.setVisible(false); hitEffectPane.effectPane.setVisible(false); + hitReceivedEffectPane.effectPane.setVisible(false); killEffectPane.effectPane.setVisible(false); } else if (item.category.action_type == ItemCategory.ActionType.use) { equipEffectPane.setVisible(false); hitEffectPane.effectPane.setVisible(false); + hitReceivedEffectPane.effectPane.setVisible(false); killEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setTitle(useLabel); killEffectPane.effectPane.revalidate(); @@ -198,6 +187,7 @@ public class ItemEditor extends JSONElementEditor { } else if (item.category.action_type == ItemCategory.ActionType.equip) { equipEffectPane.setVisible(true); hitEffectPane.effectPane.setVisible(true); + hitReceivedEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setTitle(killLabel); killEffectPane.effectPane.revalidate(); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java index dfda8e2..33715af 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java @@ -59,10 +59,10 @@ public class NPCEditor extends JSONElementEditor { private JSpinner blockChance; private JSpinner dmgRes; - private CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane("Effect on every hit: ", TimedActorConditionEffect::new, this, null, null); - private CommonEditor.HitRecievedEffectPane hitReceivedEffectPane = new CommonEditor.HitRecievedEffectPane("Effect on every hit received: ", TimedActorConditionEffect::new, this, "NPC", - "Attacker"); - private CommonEditor.DeathEffectPane deathEffectPane = new CommonEditor.DeathEffectPane("Effect when killed: ", TimedActorConditionEffect::new, this, "Killer"); + private final CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane<>("Effect on every hit: ", this, null, null); + private final CommonEditor.HitReceivedEffectPane hitReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every hit received: ", this, "attacked", + "attacker"); + private final CommonEditor.DeathEffectPane deathEffectPane = new CommonEditor.DeathEffectPane<>("Effect when killed: ", this, "attacker"); private JPanel dialogueGraphPane; private DialogueGraphView dialogueGraphView; @@ -117,7 +117,6 @@ public class NPCEditor extends JSONElementEditor { } } - @SuppressWarnings({"rawtypes", "unchecked"}) @Override public void insertFormViewDataField(JPanel pane) { final NPC npc = (NPC) target; @@ -151,23 +150,15 @@ public class NPCEditor extends JSONElementEditor { dmgRes = addIntegerField(combatTraitPane, "Damage resistance: ", npc.damage_resistance, false, npc.writable, listener); HitEffect hitEffect = Objects.requireNonNullElseGet(npc.hit_effect, HitEffect::new); - hitEffectPane.createHitEffectPaneContent(listener, npc.writable, hitEffect, - new CommonEditor.SourceTimedConditionsListModel(hitEffect), - new CommonEditor.TargetTimedConditionsListModel(hitEffect)); + hitEffectPane.createHitEffectPaneContent(listener, npc.writable, hitEffect); combatTraitPane.add(hitEffectPane.effectPane, JideBoxLayout.FIX); - HitReceivedEffect hitReceivedEffect = Objects.requireNonNullElseGet(npc.hit_received_effect, - HitReceivedEffect::new); - hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, npc.writable, hitReceivedEffect, - new CommonEditor.SourceTimedConditionsListModel( - hitReceivedEffect), - new CommonEditor.TargetTimedConditionsListModel( - hitReceivedEffect)); + HitReceivedEffect hitReceivedEffect = Objects.requireNonNullElseGet(npc.hit_received_effect, HitReceivedEffect::new); + hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, npc.writable, hitReceivedEffect); combatTraitPane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX); DeathEffect deathEffect = Objects.requireNonNullElseGet(npc.death_effect, DeathEffect::new); - deathEffectPane.createDeathEffectPaneContent(listener, npc.writable, deathEffect, - new CommonEditor.SourceTimedConditionsListModel(deathEffect)); + deathEffectPane.createDeathEffectPaneContent(listener, npc.writable, deathEffect); combatTraitPane.add(deathEffectPane.effectPane, JideBoxLayout.FIX); pane.add(combatTraitPane, JideBoxLayout.FIX); From 806f0b10e621b2ddab605573e987c0dc9f2687e8 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Tue, 23 Sep 2025 18:27:22 +0200 Subject: [PATCH 2/8] miss effect --- .../atcontentstudio/model/gamedata/Item.java | 36 ++++++++++++++ .../ui/gamedataeditors/ItemEditor.java | 49 ++++++++++++++++++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java b/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java index 032b91a..265a52f 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java +++ b/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java @@ -36,6 +36,8 @@ public class Item extends JSONElement { public String description = null; public HitEffect hit_effect = null; public HitReceivedEffect hit_received_effect = null; + public HitReceivedEffect miss_effect = null; + public HitReceivedEffect miss_received_effect = null; public DeathEffect kill_effect = null; public EquipEffect equip_effect = null; @@ -193,6 +195,16 @@ public class Item extends JSONElement { this.hit_received_effect = parseHitReceivedEffect(hitReceivedEffect); } + Map missEffect = (Map) itemJson.get("missEffect"); + if (missEffect != null) { + this.miss_effect = parseHitReceivedEffect(missEffect); + } + + Map missReceivedEffect = (Map) itemJson.get("missReceivedEffect"); + if (missReceivedEffect != null) { + this.miss_received_effect = parseHitReceivedEffect(missReceivedEffect); + } + Map killEffect = (Map) itemJson.get("killEffect"); if (killEffect == null) { killEffect = (Map) itemJson.get("useEffect"); @@ -225,6 +237,8 @@ public class Item extends JSONElement { linkEffects(this.hit_effect, proj, this); linkEffects(this.hit_received_effect, proj, this); + linkEffects(this.miss_effect, proj, this); + linkEffects(this.miss_received_effect, proj, this); linkEffects(this.kill_effect, proj, this); this.state = State.linked; } @@ -294,6 +308,14 @@ public class Item extends JSONElement { clone.hit_received_effect = new HitReceivedEffect(); copyHitReceivedEffectValues(clone.hit_received_effect, this.hit_received_effect, clone); } + if (this.miss_effect != null) { + clone.miss_effect = new HitReceivedEffect(); + copyHitReceivedEffectValues(clone.miss_effect, this.miss_effect, clone); + } + if (this.miss_received_effect != null) { + clone.miss_received_effect = new HitReceivedEffect(); + copyHitReceivedEffectValues(clone.miss_received_effect, this.miss_received_effect, clone); + } if (this.kill_effect != null) { clone.kill_effect = new DeathEffect(); copyDeathEffectValues(clone.kill_effect, this.kill_effect, clone); @@ -317,6 +339,18 @@ public class Item extends JSONElement { actorConditionElementChanged(this.hit_effect.conditions_source, oldOne, newOne, this); actorConditionElementChanged(this.hit_effect.conditions_target, oldOne, newOne, this); } + if (this.hit_received_effect != null) { + actorConditionElementChanged(this.hit_received_effect.conditions_source, oldOne, newOne, this); + actorConditionElementChanged(this.hit_received_effect.conditions_target, oldOne, newOne, this); + } + if (this.miss_effect != null) { + actorConditionElementChanged(this.miss_effect.conditions_source, oldOne, newOne, this); + actorConditionElementChanged(this.miss_effect.conditions_target, oldOne, newOne, this); + } + if (this.miss_received_effect != null) { + actorConditionElementChanged(this.miss_received_effect.conditions_source, oldOne, newOne, this); + actorConditionElementChanged(this.miss_received_effect.conditions_target, oldOne, newOne, this); + } if (this.kill_effect != null) { actorConditionElementChanged(this.kill_effect.conditions_source, oldOne, newOne, this); @@ -381,6 +415,8 @@ public class Item extends JSONElement { } writeHitEffectToMap(itemJson, this.hit_effect, "hitEffect"); writeHitReceivedEffectToMap(itemJson, this.hit_received_effect, "hitReceivedEffect"); + writeHitReceivedEffectToMap(itemJson, this.miss_effect, "missEffect"); + writeHitReceivedEffectToMap(itemJson, this.miss_received_effect, "missReceivedEffect"); String key; if (this.category != null && this.category.action_type != null && this.category.action_type == ItemCategory.ActionType.equip) { diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java index 3557bf2..6c7fa43 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java @@ -79,6 +79,8 @@ public class ItemEditor extends JSONElementEditor { private final CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane<>("Effect on every hit: ", this, null, "npc"); private final CommonEditor.DeathEffectPane killEffectPane = new CommonEditor.DeathEffectPane<>(killLabel, this, null); private final CommonEditor.HitReceivedEffectPane hitReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every hit received: ", this, "player", "npc"); + private final CommonEditor.HitReceivedEffectPane missEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every miss: ", this, "player", "npc"); + private final CommonEditor.HitReceivedEffectPane missReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every miss received: ", this, "player", "npc"); public ItemEditor(Item item) { super(item, item.getDesc(), item.getIcon()); @@ -170,16 +172,27 @@ public class ItemEditor extends JSONElementEditor { hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, hitReceivedEffect); pane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX); + HitReceivedEffect missEffect = Objects.requireNonNullElseGet(item.miss_effect, HitReceivedEffect::new); + missEffectPane.createHitEffectPaneContent(listener, item.writable, missEffect); + pane.add(missEffectPane.effectPane, JideBoxLayout.FIX); + + HitReceivedEffect missReceivedEffect = Objects.requireNonNullElseGet(item.miss_received_effect, HitReceivedEffect::new); + missReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, missReceivedEffect); + pane.add(missReceivedEffectPane.effectPane, JideBoxLayout.FIX); if (item.category == null || item.category.action_type == null || item.category.action_type == ItemCategory.ActionType.none) { equipEffectPane.setVisible(false); hitEffectPane.effectPane.setVisible(false); hitReceivedEffectPane.effectPane.setVisible(false); + missEffectPane.effectPane.setVisible(false); + missReceivedEffectPane.effectPane.setVisible(false); killEffectPane.effectPane.setVisible(false); } else if (item.category.action_type == ItemCategory.ActionType.use) { equipEffectPane.setVisible(false); hitEffectPane.effectPane.setVisible(false); hitReceivedEffectPane.effectPane.setVisible(false); + missEffectPane.effectPane.setVisible(false); + missReceivedEffectPane.effectPane.setVisible(false); killEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setTitle(useLabel); killEffectPane.effectPane.revalidate(); @@ -188,6 +201,8 @@ public class ItemEditor extends JSONElementEditor { equipEffectPane.setVisible(true); hitEffectPane.effectPane.setVisible(true); hitReceivedEffectPane.effectPane.setVisible(true); + missEffectPane.effectPane.setVisible(true); + missReceivedEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setTitle(killLabel); killEffectPane.effectPane.revalidate(); @@ -284,8 +299,8 @@ public class ItemEditor extends JSONElementEditor { @Override public void valueChanged(JComponent source, Object value) { Item item = (Item) target; - boolean updatePrice, updateEquip, updateHit, updateKill, updateHitReceived; - updatePrice = updateEquip = updateHit = updateKill = updateHitReceived = false; + boolean updatePrice, updateEquip, updateHit, updateMiss, updateKill, updateHitReceived, updateMissReceived; + updatePrice = updateEquip = updateHit = updateMiss = updateKill = updateHitReceived = updateMissReceived = false; if (source == idField) { //Events caused by cancel an ID edition. Dismiss. if (skipNext) { @@ -352,10 +367,14 @@ public class ItemEditor extends JSONElementEditor { item.equip_effect = null; hitEffectPane.effectPane.setVisible(false); item.hit_effect = null; + missEffectPane.effectPane.setVisible(false); + item.miss_effect = null; killEffectPane.effectPane.setVisible(false); item.kill_effect = null; hitReceivedEffectPane.effectPane.setVisible(false); item.hit_received_effect = null; + missReceivedEffectPane.effectPane.setVisible(false); + item.miss_received_effect = null; ItemEditor.this.revalidate(); ItemEditor.this.repaint(); } else if (item.category.action_type == ItemCategory.ActionType.use) { @@ -363,10 +382,14 @@ public class ItemEditor extends JSONElementEditor { item.equip_effect = null; hitEffectPane.effectPane.setVisible(false); item.hit_effect = null; + missEffectPane.effectPane.setVisible(false); + item.miss_effect = null; killEffectPane.effectPane.setVisible(true); updateKill = true; hitReceivedEffectPane.effectPane.setVisible(false); item.hit_received_effect = null; + missReceivedEffectPane.effectPane.setVisible(false); + item.miss_received_effect = null; updateHitReceived = true; updateEquip = true; killEffectPane.effectPane.setTitle(useLabel); @@ -375,9 +398,11 @@ public class ItemEditor extends JSONElementEditor { } else if (item.category.action_type == ItemCategory.ActionType.equip) { equipEffectPane.setVisible(true); hitEffectPane.effectPane.setVisible(true); + missEffectPane.effectPane.setVisible(true); killEffectPane.effectPane.setVisible(true); updateKill = true; hitReceivedEffectPane.effectPane.setVisible(true); + missReceivedEffectPane.effectPane.setVisible(true); updateHitReceived = true; updateEquip = true; killEffectPane.effectPane.setTitle(killLabel); @@ -459,12 +484,18 @@ public class ItemEditor extends JSONElementEditor { } else if (hitEffectPane.valueChanged(source, value, item)) { updatePrice = true; updateHit = true; + } else if (missEffectPane.valueChanged(source, value, item)) { + updatePrice = true; + updateMiss = true; } else if (killEffectPane.valueChanged(source, value, item)) { updatePrice = true; updateKill = true; } else if (hitReceivedEffectPane.valueChanged(source, value, item)) { updatePrice = true; updateHitReceived = true; + } else if (missReceivedEffectPane.valueChanged(source, value, item)) { + updatePrice = true; + updateMissReceived = true; } if (updateEquip) { @@ -481,6 +512,13 @@ public class ItemEditor extends JSONElementEditor { item.hit_effect = hitEffectPane.effect; } } + if (updateMiss) { + if (missEffectPane.effect.isNull()) { + item.miss_effect = null; + } else { + item.miss_effect = missEffectPane.effect; + } + } if (updateKill) { if (killEffectPane.effect.isNull()) { item.kill_effect = null; @@ -495,6 +533,13 @@ public class ItemEditor extends JSONElementEditor { item.hit_received_effect = hitReceivedEffectPane.effect; } } + if (updateMissReceived) { + if (missReceivedEffectPane.effect.isNull()) { + item.miss_received_effect = null; + } else { + item.miss_received_effect = missReceivedEffectPane.effect; + } + } if (updatePrice && !manualPriceBox.isSelected()) { baseCostField.setValue(item.computePrice()); } From 3b99a946540753adb5864ed1448bf0052269dc66 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Tue, 23 Sep 2025 19:29:28 +0200 Subject: [PATCH 3/8] add comments to start script about min required java version; update nsi script to match standalone start script --- packaging/Windows/ATCS_Installer.nsi | 8 ++++---- packaging/common/ATCS.cmd | 2 ++ packaging/common/ATCS.sh | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packaging/Windows/ATCS_Installer.nsi b/packaging/Windows/ATCS_Installer.nsi index b671470..85e6ad7 100644 --- a/packaging/Windows/ATCS_Installer.nsi +++ b/packaging/Windows/ATCS_Installer.nsi @@ -67,22 +67,22 @@ Section install FileWrite $9 '$\r$\n' FileWrite $9 'set "ATCS_DIR=%~dp0"$\r$\n' FileWrite $9 'set "MAX_MEM=1024M"$\r$\n' - FileWrite $9 'set "CP=%ATCS_DIR%lib\*"$\r$\n' + FileWrite $9 'REM required minimum java version is 11$\r$\n' FileWrite $9 'set "JAVA=$R0"$\r$\n' - FileWrite $9 'set "JAVA_OPTS="$\r$\n' + FileWrite $9 'set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"$\r$\n' FileWrite $9 'set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"$\r$\n' - FileWrite $9 'set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"$\r$\n' FileWrite $9 '$\r$\n' FileWrite $9 'if exist "%ENV_FILE%" ($\r$\n' FileWrite $9 ' call "%ENV_FILE%"$\r$\n' FileWrite $9 ') else ($\r$\n' FileWrite $9 ' echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%"$\r$\n' + FileWrite $9 ' echo REM required minimum java version is 11$\r$\n' FileWrite $9 ' echo REM set "JAVA=%JAVA%">>"%ENV_FILE%"$\r$\n' FileWrite $9 ' echo REM set "JAVA_OPTS=%JAVA_OPTS%">>"%ENV_FILE%"$\r$\n' FileWrite $9 ' echo.>>"%ENV_FILE%"$\r$\n' FileWrite $9 ')$\r$\n' FileWrite $9 '$\r$\n' - FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -jar ATCS.jar$\r$\n' + FileWrite $9 'start "" "%JAVA%" %JAVA_OPTS% -Xmx%MAX_MEM% -jar "%ATCS_DIR%\ATCS.jar"$\r$\n' FileClose $9 WriteUninstaller "$INSTDIR\Uninstall.exe" diff --git a/packaging/common/ATCS.cmd b/packaging/common/ATCS.cmd index d0d6449..912b902 100644 --- a/packaging/common/ATCS.cmd +++ b/packaging/common/ATCS.cmd @@ -2,6 +2,7 @@ set "ATCS_DIR=%~dp0" set "MAX_MEM=1024M" +REM required minimum java version is 11 set "JAVA=java.exe" set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true" set "ENV_FILE=%ATCS_DIR%ATCS.env.bat" @@ -10,6 +11,7 @@ if exist "%ENV_FILE%" ( call "%ENV_FILE%" ) else ( echo REM set "MAX_MEM=%MAX_MEM%">"%ENV_FILE%" + echo REM required minimum java version is 11 echo REM set "JAVA=%JAVA%">>"%ENV_FILE%" echo REM set "JAVA_OPTS=%JAVA_OPTS%">>"%ENV_FILE%" echo.>>"%ENV_FILE%" diff --git a/packaging/common/ATCS.sh b/packaging/common/ATCS.sh index 61086ba..8ec6397 100755 --- a/packaging/common/ATCS.sh +++ b/packaging/common/ATCS.sh @@ -1,9 +1,11 @@ -#!/bin/bash +#!/usr/bin/env bash + +# get the directory of this script ATCS_DIR="$(dirname "$(readlink -f "$0" || greadlink -f "$0" || stat -f "$0")")" echo "ATCS_DIR: '${ATCS_DIR}'" MAX_MEM="512M" -JAVA="java" +JAVA="java" # minimum required version is Java 11 JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true' ENV_FILE="${ATCS_DIR}/ATCS.env" @@ -13,7 +15,7 @@ if [ -f "${ENV_FILE}" ]; then else { echo "#MAX_MEM=\"${MAX_MEM}\"" - echo "#JAVA=\"${JAVA}\"" + echo "#JAVA=\"${JAVA}\" # minimum required version is Java 11" echo "#JAVA_OPTS=\"${JAVA_OPTS}\"" echo "" }>"${ENV_FILE}" From b2003bfc38e2b9cd99b075d9503bd68d7d009050 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Tue, 23 Sep 2025 20:10:30 +0200 Subject: [PATCH 4/8] improve create pane content calls with overrides also fixes a bug where the wrong one was used on accident --- .../ui/gamedataeditors/CommonEditor.java | 13 +++++++------ .../ui/gamedataeditors/ItemEditor.java | 10 +++++----- .../ui/gamedataeditors/NPCEditor.java | 6 +++--- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java index 443a543..d806468 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/CommonEditor.java @@ -102,9 +102,10 @@ public class CommonEditor { super(title, editor, applyToHint, applyToTargetHint); } - void createHitReceivedEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { + @Override + public void createPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { effect = e; - createHitEffectPaneContent(listener, writable, e); + super.createPaneContent(listener, writable, e); } @Override @@ -168,10 +169,11 @@ public class CommonEditor { } } - void createHitEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { + @Override + public void createPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { effect = e; hitTargetConditionPane.conditionsModel = new TargetTimedConditionsListModel(e); - createDeathEffectPaneContent(listener, writable, e); + super.createPaneContent(listener, writable, e); } @Override @@ -244,8 +246,7 @@ public class CommonEditor { this.applyToHint = String.format(" (%s)", applyToHint); } } - - void createDeathEffectPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { + public void createPaneContent(FieldUpdateListener listener, boolean writable, EFFECT e) { effect = e; sourceConditionPane.conditionsModel = new SourceTimedConditionsListModel(e); diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java index 6c7fa43..9cf135f 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java @@ -161,23 +161,23 @@ public class ItemEditor extends JSONElementEditor { } HitEffect hitEffect = Objects.requireNonNullElseGet(item.hit_effect, HitEffect::new); - hitEffectPane.createHitEffectPaneContent(listener, item.writable, hitEffect); + hitEffectPane.createPaneContent(listener, item.writable, hitEffect); pane.add(hitEffectPane.effectPane, JideBoxLayout.FIX); DeathEffect killEffect = Objects.requireNonNullElseGet(item.kill_effect, DeathEffect::new); - killEffectPane.createDeathEffectPaneContent(listener, item.writable, killEffect); + killEffectPane.createPaneContent(listener, item.writable, killEffect); pane.add(killEffectPane.effectPane, JideBoxLayout.FIX); HitReceivedEffect hitReceivedEffect = Objects.requireNonNullElseGet(item.hit_received_effect, HitReceivedEffect::new); - hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, hitReceivedEffect); + hitReceivedEffectPane.createPaneContent(listener, item.writable, hitReceivedEffect); pane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX); HitReceivedEffect missEffect = Objects.requireNonNullElseGet(item.miss_effect, HitReceivedEffect::new); - missEffectPane.createHitEffectPaneContent(listener, item.writable, missEffect); + missEffectPane.createPaneContent(listener, item.writable, missEffect); pane.add(missEffectPane.effectPane, JideBoxLayout.FIX); HitReceivedEffect missReceivedEffect = Objects.requireNonNullElseGet(item.miss_received_effect, HitReceivedEffect::new); - missReceivedEffectPane.createHitReceivedEffectPaneContent(listener, item.writable, missReceivedEffect); + missReceivedEffectPane.createPaneContent(listener, item.writable, missReceivedEffect); pane.add(missReceivedEffectPane.effectPane, JideBoxLayout.FIX); if (item.category == null || item.category.action_type == null || item.category.action_type == ItemCategory.ActionType.none) { diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java index 33715af..b854519 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java @@ -150,15 +150,15 @@ public class NPCEditor extends JSONElementEditor { dmgRes = addIntegerField(combatTraitPane, "Damage resistance: ", npc.damage_resistance, false, npc.writable, listener); HitEffect hitEffect = Objects.requireNonNullElseGet(npc.hit_effect, HitEffect::new); - hitEffectPane.createHitEffectPaneContent(listener, npc.writable, hitEffect); + hitEffectPane.createPaneContent(listener, npc.writable, hitEffect); combatTraitPane.add(hitEffectPane.effectPane, JideBoxLayout.FIX); HitReceivedEffect hitReceivedEffect = Objects.requireNonNullElseGet(npc.hit_received_effect, HitReceivedEffect::new); - hitReceivedEffectPane.createHitReceivedEffectPaneContent(listener, npc.writable, hitReceivedEffect); + hitReceivedEffectPane.createPaneContent(listener, npc.writable, hitReceivedEffect); combatTraitPane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX); DeathEffect deathEffect = Objects.requireNonNullElseGet(npc.death_effect, DeathEffect::new); - deathEffectPane.createDeathEffectPaneContent(listener, npc.writable, deathEffect); + deathEffectPane.createPaneContent(listener, npc.writable, deathEffect); combatTraitPane.add(deathEffectPane.effectPane, JideBoxLayout.FIX); pane.add(combatTraitPane, JideBoxLayout.FIX); From 7e5c8d05ab42ec78bb2394f141d7154255174212 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Tue, 23 Sep 2025 20:26:58 +0200 Subject: [PATCH 5/8] improve hints on who is getting what effect on hit / hit-received for npcs --- .../rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java index b854519..140893e 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/NPCEditor.java @@ -59,10 +59,9 @@ public class NPCEditor extends JSONElementEditor { private JSpinner blockChance; private JSpinner dmgRes; - private final CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane<>("Effect on every hit: ", this, null, null); - private final CommonEditor.HitReceivedEffectPane hitReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every hit received: ", this, "attacked", - "attacker"); - private final CommonEditor.DeathEffectPane deathEffectPane = new CommonEditor.DeathEffectPane<>("Effect when killed: ", this, "attacker"); + private final CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane<>("Effect on every hit: ", this, null, "player"); + private final CommonEditor.HitReceivedEffectPane hitReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every hit received: ", this, "npc", "player"); + private final CommonEditor.DeathEffectPane deathEffectPane = new CommonEditor.DeathEffectPane<>("Effect when killed: ", this, null); private JPanel dialogueGraphPane; private DialogueGraphView dialogueGraphView; From 31cbdcabab2a17994b11b2e3bc0008961a78dbd1 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Tue, 23 Sep 2025 20:43:08 +0200 Subject: [PATCH 6/8] add clarification comment to package.sh --- packaging/package.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/package.sh b/packaging/package.sh index 96d4091..df72e53 100755 --- a/packaging/package.sh +++ b/packaging/package.sh @@ -13,8 +13,8 @@ else fi # --- Configuration --- -PACKAGING_DIR=$(dirname "$(readlink -f "$0" || greadlink -f "$0" || stat -f "$0")") -ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}") +PACKAGING_DIR=$(dirname "$(readlink -f "$0" || greadlink -f "$0" || stat -f "$0")") # Directory of this script +ATCS_SOURCE_DIR=$(dirname "${PACKAGING_DIR}") # Parent directory of this script, assumed to be ATCS source root TEMP_DIR="${PACKAGING_DIR}/tmp" JAR_LOCATION="${PACKAGING_DIR}/ATCS.jar" # Output JAR location as per script MANIFEST_LOCATION="${PACKAGING_DIR}/Manifest.txt" From be040a74bdf46e8e4e1b5e3f62ec035f9ea965a5 Mon Sep 17 00:00:00 2001 From: OMGeeky <> Date: Thu, 2 Oct 2025 15:57:21 +0200 Subject: [PATCH 7/8] change miss_effect to HitEffect instead of HitReceivedEffect (the received effects might have been applied, but the game UI would not display them, so better not show them here too) --- .../gpl/rpg/atcontentstudio/model/gamedata/Item.java | 10 +++++----- .../atcontentstudio/ui/gamedataeditors/ItemEditor.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java b/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java index 265a52f..c7aa412 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java +++ b/src/com/gpl/rpg/atcontentstudio/model/gamedata/Item.java @@ -36,7 +36,7 @@ public class Item extends JSONElement { public String description = null; public HitEffect hit_effect = null; public HitReceivedEffect hit_received_effect = null; - public HitReceivedEffect miss_effect = null; + public HitEffect miss_effect = null; public HitReceivedEffect miss_received_effect = null; public DeathEffect kill_effect = null; public EquipEffect equip_effect = null; @@ -197,7 +197,7 @@ public class Item extends JSONElement { Map missEffect = (Map) itemJson.get("missEffect"); if (missEffect != null) { - this.miss_effect = parseHitReceivedEffect(missEffect); + this.miss_effect = parseHitEffect(missEffect); } Map missReceivedEffect = (Map) itemJson.get("missReceivedEffect"); @@ -309,8 +309,8 @@ public class Item extends JSONElement { copyHitReceivedEffectValues(clone.hit_received_effect, this.hit_received_effect, clone); } if (this.miss_effect != null) { - clone.miss_effect = new HitReceivedEffect(); - copyHitReceivedEffectValues(clone.miss_effect, this.miss_effect, clone); + clone.miss_effect = new HitEffect(); + copyHitEffectValues(clone.miss_effect, this.miss_effect, clone); } if (this.miss_received_effect != null) { clone.miss_received_effect = new HitReceivedEffect(); @@ -415,7 +415,7 @@ public class Item extends JSONElement { } writeHitEffectToMap(itemJson, this.hit_effect, "hitEffect"); writeHitReceivedEffectToMap(itemJson, this.hit_received_effect, "hitReceivedEffect"); - writeHitReceivedEffectToMap(itemJson, this.miss_effect, "missEffect"); + writeHitEffectToMap(itemJson, this.miss_effect, "missEffect"); writeHitReceivedEffectToMap(itemJson, this.miss_received_effect, "missReceivedEffect"); String key; diff --git a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java index 9cf135f..530ceae 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/gamedataeditors/ItemEditor.java @@ -79,7 +79,7 @@ public class ItemEditor extends JSONElementEditor { private final CommonEditor.HitEffectPane hitEffectPane = new CommonEditor.HitEffectPane<>("Effect on every hit: ", this, null, "npc"); private final CommonEditor.DeathEffectPane killEffectPane = new CommonEditor.DeathEffectPane<>(killLabel, this, null); private final CommonEditor.HitReceivedEffectPane hitReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every hit received: ", this, "player", "npc"); - private final CommonEditor.HitReceivedEffectPane missEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every miss: ", this, "player", "npc"); + private final CommonEditor.HitEffectPane missEffectPane = new CommonEditor.HitEffectPane<>("Effect on every miss: ", this, "player", "npc"); private final CommonEditor.HitReceivedEffectPane missReceivedEffectPane = new CommonEditor.HitReceivedEffectPane<>("Effect on every miss received: ", this, "player", "npc"); public ItemEditor(Item item) { @@ -172,7 +172,7 @@ public class ItemEditor extends JSONElementEditor { hitReceivedEffectPane.createPaneContent(listener, item.writable, hitReceivedEffect); pane.add(hitReceivedEffectPane.effectPane, JideBoxLayout.FIX); - HitReceivedEffect missEffect = Objects.requireNonNullElseGet(item.miss_effect, HitReceivedEffect::new); + HitEffect missEffect = Objects.requireNonNullElseGet(item.miss_effect, HitEffect::new); missEffectPane.createPaneContent(listener, item.writable, missEffect); pane.add(missEffectPane.effectPane, JideBoxLayout.FIX); From 5b2480920ed49fff597d507192bc3c9ff375eb63 Mon Sep 17 00:00:00 2001 From: "Nut.andor" Date: Fri, 3 Oct 2025 15:53:37 +0200 Subject: [PATCH 8/8] Version 24 --- res/ATCS_latest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/ATCS_latest b/res/ATCS_latest index 4074851..3e4ce3f 100644 --- a/res/ATCS_latest +++ b/res/ATCS_latest @@ -1 +1 @@ -v0.6.23 \ No newline at end of file +v0.6.24 \ No newline at end of file