From e02222495c2c7fb403f9cb8b256c432071e23755 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 29 Oct 2014 22:19:52 -0400 Subject: [PATCH] v0.2.2: refactored immunity to gasses --- .../shatteredpixeldungeon/actors/blobs/ConfusionGas.java | 3 ++- .../shatteredpixeldungeon/actors/blobs/ParalyticGas.java | 3 ++- .../shatteredpixeldungeon/actors/blobs/StenchGas.java | 3 ++- .../shatteredpixeldungeon/actors/buffs/GasesImmunity.java | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ConfusionGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ConfusionGas.java index fb57fd61b..225b226a1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ConfusionGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ConfusionGas.java @@ -33,7 +33,8 @@ public class ConfusionGas extends Blob { Char ch; for (int i=0; i < LENGTH; i++) { if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) { - Buff.prolong( ch, Vertigo.class, 1 ); + if (!ch.immunities().contains(this.getClass())) + Buff.prolong( ch, Vertigo.class, 1 ); } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ParalyticGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ParalyticGas.java index 342685d26..fa57c2214 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ParalyticGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/ParalyticGas.java @@ -33,7 +33,8 @@ public class ParalyticGas extends Blob { Char ch; for (int i=0; i < LENGTH; i++) { if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) { - Buff.prolong( ch, Paralysis.class, Paralysis.duration( ch ) ); + if (!ch.immunities().contains(this.getClass())) + Buff.prolong( ch, Paralysis.class, Paralysis.duration( ch ) ); } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java index e25a879a9..6de30ef5e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/StenchGas.java @@ -19,7 +19,8 @@ public class StenchGas extends Blob { Char ch; for (int i=0; i < LENGTH; i++) { if (cur[i] > 0 && (ch = Actor.findChar(i)) != null) { - Buff.prolong(ch, Paralysis.class, Paralysis.duration(ch)/5); + if (!ch.immunities().contains(this.getClass())) + Buff.prolong( ch, Paralysis.class, Paralysis.duration( ch )/5 ); } } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java index bb9ad296b..108157d03 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/GasesImmunity.java @@ -18,6 +18,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ConfusionGas; +import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ParalyticGas; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.StenchGas; import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.ToxicGas; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -40,7 +41,7 @@ public class GasesImmunity extends FlavourBuff { public static final HashSet> IMMUNITIES = new HashSet>(); static { - IMMUNITIES.add( Paralysis.class ); + IMMUNITIES.add( ParalyticGas.class ); IMMUNITIES.add( ToxicGas.class ); IMMUNITIES.add( ConfusionGas.class ); IMMUNITIES.add( StenchGas.class );