mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-01-06 19:45:31 +01:00
extract linkEffects
This commit is contained in:
@@ -17,6 +17,19 @@ public final class Common {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void linkEffects(HitEffect effect, Project proj, GameDataElement backlink){
|
||||||
|
linkEffects((DeathEffect) effect, proj, backlink);
|
||||||
|
if (effect != null)
|
||||||
|
{
|
||||||
|
linkConditions(effect.conditions_target, proj, backlink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void linkEffects(DeathEffect effect, Project proj, GameDataElement backlink){
|
||||||
|
if (effect != null)
|
||||||
|
{
|
||||||
|
linkConditions(effect.conditions_source, proj, backlink);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class TimedActorConditionEffect extends ActorConditionEffect {
|
public static class TimedActorConditionEffect extends ActorConditionEffect {
|
||||||
//Available from parsed state
|
//Available from parsed state
|
||||||
|
|||||||
@@ -226,19 +226,9 @@ public class Item extends JSONElement {
|
|||||||
linkConditions(this.equip_effect.conditions, proj, this);
|
linkConditions(this.equip_effect.conditions, proj, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hit_effect != null) {
|
linkEffects(this.hit_effect, proj, this);
|
||||||
linkConditions(this.hit_effect.conditions_source, proj, this);
|
linkEffects(this.hit_received_effect, proj, this);
|
||||||
linkConditions(this.hit_effect.conditions_target, proj, this);
|
linkEffects(this.kill_effect, proj, this);
|
||||||
}
|
|
||||||
|
|
||||||
if (this.hit_received_effect != null) {
|
|
||||||
linkConditions(this.hit_received_effect.conditions_source, proj, this);
|
|
||||||
linkConditions(this.hit_received_effect.conditions_target, proj, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.kill_effect != null) {
|
|
||||||
linkConditions(this.kill_effect.conditions_source, proj, this);
|
|
||||||
}
|
|
||||||
this.state = State.linked;
|
this.state = State.linked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -230,17 +230,9 @@ public class NPC extends JSONElement {
|
|||||||
if (this.droplist_id != null) this.droplist = proj.getDroplist(this.droplist_id);
|
if (this.droplist_id != null) this.droplist = proj.getDroplist(this.droplist_id);
|
||||||
if (this.droplist != null) this.droplist.addBacklink(this);
|
if (this.droplist != null) this.droplist.addBacklink(this);
|
||||||
|
|
||||||
if (this.hit_effect != null) {
|
linkEffects(this.hit_effect, proj, this);
|
||||||
linkConditions(this.hit_effect.conditions_source, proj, this);
|
linkEffects(this.hit_received_effect, proj, this);
|
||||||
linkConditions(this.hit_effect.conditions_target, proj, this);
|
linkEffects(this.death_effect, proj, this);
|
||||||
}
|
|
||||||
if (this.hit_received_effect != null) {
|
|
||||||
linkConditions(this.hit_received_effect.conditions_source, proj, this);
|
|
||||||
linkConditions(this.hit_received_effect.conditions_target, proj, this);
|
|
||||||
}
|
|
||||||
if (this.death_effect != null) {
|
|
||||||
linkConditions(this.death_effect.conditions_source, proj, this);
|
|
||||||
}
|
|
||||||
this.state = State.linked;
|
this.state = State.linked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user