Example #1
0
        public static void Prefix(WeaponDamage __instance, ref AttackSkill ___m_attackSkill, out List <Weapon.WeaponType> __state)
        {
            __state = null;
            AttackSkill attackSkill = ___m_attackSkill;
            Weapon      weapon;

            if (attackSkill == null)
            {
                weapon = null;
            }
            else
            {
                Character ownerCharacter = attackSkill.OwnerCharacter;
                weapon = ((ownerCharacter != null) ? ownerCharacter.CurrentWeapon : null);
            }
            Weapon weapon2 = weapon;
            bool   flag    = weapon2 != null;

            if (flag)
            {
                Weapon.WeaponType valueOrDefault;
                bool flag2;
                if (___m_attackSkill.RequiredWeaponTypes != null)
                {
                    Weapon.WeaponType?bastardType = BehaviourManager.GetBastardType(weapon2.Type);
                    if (bastardType != null)
                    {
                        valueOrDefault = bastardType.GetValueOrDefault();
                        flag2          = true;
                    }
                    else
                    {
                        flag2 = false;
                    }
                }
                else
                {
                    flag2 = false;
                }
                bool flag3 = flag2;
                if (flag3)
                {
                    bool flag4 = ___m_attackSkill.RequiredWeaponTypes.Contains(valueOrDefault) && !___m_attackSkill.RequiredWeaponTypes.Contains(weapon2.Type) && BehaviourManager.IsBastardMode(weapon2);
                    if (flag4)
                    {
                        __state = ___m_attackSkill.RequiredWeaponTypes;
                        ___m_attackSkill.RequiredWeaponTypes = new List <Weapon.WeaponType>(__state);
                        ___m_attackSkill.RequiredWeaponTypes.Add(weapon2.Type);
                    }
                }
            }
        }
Example #2
0
        // Token: 0x0600000D RID: 13 RVA: 0x00002438 File Offset: 0x00000638
        public static void PostAmplifySpeed(Weapon weapon, ref float result)
        {
            bool flag = weapon == null;

            if (!flag)
            {
                bool flag2 = BehaviourManager.IsBastardMode(weapon);
                if (flag2)
                {
                    result += CustomBehaviourFormulas.GetBastardSpeedBonus(weapon);
                }
                bool flag3 = WeaponManager.Speeds.ContainsKey(weapon.Type) && WeaponManager.Speeds.ContainsKey(BehaviourManager.GetCurrentAnimationType(weapon));
                if (flag3)
                {
                    result *= WeaponManager.Speeds[BehaviourManager.GetCurrentAnimationType(weapon)] / WeaponManager.Speeds[weapon.Type];
                }
            }
        }
Example #3
0
        // Token: 0x0600000F RID: 15 RVA: 0x000024CC File Offset: 0x000006CC
        public static void PreAmplifyDamage(Weapon weapon, ref DamageList _list)
        {
            bool flag = weapon == null;

            if (!flag)
            {
                bool flag2 = BehaviourManager.IsHolyWeaponMode(weapon);
                if (flag2)
                {
                    float holyWeaponConvertionRate = CustomBehaviourFormulas.GetHolyWeaponConvertionRate(weapon);
                    float totalDamage = _list.TotalDamage;
                    _list *= 1f - holyWeaponConvertionRate;
                    _list.Add(new DamageType(CustomBehaviourFormulas.GetHolyDamageType(), totalDamage * holyWeaponConvertionRate));
                }
                bool flag3 = BehaviourManager.IsBastardMode(weapon);
                if (flag3)
                {
                    _list *= 1f + CustomBehaviourFormulas.GetBastardDamageBonus(weapon);
                }
            }
        }
Example #4
0
        // Token: 0x06000007 RID: 7 RVA: 0x0000225C File Offset: 0x0000045C
        public static bool AdaptGrip(Character __instance, ref int _type, ref int _id)
        {
            Weapon weapon = (__instance != null) ? __instance.CurrentWeapon : null;
            bool   flag   = weapon == null;
            bool   result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = _type == 2502;
                if (flag2)
                {
                    MeleeSkill meleeSkill = At.GetValue(typeof(Character), __instance, "m_lastUsedSkill") as MeleeSkill;
                    bool       flag3      = meleeSkill != null && meleeSkill.ActivateEffectAnimType == Character.SpellCastType.WeaponSkill1;
                    if (flag3)
                    {
                        bool flag4 = meleeSkill.RequiredWeaponTypes[0] != weapon.Type;
                        if (flag4)
                        {
                            CustomWeaponBehaviour.ChangeGrip(__instance, meleeSkill.RequiredWeaponTypes[0]);
                            return(true);
                        }
                    }
                }
                bool flag5 = weapon.HasTag(CustomWeaponBehaviour.FinesseTag);
                if (flag5)
                {
                    bool flag6 = _type == 1 && !BehaviourManager.IsComboAttack(__instance, _type, _id);
                    if (flag6)
                    {
                        CustomWeaponBehaviour.ChangeGrip(__instance, Weapon.WeaponType.Axe_1H);
                        return(true);
                    }
                }
                bool flag7 = BehaviourManager.IsHalfHandedMode(weapon);
                if (flag7)
                {
                    bool flag8 = _type == 1 && !BehaviourManager.IsComboAttack(__instance, _type, _id);
                    if (flag8)
                    {
                        CustomWeaponBehaviour.ChangeGrip(__instance, Weapon.WeaponType.Spear_2H);
                        return(true);
                    }
                }
                bool flag9 = BehaviourManager.IsBastardMode(weapon);
                if (flag9)
                {
                    Weapon.WeaponType?bastardType = BehaviourManager.GetBastardType(weapon.Type);
                    Weapon.WeaponType valueOrDefault;
                    bool flag10;
                    if (bastardType != null)
                    {
                        valueOrDefault = bastardType.GetValueOrDefault();
                        flag10         = true;
                    }
                    else
                    {
                        flag10 = false;
                    }
                    bool flag11 = flag10;
                    if (flag11)
                    {
                        bool flag12 = _type != 2502;
                        if (flag12)
                        {
                            CustomWeaponBehaviour.ChangeGrip(__instance, valueOrDefault);
                            return(true);
                        }
                    }
                }
                result = false;
            }
            return(result);
        }
 public static void Prefix(Character __instance, ref int _type, ref int _id)
 {
     BehaviourManager.AdaptGrip(__instance, ref _type, ref _id);
 }