#include <config.h>
#include <handler.h>
#include <drawing.h>
#include <zakdef.h>
#include <logging.h>
#include <locking.h>
#include <ui.h>
#include <globals.h>
#include <build.h>
#include <disaster.h>
#include <simulation.h>
#include <stdio.h>
Go to the source code of this file.
Functions | |
void | FireSpread (UInt16 x, UInt16 y) DISASTER_SECTION |
Cause a fire to spread out from the point chosen. | |
void | CreateWaste (UInt16 x, UInt16 y) DISASTER_SECTION |
Turn the zone into wasteland. | |
UInt16 | GetDefenceValue (UInt16 xpos, UInt16 ypos) DISASTER_SECTION |
Get the value of the defence fields around this point. | |
UInt16 | ContainsDefence (UInt16 x, UInt16 y) DISASTER_SECTION |
check if the node has a defence position within it. | |
void | MonsterCheckSurrounded (UInt16 i) DISASTER_SECTION |
Check if a monster is surrounded by defensive units. | |
void | CreateMeteor (UInt16 x, UInt16 y, Int16 size) DISASTER_SECTION |
Create a waste zone for the meteor. | |
void | DoCommitmentNasties (void) |
perform nasties to zones if they are not being completely funded | |
void | DoNastyStuffTo (welem_t type, UInt16 probability, UInt8 purge) |
Do nasty things to a location. | |
void | DoRandomDisaster (void) |
Do a random disaster. | |
void | DoSpecificDisaster (disaster_t disaster) |
Deliberately cause a disaster. | |
Int16 | UpdateDisasters (void) |
Make sure the disasters are still happening. | |
Int16 | BurnField (UInt16 x, UInt16 y, Int16 forceit) |
burn the field specified. | |
Int16 | CreateMonster (UInt16 x, UInt16 y) |
Create a 'zilla at the location specified. | |
Int16 | CreateDragon (UInt16 x, UInt16 y) |
Create a dragon at the location. | |
void | MoveAllObjects (void) |
Move all the moveable elements around the screen. | |
Int16 | MeteorDisaster (UInt16 x, UInt16 y) |
We've had a meteor strike on the map at that location. |
This module contains functions that are used to create disasters in the simulation.
Definition in file disaster.c.
|
burn the field specified. Can be forced to burn.
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(). |
|
check if the node has a defence position within it. If it does, return the value of that defence.
Definition at line 356 of file disaster.c. References NUM_OF_UNITS, and UInt16. Referenced by BurnField(), and GetDefenceValue(). |
|
Create a dragon at the location.
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(). |
|
Create a waste zone for the meteor.
Definition at line 489 of file disaster.c. References Build_Destroy(), BurnField(), CreateWaste(), getMapHeight, getMapWidth, GetRandomNumber(), getWorld(), Int16, LockZone(), lz_flags, lz_world, RedrawAllFields(), setWorldAndFlag(), UILockScreen(), UInt16, UIUnlockScreen(), UnlockZone(), and WORLDPOS. Referenced by MeteorDisaster(). |
|
Create a 'zilla at the location specified.
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(). |
|
Turn the zone into wasteland.
Definition at line 532 of file disaster.c. References bc_waste, Build_Destroy(), diPlantExplosion, DrawCross(), FireSpread(), getWorld(), IsRoadBridge(), LockZone(), lz_flags, lz_world, setWorldAndFlag(), UInt16, UnlockZone(), welem_t, and WORLDPOS. Referenced by CreateMeteor(), DoNastyStuffTo(), MoveAllObjects(), and UpdateDisasters(). |
|
Do nasty things to a location. turns a zone into wasteland based on the normalized probability.
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(). |
|
Deliberately cause a disaster.
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(). |
|
Cause a fire to spread out from the point chosen.
Definition at line 220 of file disaster.c. References BurnField(), getMapHeight, getMapWidth, and UInt16. Referenced by CreateWaste(), and UpdateDisasters(). |
|
Get the value of the defence fields around this point.
Definition at line 330 of file disaster.c. References ContainsDefence(), and UInt16. Referenced by MonsterCheckSurrounded(), and UpdateDisasters(). |
|
We've had a meteor strike on the map at that location.
Definition at line 473 of file disaster.c. References CreateMeteor(), GetRandomNumber(), Int16, and UInt16. Referenced by DoSpecificDisaster(). |
|
Check if a monster is surrounded by defensive units.
Definition at line 314 of file disaster.c. References GetDefenceValue(), GetRandomNumber(), and UInt16. Referenced by MoveAllObjects(). |
|
Make sure the disasters are still happening. Causes all disasters to go to their next stage.
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(). |