v0.4.0: fixed a number of bugs regarding tengu
This commit is contained in:
parent
13625bc5aa
commit
82cdc7149f
|
@ -92,25 +92,23 @@ public class Tengu extends Mob {
|
||||||
@Override
|
@Override
|
||||||
public void damage(int dmg, Object src) {
|
public void damage(int dmg, Object src) {
|
||||||
|
|
||||||
|
int beforeHitHP = HP;
|
||||||
|
super.damage(dmg, src);
|
||||||
|
dmg = beforeHitHP - HP;
|
||||||
|
|
||||||
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
LockedFloor lock = Dungeon.hero.buff(LockedFloor.class);
|
||||||
if (lock != null) {
|
if (lock != null) {
|
||||||
int multiple = HP > HT/2 ? 1 : 4;
|
int multiple = beforeHitHP > HT/2 ? 1 : 4;
|
||||||
lock.addTime(dmg*multiple);
|
lock.addTime(dmg*multiple);
|
||||||
}
|
}
|
||||||
|
|
||||||
//phase 2 of the fight is over
|
//phase 2 of the fight is over
|
||||||
if (dmg >= HP) {
|
if (HP == 0 && beforeHitHP <= HT/2) {
|
||||||
if (state == SLEEPING) {
|
|
||||||
state = WANDERING;
|
|
||||||
}
|
|
||||||
((PrisonBossLevel)Dungeon.level).progress();
|
((PrisonBossLevel)Dungeon.level).progress();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int beforeHitHP = HP;
|
int hpBracket = beforeHitHP > HT/2 ? 12 : 20;
|
||||||
super.damage(dmg, src);
|
|
||||||
|
|
||||||
int hpBracket = HP > HT/2 ? 12 : 20;
|
|
||||||
|
|
||||||
//phase 1 of the fight is over
|
//phase 1 of the fight is over
|
||||||
if (beforeHitHP > HT/2 && HP <= HT/2){
|
if (beforeHitHP > HT/2 && HP <= HT/2){
|
||||||
|
@ -125,6 +123,11 @@ public class Tengu extends Mob {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAlive() {
|
||||||
|
return HP > 0 || Dungeon.level.mobs.contains(this); //Tengu has special death rules, see prisonbosslevel.progress()
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void die( Object cause ) {
|
public void die( Object cause ) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user