v0.8.0: Fixes:

- Further bee AI weirdness involving explosive traps
- Fixed no logic existing to account for hero being killed by an attack proc
This commit is contained in:
Evan Debenham 2019-12-08 18:38:11 -05:00
parent 0351ad6475
commit 208a954dc0
4 changed files with 23 additions and 2 deletions

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
@ -120,7 +121,12 @@ public class Statue extends Mob {
@Override
public int attackProc( Char enemy, int damage ) {
damage = super.attackProc( enemy, damage );
return weapon.proc( this, enemy, damage );
damage = weapon.proc( this, enemy, damage );
if (!enemy.isAlive() && enemy == Dungeon.hero){
Dungeon.fail(getClass());
GLog.n( Messages.capitalize(Messages.get(Char.class, "kill", name())) );
}
return damage;
}
@Override

View File

@ -32,9 +32,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite;
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
@ -158,7 +160,12 @@ public class MirrorImage extends NPC {
((Mob)enemy).aggro( this );
}
if (hero.belongings.weapon != null){
return hero.belongings.weapon.proc( this, enemy, damage );
damage = hero.belongings.weapon.proc( this, enemy, damage );
if (!enemy.isAlive() && enemy == Dungeon.hero){
Dungeon.fail(getClass());
GLog.n( Messages.capitalize(Messages.get(Char.class, "kill", name())) );
}
return damage;
} else {
return damage;
}

View File

@ -275,6 +275,10 @@ public class Heap implements Bundlable {
items.remove(item);
((Potion) item).shatter(pos);
} else if (item instanceof Honeypot.ShatteredPot) {
items.remove(item);
((Honeypot.ShatteredPot) item).destroyPot(pos);
} else if (item instanceof Bomb) {
items.remove( item );
((Bomb) item).explode(pos);

View File

@ -619,6 +619,10 @@ public class DriedRose extends Artifact {
damage = super.attackProc(enemy, damage);
if (rose != null && rose.weapon != null) {
damage = rose.weapon.proc( this, enemy, damage );
if (!enemy.isAlive() && enemy == Dungeon.hero){
Dungeon.fail(getClass());
GLog.n( Messages.capitalize(Messages.get(Char.class, "kill", name())) );
}
}
return damage;
}