mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 23:57:25 +01:00
extract some valueChanged stuff for DeathEffectPane & HitEffectPane
This commit is contained in:
@@ -1105,10 +1105,10 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
}
|
||||
|
||||
|
||||
protected <E extends Common.ActorConditionEffect, T extends OrderedListenerListModel<?, E>> void updateConditionEffect(ActorCondition value,
|
||||
GameDataElement backlink,
|
||||
E selectedHitEffectTargetCondition,
|
||||
T hitTargetConditionsModel) {
|
||||
public <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);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gpl.rpg.atcontentstudio.ui.gamedataeditors;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
||||
import com.gpl.rpg.atcontentstudio.model.Project;
|
||||
import com.gpl.rpg.atcontentstudio.model.gamedata.ActorCondition;
|
||||
import com.gpl.rpg.atcontentstudio.model.gamedata.Common;
|
||||
@@ -105,9 +106,9 @@ public class CommonEditor {
|
||||
this.selectedHitEffectTargetCondition = selectedHitEffectTargetCondition;
|
||||
}
|
||||
|
||||
void createHitEffectPaneContent(FieldUpdateListener listener, boolean writable, Common.HitEffect e, NPCEditor.SourceTimedConditionsListModel sourceConditionsModelInput) {
|
||||
void createHitEffectPaneContent(FieldUpdateListener listener, boolean writable, Common.HitEffect e, NPCEditor.SourceTimedConditionsListModel sourceConditionsModelInput) {
|
||||
effect = e;
|
||||
createDeathEffectPaneContent( listener, writable, e, sourceConditionsModelInput);
|
||||
createDeathEffectPaneContent(listener, writable, e, sourceConditionsModelInput);
|
||||
|
||||
String titleTarget = "Actor Conditions applied to the target: ";
|
||||
hitTargetConditionsListModel = new NPCEditor.TargetTimedConditionsListModel(effect);
|
||||
@@ -225,6 +226,68 @@ public class CommonEditor {
|
||||
hitTargetConditionForever.setEnabled(!clear);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean valueChanged(JComponent source, Object value, GameDataElement backlink) {
|
||||
boolean updateHit = super.valueChanged(source, value, backlink);
|
||||
if (!updateHit) {
|
||||
if (source == hitTargetConditionsList) {
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionBox) {
|
||||
editor.updateConditionEffect((ActorCondition) value, backlink, selectedHitEffectTargetCondition, hitTargetConditionsListModel);
|
||||
} else if (source == hitTargetConditionClear && (Boolean) value) {
|
||||
selectedHitEffectTargetCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
selectedHitEffectTargetCondition.duration = null;
|
||||
updateHitTargetTimedConditionWidgets(selectedHitEffectTargetCondition);
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionApply && (Boolean) value) {
|
||||
selectedHitEffectTargetCondition.magnitude = (Integer) hitTargetConditionMagnitude.getValue();
|
||||
selectedHitEffectTargetCondition.duration = hitTargetConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) hitTargetConditionDuration.getValue();
|
||||
if (selectedHitEffectTargetCondition.duration == null || selectedHitEffectTargetCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
selectedHitEffectTargetCondition.duration = 1;
|
||||
}
|
||||
updateHitTargetTimedConditionWidgets(selectedHitEffectTargetCondition);
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionImmunity && (Boolean) value) {
|
||||
selectedHitEffectTargetCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
selectedHitEffectTargetCondition.duration = hitTargetConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) hitTargetConditionDuration.getValue();
|
||||
if (selectedHitEffectTargetCondition.duration == null || selectedHitEffectTargetCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
selectedHitEffectTargetCondition.duration = 1;
|
||||
}
|
||||
updateHitTargetTimedConditionWidgets(selectedHitEffectTargetCondition);
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionMagnitude) {
|
||||
selectedHitEffectTargetCondition.magnitude = (Integer) value;
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionTimed && (Boolean) value) {
|
||||
selectedHitEffectTargetCondition.duration = (Integer) hitTargetConditionDuration.getValue();
|
||||
if (selectedHitEffectTargetCondition.duration == null || selectedHitEffectTargetCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
selectedHitEffectTargetCondition.duration = 1;
|
||||
}
|
||||
updateHitTargetTimedConditionWidgets(selectedHitEffectTargetCondition);
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionForever && (Boolean) value) {
|
||||
selectedHitEffectTargetCondition.duration = ActorCondition.DURATION_FOREVER;
|
||||
updateHitTargetTimedConditionWidgets(selectedHitEffectTargetCondition);
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionDuration) {
|
||||
selectedHitEffectTargetCondition.duration = (Integer) value;
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitTargetConditionChance) {
|
||||
selectedHitEffectTargetCondition.chance = (Double) value;
|
||||
hitTargetConditionsListModel.itemChanged(selectedHitEffectTargetCondition);
|
||||
}
|
||||
}
|
||||
|
||||
return updateHit;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DeathEffectPane<S, E extends Common.TimedActorConditionEffect, M extends OrderedListenerListModel<S, E>> {
|
||||
@@ -397,5 +460,85 @@ public class CommonEditor {
|
||||
sourceConditionForever.setSelected(forever);
|
||||
sourceConditionForever.setEnabled(!clear);
|
||||
}
|
||||
|
||||
public boolean valueChanged(JComponent source, Object value, GameDataElement backlink) {
|
||||
boolean updateHit = false;
|
||||
if (source == effectHPMin) {
|
||||
effect.hp_boost_min = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == effectHPMax) {
|
||||
effect.hp_boost_max = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == effectAPMin) {
|
||||
effect.ap_boost_min = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == effectAPMax) {
|
||||
effect.ap_boost_max = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionsList) {
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionBox) {
|
||||
if (selectedEffectSourceCondition.condition != null) {
|
||||
selectedEffectSourceCondition.condition.removeBacklink(backlink);
|
||||
}
|
||||
selectedEffectSourceCondition.condition = (ActorCondition) value;
|
||||
if (selectedEffectSourceCondition.condition != null) {
|
||||
selectedEffectSourceCondition.condition.addBacklink(backlink);
|
||||
selectedEffectSourceCondition.condition_id = selectedEffectSourceCondition.condition.id;
|
||||
} else {
|
||||
selectedEffectSourceCondition.condition_id = null;
|
||||
}
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
} else if (source == sourceConditionClear && (Boolean) value) {
|
||||
selectedEffectSourceCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
selectedEffectSourceCondition.duration = null;
|
||||
updateEffectSourceTimedConditionWidgets(selectedEffectSourceCondition);
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionApply && (Boolean) value) {
|
||||
selectedEffectSourceCondition.magnitude = (Integer) sourceConditionMagnitude.getValue();
|
||||
selectedEffectSourceCondition.duration = sourceConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) sourceConditionDuration.getValue();
|
||||
if (selectedEffectSourceCondition.duration == null || selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateEffectSourceTimedConditionWidgets(selectedEffectSourceCondition);
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionImmunity && (Boolean) value) {
|
||||
selectedEffectSourceCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
selectedEffectSourceCondition.duration = sourceConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) sourceConditionDuration.getValue();
|
||||
if (selectedEffectSourceCondition.duration == null || selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateEffectSourceTimedConditionWidgets(selectedEffectSourceCondition);
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionMagnitude) {
|
||||
selectedEffectSourceCondition.magnitude = (Integer) value;
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionTimed && (Boolean) value) {
|
||||
selectedEffectSourceCondition.duration = (Integer) sourceConditionDuration.getValue();
|
||||
if (selectedEffectSourceCondition.duration == null || selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateEffectSourceTimedConditionWidgets(selectedEffectSourceCondition);
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionForever && (Boolean) value) {
|
||||
selectedEffectSourceCondition.duration = ActorCondition.DURATION_FOREVER;
|
||||
updateEffectSourceTimedConditionWidgets(selectedEffectSourceCondition);
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionDuration) {
|
||||
selectedEffectSourceCondition.duration = (Integer) value;
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == sourceConditionChance) {
|
||||
selectedEffectSourceCondition.chance = (Double) value;
|
||||
sourceConditionsModel.itemChanged(selectedEffectSourceCondition);
|
||||
}
|
||||
return updateHit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -638,132 +638,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
npc.block_chance = (Integer) value;
|
||||
} else if (source == dmgRes) {
|
||||
npc.damage_resistance = (Integer) value;
|
||||
} else if (source == hitEffectPane.effectHPMin) {
|
||||
hitEffectPane.effect.hp_boost_min = (Integer) value;
|
||||
} else if(hitEffectPane != null &&hitEffectPane.valueChanged(source, value, npc)) {
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.effectHPMax) {
|
||||
hitEffectPane.effect.hp_boost_max = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.effectAPMin) {
|
||||
hitEffectPane.effect.ap_boost_min = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.effectAPMax) {
|
||||
hitEffectPane.effect.ap_boost_max = (Integer) value;
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionsList) {
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionBox) {
|
||||
if (hitEffectPane.selectedEffectSourceCondition.condition != null) {
|
||||
hitEffectPane.selectedEffectSourceCondition.condition.removeBacklink(npc);
|
||||
}
|
||||
hitEffectPane.selectedEffectSourceCondition.condition = (ActorCondition) value;
|
||||
if (hitEffectPane.selectedEffectSourceCondition.condition != null) {
|
||||
hitEffectPane.selectedEffectSourceCondition.condition.addBacklink(npc);
|
||||
hitEffectPane.selectedEffectSourceCondition.condition_id = hitEffectPane.selectedEffectSourceCondition.condition.id;
|
||||
} else {
|
||||
hitEffectPane.selectedEffectSourceCondition.condition_id = null;
|
||||
}
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
} else if (source == hitEffectPane.sourceConditionClear && (Boolean) value) {
|
||||
hitEffectPane.selectedEffectSourceCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = null;
|
||||
updateHitSourceTimedConditionWidgets(hitEffectPane.selectedEffectSourceCondition);
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionApply && (Boolean) value) {
|
||||
hitEffectPane.selectedEffectSourceCondition.magnitude = (Integer) hitEffectPane.sourceConditionMagnitude.getValue();
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = hitEffectPane.sourceConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) hitEffectPane.sourceConditionDuration.getValue();
|
||||
if (hitEffectPane.selectedEffectSourceCondition.duration == null || hitEffectPane.selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateHitSourceTimedConditionWidgets(hitEffectPane.selectedEffectSourceCondition);
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionImmunity && (Boolean) value) {
|
||||
hitEffectPane.selectedEffectSourceCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = hitEffectPane.sourceConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) hitEffectPane.sourceConditionDuration.getValue();
|
||||
if (hitEffectPane.selectedEffectSourceCondition.duration == null || hitEffectPane.selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateHitSourceTimedConditionWidgets(hitEffectPane.selectedEffectSourceCondition);
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionMagnitude) {
|
||||
hitEffectPane.selectedEffectSourceCondition.magnitude = (Integer) value;
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionTimed && (Boolean) value) {
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = (Integer) hitEffectPane.sourceConditionDuration.getValue();
|
||||
if (hitEffectPane.selectedEffectSourceCondition.duration == null || hitEffectPane.selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateHitSourceTimedConditionWidgets(hitEffectPane.selectedEffectSourceCondition);
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionForever && (Boolean) value) {
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = ActorCondition.DURATION_FOREVER;
|
||||
updateHitSourceTimedConditionWidgets(hitEffectPane.selectedEffectSourceCondition);
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionDuration) {
|
||||
hitEffectPane.selectedEffectSourceCondition.duration = (Integer) value;
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.sourceConditionChance) {
|
||||
hitEffectPane.selectedEffectSourceCondition.chance = (Double) value;
|
||||
hitEffectPane.sourceConditionsModel.itemChanged(hitEffectPane.selectedEffectSourceCondition);
|
||||
} else if (source == hitEffectPane.hitTargetConditionsList) {
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionBox) {
|
||||
updateConditionEffect((ActorCondition) value, npc, hitEffectPane.selectedHitEffectTargetCondition, hitEffectPane.hitTargetConditionsListModel);
|
||||
} else if (source == hitEffectPane.hitTargetConditionClear && (Boolean) value) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = null;
|
||||
updateHitTargetTimedConditionWidgets(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionApply && (Boolean) value) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.magnitude = (Integer) hitEffectPane.hitTargetConditionMagnitude.getValue();
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = hitEffectPane.hitTargetConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) hitEffectPane.hitTargetConditionDuration.getValue();
|
||||
if (hitEffectPane.selectedHitEffectTargetCondition.duration == null || hitEffectPane.selectedHitEffectTargetCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = 1;
|
||||
}
|
||||
updateHitTargetTimedConditionWidgets(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionImmunity && (Boolean) value) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = hitEffectPane.hitTargetConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) hitEffectPane.hitTargetConditionDuration.getValue();
|
||||
if (hitEffectPane.selectedHitEffectTargetCondition.duration == null || hitEffectPane.selectedHitEffectTargetCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = 1;
|
||||
}
|
||||
updateHitTargetTimedConditionWidgets(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionMagnitude) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.magnitude = (Integer) value;
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionTimed && (Boolean) value) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = (Integer) hitEffectPane.hitTargetConditionDuration.getValue();
|
||||
if (hitEffectPane.selectedHitEffectTargetCondition.duration == null || hitEffectPane.selectedHitEffectTargetCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = 1;
|
||||
}
|
||||
updateHitTargetTimedConditionWidgets(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionForever && (Boolean) value) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = ActorCondition.DURATION_FOREVER;
|
||||
updateHitTargetTimedConditionWidgets(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionDuration) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.duration = (Integer) value;
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
updateHit = true;
|
||||
} else if (source == hitEffectPane.hitTargetConditionChance) {
|
||||
hitEffectPane.selectedHitEffectTargetCondition.chance = (Double) value;
|
||||
hitEffectPane.hitTargetConditionsListModel.itemChanged(hitEffectPane.selectedHitEffectTargetCondition);
|
||||
} else if (source == hitReceivedEffectHPMin) {
|
||||
hitReceivedEffect.hp_boost_min = (Integer) value;
|
||||
updateHitReceived = true;
|
||||
@@ -902,80 +778,8 @@ public class NPCEditor extends JSONElementEditor {
|
||||
} else if (source == hitReceivedTargetConditionChance) {
|
||||
selectedHitReceivedEffectTargetCondition.chance = (Double) value;
|
||||
hitReceivedTargetConditionsListModel.itemChanged(selectedHitReceivedEffectTargetCondition);
|
||||
} else if (source == deathEffectPane.effectHPMin) {
|
||||
deathEffectPane. effect.hp_boost_min = (Integer) value;
|
||||
} else if (deathEffectPane.valueChanged(source, value, npc)) {
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. effectHPMax) {
|
||||
deathEffectPane. effect.hp_boost_max = (Integer) value;
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. effectAPMin) {
|
||||
deathEffectPane. effect.ap_boost_min = (Integer) value;
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. effectAPMax) {
|
||||
deathEffectPane. effect.ap_boost_max = (Integer) value;
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionsList) {
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionBox) {
|
||||
if (deathEffectPane.selectedEffectSourceCondition.condition != null) {
|
||||
deathEffectPane.selectedEffectSourceCondition.condition.removeBacklink(npc);
|
||||
}
|
||||
deathEffectPane.selectedEffectSourceCondition.condition = (ActorCondition) value;
|
||||
if (deathEffectPane.selectedEffectSourceCondition.condition != null) {
|
||||
deathEffectPane.selectedEffectSourceCondition.condition.addBacklink(npc);
|
||||
deathEffectPane.selectedEffectSourceCondition.condition_id = deathEffectPane.selectedEffectSourceCondition.condition.id;
|
||||
} else {
|
||||
deathEffectPane.selectedEffectSourceCondition.condition_id = null;
|
||||
}
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
} else if (source == deathEffectPane. sourceConditionClear && (Boolean) value) {
|
||||
deathEffectPane.selectedEffectSourceCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = null;
|
||||
updateDeathSourceTimedConditionWidgets(deathEffectPane.selectedEffectSourceCondition);
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionApply && (Boolean) value) {
|
||||
deathEffectPane.selectedEffectSourceCondition.magnitude = (Integer) deathEffectPane. sourceConditionMagnitude.getValue();
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = deathEffectPane. sourceConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) deathEffectPane. sourceConditionDuration.getValue();
|
||||
if (deathEffectPane.selectedEffectSourceCondition.duration == null || deathEffectPane.selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateDeathSourceTimedConditionWidgets(deathEffectPane.selectedEffectSourceCondition);
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionImmunity && (Boolean) value) {
|
||||
deathEffectPane.selectedEffectSourceCondition.magnitude = ActorCondition.MAGNITUDE_CLEAR;
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = deathEffectPane. sourceConditionForever.isSelected() ? ActorCondition.DURATION_FOREVER : (Integer) deathEffectPane. sourceConditionDuration.getValue();
|
||||
if (deathEffectPane.selectedEffectSourceCondition.duration == null || deathEffectPane.selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateDeathSourceTimedConditionWidgets(deathEffectPane.selectedEffectSourceCondition);
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionMagnitude) {
|
||||
deathEffectPane.selectedEffectSourceCondition.magnitude = (Integer) value;
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionTimed && (Boolean) value) {
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = (Integer) deathEffectPane. sourceConditionDuration.getValue();
|
||||
if (deathEffectPane.selectedEffectSourceCondition.duration == null || deathEffectPane.selectedEffectSourceCondition.duration == ActorCondition.DURATION_NONE) {
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = 1;
|
||||
}
|
||||
updateDeathSourceTimedConditionWidgets(deathEffectPane.selectedEffectSourceCondition);
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionForever && (Boolean) value) {
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = ActorCondition.DURATION_FOREVER;
|
||||
updateDeathSourceTimedConditionWidgets(deathEffectPane.selectedEffectSourceCondition);
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionDuration) {
|
||||
deathEffectPane.selectedEffectSourceCondition.duration = (Integer) value;
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
updateDeath = true;
|
||||
} else if (source == deathEffectPane. sourceConditionChance) {
|
||||
deathEffectPane.selectedEffectSourceCondition.chance = (Double) value;
|
||||
deathEffectPane. sourceConditionsModel.itemChanged(deathEffectPane.selectedEffectSourceCondition);
|
||||
}
|
||||
|
||||
if (updateHit) {
|
||||
|
||||
Reference in New Issue
Block a user