v0.2.3: more implementation on hourglass
This commit is contained in:
@@ -20,6 +20,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||
|
||||
public class Invisibility extends FlavourBuff {
|
||||
@@ -63,5 +64,10 @@ public class Invisibility extends FlavourBuff {
|
||||
cloakBuff.act();
|
||||
cloakBuff.detach();
|
||||
}
|
||||
//this isn't a form of invisibilty, but it is meant to dispel at the same time as it.
|
||||
TimekeepersHourglass.timeFreeze timeFreeze = Dungeon.hero.buff( TimekeepersHourglass.timeFreeze.class );
|
||||
if (timeFreeze != null && Dungeon.hero.visibleEnemies() > 0) {
|
||||
timeFreeze.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,6 +254,7 @@ public class Hero extends Char {
|
||||
|
||||
rangedWeapon = wep;
|
||||
boolean result = attack( enemy );
|
||||
Invisibility.dispel();
|
||||
rangedWeapon = null;
|
||||
|
||||
return result;
|
||||
@@ -378,7 +379,9 @@ public class Hero extends Char {
|
||||
|
||||
@Override
|
||||
public void spend( float time ) {
|
||||
super.spend( time );
|
||||
TimekeepersHourglass.timeFreeze buff = buff(TimekeepersHourglass.timeFreeze.class);
|
||||
if (!(buff != null && buff.processTime(time)))
|
||||
super.spend( time );
|
||||
};
|
||||
|
||||
public void spendAndNext( float time ) {
|
||||
|
||||
Reference in New Issue
Block a user