protected override void Success() { List <WS_Tile> affectedTiles = new List <WS_Tile>(); affectedTiles.Add(tile); int areaOfEffect = triggeredDisaster.AreaOfEffect(); if (areaOfEffect > 1) { foreach (WS_Tile neighbor in tile.Neighbors()) { if (tile.population > 0.0f && tile.disaster == null) { affectedTiles.Add(tile); } } for (int i = affectedTiles.Count; i > areaOfEffect; i--) { int index = Mathf.FloorToInt(Random.Range(1.0f, affectedTiles.Count - 0.01f)); affectedTiles.RemoveAt(index); } } foreach (WS_Tile affectedTile in affectedTiles) { triggeredDisaster.Apply(affectedTile); affectedTile.disaster = triggeredDisaster; } }
protected override void Success() { spreadDisaster.Apply(tile); tile.disaster = spreadDisaster; }