//------------------------------------- // Graphic representation of DISASTERS BY THE IMORTAL WOMBAT AND THE BIG MC from huricanes to alians and back to temperial rifts //--------------------------------------- int_t STORM_BEGIN_TURN; // after what turn can storms start int_t STORM_CHANCE; // change of storm; on average, 1 hurricane every STORM_CHANCE turns void_f SetUp() { //// variables //// STORM_BEGIN_TURN = 2; //100 STORM_CHANCE = 2; //20 } HandleEvent(BeginTurn) 'GameStart' pre { SetUp(); DisableTrigger('GameStart'); // execute this trigger only once } army_t tmpStorm; location_t tmpTarget; HandleEvent(BeginTurn) 'StormHit' pre { location_t tmpLoc; unit_t tmpUnit; int_t xcoord; int_t ycoord; int_t i; int_t NumPlayers; int_t tmpDist; int_t min; int_t val; int_t cities; city_t city; city_t tmpOtherCity; city_t finalcity; NumPlayers = preference("NumPlayers"); if (g.player == 0 && Random(STORM_CHANCE) == 1 && g.year > STORM_BEGIN_TURN) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); while (TerrainType(tmpLoc) < 10 || (TerrainType(tmpLoc) > 16 && TerrainType(tmpLoc) != 22 && TerrainType(tmpLoc) != 23)) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); } if(UnitsInCell(tmpLoc) < 1){ CreateUnit(0, UnitDB(UNIT_HURRICANE), tmpLoc, 0, tmpUnit); } } } HandleEvent(BeginTurn) 'FIRESTORM' pre { location_t tmpLoc; unit_t tmpUnit; int_t xcoord; int_t ycoord; NumPlayers = preference("NumPlayers"); if (g.player == 0 && Random(STORM_CHANCE) == 1 && g.year > STORM_BEGIN_TURN) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); while (TerrainType(tmpLoc) < 0 || (TerrainType(tmpLoc) > 0 && TerrainType(tmpLoc) != 0 && TerrainType(tmpLoc) != 7)) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); } if(UnitsInCell(tmpLoc) < 12){ AddEffect(tmploc, "SPECEFFECT_FIRES", "SOUND_ID_NANO_TERROR"); Terraform(tmploc, 17); // Transform to DEADTILE } } } HandleEvent(BeginTurn) 'THUNDERKILLER' pre { location_t tmpLoc; unit_t tmpUnit; int_t xcoord; int_t ycoord; NumPlayers = preference("NumPlayers"); if (g.player == 0 && Random(STORM_CHANCE) == 1 && g.year > STORM_BEGIN_TURN) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); while (TerrainType(tmpLoc) < 4 || (TerrainType(tmpLoc) > 4 && TerrainType(tmpLoc) != 4 && TerrainType(tmpLoc) != 9 )) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); } if(UnitsInCell(tmpLoc) < 12){ AddEffect(tmploc, "SPECEFFECT_CLERIC", "SOUND_ID_NANO_TERROR"); Terraform(tmploc, 6); // Transform to MARSH } } } HandleEvent(BeginTurn) 'DRYSPELL' pre { location_t tmpLoc; unit_t tmpUnit; int_t xcoord; int_t ycoord; NumPlayers = preference("NumPlayers"); if (g.player == 0 && Random(STORM_CHANCE) == 1 && g.year > STORM_BEGIN_TURN) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); while (TerrainType(tmpLoc) < 6 || (TerrainType(tmpLoc) > 6 && TerrainType(tmpLoc) != 6 && TerrainType(tmpLoc) != 6 )) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); } if(UnitsInCell(tmpLoc) < 12){ AddEffect(tmploc, "SPECEFFECT_CLERIC", "SOUND_ID_NANO_TERROR"); Terraform(tmploc, 4); // Transform to GRASS LAND } } } HandleEvent(BeginTurn) 'REGENERATE' pre { location_t tmpLoc; unit_t tmpUnit; int_t xcoord; int_t ycoord; NumPlayers = preference("NumPlayers"); if (g.player == 0 && Random(STORM_CHANCE) == 1 && g.year > STORM_BEGIN_TURN) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); while (TerrainType(tmpLoc) < 17 || (TerrainType(tmpLoc) > 17 && TerrainType(tmpLoc) != 17 && TerrainType(tmpLoc) != 17 )) { xcoord = Random(GetMapWidth()); ycoord = Random(GetMapHeight()); MakeLocation(tmpLoc, xcoord, ycoord); } if(UnitsInCell(tmpLoc) < 12){ AddEffect(tmploc, "SPECEFFECT_CLERIC", "SOUND_ID_NANO_TERROR"); Terraform(tmploc, 4); // Transform to GRASS LAND } } }