//return how much damages the character takes depending on the entry damages (we substract the resistance) private DamagesInfo calculateDamageTaken(DamagesInfo entryDamage, Character character) { DamagesInfo result = new DamagesInfo(new Dictionary <DamageType, int>(), new Dictionary <AlterationType, int>(), character); Armor defenserArmor = character.armor; foreach (KeyValuePair <DamageType, int> damage in entryDamage.damages) { result.damages.Add(damage.Key, damage.Value - defenserArmor.getArmorResistance(damage.Key));//we substract the resistance } //TODO something with the alterations return(result); }
public string characterName; //will be useful to know which character attacks public ActInfo(DamagesInfo dmgInfo, ActType actType, string characterName) { damagesInfo.Add(dmgInfo); this.actType = actType; this.characterName = characterName; }