From 801fd58e7cb7b793eed95362b53616438bf634c2 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 28 Dec 2015 13:19:44 -0500 Subject: [PATCH] v0.3.4: fixed some bugs with actor time --- .../shatteredpixel/shatteredpixeldungeon/actors/Actor.java | 4 ++-- .../shatteredpixeldungeon/actors/mobs/Tengu.java | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java index b78c9b048..bd750b49e 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/Actor.java @@ -136,7 +136,7 @@ public abstract class Actor implements Bundlable { public static void init() { - addDelayed( Dungeon.hero, -Float.MIN_VALUE ); + add( Dungeon.hero ); for (Mob mob : Dungeon.level.mobs) { add( mob ); @@ -231,7 +231,7 @@ public abstract class Actor implements Bundlable { ids.put( actor.id(), actor ); all.add( actor ); - actor.time = time; + actor.time += time; actor.onAdd(); if (actor instanceof Char) { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java index 1c82a360c..fffdc2770 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Tengu.java @@ -68,6 +68,13 @@ public class Tengu extends Mob { properties.add(Property.BOSS); } + @Override + protected void onAdd() { + //when he's removed and re-added to the fight, his time is always set to now. + spend(-cooldown()); + super.onAdd(); + } + @Override public int damageRoll() { return Random.NormalIntRange( 6, 15 );