Exemplo n.º 1
0
    public static CharacterStats CalculateEquipment(CharacterStats current, CharEquip equip)
    {
        if (equip.Head.Length > 0)
        {
            current = CalculateItem(current, equip.Head[0]);
        }
        if (equip.Chest.Length > 0)
        {
            current = CalculateItem(current, equip.Chest[0]);
        }
        if (equip.Pants.Length > 0)
        {
            current = CalculateItem(current, equip.Pants[0]);
        }
        if (equip.WeaponsSlot[0].Right.Length > 0)
        {
            current.dmgWeapons[0].SetValues(((IWeapon)equip.WeaponsSlot[0].Right[0].item));
            current = CalculateItem(current, equip.WeaponsSlot[0].Right[0]);
        }
        if (equip.WeaponsSlot[0].Left.Length > 0)
        {
            current.dmgWeapons[1].SetValues(((IWeapon)equip.WeaponsSlot[0].Left[0].item));
            current = CalculateItem(current, equip.WeaponsSlot[0].Left[0]);
        }

        for (int i = 0; i < equip.ItemSlots.Items.Count; i++)
        {
            current = CalculateItem(current, equip.ItemSlots.Items[i]);
        }
        return(current);
    }
Exemplo n.º 2
0
    public static CharacterStats CalculateBattleBonus(CharacterStats current, CharEquip Equipment, Stats Stats)
    {
        if (Equipment.WeaponsSlot[0].Right.Length == 0 && Equipment.WeaponsSlot[0].Left.Length == 0)
        {
            current.Battle.dmg += (int)(current.Battle.dmg * (0.05f * current.Ability.fist)) + Stats.Battle.dmg;
        }
        else
        {
            if (Equipment.WeaponsSlot[0].Right.Length > 0)
            {
                CalculateWeaponDmg(current, Equipment.WeaponsSlot[0].Right[0].item, 0);
            }
            if (Equipment.WeaponsSlot[0].Left.Length > 0)
            {
                CalculateWeaponDmg(current, Equipment.WeaponsSlot[0].Left[0].item, 1);
            }

            if (Equipment.WeaponsSlot[0].Right.Length > 0 && ((IWeapon)Equipment.WeaponsSlot[0].Right[0].item).WCategory != IWeaponCategory.Shield && Equipment.WeaponsSlot[0].Left.Length > 0 && ((IWeapon)Equipment.WeaponsSlot[0].Left[0].item).WCategory != IWeaponCategory.Shield)
            {
                current.dmgWeapons[0].IncreaseDmg((int)(current.dmgWeapons[0].minDmg * (0.05f * current.Ability.doubleWeapon)));
                current.dmgWeapons[1].IncreaseDmg((int)(current.dmgWeapons[1].minDmg * (0.05f * current.Ability.doubleWeapon)));
                current.Battle.evade += 1 * current.Ability.doubleWeapon;
                current.Battle.parry += 1 * current.Ability.doubleWeapon;
            }
        }

        if (Equipment.WeaponsSlot[0].Right.Length > 0 && ((IWeapon)Equipment.WeaponsSlot[0].Right[0].item).WCategory == IWeaponCategory.Shield)
        {
            current.Battle.armor_phisical += (int)(current.Battle.armor_phisical * (0.05f * current.Ability.shield));
            current.Battle.parry          += 2 * current.Ability.shield;
        }
        if (Equipment.WeaponsSlot[0].Left.Length > 0 && ((IWeapon)Equipment.WeaponsSlot[0].Left[0].item).WCategory == IWeaponCategory.Shield)
        {
            current.Battle.armor_phisical += (int)(current.Battle.armor_phisical * (0.05f * current.Ability.shield));
            current.Battle.parry          += 2 * current.Ability.shield;
        }

        current.Other.hp += (int)(current.Other.hp * (0.3f * current.Ability.endurance));

        current.Resistance.darkness += 3 * current.Ability.resistance;
        current.Resistance.demonic  += 3 * current.Ability.resistance;
        current.Resistance.earth    += 3 * current.Ability.resistance;
        current.Resistance.fire     += 3 * current.Ability.resistance;
        current.Resistance.light    += 3 * current.Ability.resistance;
        current.Resistance.physical += 3 * current.Ability.resistance;
        current.Resistance.poison   += 3 * current.Ability.resistance;
        current.Resistance.water    += 3 * current.Ability.resistance;
        current.Resistance.wind     += 3 * current.Ability.resistance;

        current.Battle.crit_chance += 1 * current.Ability.luck;
        return(current);
    }
Exemplo n.º 3
0
    public CharacterAi(CharacterAi character)
    {
        Name  = character.Name;
        Stats = new Stats();
        Stats.AddStats(character.Stats);
        Equipment = character.Equipment;
        Exp       = character.Exp;
        Traits    = new List <int>(character.Traits);

        currentStats  = new CharacterStats();
        Precent_Stats = new Precent_Stats();
        Effects       = new List <Effect>();
    }
Exemplo n.º 4
0
    public static CharacterStats CalculateBaseBonus(CharacterStats current, CharEquip Equipment)
    {
        current.Battle.actionPoint += current.Base.agility / 15;
        current.Battle.evade       += current.Base.agility / 3;
        current.Battle.iniciative  += current.Base.agility;
        current.Battle.move        += current.Battle.move * (0.02f * current.Base.agility) - current.Battle.move * (0.02f * current.Base.agility) % 0.2f;

        current.Battle.stressReduce += current.Base.willpower / 2;
        current.Battle.calm         += current.Base.willpower / 3;
        current.Other.mp            += (int)(current.Other.mp * (0.05f * current.Base.willpower));

        current.Battle.crit_chance += (int)(current.Battle.crit_chance * (0.03f * current.Base.perception));
        current.Battle.parry       += (int)(current.Battle.parry * (0.05f * current.Base.perception));
        current.Battle.contrattack += (int)(current.Battle.contrattack * (0.03f * current.Base.perception));

        if (Equipment.WeaponsSlot[0].Right.Length == 0 && Equipment.WeaponsSlot[0].Left.Length == 0)
        {
            current.Battle.dmg += (int)(0.8f * current.Base.strength);
        }

        current.Other.regen_cMP      += (int)(current.Other.regen_cMP * (0.15f * current.Base.intelligence));
        current.Other.restoration_MP += current.Base.intelligence / 5;
        return(current);
    }
Exemplo n.º 5
0
 public CharacterAi()
 {
     Equipment = new CharEquip();
 }