private double GetHeightScalar(MTile tile) { double scalar = 1; foreach (var neighbor in tile.GetAdjacent()) { int delta = neighbor.GetHeight() - tile.GetHeight(); switch (delta) { case (2): { scalar *= 0.8; } break; case (1): { scalar *= 0.9; } break; case (-1): { scalar *= 1.1; } break; case (-2): { scalar *= 1.2; } break; } } return(scalar); }
private double GetRangedVulnScalar(MTile tile) { double scalar = 1; foreach (var neighbor in tile.GetAdjacent()) { if (neighbor.GetCurrentOccupant() != null) { if (neighbor.GetCurrentOccupant().GetType().Equals(typeof(CChar))) { scalar *= this.TryScaleRangedVulnDueToChar(neighbor.GetCurrentOccupant() as CChar); } else if (neighbor.GetCurrentOccupant().GetType().Equals(typeof(CDeco))) { scalar *= this.TryScaleRangedVulnDueToDeco(neighbor.GetCurrentOccupant() as CDeco); } } } return(scalar); }