factoring various junk out of Bullet.Tick in prep for homing bullets

This commit is contained in:
Chris Forbes
2009-12-06 20:00:04 +13:00
parent 08f2613817
commit 6594a169d8
2 changed files with 45 additions and 42 deletions

View File

@@ -1,4 +1,5 @@

using OpenRa.Game.GameRules;
namespace OpenRa.Game
{
static class Smudge
@@ -23,6 +24,22 @@ namespace OpenRa.Game
Rules.Map.MapTiles[x, y].smudge++;
}
public static void AddSmudge(int2 targetTile, WarheadInfo warhead)
{
switch (warhead.Explosion) /* todo: push the scorch/crater behavior into data */
{
case 4:
case 5:
Smudge.AddSmudge(true, targetTile.X, targetTile.Y);
break;
case 3:
case 6:
Smudge.AddSmudge(false, targetTile.X, targetTile.Y);
break;
}
}
static int lastSmudge = 0;
static int ChooseSmudge() { lastSmudge = (lastSmudge + 1) % 6; return lastSmudge; }
}