tornado: add logic for when tornado runs out of steam

This is code from the original C/C++ release, modified to fix
what I perceived as a bug. After the tornado runs for 200 ticks,
there is a 0.2% chance of termination each tick.

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@912 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-12-22 16:32:39 +00:00
parent 84d8906a88
commit 2d8e8ba86d

View file

@ -75,7 +75,11 @@ public class TornadoSprite extends Sprite
return;
}
// FIXME- the original code checks here for an ending condition
if (this.count == 0 && city.PRNG.nextInt(501) == 0) {
// early termination
this.frame = 0;
return;
}
destroyTile(x/16, y/16);
}