Ejemplo n.º 1
0
 public SuffixStaticData()
 {
     m_name                      = String.Empty;
     m_description               = String.Empty;
     m_conditionDayTime          = EDayTimeCondition.NONE;
     m_conditionTargetedBySource = EAttackTypeCondition.NONE;
     m_conditionHitBySource      = EAttackTypeCondition.NONE;
     m_conditionHitByMagic       = EMagicAttackTypeCondition.NONE;
     m_conditionHitByType        = EHitTypeCondition.NONE;
     m_conditionCastSpell        = EMagicAttackTypeCondition.NONE;
     m_conditionAttacksMonster   = EMonsterClassTypeCondition.NONE;
     m_conditionHits             = EHitTypeCondition.NONE;
     m_effect                    = ESuffixEffect.NONE;
     m_probabilityCloth          = 0f;
     m_probabilityLightArmor     = 0f;
     m_probabilityHeavyArmor     = 0f;
     m_probabilityArcane         = 0f;
     m_probabilityMartial        = 0f;
     m_probabilityJewelry        = 0f;
     m_probabilityMagicFocus     = 0f;
     m_probabilityShields        = 0f;
     m_probabilityMelee          = 0f;
     m_probabilityRanged         = 0f;
     m_valueMode                 = EValueMode.NONE;
 }
Ejemplo n.º 2
0
        public void ResolveFightValueEffects(EEquipSlots p_equipSlot, Equipment p_equip, FightValues p_fightValues)
        {
            m_fightValues = p_fightValues;
            Int32 prefixLevel = p_equip.PrefixLevel;
            List <PrefixStaticData> prefixes = p_equip.Prefixes;

            foreach (PrefixStaticData prefixStaticData in prefixes)
            {
                if (prefixStaticData.Effect == EPrefixEffect.INCREASE_ELEMENTAL_PROTECTION)
                {
                    IncreaseElementalProtection(prefixStaticData, prefixLevel);
                }
                else if (prefixStaticData.Effect == EPrefixEffect.ADD_ELEMENTAL_DAMAGE)
                {
                    AddElementalDamage(prefixStaticData, prefixLevel, p_equipSlot);
                }
            }
            Int32 suffixLevel = p_equip.SuffixLevel;
            List <SuffixStaticData> suffixes = p_equip.Suffixes;

            foreach (SuffixStaticData suffixStaticData in suffixes)
            {
                ESuffixEffect effect = suffixStaticData.Effect;
                switch (effect)
                {
                case ESuffixEffect.INCREASE_MELEE_ATTACK_VALUE:
                    if (p_equipSlot == EEquipSlots.OFF_HAND)
                    {
                        m_fightValues.OffHandAttackValue += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    }
                    else
                    {
                        m_fightValues.MainHandAttackValue += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    }
                    break;

                case ESuffixEffect.INCREASE_RANGE_ATTACK_VALUE:
                    m_fightValues.RangedAttackValue += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    break;

                default:
                    switch (effect)
                    {
                    case ESuffixEffect.PROTECTION_AGAINST_PARALYZED:
                        m_fightValues.ConditionProtectionParalysis += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;

                    case ESuffixEffect.PROTECTION_AGAINST_SLEEPING:
                        m_fightValues.ConditionProtectionSleep += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;

                    case ESuffixEffect.PROTECTION_AGAINST_POISONED:
                        m_fightValues.ConditionProtectionPoison += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;

                    case ESuffixEffect.PROTECTION_AGAINST_CONFUSED:
                        m_fightValues.ConditionProtectionConfusion += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;

                    case ESuffixEffect.PROTECTION_AGAINST_WEAK:
                        m_fightValues.ConditionProtectionWeakness += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;

                    case ESuffixEffect.PROTECTION_AGAINST_CURSED:
                        m_fightValues.ConditionProtectionCurses += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;

                    case ESuffixEffect.PROTECTION_AGAINST_KNOCKOUT:
                        m_fightValues.ConditionProtectionKnockOut += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                        break;
                    }
                    break;

                case ESuffixEffect.INCREASE_CRITICAL_HIT_CHANCE:
                    if (p_equipSlot == EEquipSlots.OFF_HAND)
                    {
                        m_fightValues.CriticalOffHandHitChance += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) / 100f;
                    }
                    else if (p_equipSlot == EEquipSlots.RANGE_WEAPON)
                    {
                        m_fightValues.CriticalRangeHitChance += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) / 100f;
                    }
                    else
                    {
                        m_fightValues.CriticalMainHandHitChance += suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) / 100f;
                    }
                    break;

                case ESuffixEffect.INCREASE_CRITICAL_DAMAGE:
                    if (p_equipSlot == EEquipSlots.OFF_HAND)
                    {
                        m_fightValues.OffHandCriticalDamageMod += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) / 100f;
                    }
                    else if (p_equipSlot == EEquipSlots.RANGE_WEAPON)
                    {
                        m_fightValues.RangeCriticalDamageMod += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) / 100f;
                    }
                    else
                    {
                        m_fightValues.MainHandCriticalDamageMod += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND) / 100f;
                    }
                    break;

                case ESuffixEffect.INCREASE_EVADE_VALUE:
                    m_fightValues.EvadeValue += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    break;

                case ESuffixEffect.INCREASE_ARMOR_VALUE:
                    m_fightValues.ArmorValue += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    break;

                case ESuffixEffect.INCREASE_MELEE_BLOCK_ATTEMPTS:
                    m_fightValues.MeleeBlockAttempts += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    break;

                case ESuffixEffect.INCREASE_GENERAL_BLOCK_ATTEMPTS:
                    m_fightValues.GeneralBlockAttempts += (Int32)suffixStaticData.GetValueForLevel(suffixLevel, p_equip.ItemSlot == EItemSlot.ITEM_SLOT_2_HAND);
                    break;
                }
            }
        }