v0.2.2: refactored immunity to gasses

This commit is contained in:
Evan Debenham 2014-10-29 22:19:52 -04:00
parent 6810d0adef
commit e02222495c
4 changed files with 8 additions and 4 deletions

View File

@ -33,6 +33,7 @@ public class ConfusionGas extends Blob {
Char ch;
for (int i=0; i < LENGTH; i++) {
if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) {
if (!ch.immunities().contains(this.getClass()))
Buff.prolong( ch, Vertigo.class, 1 );
}
}

View File

@ -33,6 +33,7 @@ public class ParalyticGas extends Blob {
Char ch;
for (int i=0; i < LENGTH; i++) {
if (cur[i] > 0 && (ch = Actor.findChar( i )) != null) {
if (!ch.immunities().contains(this.getClass()))
Buff.prolong( ch, Paralysis.class, Paralysis.duration( ch ) );
}
}

View File

@ -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 );
}
}
}

View File

@ -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<Class<?>> IMMUNITIES = new HashSet<Class<?>>();
static {
IMMUNITIES.add( Paralysis.class );
IMMUNITIES.add( ParalyticGas.class );
IMMUNITIES.add( ToxicGas.class );
IMMUNITIES.add( ConfusionGas.class );
IMMUNITIES.add( StenchGas.class );