v3.3.0: mobs added on a partial turn now have their time rounded up
This commit is contained in:
@@ -1141,11 +1141,7 @@ public class GameScene extends PixelScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void add( Mob mob ) {
|
public static void add( Mob mob ) {
|
||||||
Dungeon.level.mobs.add( mob );
|
add( mob, 0);
|
||||||
if (scene != null) {
|
|
||||||
scene.addMobSprite(mob);
|
|
||||||
Actor.add(mob);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSprite( Mob mob ) {
|
public static void addSprite( Mob mob ) {
|
||||||
@@ -1154,8 +1150,13 @@ public class GameScene extends PixelScene {
|
|||||||
|
|
||||||
public static void add( Mob mob, float delay ) {
|
public static void add( Mob mob, float delay ) {
|
||||||
Dungeon.level.mobs.add( mob );
|
Dungeon.level.mobs.add( mob );
|
||||||
|
//mobs added on partial turns wait until next full turn to act
|
||||||
|
delay = (float)Math.ceil(Actor.now() + delay) - Actor.now();
|
||||||
|
if (scene != null) {
|
||||||
scene.addMobSprite(mob);
|
scene.addMobSprite(mob);
|
||||||
Actor.addDelayed(mob, delay);
|
Actor.addDelayed(mob, delay);
|
||||||
|
mob.spendToWhole();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void add( EmoIcon icon ) {
|
public static void add( EmoIcon icon ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user