mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-01-05 11:06:18 +01:00
extract BasicEffect and rename TimedConditionEffect to TimedActorConditionEffect
This commit is contained in:
@@ -9,22 +9,22 @@ import java.util.Map;
|
||||
|
||||
public final class Common {
|
||||
|
||||
public static void linkConditions(List<? extends ConditionEffect> conditions, Project proj, GameDataElement backlink) {
|
||||
public static void linkConditions(List<? extends ActorConditionEffect> conditions, Project proj, GameDataElement backlink) {
|
||||
if (conditions != null) {
|
||||
for (ConditionEffect ce : conditions) {
|
||||
for (ActorConditionEffect ce : conditions) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
if (ce.condition != null) ce.condition.addBacklink(backlink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class TimedConditionEffect extends ConditionEffect {
|
||||
public static class TimedActorConditionEffect extends ActorConditionEffect {
|
||||
//Available from parsed state
|
||||
public Integer duration = null;
|
||||
public Double chance = null;
|
||||
|
||||
public TimedConditionEffect createClone() {
|
||||
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||
public TimedActorConditionEffect createClone() {
|
||||
TimedActorConditionEffect cclone = new TimedActorConditionEffect();
|
||||
cclone.magnitude = this.magnitude;
|
||||
cclone.condition_id = this.condition_id;
|
||||
cclone.condition = this.condition;
|
||||
@@ -34,7 +34,7 @@ public final class Common {
|
||||
}
|
||||
}
|
||||
|
||||
public static class ConditionEffect {
|
||||
public static class ActorConditionEffect {
|
||||
//Available from parsed state
|
||||
public Integer magnitude = null;
|
||||
public String condition_id = null;
|
||||
@@ -44,13 +44,13 @@ public final class Common {
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static ArrayList<TimedConditionEffect> parseTimedConditionEffects(List conditionsSourceJson) {
|
||||
ArrayList<TimedConditionEffect> conditions_source;
|
||||
public static ArrayList<TimedActorConditionEffect> parseTimedConditionEffects(List conditionsSourceJson) {
|
||||
ArrayList<TimedActorConditionEffect> conditions_source;
|
||||
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||
conditions_source = new ArrayList<>();
|
||||
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||
Map conditionJson = (Map) conditionJsonObj;
|
||||
TimedConditionEffect condition = new TimedConditionEffect();
|
||||
TimedActorConditionEffect condition = new TimedActorConditionEffect();
|
||||
readConditionEffect(condition, conditionJson);
|
||||
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||
if (conditionJson.get("chance") != null)
|
||||
@@ -64,7 +64,7 @@ public final class Common {
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private static void readConditionEffect(ConditionEffect condition, Map conditionJson) {
|
||||
private static void readConditionEffect(ActorConditionEffect condition, Map conditionJson) {
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
}
|
||||
@@ -119,19 +119,21 @@ public final class Common {
|
||||
hit_effect.conditions_target = parseTimedConditionEffects(conditionsTargetJson);
|
||||
}
|
||||
|
||||
|
||||
public static class DeathEffect {
|
||||
//Available from parsed state
|
||||
public static class BasicEffect {
|
||||
public Integer hp_boost_min = null;
|
||||
public Integer hp_boost_max = null;
|
||||
public Integer ap_boost_min = null;
|
||||
public Integer ap_boost_max = null;
|
||||
public List<TimedConditionEffect> conditions_source = null;
|
||||
}
|
||||
|
||||
public static class DeathEffect extends BasicEffect {
|
||||
//Available from parsed state
|
||||
public List<TimedActorConditionEffect> conditions_source = null;
|
||||
}
|
||||
|
||||
public static class HitEffect extends DeathEffect {
|
||||
//Available from parsed state
|
||||
public List<TimedConditionEffect> conditions_target = null;
|
||||
public List<TimedActorConditionEffect> conditions_target = null;
|
||||
}
|
||||
|
||||
public static class HitReceivedEffect extends Common.HitEffect {
|
||||
@@ -144,14 +146,11 @@ public final class Common {
|
||||
|
||||
|
||||
public static void copyDeathEffectValues(Common.DeathEffect target, Common.DeathEffect source, GameDataElement backlink) {
|
||||
target.ap_boost_max = source.ap_boost_max;
|
||||
target.ap_boost_min = source.ap_boost_min;
|
||||
target.hp_boost_max = source.hp_boost_max;
|
||||
target.hp_boost_min = source.hp_boost_min;
|
||||
copyEffectValues(target, source);
|
||||
if (source.conditions_source != null) {
|
||||
target.conditions_source = new ArrayList<>();
|
||||
for (Common.TimedConditionEffect c : source.conditions_source) {
|
||||
Common.TimedConditionEffect cclone = c.createClone();
|
||||
for (TimedActorConditionEffect c : source.conditions_source) {
|
||||
TimedActorConditionEffect cclone = c.createClone();
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(backlink);
|
||||
}
|
||||
@@ -160,12 +159,19 @@ public final class Common {
|
||||
}
|
||||
}
|
||||
|
||||
private static void copyEffectValues(BasicEffect target, BasicEffect source) {
|
||||
target.ap_boost_max = source.ap_boost_max;
|
||||
target.ap_boost_min = source.ap_boost_min;
|
||||
target.hp_boost_max = source.hp_boost_max;
|
||||
target.hp_boost_min = source.hp_boost_min;
|
||||
}
|
||||
|
||||
public static void copyHitEffectValues(Common.HitEffect target, Common.HitEffect source, GameDataElement backlink) {
|
||||
copyDeathEffectValues(target, source, backlink);
|
||||
if (source.conditions_target != null) {
|
||||
target.conditions_target = new ArrayList<>();
|
||||
for (Common.TimedConditionEffect c : source.conditions_target) {
|
||||
Common.TimedConditionEffect cclone = c.createClone();
|
||||
for (TimedActorConditionEffect c : source.conditions_target) {
|
||||
TimedActorConditionEffect cclone = c.createClone();
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(backlink);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Item extends JSONElement {
|
||||
public Integer damage_boost_max = null;
|
||||
public Integer max_hp_boost = null;
|
||||
public Integer max_ap_boost = null;
|
||||
public List<ConditionEffect> conditions = null;
|
||||
public List<ActorConditionEffect> conditions = null;
|
||||
public Integer increase_move_cost = null;
|
||||
public Integer increase_use_item_cost = null;
|
||||
public Integer increase_reequip_cost = null;
|
||||
@@ -174,7 +174,7 @@ public class Item extends JSONElement {
|
||||
this.equip_effect.conditions = new ArrayList<>();
|
||||
for (Object conditionJsonObj : conditionsJson) {
|
||||
Map conditionJson = (Map) conditionJsonObj;
|
||||
ConditionEffect condition = new ConditionEffect();
|
||||
ActorConditionEffect condition = new ActorConditionEffect();
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
this.equip_effect.conditions.add(condition);
|
||||
@@ -286,8 +286,8 @@ public class Item extends JSONElement {
|
||||
clone.equip_effect.max_hp_boost = this.equip_effect.max_hp_boost;
|
||||
if (this.equip_effect.conditions != null) {
|
||||
clone.equip_effect.conditions = new ArrayList<>();
|
||||
for (ConditionEffect c : this.equip_effect.conditions) {
|
||||
ConditionEffect cclone = new ConditionEffect();
|
||||
for (ActorConditionEffect c : this.equip_effect.conditions) {
|
||||
ActorConditionEffect cclone = new ActorConditionEffect();
|
||||
cclone.magnitude = c.magnitude;
|
||||
cclone.condition_id = c.condition_id;
|
||||
cclone.condition = c.condition;
|
||||
@@ -321,7 +321,7 @@ public class Item extends JSONElement {
|
||||
if (newOne != null) newOne.addBacklink(this);
|
||||
} else {
|
||||
if (this.equip_effect != null && this.equip_effect.conditions != null) {
|
||||
for (ConditionEffect c : this.equip_effect.conditions) {
|
||||
for (ActorConditionEffect c : this.equip_effect.conditions) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
@@ -330,7 +330,7 @@ public class Item extends JSONElement {
|
||||
}
|
||||
}
|
||||
if (this.hit_effect != null && this.hit_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect c : this.hit_effect.conditions_source) {
|
||||
for (TimedActorConditionEffect c : this.hit_effect.conditions_source) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
@@ -339,7 +339,7 @@ public class Item extends JSONElement {
|
||||
}
|
||||
}
|
||||
if (this.hit_effect != null && this.hit_effect.conditions_target != null) {
|
||||
for (TimedConditionEffect c : this.hit_effect.conditions_target) {
|
||||
for (TimedActorConditionEffect c : this.hit_effect.conditions_target) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
@@ -349,7 +349,7 @@ public class Item extends JSONElement {
|
||||
}
|
||||
|
||||
if (this.kill_effect != null && this.kill_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect c : this.kill_effect.conditions_source) {
|
||||
for (TimedActorConditionEffect c : this.kill_effect.conditions_source) {
|
||||
if (c.condition == oldOne) {
|
||||
oldOne.removeBacklink(this);
|
||||
c.condition = (ActorCondition) newOne;
|
||||
@@ -417,7 +417,7 @@ public class Item extends JSONElement {
|
||||
if (this.equip_effect.conditions != null) {
|
||||
List conditionsJson = new ArrayList();
|
||||
equipEffectJson.put("addedConditions", conditionsJson);
|
||||
for (ConditionEffect condition : this.equip_effect.conditions) {
|
||||
for (ActorConditionEffect condition : this.equip_effect.conditions) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
@@ -451,7 +451,7 @@ public class Item extends JSONElement {
|
||||
if (this.hit_effect.conditions_source != null) {
|
||||
List conditionsSourceJson = new ArrayList();
|
||||
hitEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||
for (TimedConditionEffect condition : this.hit_effect.conditions_source) {
|
||||
for (TimedActorConditionEffect condition : this.hit_effect.conditions_source) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsSourceJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
@@ -468,7 +468,7 @@ public class Item extends JSONElement {
|
||||
if (this.hit_effect.conditions_target != null) {
|
||||
List conditionsTargetJson = new ArrayList();
|
||||
hitEffectJson.put("conditionsTarget", conditionsTargetJson);
|
||||
for (TimedConditionEffect condition : this.hit_effect.conditions_target) {
|
||||
for (TimedActorConditionEffect condition : this.hit_effect.conditions_target) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsTargetJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
@@ -529,7 +529,7 @@ public class Item extends JSONElement {
|
||||
if (this.hit_received_effect.conditions_source != null) {
|
||||
List conditionsSourceJson = new ArrayList();
|
||||
hitReceivedEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||
for (TimedConditionEffect condition : this.hit_received_effect.conditions_source) {
|
||||
for (TimedActorConditionEffect condition : this.hit_received_effect.conditions_source) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsSourceJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
@@ -546,7 +546,7 @@ public class Item extends JSONElement {
|
||||
if (this.hit_received_effect.conditions_target != null) {
|
||||
List conditionsTargetJson = new ArrayList();
|
||||
hitReceivedEffectJson.put("conditionsTarget", conditionsTargetJson);
|
||||
for (TimedConditionEffect condition : this.hit_received_effect.conditions_target) {
|
||||
for (TimedActorConditionEffect condition : this.hit_received_effect.conditions_target) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsTargetJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
@@ -587,7 +587,7 @@ public class Item extends JSONElement {
|
||||
if (this.kill_effect.conditions_source != null) {
|
||||
List conditionsSourceJson = new ArrayList();
|
||||
killEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||
for (TimedConditionEffect condition : this.kill_effect.conditions_source) {
|
||||
for (TimedActorConditionEffect condition : this.kill_effect.conditions_source) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsSourceJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,6 @@ import javax.swing.text.DefaultFormatter;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.io.Console;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
@@ -1106,10 +1105,10 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
}
|
||||
|
||||
|
||||
protected <E extends Common.ConditionEffect, T extends OrderedListenerListModel<?, E>> void updateConditionEffect(ActorCondition value,
|
||||
GameDataElement backlink,
|
||||
E selectedHitEffectTargetCondition,
|
||||
T hitTargetConditionsModel) {
|
||||
protected <E extends Common.ActorConditionEffect, T extends OrderedListenerListModel<?, E>> void updateConditionEffect(ActorCondition value,
|
||||
GameDataElement backlink,
|
||||
E selectedHitEffectTargetCondition,
|
||||
T hitTargetConditionsModel) {
|
||||
if (selectedHitEffectTargetCondition.condition != null) {
|
||||
selectedHitEffectTargetCondition.condition.removeBacklink(backlink);
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ import com.gpl.rpg.atcontentstudio.utils.UiUtils;
|
||||
import com.jidesoft.swing.JideBoxLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -33,12 +31,12 @@ public class ItemEditor extends JSONElementEditor {
|
||||
private static final String useLabel = "Effect on use: ";
|
||||
|
||||
|
||||
private Common.ConditionEffect selectedEquipEffectCondition;
|
||||
private Common.TimedConditionEffect selectedHitEffectSourceCondition;
|
||||
private Common.TimedConditionEffect selectedHitEffectTargetCondition;
|
||||
private Common.TimedConditionEffect selectedKillEffectCondition;
|
||||
private Common.TimedConditionEffect selectedHitReceivedEffectSourceCondition;
|
||||
private Common.TimedConditionEffect selectedHitReceivedEffectTargetCondition;
|
||||
private Common.ActorConditionEffect selectedEquipEffectCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitEffectSourceCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitEffectTargetCondition;
|
||||
private Common.TimedActorConditionEffect selectedKillEffectCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitReceivedEffectSourceCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitReceivedEffectTargetCondition;
|
||||
|
||||
|
||||
private JButton itemIcon;
|
||||
@@ -84,7 +82,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
private JSpinner hitAPMax;
|
||||
private SourceTimedConditionsListModel hitSourceConditionsModel;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private JList<Common.TimedConditionEffect> hitSourceConditionsList;
|
||||
private JList<Common.TimedActorConditionEffect> hitSourceConditionsList;
|
||||
private MyComboBox hitSourceConditionBox;
|
||||
private JSpinner hitSourceConditionChance;
|
||||
private JRadioButton hitSourceConditionClear;
|
||||
@@ -214,8 +212,8 @@ public class ItemEditor extends JSONElementEditor {
|
||||
String titleEquipConditions = "Actor Conditions applied when equipped: ";
|
||||
equipConditionsModel = new ConditionsListModel(equipEffect);
|
||||
ConditionsCellRenderer cellRendererEquipConditions = new ConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.ConditionEffect> selectedSetEquipConditions = (value)->selectedEquipEffectCondition = value;
|
||||
BasicLambdaWithReturn<Common.ConditionEffect> selectedGetEquipConditions = ()->selectedEquipEffectCondition ;
|
||||
BasicLambdaWithArg<Common.ActorConditionEffect> selectedSetEquipConditions = (value)->selectedEquipEffectCondition = value;
|
||||
BasicLambdaWithReturn<Common.ActorConditionEffect> selectedGetEquipConditions = ()->selectedEquipEffectCondition ;
|
||||
BasicLambda selectedResetEquipConditions = ()->selectedEquipEffectCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneEquipConditions = (editorPane) -> updateEquipConditionEditorPane(editorPane, selectedEquipEffectCondition, listener);
|
||||
var resultEquipConditions = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -226,7 +224,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneEquipConditions,
|
||||
item.writable,
|
||||
Common.ConditionEffect::new,
|
||||
Common.ActorConditionEffect::new,
|
||||
cellRendererEquipConditions,
|
||||
titleEquipConditions,
|
||||
(x) -> null);
|
||||
@@ -255,11 +253,11 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitAPMax = addIntegerField(hitEffectPane, "AP bonus max: ", hitEffect.ap_boost_max, true, item.writable, listener);
|
||||
hitSourceConditionsModel = new SourceTimedConditionsListModel(hitEffect);
|
||||
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> getSelected = () -> hitSourceConditionsList.getSelectedValue();
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> getSelected = () -> hitSourceConditionsList.getSelectedValue();
|
||||
BasicLambda resetSelected = () -> {
|
||||
selectedHitEffectSourceCondition = null;
|
||||
};
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> setSelected = (selectedItem) -> {
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> setSelected = (selectedItem) -> {
|
||||
selectedHitEffectSourceCondition = selectedItem;
|
||||
};
|
||||
BasicLambdaWithArg valueChanged = (selectedReply) -> {
|
||||
@@ -276,7 +274,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
valueChanged,
|
||||
updateEditorPane,
|
||||
item.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRenderer,
|
||||
title,
|
||||
(x) -> null
|
||||
@@ -290,8 +288,8 @@ public class ItemEditor extends JSONElementEditor {
|
||||
String titleHitTargetConditions = "Actor Conditions applied to the target: ";
|
||||
hitTargetConditionsModel = new TargetTimedConditionsListModel(hitEffect);
|
||||
ConditionsCellRenderer cellRendererHitTargetConditions = new ConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetHitTargetConditions = (value)->selectedHitEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetHitTargetConditions = ()->selectedHitEffectTargetCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetHitTargetConditions = (value)->selectedHitEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetHitTargetConditions = ()->selectedHitEffectTargetCondition ;
|
||||
BasicLambda selectedResetHitTargetConditions = ()->selectedHitEffectTargetCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneHitTargetConditions = (editorPane) -> updateHitTargetTimedConditionEditorPane(editorPane, selectedHitEffectTargetCondition, listener);
|
||||
var resultHitTargetConditions = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -302,7 +300,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneHitTargetConditions,
|
||||
item.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererHitTargetConditions,
|
||||
titleHitTargetConditions,
|
||||
(x) -> null);
|
||||
@@ -333,8 +331,8 @@ public class ItemEditor extends JSONElementEditor {
|
||||
String titleKillSourceConditions = "Actor Conditions applied to the source: ";
|
||||
killSourceConditionsModel = new SourceTimedConditionsListModel(killEffect);
|
||||
TimedConditionsCellRenderer cellRendererKillSourceConditions = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetKillSourceConditions = (value)->selectedKillEffectCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetKillSourceConditions = ()->selectedKillEffectCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetKillSourceConditions = (value)->selectedKillEffectCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetKillSourceConditions = ()->selectedKillEffectCondition ;
|
||||
BasicLambda selectedResetKillSourceConditions = ()->selectedKillEffectCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneKillSourceConditions = (editorPane) -> updateKillSourceTimedConditionEditorPane(editorPane, selectedKillEffectCondition, listener);
|
||||
var resultKillSourceConditions = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -345,7 +343,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneKillSourceConditions,
|
||||
item.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererKillSourceConditions,
|
||||
titleKillSourceConditions,
|
||||
(x) -> null);
|
||||
@@ -373,16 +371,17 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitReceivedHPMax = addIntegerField(hitReceivedEffectPane, "Player HP bonus max: ", hitReceivedEffect.hp_boost_max, true, item.writable, listener);
|
||||
hitReceivedAPMin = addIntegerField(hitReceivedEffectPane, "Player AP bonus min: ", hitReceivedEffect.ap_boost_min, true, item.writable, listener);
|
||||
hitReceivedAPMax = addIntegerField(hitReceivedEffectPane, "Player AP bonus max: ", hitReceivedEffect.ap_boost_max, true, item.writable, listener);
|
||||
hitReceivedHPMinTarget = addIntegerField(hitReceivedEffectPane, "Attacker HP bonus min: ", hitReceivedEffect.hp_boost_min_target, true, item.writable, listener);
|
||||
hitReceivedHPMaxTarget = addIntegerField(hitReceivedEffectPane, "Attacker HP bonus max: ", hitReceivedEffect.hp_boost_max_target, true, item.writable, listener);
|
||||
hitReceivedAPMinTarget = addIntegerField(hitReceivedEffectPane, "Attacker AP bonus min: ", hitReceivedEffect.ap_boost_min_target, true, item.writable, listener);
|
||||
hitReceivedAPMaxTarget = addIntegerField(hitReceivedEffectPane, "Attacker AP bonus max: ", hitReceivedEffect.ap_boost_max_target, true, item.writable, listener);
|
||||
String roleHitReceivedTarget = "Attacker";
|
||||
hitReceivedHPMinTarget = addIntegerField(hitReceivedEffectPane, roleHitReceivedTarget + " HP bonus min: ", hitReceivedEffect.target.hp_boost_min, true, item.writable, listener);
|
||||
hitReceivedHPMaxTarget = addIntegerField(hitReceivedEffectPane, roleHitReceivedTarget + " HP bonus max: ", hitReceivedEffect.target.hp_boost_max, true, item.writable, listener);
|
||||
hitReceivedAPMinTarget = addIntegerField(hitReceivedEffectPane, roleHitReceivedTarget + " AP bonus min: ", hitReceivedEffect.target.ap_boost_min, true, item.writable, listener);
|
||||
hitReceivedAPMaxTarget = addIntegerField(hitReceivedEffectPane, roleHitReceivedTarget + " AP bonus max: ", hitReceivedEffect.target.ap_boost_max, true, item.writable, listener);
|
||||
|
||||
String titleHitReceivedSourceConditions = "Actor Conditions applied to the player: ";
|
||||
hitReceivedSourceConditionsModel = new SourceTimedConditionsListModel(killEffect);
|
||||
TimedConditionsCellRenderer cellRendererHitReceivedSourceConditions = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetHitReceivedSourceConditions = (value)->selectedHitReceivedEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetHitReceivedSourceConditions = ()->selectedHitReceivedEffectSourceCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetHitReceivedSourceConditions = (value)->selectedHitReceivedEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetHitReceivedSourceConditions = ()->selectedHitReceivedEffectSourceCondition ;
|
||||
BasicLambda selectedResetHitReceivedSourceConditions = ()->selectedHitReceivedEffectSourceCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneHitReceivedSourceConditions = (editorPane) -> updateHitReceivedSourceTimedConditionEditorPane(editorPane, selectedHitReceivedEffectSourceCondition, listener);
|
||||
var resultHitReceivedSourceConditions = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -393,7 +392,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneHitReceivedSourceConditions,
|
||||
item.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererHitReceivedSourceConditions,
|
||||
titleHitReceivedSourceConditions,
|
||||
(x) -> null);
|
||||
@@ -407,8 +406,8 @@ public class ItemEditor extends JSONElementEditor {
|
||||
String titleHitReceivedTargetConditions = "Actor Conditions applied to the attacker: ";
|
||||
hitReceivedTargetConditionsModel = new TargetTimedConditionsListModel(hitReceivedEffect);
|
||||
TimedConditionsCellRenderer cellRendererHitReceivedTargetConditions = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetHitReceivedTargetConditions = (value)->selectedHitReceivedEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetHitReceivedTargetConditions = ()->selectedHitReceivedEffectTargetCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetHitReceivedTargetConditions = (value)->selectedHitReceivedEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetHitReceivedTargetConditions = ()->selectedHitReceivedEffectTargetCondition ;
|
||||
BasicLambda selectedResetHitReceivedTargetConditions = ()->selectedHitReceivedEffectTargetCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneHitReceivedTargetConditions = (editorPane) -> updateHitReceivedTargetTimedConditionEditorPane(editorPane, selectedHitReceivedEffectTargetCondition, listener);
|
||||
var resultHitReceivedTargetConditions = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -419,7 +418,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneHitReceivedTargetConditions,
|
||||
item.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererHitReceivedTargetConditions,
|
||||
titleHitReceivedTargetConditions,
|
||||
(x) -> null);
|
||||
@@ -458,7 +457,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
|
||||
}
|
||||
|
||||
public void updateHitSourceTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitSourceTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitSourceConditionBox != null) {
|
||||
removeElementListener(hitSourceConditionBox);
|
||||
@@ -536,7 +535,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitSourceTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitSourceTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -554,7 +553,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitSourceConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public void updateHitTargetTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitTargetTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitTargetConditionBox != null) {
|
||||
removeElementListener(hitTargetConditionBox);
|
||||
@@ -632,7 +631,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitTargetTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitTargetTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -650,7 +649,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitTargetConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public void updateKillSourceTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateKillSourceTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (killSourceConditionBox != null) {
|
||||
removeElementListener(killSourceConditionBox);
|
||||
@@ -728,7 +727,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateKillSourceTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateKillSourceTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -746,7 +745,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
killSourceConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public void updateEquipConditionEditorPane(JPanel pane, Common.ConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateEquipConditionEditorPane(JPanel pane, Common.ActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (equipConditionBox != null) {
|
||||
removeElementListener(equipConditionBox);
|
||||
@@ -794,7 +793,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitReceivedSourceTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitReceivedSourceTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitReceivedSourceConditionBox != null) {
|
||||
removeElementListener(hitReceivedSourceConditionBox);
|
||||
@@ -872,7 +871,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitReceivedSourceTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitReceivedSourceTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -890,7 +889,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitReceivedSourceConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public void updateHitReceivedTargetTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitReceivedTargetTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitReceivedTargetConditionBox != null) {
|
||||
removeElementListener(hitReceivedTargetConditionBox);
|
||||
@@ -968,7 +967,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitReceivedTargetTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitReceivedTargetTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -987,34 +986,34 @@ public class ItemEditor extends JSONElementEditor {
|
||||
}
|
||||
|
||||
|
||||
public static class SourceTimedConditionsListModel extends OrderedListenerListModel<Common.DeathEffect, Common.TimedConditionEffect> {
|
||||
public static class SourceTimedConditionsListModel extends OrderedListenerListModel<Common.DeathEffect, Common.TimedActorConditionEffect> {
|
||||
public SourceTimedConditionsListModel(Common.DeathEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Common.TimedConditionEffect> getItems() {
|
||||
protected List<Common.TimedActorConditionEffect> getItems() {
|
||||
return source.conditions_source;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setItems(List<Common.TimedConditionEffect> items) {
|
||||
protected void setItems(List<Common.TimedActorConditionEffect> items) {
|
||||
source.conditions_source = items;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TargetTimedConditionsListModel extends OrderedListenerListModel<Common.HitEffect, Common.TimedConditionEffect> {
|
||||
public static class TargetTimedConditionsListModel extends OrderedListenerListModel<Common.HitEffect, Common.TimedActorConditionEffect> {
|
||||
public TargetTimedConditionsListModel(Common.HitEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Common.TimedConditionEffect> getItems() {
|
||||
protected List<Common.TimedActorConditionEffect> getItems() {
|
||||
return source.conditions_target;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setItems(List<Common.TimedConditionEffect> items) {
|
||||
protected void setItems(List<Common.TimedActorConditionEffect> items) {
|
||||
source.conditions_target = items;
|
||||
}
|
||||
}
|
||||
@@ -1027,7 +1026,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
if (c instanceof JLabel) {
|
||||
JLabel label = ((JLabel) c);
|
||||
Common.TimedConditionEffect effect = (Common.TimedConditionEffect) value;
|
||||
Common.TimedActorConditionEffect effect = (Common.TimedActorConditionEffect) value;
|
||||
|
||||
if (effect.condition != null) {
|
||||
|
||||
@@ -1053,18 +1052,18 @@ public class ItemEditor extends JSONElementEditor {
|
||||
}
|
||||
}
|
||||
|
||||
public static class ConditionsListModel extends OrderedListenerListModel<Item.EquipEffect, Common.ConditionEffect> {
|
||||
public static class ConditionsListModel extends OrderedListenerListModel<Item.EquipEffect, Common.ActorConditionEffect> {
|
||||
public ConditionsListModel(Item.EquipEffect equipEffect) {
|
||||
super(equipEffect);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Common.ConditionEffect> getItems() {
|
||||
protected List<Common.ActorConditionEffect> getItems() {
|
||||
return source.conditions;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setItems(List<Common.ConditionEffect> conditions) {
|
||||
protected void setItems(List<Common.ActorConditionEffect> conditions) {
|
||||
source.conditions = conditions;
|
||||
}
|
||||
}
|
||||
@@ -1077,7 +1076,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
if (c instanceof JLabel) {
|
||||
JLabel label = ((JLabel) c);
|
||||
Common.ConditionEffect effect = (Common.ConditionEffect) value;
|
||||
Common.ActorConditionEffect effect = (Common.ActorConditionEffect) value;
|
||||
|
||||
if (effect.condition != null) {
|
||||
if (effect.magnitude == ActorCondition.MAGNITUDE_CLEAR) {
|
||||
@@ -1703,6 +1702,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ import com.gpl.rpg.atcontentstudio.utils.UiUtils;
|
||||
import com.jidesoft.swing.JideBoxLayout;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -31,11 +29,11 @@ public class NPCEditor extends JSONElementEditor {
|
||||
private static final String json_view_id = "JSON";
|
||||
private static final String dialogue_tree_id = "Dialogue Tree";
|
||||
|
||||
private Common.TimedConditionEffect selectedHitEffectSourceCondition;
|
||||
private Common.TimedConditionEffect selectedHitEffectTargetCondition;
|
||||
private Common.TimedConditionEffect selectedHitReceivedEffectSourceCondition;
|
||||
private Common.TimedConditionEffect selectedHitReceivedEffectTargetCondition;
|
||||
private Common.TimedConditionEffect selectedDeathEffectSourceCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitEffectSourceCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitEffectTargetCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitReceivedEffectSourceCondition;
|
||||
private Common.TimedActorConditionEffect selectedHitReceivedEffectTargetCondition;
|
||||
private Common.TimedActorConditionEffect selectedDeathEffectSourceCondition;
|
||||
|
||||
private JButton npcIcon;
|
||||
private JTextField idField;
|
||||
@@ -254,8 +252,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
String titleSource = "Actor Conditions applied to the source: ";
|
||||
hitSourceConditionsListModel = new SourceTimedConditionsListModel(hitEffect);
|
||||
TimedConditionsCellRenderer cellRendererSource = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetSource = (value)->selectedHitEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetSource = ()->selectedHitEffectSourceCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetSource = (value)->selectedHitEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetSource = ()->selectedHitEffectSourceCondition ;
|
||||
BasicLambda selectedResetSource = ()->selectedHitEffectSourceCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneSource = (editorPane) -> updateHitSourceTimedConditionEditorPane(editorPane, selectedHitEffectSourceCondition, listener);
|
||||
|
||||
@@ -267,7 +265,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneSource,
|
||||
npc.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererSource,
|
||||
titleSource,
|
||||
(x) -> null);
|
||||
@@ -281,8 +279,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
String titleTarget = "Actor Conditions applied to the target: ";
|
||||
hitTargetConditionsListModel = new TargetTimedConditionsListModel(hitEffect);
|
||||
TimedConditionsCellRenderer cellRendererTarget = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetTarget = (value)->selectedHitEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetTarget = ()->selectedHitEffectTargetCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetTarget = (value)->selectedHitEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetTarget = ()->selectedHitEffectTargetCondition ;
|
||||
BasicLambda selectedResetTarget = ()->selectedHitEffectTargetCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneTarget = (editorPane) -> updateHitTargetTimedConditionEditorPane(editorPane, selectedHitEffectTargetCondition, listener);
|
||||
var resultTarget = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -293,7 +291,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneTarget,
|
||||
npc.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererTarget,
|
||||
titleTarget,
|
||||
(x) -> null);
|
||||
@@ -315,16 +313,16 @@ public class NPCEditor extends JSONElementEditor {
|
||||
hitReceivedEffectHPMax = addIntegerField(hitReceivedEffectPane, "NPC HP bonus max: ", hitReceivedEffect.hp_boost_max, true, npc.writable, listener);
|
||||
hitReceivedEffectAPMin = addIntegerField(hitReceivedEffectPane, "NPC AP bonus min: ", hitReceivedEffect.ap_boost_min, true, npc.writable, listener);
|
||||
hitReceivedEffectAPMax = addIntegerField(hitReceivedEffectPane, "NPC AP bonus max: ", hitReceivedEffect.ap_boost_max, true, npc.writable, listener);
|
||||
hitReceivedEffectHPMinTarget = addIntegerField(hitReceivedEffectPane, "Attacker HP bonus min: ", hitReceivedEffect.hp_boost_min_target, true, npc.writable, listener);
|
||||
hitReceivedEffectHPMaxTarget = addIntegerField(hitReceivedEffectPane, "Attacker HP bonus max: ", hitReceivedEffect.hp_boost_max_target, true, npc.writable, listener);
|
||||
hitReceivedEffectAPMinTarget = addIntegerField(hitReceivedEffectPane, "Attacker AP bonus min: ", hitReceivedEffect.ap_boost_min_target, true, npc.writable, listener);
|
||||
hitReceivedEffectAPMaxTarget = addIntegerField(hitReceivedEffectPane, "Attacker AP bonus max: ", hitReceivedEffect.ap_boost_max_target, true, npc.writable, listener);
|
||||
hitReceivedEffectHPMinTarget = addIntegerField(hitReceivedEffectPane, "Attacker HP bonus min: ", hitReceivedEffect.target.hp_boost_min, true, npc.writable, listener);
|
||||
hitReceivedEffectHPMaxTarget = addIntegerField(hitReceivedEffectPane, "Attacker HP bonus max: ", hitReceivedEffect.target.hp_boost_max, true, npc.writable, listener);
|
||||
hitReceivedEffectAPMinTarget = addIntegerField(hitReceivedEffectPane, "Attacker AP bonus min: ", hitReceivedEffect.target.ap_boost_min, true, npc.writable, listener);
|
||||
hitReceivedEffectAPMaxTarget = addIntegerField(hitReceivedEffectPane, "Attacker AP bonus max: ", hitReceivedEffect.target.ap_boost_max, true, npc.writable, listener);
|
||||
|
||||
String titleReceivedSource = "Actor Conditions applied to this NPC: ";
|
||||
hitReceivedSourceConditionsListModel = new SourceTimedConditionsListModel(hitReceivedEffect);
|
||||
TimedConditionsCellRenderer cellRendererReceivedSource = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetReceivedSource = (value)->selectedHitReceivedEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetReceivedSource = ()->selectedHitReceivedEffectSourceCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetReceivedSource = (value)->selectedHitReceivedEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetReceivedSource = ()->selectedHitReceivedEffectSourceCondition ;
|
||||
BasicLambda selectedResetReceivedSource = ()->selectedHitReceivedEffectSourceCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneReceivedSource = (editorPane) -> updateHitReceivedSourceTimedConditionEditorPane(editorPane, selectedHitReceivedEffectSourceCondition, listener);
|
||||
var resultReceivedSource = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -335,7 +333,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneReceivedSource,
|
||||
npc.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererReceivedSource,
|
||||
titleReceivedSource,
|
||||
(x) -> null);
|
||||
@@ -349,8 +347,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
String titleReceivedTarget = "Actor Conditions applied to the attacker: ";
|
||||
hitReceivedTargetConditionsListModel = new TargetTimedConditionsListModel(hitReceivedEffect);
|
||||
TimedConditionsCellRenderer cellRendererReceivedTarget = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetReceivedTarget = (value)->selectedHitReceivedEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetReceivedTarget = ()->selectedHitReceivedEffectTargetCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetReceivedTarget = (value)->selectedHitReceivedEffectTargetCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetReceivedTarget = ()->selectedHitReceivedEffectTargetCondition ;
|
||||
BasicLambda selectedResetReceivedTarget = ()->selectedHitReceivedEffectTargetCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneReceivedTarget = (editorPane) -> updateHitReceivedTargetTimedConditionEditorPane(editorPane, selectedHitReceivedEffectTargetCondition, listener);
|
||||
var resultReceivedTarget = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -361,7 +359,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneReceivedTarget,
|
||||
npc.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererReceivedTarget,
|
||||
titleReceivedTarget,
|
||||
(x) -> null);
|
||||
@@ -387,8 +385,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
String titleDeathSource = "Actor Conditions applied to the killer: ";
|
||||
deathSourceConditionsListModel = new SourceTimedConditionsListModel(deathEffect);
|
||||
TimedConditionsCellRenderer cellRendererDeathSource = new TimedConditionsCellRenderer();
|
||||
BasicLambdaWithArg<Common.TimedConditionEffect> selectedSetDeathSource = (value)->selectedDeathEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedConditionEffect> selectedGetDeathSource = ()->selectedDeathEffectSourceCondition ;
|
||||
BasicLambdaWithArg<Common.TimedActorConditionEffect> selectedSetDeathSource = (value)->selectedDeathEffectSourceCondition = value;
|
||||
BasicLambdaWithReturn<Common.TimedActorConditionEffect> selectedGetDeathSource = ()->selectedDeathEffectSourceCondition ;
|
||||
BasicLambda selectedResetDeathSource = ()->selectedDeathEffectSourceCondition = null;
|
||||
BasicLambdaWithArg<JPanel> updatePaneDeathSource = (editorPane) -> updateDeathSourceTimedConditionEditorPane(editorPane, selectedDeathEffectSourceCondition, listener);
|
||||
var resultDeathSource = UiUtils.getCollapsibleItemList(listener,
|
||||
@@ -399,7 +397,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
(x) -> {},
|
||||
updatePaneDeathSource,
|
||||
npc.writable,
|
||||
Common.TimedConditionEffect::new,
|
||||
Common.TimedActorConditionEffect::new,
|
||||
cellRendererDeathSource,
|
||||
titleDeathSource,
|
||||
(x) -> null);
|
||||
@@ -415,7 +413,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
pane.add(combatTraitPane, JideBoxLayout.FIX);
|
||||
}
|
||||
|
||||
public void updateHitSourceTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitSourceTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitSourceConditionBox != null) {
|
||||
removeElementListener(hitSourceConditionBox);
|
||||
@@ -487,7 +485,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitSourceTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitSourceTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -506,7 +504,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
}
|
||||
|
||||
|
||||
public void updateHitTargetTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitTargetTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitTargetConditionBox != null) {
|
||||
removeElementListener(hitTargetConditionBox);
|
||||
@@ -577,7 +575,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitTargetTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitTargetTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -596,7 +594,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
}
|
||||
|
||||
|
||||
public void updateHitReceivedSourceTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitReceivedSourceTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitReceivedSourceConditionBox != null) {
|
||||
removeElementListener(hitReceivedSourceConditionBox);
|
||||
@@ -668,7 +666,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitReceivedSourceTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitReceivedSourceTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -687,7 +685,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
}
|
||||
|
||||
|
||||
public void updateHitReceivedTargetTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateHitReceivedTargetTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (hitReceivedTargetConditionBox != null) {
|
||||
removeElementListener(hitReceivedTargetConditionBox);
|
||||
@@ -758,7 +756,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateHitReceivedTargetTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateHitReceivedTargetTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -776,7 +774,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
hitReceivedTargetConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public void updateDeathSourceTimedConditionEditorPane(JPanel pane, Common.TimedConditionEffect condition, final FieldUpdateListener listener) {
|
||||
public void updateDeathSourceTimedConditionEditorPane(JPanel pane, Common.TimedActorConditionEffect condition, final FieldUpdateListener listener) {
|
||||
pane.removeAll();
|
||||
if (deathSourceConditionBox != null) {
|
||||
removeElementListener(deathSourceConditionBox);
|
||||
@@ -848,7 +846,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
pane.repaint();
|
||||
}
|
||||
|
||||
public void updateDeathSourceTimedConditionWidgets(Common.TimedConditionEffect condition) {
|
||||
public void updateDeathSourceTimedConditionWidgets(Common.TimedActorConditionEffect condition) {
|
||||
|
||||
boolean immunity = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration != null && condition.duration > ActorCondition.DURATION_NONE);
|
||||
boolean clear = (condition.magnitude == null || condition.magnitude == ActorCondition.MAGNITUDE_CLEAR) && (condition.duration == null || condition.duration == ActorCondition.DURATION_NONE);
|
||||
@@ -866,34 +864,34 @@ public class NPCEditor extends JSONElementEditor {
|
||||
deathSourceConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public static class TargetTimedConditionsListModel extends OrderedListenerListModel<Common.HitEffect, Common.TimedConditionEffect> {
|
||||
public static class TargetTimedConditionsListModel extends OrderedListenerListModel<Common.HitEffect, Common.TimedActorConditionEffect> {
|
||||
public TargetTimedConditionsListModel(Common.HitEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Common.TimedConditionEffect> getItems() {
|
||||
protected List<Common.TimedActorConditionEffect> getItems() {
|
||||
return source.conditions_target;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setItems(List<Common.TimedConditionEffect> items) {
|
||||
protected void setItems(List<Common.TimedActorConditionEffect> items) {
|
||||
source.conditions_target = items;
|
||||
}
|
||||
}
|
||||
|
||||
public static class SourceTimedConditionsListModel extends OrderedListenerListModel<Common.DeathEffect, Common.TimedConditionEffect> {
|
||||
public static class SourceTimedConditionsListModel extends OrderedListenerListModel<Common.DeathEffect, Common.TimedActorConditionEffect> {
|
||||
public SourceTimedConditionsListModel(Common.DeathEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<Common.TimedConditionEffect> getItems() {
|
||||
protected List<Common.TimedActorConditionEffect> getItems() {
|
||||
return source.conditions_source;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setItems(List<Common.TimedConditionEffect> items) {
|
||||
protected void setItems(List<Common.TimedActorConditionEffect> items) {
|
||||
source.conditions_source = items;
|
||||
}
|
||||
}
|
||||
@@ -906,7 +904,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
|
||||
if (c instanceof JLabel) {
|
||||
JLabel label = ((JLabel) c);
|
||||
Common.TimedConditionEffect effect = (Common.TimedConditionEffect) value;
|
||||
Common.TimedActorConditionEffect effect = (Common.TimedActorConditionEffect) value;
|
||||
|
||||
if (effect.condition != null) {
|
||||
|
||||
|
||||
@@ -96,18 +96,18 @@ public class GDEVisitor {
|
||||
if (element.icon_id != null)
|
||||
visit(element.getProject().getSpritesheet(element.icon_id.split(":")[0]), visited, includeSource);
|
||||
if (element.equip_effect != null && element.equip_effect.conditions != null) {
|
||||
for (Common.ConditionEffect condEffect : element.equip_effect.conditions) {
|
||||
for (Common.ActorConditionEffect condEffect : element.equip_effect.conditions) {
|
||||
visit(condEffect.condition, visited, includeSource);
|
||||
}
|
||||
}
|
||||
if (element.hit_effect != null) {
|
||||
if (element.hit_effect.conditions_source != null) {
|
||||
for (Common.ConditionEffect condEffect : element.hit_effect.conditions_source) {
|
||||
for (Common.ActorConditionEffect condEffect : element.hit_effect.conditions_source) {
|
||||
visit(condEffect.condition, visited, includeSource);
|
||||
}
|
||||
}
|
||||
if (element.hit_effect.conditions_target != null) {
|
||||
for (Common.ConditionEffect condEffect : element.hit_effect.conditions_target) {
|
||||
for (Common.ActorConditionEffect condEffect : element.hit_effect.conditions_target) {
|
||||
visit(condEffect.condition, visited, includeSource);
|
||||
}
|
||||
}
|
||||
@@ -130,12 +130,12 @@ public class GDEVisitor {
|
||||
visit(element.getProject().getSpritesheet(element.icon_id.split(":")[0]), visited, includeSource);
|
||||
if (element.hit_effect != null) {
|
||||
if (element.hit_effect.conditions_source != null) {
|
||||
for (Common.TimedConditionEffect condEffect : element.hit_effect.conditions_source) {
|
||||
for (Common.TimedActorConditionEffect condEffect : element.hit_effect.conditions_source) {
|
||||
visit(condEffect.condition, visited, includeSource);
|
||||
}
|
||||
}
|
||||
if (element.hit_effect.conditions_target != null) {
|
||||
for (Common.TimedConditionEffect condEffect : element.hit_effect.conditions_target) {
|
||||
for (Common.TimedActorConditionEffect condEffect : element.hit_effect.conditions_target) {
|
||||
visit(condEffect.condition, visited, includeSource);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user