Example #1
0
        public static void Postfix(PunctualDamage __instance, Character _targetCharacter)
        {
            if (_targetCharacter.Alive)
            {
                var damageList = At.GetField(__instance, "m_tempList") as DamageList;

                DamageList damages = damageList.Clone();
                _targetCharacter.Stats.GetMitigatedDamage(null, ref damages, false);

                DamageLabels.AddDamageLabel(damages, _targetCharacter.CenterPosition, _targetCharacter);
            }
        }
Example #2
0
        public static void Postfix(PunctualDamage __instance, Character _targetCharacter)
        {
            if (_targetCharacter.Alive)
            {
                if (At.GetValue(typeof(PunctualDamage), __instance, "m_tempList") is DamageList damagelist)
                {
                    DamageList damages = damagelist.Clone();
                    _targetCharacter.Stats.GetMitigatedDamage(null, ref damages);

                    DamageLabels.AddDamageLabel(damages, _targetCharacter.CenterPosition, _targetCharacter);
                }
            }
        }
Example #3
0
        public static void Postfix(PunctualDamage __instance, Character _targetCharacter)
        {
            if (_targetCharacter.Alive)
            {
                DamageList damages = (At.GetField(__instance, "m_tempList") as DamageList).Clone();

                Weapon weapon = At.GetField(__instance, "m_weapon") as Weapon;

                At.Invoke(_targetCharacter, "ProcessDamageReduction", new object[] { weapon, damages, false });

                // _targetCharacter.Stats.GetMitigatedDamage(null, ref damages, false);

                DamageLabels.AddDamageLabel(damages, _targetCharacter.CenterPosition, _targetCharacter);
            }
        }
Example #4
0
        public static void Postfix(PunctualDamage __instance, Character _targetCharacter)
        {
            if (_targetCharacter.Alive)
            {
                var damageList = At.GetField(__instance, "m_tempList") as DamageList;

                bool ignoreBarrier = false;
                if (__instance.ParentSynchronizer is StatusEffect status)
                {
                    ignoreBarrier = status.IgnoreBarrier;
                }

                DamageList damages = damageList.Clone();
                _targetCharacter.Stats.GetMitigatedDamage(null, ref damages, ignoreBarrier);

                DamageLabels.AddDamageLabel(damages, _targetCharacter.CenterPosition, _targetCharacter);
            }
        }
        public static void Postfix(PunctualDamage __instance, Character _targetCharacter)
        {
            if (_targetCharacter.Alive || Time.time - _targetCharacter.TimeOfDeath < 1f)
            {
                bool ignoreBarrier = false;
                if (__instance.ParentSynchronizer is StatusEffect status)
                {
                    ignoreBarrier = status.IgnoreBarrier;
                }

                var damages = __instance.m_tempList.Clone();
                var weapon  = __instance.ParentSynchronizer as Weapon;

                _targetCharacter.ProcessDamageReduction(weapon, damages, ignoreBarrier);

                DamageLabels.AddDamageLabel(damages, _targetCharacter.CenterPosition, _targetCharacter);
            }
        }
Example #6
0
        public static void Postfix(PunctualDamage __instance, Character _targetCharacter)
        {
            if (_targetCharacter.Alive)
            {
                bool ignoreBarrier = false;
                if (__instance.ParentSynchronizer is StatusEffect status)
                {
                    ignoreBarrier = status.IgnoreBarrier;
                }

                DamageList damages = (At.GetField(__instance, "m_tempList") as DamageList).Clone();

                At.Invoke(_targetCharacter, "ProcessDamageReduction", new object[] { __instance.ParentSynchronizer, damages, ignoreBarrier });

                // _targetCharacter.Stats.GetMitigatedDamage(null, ref damages, ignoreBarrier);

                DamageLabels.AddDamageLabel(damages, _targetCharacter.CenterPosition, _targetCharacter);
            }
        }
        // Token: 0x06000062 RID: 98 RVA: 0x000042A8 File Offset: 0x000024A8
        public static Skill Init()
        {
            SL_AttackSkill sl_AttackSkill = new SL_AttackSkill
            {
                Name                   = "Tackle",
                EffectBehaviour        = EffectBehaviours.OverrideEffects,
                Target_ItemID          = 8100072,
                New_ItemID             = 2502017,
                SLPackName             = "Juggernaut",
                SubfolderName          = "Tackle",
                Description            = "Ram into your opponent! Either of you will fall. The most stable at foot will triump!",
                CastType               = Character.SpellCastType.ShieldCharge,
                CastModifier           = Character.SpellCastModifier.Attack,
                CastLocomotionEnabled  = false,
                MobileCastMovementMult = -1f,
                CastSheatheRequired    = 0,
                RequiredOffHandTypes   = new Weapon.WeaponType[0],
                Cooldown               = 30f,
                StaminaCost            = 8f,
                ManaCost               = 0f
            };
            Skill skill = (Skill)CustomItems.CreateCustomItem(sl_AttackSkill.Target_ItemID, sl_AttackSkill.New_ItemID, sl_AttackSkill.Name, sl_AttackSkill);

            EmptyOffHandCondition.AddToSkill(skill, false, false);

            GameObject gameObject = skill.transform.Find("ActivationEffects").gameObject;

            for (int i = 0; i < 4; i++)
            {
                EnableHitDetection enableHitDetection = gameObject.AddComponent <EnableHitDetection>();
                enableHitDetection.Delay = 0.2f + (float)i * 0.08f;
            }
            foreach (PlaySoundEffect obj in gameObject.GetComponentsInChildren <PlaySoundEffect>())
            {
                UnityEngine.Object.Destroy(obj);
            }
            GameObject gameObject2 = ResourcesPrefabManager.Instance.GetItemPrefab(8100190).gameObject;

            foreach (PlaySoundEffect playSoundEffect in gameObject2.gameObject.GetComponentsInChildren <PlaySoundEffect>())
            {
                bool flag = (double)playSoundEffect.Delay <= 0.2;
                if (flag)
                {
                    PlaySoundEffect playSoundEffect2 = gameObject.AddComponent <PlaySoundEffect>();
                    playSoundEffect2.Sounds   = playSoundEffect.Sounds;
                    playSoundEffect2.Delay    = playSoundEffect.Delay;
                    playSoundEffect2.Follow   = playSoundEffect.Follow;
                    playSoundEffect2.MinPitch = playSoundEffect.MinPitch;
                    playSoundEffect2.MaxPitch = playSoundEffect.MaxPitch;
                    playSoundEffect2.SyncType = playSoundEffect.SyncType;
                }
            }
            GameObject   gameObject3  = skill.gameObject.transform.FindInAllChildren("HitEffects").gameObject;
            TackleEffect tackleEffect = gameObject3.AddComponent <TackleEffect>();

            tackleEffect.Knockback = 10f;
            tackleEffect.Damages   = new DamageType[]
            {
                new DamageType(DamageType.Types.Physical, 3f)
            };
            PunctualDamage component = gameObject3.GetComponent <PunctualDamage>();

            UnityEngine.Object.Destroy(component);
            return(skill);
        }