public static AbilityStep FromWeaponAttack(WeaponAttackModel weaponAttack, Double attackDamageMultiplier) { return WithNoSecondaryTargets(weaponAttack.AnimationId, (source, target) => { //figure out the attack damage for this attack var damage = source.GenerateDamage(weaponAttack.AttackModel); //apply damage multiplier var modifiedDamages = damage.DamagesByType.ToDictionary(x => x.Key, x => Convert.ToInt32(x.Value * attackDamageMultiplier)); //target takes the damage target.TakeDamage(damage); }); }
public static WeaponItem New(String id, String name, String description, String itemTypeDetailsId, Dictionary<EquipmentTarget, EquipableItemModification> modificationsByTarget, WeaponAttackModel[] attacks) { return new WeaponItem(id, name, description, itemTypeDetailsId, modificationsByTarget, attacks); }
protected WeaponItem(String id, String name, String description, String itemTypeDetailsId, Dictionary<EquipmentTarget, EquipableItemModification> modificationsByTarget, WeaponAttackModel[] getAttacks) : base(id, name, description, itemTypeDetailsId, modificationsByTarget) { Attacks = getAttacks; }