Ensure a tornado sprite exists. */
| 1989 | |
| 1990 | /** Ensure a tornado sprite exists. */ |
| 1991 | void Micropolis::makeTornado() |
| 1992 | { |
| 1993 | short x, y; |
| 1994 | SimSprite *sprite; |
| 1995 | |
| 1996 | sprite = getSprite(SPRITE_TORNADO); |
| 1997 | if (sprite != NULL) { |
| 1998 | sprite->count = 200; |
| 1999 | return; |
| 2000 | } |
| 2001 | |
| 2002 | x = getRandom((WORLD_W <<4) - 800) + 400; |
| 2003 | y = getRandom((WORLD_H <<4) - 200) + 100; |
| 2004 | |
| 2005 | makeSprite(SPRITE_TORNADO, x, y); |
| 2006 | sendMessage(MESSAGE_TORNADO_SIGHTED, (x >>4) + 3, (y >>4) + 2, true, true); |
| 2007 | } |
| 2008 | |
| 2009 | |
| 2010 | /** |
no outgoing calls
no test coverage detected