Пример #1
0
    //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);
    }
Пример #2
0
    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;
    }