From a5186265e26f098de32bd10f7db5f1b88ff4a44c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 12 Mar 2025 19:14:33 -0500 Subject: [PATCH] use of proper stack ranks --- src/engine/powers/ActionsBase.java | 40 ++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/src/engine/powers/ActionsBase.java b/src/engine/powers/ActionsBase.java index 57249537..42cd38fd 100644 --- a/src/engine/powers/ActionsBase.java +++ b/src/engine/powers/ActionsBase.java @@ -9,6 +9,7 @@ package engine.powers; +import com.sun.corba.se.spi.orbutil.fsm.ActionBase; import engine.Enum; import engine.Enum.ModType; import engine.Enum.SourceType; @@ -259,6 +260,34 @@ public class ActionsBase { if (AbstractWorldObject.IsAbstractCharacter(awo)) { AbstractCharacter ac = (AbstractCharacter) awo; + + if(ac.effects.containsKey(this.stackType)) { + Boolean sameRank = false; + Effect eff = ac.effects.get(this.stackType); + + String currentEffect = eff.getEffectsBase().getIDString(); + String newEffect = this.effectID; + if (currentEffect.equals(newEffect) && !this.stackType.equals("Stun")) + return false; + + if (eff != null) { + for (ActionsBase action : eff.getPower().getActions()) { + if (this.stackType.equals(action.stackType) && this.stackOrder == action.stackOrder) { + if (this.stackType.equals("NoStun")) { + return true; + } + } + + if (sameRank) { + if (this.greaterThan && trains <= eff.getTrains()) + return true; + + if (this.greaterThanEqual && trains < eff.getTrains()) + return true; + } + } + } + } PlayerBonuses bonus = ac.getBonuses(); if (bonus == null) return false; @@ -290,17 +319,6 @@ public class ActionsBase { if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock)) return true; - - if(ac.effects.containsKey(this.stackType)) { - Effect eff = ac.effects.get(this.stackType); - if(eff != null) { - if (this.greaterThan && trains <= eff.getTrains()) - return true; - - if (this.greaterThanEqual && trains < eff.getTrains()) - return true; - } - } } return false; }