Пример #1
0
        public static int F312_xzzz_CHAMPION_GetStrength(ILiveEntity attackProvider, IStorageType P651_i_SlotIndex)
        {
            int L0935_i_Strength = rand.Next(16) + attackProvider.GetProperty(PropertyFactory <StrengthProperty> .Instance).MaxValue;
            var L0938_T_Thing    = attackProvider.Body.GetStorage(P651_i_SlotIndex).Storage.First();
            //if ((A0936_ui_ObjectWeight = F140_yzzz_DUNGEON_GetObjectWeight(L0938_T_Thing)) <= (A0937_ui_OneSixteenthMaximumLoad = F309_awzz_CHAMPION_GetMaximumLoad(L0939_ps_Champion) >> 4))
            int A0936_ui_ObjectWeight            = (int)L0938_T_Thing.FactoryBase.Weight;
            int A0937_ui_OneSixteenthMaximumLoad = attackProvider.GetProperty(PropertyFactory <LoadProperty> .Instance).MaxValue >> 4;

            if (A0936_ui_ObjectWeight <= A0937_ui_OneSixteenthMaximumLoad)
            {
                L0935_i_Strength += A0936_ui_ObjectWeight - 12;
            }
            else
            {
                int L0941_i_LoadThreshold;
                if (A0936_ui_ObjectWeight <= (L0941_i_LoadThreshold = A0937_ui_OneSixteenthMaximumLoad + ((A0937_ui_OneSixteenthMaximumLoad - 12) >> 1)))
                {
                    L0935_i_Strength += (A0936_ui_ObjectWeight - A0937_ui_OneSixteenthMaximumLoad) >> 1;
                }
                else
                {
                    L0935_i_Strength -= (A0936_ui_ObjectWeight - L0941_i_LoadThreshold) << 1;
                }
            }
            //if (M12_TYPE(L0938_T_Thing) == C05_THING_TYPE_WEAPON)
            if (L0938_T_Thing is Weapon)
            {
                //#ifdef C01_COMPILE_DM10aEN_DM10bEN /* CHANGE2_01_OPTIMIZATION Inline code replaced by function calls */
                //                L0940_ps_WeaponInfo = &G238_as_Graphic559_WeaponInfo[((WEAPON*)G284_apuc_ThingData[C05_THING_TYPE_WEAPON])[M13_INDEX(L0938_T_Thing)].Type];
                //#endif
                //#ifdef C15_COMPILE_DM11EN_DM12EN_DM12GE_DM13aFR_DM13bFR_CSB20EN_CSB21EN /* CHANGE2_01_OPTIMIZATION Inline code replaced by function calls */
                var L0940_ps_WeaponInfo = L0938_T_Thing as Weapon;
                //#endif
                L0935_i_Strength += L0940_ps_WeaponInfo.FactoryType.Strength;
                int A0936_ui_SkillLevel = 0;
                var A0937_ui_Class      = L0940_ps_WeaponInfo.FactoryType.Class;
                if ((A0937_ui_Class == WeaponClass.C000_CLASS_SWING_WEAPON) || (A0937_ui_Class == WeaponClass.C002_CLASS_DAGGER_AND_AXES))
                {
                    A0936_ui_SkillLevel = attackProvider.GetSkill(SkillFactory <SwingSkill> .Instance).SkillLevel;
                }
                if ((A0937_ui_Class != WeaponClass.C000_CLASS_SWING_WEAPON) && (A0937_ui_Class < WeaponClass.C016_CLASS_FIRST_BOW))
                {
                    A0936_ui_SkillLevel += attackProvider.GetSkill(SkillFactory <ThrowSkill> .Instance).SkillLevel;
                }
                if ((A0937_ui_Class >= WeaponClass.C016_CLASS_FIRST_BOW) && (A0937_ui_Class < WeaponClass.C112_CLASS_FIRST_MAGIC_WEAPON))
                {
                    A0936_ui_SkillLevel += attackProvider.GetSkill(SkillFactory <ShootSkill> .Instance).SkillLevel;
                }
                L0935_i_Strength += A0936_ui_SkillLevel << 1;
            }
            L0935_i_Strength = F306_xxxx_CHAMPION_GetStaminaAdjustedValue(attackProvider.GetProperty(PropertyFactory <StaminaProperty> .Instance), /*L0939_ps_Champion,*/ L0935_i_Strength);
            //if (M07_GET(L0939_ps_Champion->Wounds, (P651_i_SlotIndex == C00_SLOT_READY_HAND) ? MASK0x0001_READY_HAND : MASK0x0002_ACTION_HAND))
            if (attackProvider.Body.GetBodyStorage(P651_i_SlotIndex).IsWounded)
            {
                L0935_i_Strength >>= 1;
            }
            //return F026_a003_MAIN_GetBoundedValue(0, L0935_i_Strength >> 1, 100);
            return(MathHelper.Clamp(L0935_i_Strength >> 1, 0, 100));
        }
Пример #2
0
        TSpell F412_xxxx_MENUS_GetChampionSpellCastResult(ILiveEntity P795_i_ChampionIndex, IPowerSymbol powerSymbol)
        {
            int A1269_ui_RequiredSkillLevel;

            var L1270_ps_Champion = P795_i_ChampionIndex;

            IPowerSymbol L1268_i_PowerSymbolOrdinal = powerSymbol;
            int          L1273_ui_Experience        = rand.Next(8) + ((A1269_ui_RequiredSkillLevel = SkillLevel + L1268_i_PowerSymbolOrdinal.LevelOrdinal) << 4) + (((L1268_i_PowerSymbolOrdinal.LevelOrdinal - 1) * SkillLevel) << 3) + (A1269_ui_RequiredSkillLevel * A1269_ui_RequiredSkillLevel);

            var usedSkill           = P795_i_ChampionIndex.GetSkill(Skill);
            int A1267_ui_SkillLevel = usedSkill.SkillLevel;

            if (A1267_ui_SkillLevel < A1269_ui_RequiredSkillLevel)
            {
                int L1274_i_MissingSkillLevelCount = A1269_ui_RequiredSkillLevel - A1267_ui_SkillLevel;
                while (L1274_i_MissingSkillLevelCount-- > 0)
                {
                    if (rand.Next(128) > MathHelper.Min(L1270_ps_Champion.GetProperty(PropertyFactory <WisdomProperty> .Instance).Value + 15, 115))
                    {
                        usedSkill.AddExperience(L1273_ui_Experience >> (A1269_ui_RequiredSkillLevel - A1267_ui_SkillLevel));
                        F410_xxxx_MENUS_PrintSpellFailureMessage(L1270_ps_Champion, "C00_FAILURE_NEEDS_MORE_PRACTICE", Skill);
                        return(null);
                    }
                }
            }

            TSpell spell = ApplySpellEffect(L1270_ps_Champion, L1268_i_PowerSymbolOrdinal, A1267_ui_SkillLevel);

            usedSkill.AddExperience(L1273_ui_Experience);
            //TODO =>F330_szzz_CHAMPION_DisableAction(P795_i_ChampionIndex, Duration);
            return(spell);
        }
Пример #3
0
        public IAction CreateAction(ILiveEntity actionProvider)
        {
            if (actionProvider == null)
            {
                throw new ArgumentNullException();
            }

            if (MinimumSkillLevel <= actionProvider.GetSkill(FightAction.SkillIndex).SkillLevel)
            {
                return(FightAction.CreateAction(actionProvider));
            }
            else
            {
                return(null);
            }
        }
Пример #4
0
        public override int Apply(MapDirection direction)
        {
            var delay           = Factory.Fatigue;
            var requiredSkill   = attackProvider.GetSkill(Factory.SkillIndex);
            var requiredStamina = Factory.Stamina + rand.Next(2);

            PerformAttack(direction, ref delay);

            if (requiredStamina > 0)
            {
                attackProvider.GetProperty(PropertyFactory <StaminaProperty> .Instance).Value -= requiredStamina;
            }
            if (Factory.ExperienceGain > 0)
            {
                requiredSkill.AddExperience(Factory.ExperienceGain);
            }
            return(delay);
        }