public int GetDamageModifier(Actor attacker, DamageWarhead warhead) { if (!IsProne) return 100; var modifierPercentages = info.DamageModifiers.Where(x => warhead.DamageTypes.Contains(x.Key)).Select(x => x.Value); return Util.ApplyPercentageModifiers(100, modifierPercentages); }
public int GetDamageModifier(Actor attacker, DamageWarhead warhead) { var percent = 100; if (attacker.Owner.IsAlliedWith(self.Owner) && warhead.Damage < 0 && !Info.ModifyHealing) return percent; var world = self.World; var map = world.Map; var tileSet = world.TileSet; var tiles = map.MapTiles.Value; var pos = map.CellContaining(self.CenterPosition); var terrainType = tileSet[tileSet.GetTerrainIndex(tiles[pos])].Type; if (!Info.TerrainModifier.ContainsKey(terrainType)) return percent; return Info.TerrainModifier[terrainType]; }
public int GetDamageModifier(Actor attacker, DamageWarhead warhead) { return enabled ? 0 : 100; }
public int GetDamageModifier(Actor attacker, DamageWarhead warhead) { return damageLevel > 0 ? info.DamageModifier[damageLevel - 1] : 100; }