From d8379ae5a923dd5c8b46898ba796fff8dfdbe511 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 5 Jan 2025 11:18:39 -0600 Subject: [PATCH] shades dont break hide when moving --- src/engine/gameManager/PowersManager.java | 15 +++++++-------- src/engine/objects/AbstractCharacter.java | 10 +++++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/engine/gameManager/PowersManager.java b/src/engine/gameManager/PowersManager.java index cd92213c..744586d3 100644 --- a/src/engine/gameManager/PowersManager.java +++ b/src/engine/gameManager/PowersManager.java @@ -787,14 +787,13 @@ public enum PowersManager { if (playerCharacter == null || msg == null) return; - if((msg.getPowerUsedID() == 429495514 || msg.getPowerUsedID() == 429407306) && playerCharacter.getRace().getName().toLowerCase().contains("shade")){ - //use sneak instead of hide - PowersBase pb = PowersManager.getPowerByToken(429397210); - float movementPenalty = 0.01f * (50 - msg.getNumTrains()); - int offsetTrains = (40 - msg.getNumTrains()) ; - applyPower(playerCharacter,playerCharacter,playerCharacter.loc,429397210,msg.getNumTrains(),false); - applyPower(playerCharacter,playerCharacter,playerCharacter.loc,427857146,offsetTrains,false); - } + //if((msg.getPowerUsedID() == 429495514 || msg.getPowerUsedID() == 429407306) && playerCharacter.getRace().getName().toLowerCase().contains("shade")){ + // //use sneak instead of hide + // PowersBase pb = PowersManager.getPowerByToken(429397210); + // int offsetTrains = (40 - msg.getNumTrains()) ; + // applyPower(playerCharacter,playerCharacter,playerCharacter.loc,429397210,msg.getNumTrains(),false); + // applyPower(playerCharacter,playerCharacter,playerCharacter.loc,427857146,offsetTrains,false); + //} if(msg.getPowerUsedID() == 429494441) {//wildkins chase playerCharacter.removeEffectBySource(EffectSourceType.Root,40,true); playerCharacter.removeEffectBySource(EffectSourceType.Snare,40,true); diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index c8ee2164..966a48ba 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -1558,7 +1558,15 @@ public abstract class AbstractCharacter extends AbstractWorldObject { Effect eff = this.effects.get(s); if (eff == null) continue; - if (eff.cancelOnMove() && eff.cancel()) { + + Boolean override = false; + if(this.getObjectType().equals(GameObjectType.PlayerCharacter)) { + PlayerCharacter pc = (PlayerCharacter) this; + if (eff.getEffectsBase().getIDString().equals("INVIS-B") && s.equals("Invisible") && pc.getRace().getName().contains("Shade")) + override = true; + } + + if (!override && eff.cancelOnMove() && eff.cancel()) { //System.out.println("canceling on Move"); eff.cancelJob(); this.effects.remove(s);