From 54367bae2bc37f505acacf1218cbcd44d4bae4fd Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 24 Apr 2024 13:35:23 -0400 Subject: [PATCH] v2.4.0: standardized chars being immune to ai state or stun/slow debuffs --- .../shatteredpixeldungeon/actors/Char.java | 6 +++++- .../actors/mobs/CrystalSpire.java | 13 +----------- .../actors/mobs/DemonSpawner.java | 15 +------------- .../actors/mobs/Pylon.java | 16 +-------------- .../actors/mobs/RotHeart.java | 13 +----------- .../actors/mobs/YogDzewa.java | 20 +------------------ .../items/wands/WandOfRegrowth.java | 13 +----------- 7 files changed, 11 insertions(+), 85 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java index 0f43311a8..bdba3e362 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/Char.java @@ -1194,7 +1194,11 @@ public abstract class Char extends Actor { ELECTRIC ( new HashSet( Arrays.asList(WandOfLightning.class, Shocking.class, Potential.class, Electricity.class, ShockingDart.class, Elemental.ShockElemental.class )), new HashSet()), LARGE, - IMMOVABLE; + IMMOVABLE ( new HashSet(), + new HashSet( Arrays.asList(Vertigo.class) )), + //A character that acts in an unchanging manner. immune to AI state debuffs or stuns/slows + STATIC( new HashSet(), + new HashSet( Arrays.asList(Paralysis.class, Frost.class, Chill.class, Slow.class, Speed.class) )); private HashSet resistances; private HashSet immunities; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java index 8b76e55a4..e62951d8f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CrystalSpire.java @@ -25,17 +25,12 @@ import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Blindness; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Cripple; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.effects.Splash; @@ -78,6 +73,7 @@ public class CrystalSpire extends Mob { properties.add(Property.IMMOVABLE); properties.add(Property.BOSS); properties.add(Property.INORGANIC); + properties.add(Property.STATIC); } private float abilityCooldown; @@ -513,13 +509,6 @@ public class CrystalSpire extends Mob { { immunities.add( Blindness.class ); - - immunities.add( Paralysis.class ); - immunities.add( Amok.class ); - immunities.add( Sleep.class ); - immunities.add( Terror.class ); - immunities.add( Dread.class ); - immunities.add( Vertigo.class ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java index 7ef82f643..5e00fea7a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DemonSpawner.java @@ -25,13 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AscensionChallenge; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; @@ -64,6 +58,7 @@ public class DemonSpawner extends Mob { properties.add(Property.IMMOVABLE); properties.add(Property.MINIBOSS); properties.add(Property.DEMONIC); + properties.add(Property.STATIC); } @Override @@ -177,12 +172,4 @@ public class DemonSpawner extends Mob { spawnRecorded = bundle.getBoolean(SPAWN_RECORDED); } - { - immunities.add( Paralysis.class ); - immunities.add( Amok.class ); - immunities.add( Sleep.class ); - immunities.add( Dread.class ); - immunities.add( Terror.class ); - immunities.add( Vertigo.class ); - } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java index b26e5d07a..2b64b9283 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Pylon.java @@ -28,14 +28,8 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Electricity; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SparkParticle; @@ -66,6 +60,7 @@ public class Pylon extends Mob { properties.add(Property.INORGANIC); properties.add(Property.ELECTRIC); properties.add(Property.IMMOVABLE); + properties.add(Property.STATIC); state = PASSIVE; alignment = Alignment.NEUTRAL; @@ -238,13 +233,4 @@ public class Pylon extends Mob { targetNeighbor = bundle.getInt(TARGET_NEIGHBOUR); } - { - immunities.add( Paralysis.class ); - immunities.add( Amok.class ); - immunities.add( Sleep.class ); - immunities.add( Terror.class ); - immunities.add( Dread.class ); - immunities.add( Vertigo.class ); - } - } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java index 0d9f37414..3350ebbf7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/RotHeart.java @@ -26,13 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.RotHeartSprite; @@ -52,6 +46,7 @@ public class RotHeart extends Mob { properties.add(Property.IMMOVABLE); properties.add(Property.MINIBOSS); + properties.add(Property.STATIC); } @Override @@ -134,13 +129,7 @@ public class RotHeart extends Mob { } { - immunities.add( Paralysis.class ); - immunities.add( Amok.class ); - immunities.add( Sleep.class ); immunities.add( ToxicGas.class ); - immunities.add( Terror.class ); - immunities.add( Dread.class ); - immunities.add( Vertigo.class ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java index 872165d64..5aea77c74 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/YogDzewa.java @@ -28,17 +28,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Frost; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Light; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Sheep; import com.shatteredpixel.shatteredpixeldungeon.effects.Beam; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; @@ -87,6 +79,7 @@ public class YogDzewa extends Mob { properties.add(Property.BOSS); properties.add(Property.IMMOVABLE); properties.add(Property.DEMONIC); + properties.add(Property.STATIC); } private int phase = 0; @@ -575,17 +568,6 @@ public class YogDzewa extends Mob { return desc; } - { - immunities.add( Dread.class ); - immunities.add( Terror.class ); - immunities.add( Amok.class ); - immunities.add( Charm.class ); - immunities.add( Sleep.class ); - immunities.add( Vertigo.class ); - immunities.add( Frost.class ); - immunities.add( Paralysis.class ); - } - private static final String PHASE = "phase"; private static final String ABILITY_CD = "ability_cd"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java index e464849e7..cff1ef334 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfRegrowth.java @@ -27,15 +27,9 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Amok; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Doom; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Dread; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Sleep; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Terror; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.WildMagic; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DwarfKing; @@ -408,6 +402,7 @@ public class WandOfRegrowth extends Wand { { alignment = Alignment.NEUTRAL; properties.add(Property.IMMOVABLE); + properties.add(Property.STATIC); spriteClass = LotusSprite.class; @@ -469,12 +464,6 @@ public class WandOfRegrowth extends Wand { } { - immunities.add( Paralysis.class ); - immunities.add( Amok.class ); - immunities.add( Sleep.class ); - immunities.add( Terror.class ); - immunities.add( Dread.class ); - immunities.add( Vertigo.class ); immunities.add( AllyBuff.class ); immunities.add( Doom.class ); }