public override void cast(Map map, Hex hex) { base.cast(map, hex); if (!castable(map, hex)) { return; } List <Location> targets = new List <Location>(); targets.Add(hex.location); foreach (Location loc in hex.location.getNeighbours()) { targets.Add(loc); } int prevHab = (int)(100 * hex.getHabilitability()); int prevTemp = (int)(100 * hex.getTemperature()); foreach (Hex[] row in map.grid) { foreach (Hex h in row) { h.transientTempDelta += (float)(map.param.ability_runawayCatastrophyTempChange); } } map.world.prefabStore.popImgMsg("As the world begins to freeze, the white snow and ice reflect more of the incoming sunlight back into the sky, increasing the rate of cooling world-wide.", map.world.wordStore.lookup("ABILITY_RUNAWAY_CATASTROPHE")); hex.map.assignTerrainFromClimate(); }
public override void cast(Map map, Hex hex) { base.cast(map, hex); if (!castable(map, hex)) { return; } List <Location> targets = new List <Location>(); targets.Add(hex.location); foreach (Location loc in hex.location.getNeighbours()) { targets.Add(loc); } int prevHab = (int)(100 * hex.getHabilitability()); int prevTemp = (int)(100 * hex.getTemperature()); foreach (Hex[] row in map.grid) { foreach (Hex h in row) { if (targets.Contains(h.territoryOf)) { h.temporaryTempDelta += (float)map.param.ability_coldAsDeathTempChange; } } } map.world.prefabStore.popImgMsg("The world cools around " + hex.location.getName() + ", dropping the temperature in " + targets.Count + " locations." + "\n" + hex.location.getName() + " habitability goes from " + ((int)(prevHab)) + "% to " + ((int)(100 * hex.getHabilitability())) + "% habitable." + "\nTemperature changes from " + prevTemp + "% to " + ((int)(100 * hex.getTemperature())) + "% temperature.", map.world.wordStore.lookup("ABILITY_COLD_AS_DEATH")); Property rem = null; foreach (Property p in hex.location.properties) { if (p.proto is Pr_RecentHumanBattle) { rem = p; } } hex.location.properties.Remove(rem); hex.map.assignTerrainFromClimate(); }
public override void cast(Map map, Hex hex) { base.cast(map, hex); if (!castable(map, hex)) { return; } List <Location> targets = new List <Location>(); targets.Add(hex.location); foreach (Location loc in map.locations) { if (loc.settlement != null && loc.person() != null && loc.person().house == hex.location.person().house) { targets.Add(loc); } } int prevHab = (int)(100 * hex.getHabilitability()); int prevTemp = (int)(100 * hex.getTemperature()); foreach (Hex[] row in map.grid) { foreach (Hex h in row) { if (targets.Contains(h.territoryOf)) { h.transientTempDelta += (float)map.param.ability_iceBloodTempChange; } } } map.world.prefabStore.popImgMsg(hex.location.person().getFullName() + "'s sins freeze the world, the curse passing through to their bloodline." + " All those of house " + hex.location.person().house.name + " are affected, freezing the world in " + targets.Count + " locations." + "\n" + hex.location.getName() + " habitability goes from " + ((int)(prevHab)) + "% to " + ((int)(100 * hex.getHabilitability())) + "% habitable." + "\nTemperature changes from " + prevTemp + "% to " + ((int)(100 * hex.getTemperature())) + "% temperature.", map.world.wordStore.lookup("ABILITY_ICE_BLOOD")); hex.location.person().die("Died as their blood turned to ice under the weight of their sins.", true); hex.map.assignTerrainFromClimate(); }
public override void cast(Map map, Hex hex) { base.cast(map, hex); if (!castable(map, hex)) { return; } List <Location> targets = new List <Location>(); targets.Add(hex.location); foreach (Location loc in hex.location.getNeighbours()) { targets.Add(loc); } int prevHab = (int)(100 * hex.getHabilitability()); int prevTemp = (int)(100 * hex.getTemperature()); double scaling = (24d * 32d) / (map.grid.Length * map.grid[0].Length); World.log("Scaling " + scaling); float delta = (float)(map.param.ability_deathOfTheSunTempChange * scaling); int count = 0; int debug = Eleven.random.Next(); foreach (Location loc in map.locations) { foreach (Property p in loc.properties) { if (p.proto is Pr_RecentHumanBattle) { count += 1; } } } delta *= count; foreach (Hex[] row in map.grid) { foreach (Hex h in row) { h.temporaryTempDelta += delta; } } map.world.prefabStore.popImgMsg("The entire world cools, as the dead sap the life from the sun, leaving every location on the planet colder. " + count + " recent battles have been drawn upon.", map.world.wordStore.lookup("ABILITY_DEATH_OF_THE_SUN")); foreach (Location loc in map.locations) { Property rem = null; foreach (Property p in loc.properties) { if (p.proto is Pr_RecentHumanBattle) { rem = p; } } if (rem != null) { loc.properties.Remove(rem); } } hex.map.assignTerrainFromClimate(); }