v0.3.0c: fixed a bug where saving and loading while the fists are alive would make Yog invincible

This commit is contained in:
Evan Debenham
2015-06-03 16:32:34 -04:00
committed by Evan Debenham
parent b52438fe11
commit 57b3de2ae3
@@ -71,8 +71,6 @@ public class Yog extends Mob {
"barely won the war against its army of demons, but were unable to kill the god itself. Instead, they then " + "barely won the war against its army of demons, but were unable to kill the god itself. Instead, they then " +
"imprisoned it in the halls below their city, believing it to be too weak to rise ever again."; "imprisoned it in the halls below their city, believing it to be too weak to rise ever again.";
private static int fistsCount = 0;
public Yog() { public Yog() {
super(); super();
} }
@@ -101,16 +99,16 @@ public class Yog extends Mob {
@Override @Override
public void damage( int dmg, Object src ) { public void damage( int dmg, Object src ) {
if (fistsCount > 0) { HashSet<Mob> fists = new HashSet<>();
for (Mob mob : Dungeon.level.mobs) { for (Mob mob : Dungeon.level.mobs)
if (mob instanceof BurningFist || mob instanceof RottingFist) { if (mob instanceof RottingFist || mob instanceof BurningFist)
mob.beckon( pos ); fists.add( mob );
}
}
dmg >>= fistsCount; for (Mob fist : fists)
} fist.beckon( pos );
dmg >>= fists.size();
super.damage( dmg, src ); super.damage( dmg, src );
} }
@@ -212,17 +210,6 @@ public class Yog extends Mob {
state = WANDERING; state = WANDERING;
} }
public RottingFist() {
super();
fistsCount++;
}
@Override
public void die( Object cause ) {
super.die( cause );
fistsCount--;
}
@Override @Override
public int attackSkill( Char target ) { public int attackSkill( Char target ) {
return 36; return 36;
@@ -306,17 +293,6 @@ public class Yog extends Mob {
state = WANDERING; state = WANDERING;
} }
public BurningFist() {
super();
fistsCount++;
}
@Override
public void die( Object cause ) {
super.die( cause );
fistsCount--;
}
@Override @Override
public int attackSkill( Char target ) { public int attackSkill( Char target ) {
return 36; return 36;