v1.2.0: fixed various errors with the Timekeeper's Hourglass

This commit is contained in:
Evan Debenham 2022-02-24 13:11:51 -05:00
parent 3a4a9b9ed0
commit 54ea689dee
2 changed files with 10 additions and 7 deletions

View File

@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Thief;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio; import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
@ -91,7 +92,7 @@ public class Burning extends Buff implements Hero.Doom {
int damage = Random.NormalIntRange( 1, 3 + Dungeon.depth/4 ); int damage = Random.NormalIntRange( 1, 3 + Dungeon.depth/4 );
Buff.detach( target, Chill.class); Buff.detach( target, Chill.class);
if (target instanceof Hero) { if (target instanceof Hero && target.buff(TimekeepersHourglass.timeStasis.class) == null) {
Hero hero = (Hero)target; Hero hero = (Hero)target;

View File

@ -262,17 +262,19 @@ public class TimekeepersHourglass extends Artifact {
int usedCharge = Math.min(charge, 2); int usedCharge = Math.min(charge, 2);
//buffs always act last, so the stasis buff should end a turn early. //buffs always act last, so the stasis buff should end a turn early.
spend((5*usedCharge) - 1); spend(5*usedCharge);
((Hero) target).spendAndNext(5*usedCharge);
//shouldn't punish the player for going into stasis frequently //shouldn't punish the player for going into stasis frequently
Hunger hunger = Buff.affect(target, Hunger.class); Hunger hunger = Buff.affect(target, Hunger.class);
if (hunger != null && !hunger.isStarving()) if (hunger != null && !hunger.isStarving()) {
hunger.satisfy(5*usedCharge); hunger.satisfy(5 * usedCharge);
}
charge -= usedCharge; charge -= usedCharge;
target.invisible++; target.invisible++;
target.paralysed++;
target.next();
updateQuickslot(); updateQuickslot();
@ -294,8 +296,8 @@ public class TimekeepersHourglass extends Artifact {
@Override @Override
public void detach() { public void detach() {
if (target.invisible > 0) if (target.invisible > 0) target.invisible--;
target.invisible --; if (target.paralysed > 0) target.paralysed--;
super.detach(); super.detach();
activeBuff = null; activeBuff = null;
Dungeon.observe(); Dungeon.observe();