Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

source/disaster.h File Reference

interface routines for disasters More...

#include <appconfig.h>
#include <sections.h>
#include <compilerpragmas.h>

Go to the source code of this file.

Functions

EXPORT void DoNastyStuffTo (welem_t type, UInt16 probability, UInt8 purge) DISASTER_SECTION
 Do nasty things to a location.

EXPORT void DoCommitmentNasties (void) DISASTER_SECTION
 perform nasties to zones if they are not being completely funded

EXPORT void DoRandomDisaster (void) DISASTER_SECTION
 Do a random disaster.

EXPORT void DoSpecificDisaster (disaster_t disaster) DISASTER_SECTION
 Deliberately cause a disaster.

EXPORT Int16 UpdateDisasters (void) DISASTER_SECTION
 Make sure the disasters are still happening.

EXPORT Int16 BurnField (UInt16 x, UInt16 y, Int16 forceit) DISASTER_SECTION
 burn the field specified.

EXPORT Int16 CreateMonster (UInt16 x, UInt16 y) DISASTER_SECTION
 Create a 'zilla at the location specified.

EXPORT Int16 CreateDragon (UInt16 x, UInt16 y) DISASTER_SECTION
 Create a dragon at the location.

EXPORT void MoveAllObjects (void) DISASTER_SECTION
 Move all the moveable elements around the screen.

EXPORT Int16 MeteorDisaster (UInt16 x, UInt16 y) DISASTER_SECTION
 We've had a meteor strike on the map at that location.


Detailed Description

interface routines for disasters

Definition in file disaster.h.


Function Documentation

EXPORT Int16 BurnField UInt16    x,
UInt16    y,
Int16    forceit
 

burn the field specified.

Can be forced to burn.

Parameters:
x  position on horizontal of map to spread fire
y  position on vertical of map to spread fire
forceit  force the field to burn
Returns:
true if field was burned.

Definition at line 233 of file disaster.c.

References bc_fire, Build_Destroy(), ContainsDefence(), DrawCross(), getWorld(), Int16, LockZone(), lz_flags, lz_world, setWorldAndFlag(), UInt16, UnlockZone(), welem_t, and WORLDPOS.

Referenced by CreateMeteor(), DoSpecificDisaster(), FireSpread(), and MoveAllObjects().

EXPORT Int16 CreateDragon UInt16    x,
UInt16    y
 

Create a dragon at the location.

Parameters:
x  position on horizontal of map to spread fire
y  position on vertical of map to spread fire
Returns:
true if dragon was created

Definition at line 288 of file disaster.c.

References DrawField(), GetRandomNumber(), getWorld(), LockZone(), lz_flags, lz_world, obj_dragon, UInt16, UnlockZone(), welem_t, and WORLDPOS.

Referenced by DoSpecificDisaster().

EXPORT Int16 CreateMonster UInt16    x,
UInt16    y
 

Create a 'zilla at the location specified.

Parameters:
x  position on horizontal of map to spread fire
y  position on vertical of map to spread fire
Returns:
true if monster was created

Definition at line 266 of file disaster.c.

References DrawField(), GetRandomNumber(), getWorld(), LockZone(), lz_flags, lz_world, obj_monster, UInt16, UnlockZone(), welem_t, and WORLDPOS.

Referenced by DoSpecificDisaster().

EXPORT void DoNastyStuffTo welem_t    type,
UInt16    probability,
UInt8    purge
 

Do nasty things to a location.

turns a zone into wasteland based on the normalized probability.

Parameters:
type  of zone that can be affected
probability  the normalized probability of something bad happens
purge  remove a tile if it's found

Definition at line 58 of file disaster.c.

References Build_Destroy(), CreateWaste(), getMapWidth, GetRandomNumber(), getWorld(), LockZone(), lz_flags, lz_world, MapMul, UInt16, UInt32, UInt8, UnlockZone(), and welem_t.

Referenced by DoUpkeep().

EXPORT void DoSpecificDisaster disaster_t    disaster
 

Deliberately cause a disaster.

Parameters:
disaster  the type of the disaster to cause.

Definition at line 132 of file disaster.c.

References BurnField(), CreateDragon(), CreateMonster(), diDragon, diFireOutbreak, diMeteor, diMonster, diPlantExplosion, disaster_t, getMapHeight, getMapWidth, GetRandomNumber(), Goto(), Int16, MapHasJumped(), MapMul, MeteorDisaster(), UInt16, and UInt32.

Referenced by DoRandomDisaster().

EXPORT Int16 MeteorDisaster UInt16    x,
UInt16    y
 

We've had a meteor strike on the map at that location.

Parameters:
x  horizontal position
y  vertical position
Returns:
always happens (true)

Definition at line 473 of file disaster.c.

References CreateMeteor(), GetRandomNumber(), Int16, and UInt16.

Referenced by DoSpecificDisaster().

EXPORT Int16 UpdateDisasters void   
 

Make sure the disasters are still happening.

Causes all disasters to go to their next stage.

Returns:
true if zone was affected.

Definition at line 171 of file disaster.c.

References CreateWaste(), FireSpread(), GetDefenceValue(), getMapHeight, getMapWidth, GetRandomNumber(), getWorld(), LockZone(), lz_flags, lz_world, setWorldAndFlag(), UInt16, UnlockZone(), welem_t, and WORLDPOS.

Referenced by mainloop_callback().


Generated on Mon Aug 30 19:44:18 2004 for pocketcity by doxygen1.2.18