SimSprite *GlobalSprites[OBJN];
SimSprite *NewSprite(char *name, int type, int x, int y);
+void MonsterHere(int x, int y);
+void MakeShipHere(int x, int y);
+void StartFire(int x, int y);
+void OFireZone(int Xloc, int Yloc, int ch);
+void Destroy(int ox, int oy);
+void ExplodeSprite(SimSprite *sprite);
+int CanDriveOn(int x, int y);
+void DoBusSprite(SimSprite *sprite);
+void DoExplosionSprite(SimSprite *sprite);
+void DoTornadoSprite(SimSprite *sprite);
+void DoMonsterSprite(SimSprite *sprite);
+void DoShipSprite(SimSprite *sprite);
+void DoAirplaneSprite(SimSprite *sprite);
+void DoCopterSprite(SimSprite *sprite);
+void DoTrainSprite(SimSprite *sprite);
+void DrawSprite(SimView *view, SimSprite *sprite);
+void InitSprite(SimSprite *sprite, int x, int y);
#define TRA_GROOVE_X -39
return TCL_ERROR;
}
- if (ent = Tcl_FindHashEntry(&SpriteCmds, argv[1])) {
+ if ((ent = Tcl_FindHashEntry(&SpriteCmds, argv[1]))) {
cmd = (int (*)())ent->clientData;
Tk_Preserve((ClientData) sprite);
result = cmd(sprite, interp, argc, argv);
}
-sprite_command_init()
+void
+sprite_command_init(void)
{
int i;
}
+void
InitSprite(SimSprite *sprite, int x, int y)
{
sprite->x = x; sprite->y = y;
}
-DestroyAllSprites()
+void
+DestroyAllSprites(void)
{
SimSprite *sprite;
}
+void
DestroySprite(SimSprite *sprite)
{
SimView *view;
}
+void
DrawObjects(SimView *view)
{
SimSprite *sprite;
}
+void
DrawSprite(SimView *view, SimSprite *sprite)
{
Pixmap pict, mask;
}
+int
TryOther(int Tpoo, int Told, int Tnew)
{
register short z;
}
+int
GetDis(int x1, int y1, int x2, int y2)
{
register short dispX, dispY;
}
-MoveObjects()
+void MoveObjects(void)
{
SimSprite *sprite;
}
+void
DoTrainSprite(SimSprite *sprite)
{
static short Cx[4] = { 0, 16, 0, -16 };
}
+void
DoCopterSprite(SimSprite *sprite)
{
static short CDx[9] = { 0, 0, 3, 5, 3, 0, -3, -5, -3 };
}
+void
DoAirplaneSprite(SimSprite *sprite)
{
static short CDx[12] = { 0, 0, 6, 8, 6, 0, -6, -8, -6, 8, 8, 8 };
}
+void
DoShipSprite(SimSprite *sprite)
{
static short BDx[9] = { 0, 0, 1, 1, 1, 0, -1, -1, -1 };
if ((Rand16() & 3) == 1) {
if ((ScenarioID == 2) && /* San Francisco */
(Rand(10) < 5)) {
- MakeSound("city", "HonkHonk-Low -speed 80");
+ MakeSound("city", "HonkHonk-Low");
} else {
MakeSound("city", "HonkHonk-Low");
}
sprite->frame = 0;
return;
}
- for (z = 0; z < 8; z++) {
- if (t == BtClrTab[z]) break;
- if (z == 7) {
- ExplodeSprite(sprite);
- Destroy(sprite->x + 48, sprite->y);
+ if (!NoDisasters) {
+ for (z = 0; z < 8; z++) {
+ if (t == BtClrTab[z]) break;
+ if (z == 7) {
+ ExplodeSprite(sprite);
+ Destroy(sprite->x + 48, sprite->y);
+ }
}
}
}
+void
DoMonsterSprite(SimSprite *sprite)
{
static short Gx[5] = { 2, 2, -2, -2, 0 };
else z = ND2[d];
d = 4;
if (!sprite->sound_count) {
- MakeSound("city", "Monster -speed [MonsterSpeed]"); /* monster */
+ MakeSound("city", "Monster"); /* monster */
sprite->sound_count = 50 + Rand(100);
}
}
if (sprite->count > 0) sprite->count--;
c = GetChar(sprite->x + sprite->x_hot, sprite->y + sprite->y_hot);
- if ((c == -1) ||
- ((c == RIVER) &&
+ if ((c == -1)
+#ifndef ORIGINAL_MONSTER_BEHAVIOUR
+ || ((c == RIVER) &&
(sprite->count != 0) &&
- (sprite->control == -1))) {
+ (sprite->count < 900) &&
+ (sprite->control == -1))
+#endif
+ ) {
sprite->frame = 0; /* kill zilla */
}
}
+void
DoTornadoSprite(SimSprite *sprite)
{
static short CDx[9] = { 2, 3, 2, 0, -2, -3 };
}
+void
DoExplosionSprite(SimSprite *sprite)
{
short x, y;
}
+void
DoBusSprite(SimSprite *sprite)
{
static short Dx[5] = { 0, 1, 0, -1, 0 };
static short Dy[5] = { -1, 0, 1, 0, 0 };
static short Dir2Frame[4] = { 1, 2, 1, 2 };
- register int dir, dir2;
- int c, dx, dy, crossed, tx, ty, otx, oty;
+ int dx, dy, tx, ty, otx, oty;
int turned = 0;
- int speed, z;
+ int speed = 0, z;
#ifdef DEBUGBUS
printf("Bus dir %d turn %d frame %d\n",
}
+void
ExplodeSprite(SimSprite *sprite)
{
int x, y;
}
+void
Destroy(int ox, int oy)
{
short t, z, x, y;
}
+void
OFireZone(int Xloc, int Yloc, int ch)
{
register short Xtem, Ytem;
}
+void
StartFire(int x, int y)
{
- register t, z;
+ register int t, z;
x >>= 4;
y >>= 4;
}
+void
GenerateTrain(int x, int y)
{
if ((TotalPop > 20) &&
}
+void
GenerateBus(int x, int y)
{
if ((GetSprite(BUS) == NULL) &&
}
+void
GenerateShip(void)
{
register short x, y;
}
-MakeShipHere(int x, int y, int z)
+void
+MakeShipHere(int x, int y)
{
MakeSprite(SHI, (x <<4) - (48 - 1), (y <<4));
}
+void
MakeMonster(void)
{
- register x, y, z, done = 0;
+ register int x, y, z, done = 0;
SimSprite *sprite;
if ((sprite = GetSprite(GOD)) != NULL) {
}
+void
MonsterHere(int x, int y)
{
- short z;
-
MakeSprite(GOD, (x <<4) + 48, (y <<4));
ClearMes();
SendMesAt(-21, x + 5, y);
}
+void
GenerateCopter(int x, int y)
{
if (GetSprite(COP) != NULL) return;
}
+void
GeneratePlane(int x, int y)
{
if (GetSprite(AIR) != NULL) return;
}
+void
+MakeAirCrash(void)
+{
+#ifndef NO_AIRCRASH
+ if (GetSprite(AIR) == NULL) {
+ short x, y;
+
+ x = Rand(WORLD_X - 20) + 10;
+ y = Rand(WORLD_Y - 10) + 5;
+
+ GeneratePlane(x, y);
+ }
+
+ ExplodeSprite(GetSprite(AIR));
+#endif
+}
+
+
+void
MakeTornado(void)
{
short x, y;
}
+void
MakeExplosion(int x, int y)
{
if ((x >= 0) && (x < WORLD_X) &&
}
+void
MakeExplosionAt(int x, int y)
{
MakeNewSprite(EXP, x - 40, y - 16);