Example #1
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration      = SwipeForward.baseDuration / this.attackSpeedStat;
            this.modelAnimator = base.GetModelAnimator();
            Transform modelTransform = base.GetModelTransform();

            this.attack                 = new OverlapAttack();
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = TeamIndex.Monster;
            this.attack.damage          = SwipeForward.damageCoefficient * this.damageStat;
            this.attack.hitEffectPrefab = SwipeForward.hitEffectPrefab;
            this.attack.isCrit          = Util.CheckRoll(this.critStat, base.characterBody.master);
            Util.PlaySound(SwipeForward.attackString, base.gameObject);
            if (modelTransform)
            {
                this.attack.hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Sword");
            }
            if (this.modelAnimator)
            {
                base.PlayAnimation("Gesture, Override", "SwipeForward", "SwipeForward.playbackRate", this.duration);
                base.PlayAnimation("Gesture, Additive", "SwipeForward", "SwipeForward.playbackRate", this.duration);
            }
            if (base.characterBody)
            {
                base.characterBody.SetAimTimer(2f);
            }
        }
 public override void OnEnter()
 {
     procCoefficient             = DoubleSlash.procCoefficient;
     selfForce                   = DoubleSlash.selfForce;
     hitEffectPrefab             = DoubleSlash.hitEffectPrefab;
     swipeEffectPrefab           = DoubleSlash.swipeEffectPrefab;
     enterSoundString            = DoubleSlash.enterSoundString;
     slashSoundString            = DoubleSlash.slashSoundString;
     walkSpeedPenaltyCoefficient = DoubleSlash.walkSpeedPenaltyCoefficient;
     base.OnEnter();
     duration       = baseDuration / attackSpeedStat;
     modelAnimator  = GetModelAnimator();
     modelTransform = GetModelTransform();
     base.characterMotor.walkSpeedPenaltyCoefficient = walkSpeedPenaltyCoefficient;
     attack                 = new OverlapAttack();
     attack.attacker        = base.gameObject;
     attack.inflictor       = base.gameObject;
     attack.teamIndex       = TeamComponent.GetObjectTeam(attack.attacker);
     attack.damage          = damageCoefficient * damageStat;
     attack.hitEffectPrefab = hitEffectPrefab;
     attack.isCrit          = Util.CheckRoll(critStat, base.characterBody.master);
     attack.procCoefficient = procCoefficient;
     attack.damageType      = DamageType.Generic;
     Util.PlayAttackSpeedSound(enterSoundString, base.gameObject, attackSpeedStat);
     if ((bool)modelAnimator)
     {
         PlayAnimation("Gesture, Additive", "DoubleSlash", "DoubleSlash.playbackRate", duration);
         PlayAnimation("Gesture, Override", "DoubleSlash", "DoubleSlash.playbackRate", duration);
     }
     if ((bool)base.characterBody)
     {
         base.characterBody.SetAimTimer(duration + 2f);
     }
 }
Example #3
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration = MaceSlam.baseDuration / this.attackSpeedStat;
            this.priorityReduceDuration = this.duration * MaceSlam.durationBeforePriorityReduces;
            this.modelAnimator          = base.GetModelAnimator();
            this.modelTransform         = base.GetModelTransform();

            base.PlayCrossfade("FullBody, Override", "MaceSlam", "Whirlwind.playbackRate", this.duration, 0.1f);
            Util.PlayAttackSpeedSound(EntityStates.BrotherMonster.WeaponSlam.attackSoundString, base.gameObject, this.attackSpeedStat);

            if (base.characterDirection)
            {
                base.characterDirection.moveVector = base.GetAimRay().direction;
            }

            if (base.isAuthority)
            {
                OverlapAttack overlapAttack = new OverlapAttack();
                overlapAttack.attacker         = base.gameObject;
                overlapAttack.damage           = MaceSlam.damageCoefficient * this.damageStat;
                overlapAttack.damageColorIndex = DamageColorIndex.Default;
                overlapAttack.damageType       = DamageType.Generic;
                overlapAttack.hitEffectPrefab  = EntityStates.BrotherMonster.WeaponSlam.weaponHitEffectPrefab;
                overlapAttack.hitBoxGroup      = Array.Find <HitBoxGroup>(this.modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "LeapStrike");
                overlapAttack.impactSound      = EntityStates.BrotherMonster.WeaponSlam.weaponImpactSound.index;
                overlapAttack.inflictor        = base.gameObject;
                overlapAttack.procChainMask    = default(ProcChainMask);
                overlapAttack.pushAwayForce    = MaceSlam.weaponForce;
                overlapAttack.procCoefficient  = 1f;
                overlapAttack.teamIndex        = base.GetTeam();

                this.weaponAttack = overlapAttack;
            }
        }
Example #4
0
        //private StyleSystem.StyleComponent styleComponent;

        public override void OnEnter()
        {
            base.OnEnter();
            this.duration = this.baseDuration / this.attackSpeedStat;
            this.hasFired = false;
            this.animator = base.GetModelAnimator();
            //this.styleComponent = base.GetComponent<StyleSystem.StyleComponent>();
            base.StartAimMode(0.5f + this.duration, false);
            base.PlayCrossfade("Gesture, Override", "Crush", "Crush.playbackRate", this.duration, 0.05f);

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Crush");
            }

            this.attack                 = new OverlapAttack();
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = Crush.damageCoefficient * this.damageStat;
            this.attack.procCoefficient = 1;
            this.attack.hitEffectPrefab = Loader.SwingChargedFist.overchargeImpactEffectPrefab;
            this.attack.forceVector     = Vector3.zero;
            this.attack.pushAwayForce   = 1f;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
        }
Example #5
0
        public override void OnEnter()
        {
            hitEffectPrefab   = SwipeForward.hitEffectPrefab;
            swingEffectPrefab = SwipeForward.swingEffectPrefab;
            base.OnEnter();
            duration      = baseDuration / attackSpeedStat;
            modelAnimator = GetModelAnimator();
            Transform modelTransform = GetModelTransform();

            attack                 = new OverlapAttack();
            attack.attacker        = base.gameObject;
            attack.inflictor       = base.gameObject;
            attack.teamIndex       = TeamComponent.GetObjectTeam(attack.attacker);
            attack.damage          = damageCoefficient * damageStat;
            attack.damageType      = DamageType.SuperBleedOnCrit;
            attack.hitEffectPrefab = hitEffectPrefab;
            attack.isCrit          = Util.CheckRoll(critStat, base.characterBody.master);
            Util.PlaySound(attackString, base.gameObject);
            if ((bool)modelTransform)
            {
                attack.hitBoxGroup = Array.Find(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Sword");
            }
            if ((bool)modelAnimator)
            {
                PlayAnimation("Gesture, Override", "SwipeForward", "SwipeForward.playbackRate", duration);
                PlayAnimation("Gesture, Additive", "SwipeForward", "SwipeForward.playbackRate", duration);
            }
            if ((bool)base.characterBody)
            {
                base.characterBody.SetAimTimer(2f);
            }
        }
Example #6
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration      = this.baseDuration / this.attackSpeedStat;
            this.earlyExitTime = this.baseEarlyExitTime / this.attackSpeedStat;
            this.hasFired      = false;
            this.animator      = base.GetModelAnimator();
            base.StartAimMode(0.5f + this.duration, false);
            base.characterBody.outOfCombatStopwatch = 0f;
            this.animator.SetBool("attacking", true);

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }

            this.PlayAttackAnimation();

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = this.damageType;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = this.damageCoefficient * this.damageStat;
            this.attack.procCoefficient = this.procCoefficient;
            this.attack.hitEffectPrefab = this.hitEffectPrefab;
            this.attack.forceVector     = this.bonusForce;
            this.attack.pushAwayForce   = this.pushForce;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = this.impactSound;
        }
        public override void OnEnter()
        {
            base.OnEnter();
            base.characterBody.SetAimTimer(2f);
            this.hitEffectPrefab = Modules.Assets.punchImpactEffect;
            this.impactSound     = Modules.Assets.drillRushHitSoundEvent.index;

            this.duration      = this.baseDuration / this.attackSpeedStat;
            this.earlyExitTime = this.baseEarlyExitTime / this.attackSpeedStat;
            this.hasFired      = false;
            this.animator      = base.GetModelAnimator();


            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == this.hitboxName);
            }
            var childLocator = this.GetModelChildLocator();

            this.pullOrigin        = childLocator.FindChild(this.hitboxName);
            this.pullStrengthCurve = AnimationCurve.EaseInOut(0.1f, 0f, 1f, 1f);

            this.PlayAttackAnimation();

            this.attack = CreateAttack(hitBoxGroup);
        }
Example #8
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration        = AirSlamAlt.leapDuration / (0.5f + (0.5f * this.attackSpeedStat));
            this.hasFired        = false;
            this.hasLanded       = false;
            this.animator        = base.GetModelAnimator();
            this.swordController = base.GetComponent <PaladinSwordController>();

            base.skillLocator.secondary.DeductStock(1);

            Vector3 direction = base.GetAimRay().direction;

            if (base.isAuthority)
            {
                base.characterBody.isSprinting = true;

                base.characterMotor.velocity *= 0.1f;
                base.SmallHop(base.characterMotor, AirSlamAlt.hopVelocity);
            }

            base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage;

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            string hitboxString = "LeapStrike";

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxString);
            }

            base.PlayAnimation("FullBody, Override", "LeapSlam2", "Whirlwind.playbackRate", this.duration * 1.5f);
            Util.PlaySound(Modules.Sounds.Lunge, base.gameObject);
            Util.PlaySound(Modules.Sounds.Cloth2, base.gameObject);

            this.swordController.airSlamStacks++;

            float dmg = AirSlam.damageCoefficient;

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = DamageType.Stun1s;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = ((0.5f + (0.5f * this.swordController.airSlamStacks)) * dmg) * this.damageStat;
            this.attack.procCoefficient = 1;
            this.attack.hitEffectPrefab = this.swordController.hitEffect;
            this.attack.forceVector     = -Vector3.up * 6000f;
            this.attack.pushAwayForce   = 500f;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = Modules.Assets.swordHitSoundEventL.index;
            if (this.swordController.isBlunt)
            {
                this.attack.impactSound = Modules.Assets.batHitSoundEventL.index;
            }
        }
Example #9
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.animator = base.GetModelAnimator();
            this.hasFired = false;

            if (base.characterBody.HasBuff(Survivor.Buffs.overpowerBuff))
            {
                this.duration = SharpClaws.baseDuration / (this.attackSpeedStat * Overpower.attackSpeedMult);
            }
            else
            {
                this.duration = SharpClaws.baseDuration / this.attackSpeedStat;
            }

            // yay strafe animations
            // kind of glitchy still so i leave out for this patch
            // StartAimMode(2);
            base.characterDirection.forward = base.GetAimRay().direction;


            if (animator.GetBool("attackSwitch"))
            {
                this.animator.SetBool("attackSwitch", false);
                this.hitBoxGroup = base.FindHitBoxGroup("LeftClaw");
            }
            else
            {
                this.animator.SetBool("attackSwitch", true);
                this.hitBoxGroup = base.FindHitBoxGroup("RightClaw");
            }

            attack = new OverlapAttack
            {
                attacker         = base.gameObject,
                inflictor        = base.gameObject,
                damage           = base.damageStat * SharpClaws.damageCoefficient,
                damageColorIndex = DamageColorIndex.Default,
                damageType       = DamageType.Generic,
                isCrit           = Util.CheckRoll(this.critStat, this.characterBody.master),
                hitEffectPrefab  = Resources.Load <GameObject>("prefabs/effects/impacteffects/ImpactImpSwipe"),
                hitBoxGroup      = hitBoxGroup,
                impactSound      = Survivor.Sounds.hitNetworkSoundEventDef.index,
                procChainMask    = default(ProcChainMask),
                procCoefficient  = SharpClaws.procCoefficient,
                forceVector      = Vector3.zero,
                pushAwayForce    = 400f,
                teamIndex        = base.GetTeam(),
            };

            Util.PlayAttackSpeedSound(Core.Assets.SwingSound, base.gameObject, this.attackSpeedStat);
            base.PlayAnimation("Gesture, Override", "Attack", "Attack.playbackRate", this.duration);
            if (ClientScene.readyConnection != null)
            {
                Core.Utils.PlayAnimationOnOtherClients(base.gameObject, "Gesture, Override", "Attack", this.duration, true);
            }

            Core.Utils.RemoveNetworkedTimedBuff(base.gameObject, Survivor.Buffs.overpowerBuff, 1);
        }
Example #10
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration        = this.baseDuration / this.attackSpeedStat;
            this.hasFired        = false;
            this.animator        = base.GetModelAnimator();
            this.swordController = base.GetComponent <PaladinSwordController>();
            base.StartAimMode(0.5f + this.duration, false);
            base.characterBody.isSprinting = false;

            base.skillLocator.secondary.DeductStock(1);

            if (this.swordController)
            {
                this.swordController.attacking = true;
            }

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (NetworkServer.active)
            {
                base.characterBody.AddBuff(RoR2Content.Buffs.Slow50);
            }

            string hitboxString = "SpinSlash";

            if (this.swordController && this.swordController.swordActive)
            {
                hitboxString = "SpinSlashLarge";
            }

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxString);
            }

            base.PlayAnimation("FullBody, Override", "GroundSweepContinuous", "Whirlwind.playbackRate", this.duration * 1.1f);
            Util.PlaySound(Modules.Sounds.Cloth3, base.gameObject);

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = DamageType.Stun1s;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = GroundSweepAlt.damageCoefficient * this.damageStat;
            this.attack.procCoefficient = 1;
            this.attack.hitEffectPrefab = this.swordController.hitEffect;
            this.attack.forceVector     = Vector3.up * 1600f;
            this.attack.pushAwayForce   = -1500f;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = Modules.Assets.swordHitSoundEventM.index;
            if (this.swordController.isBlunt)
            {
                this.attack.impactSound = Modules.Assets.batHitSoundEventM.index;
            }
        }
Example #11
0
 // Token: 0x06002E07 RID: 11783 RVA: 0x000C3EE0 File Offset: 0x000C20E0
 protected override void AuthorityModifyOverlapAttack(OverlapAttack overlapAttack)
 {
     base.AuthorityModifyOverlapAttack(overlapAttack);
     if (base.HasBuff(BuffIndex.LoaderOvercharged))
     {
         overlapAttack.damage         *= 2f;
         overlapAttack.hitEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab;
         overlapAttack.damageType     |= DamageType.Stun1s;
     }
 }
Example #12
0
        public override void OnEnter()
        {
            base.OnEnter();
            if (TTGL_SurvivorPlugin.rideMeExtendedInstalled)
            {
                TTGL_SurvivorPlugin.ExitSeat(base.gameObject);
            }
            if (NetworkServer.active)
            {
                base.characterBody.AddBuff(Buffs.HiddenInvincibility);
            }
            if (base.isAuthority)
            {
                m_TrajectoryNodeCount = TrajectoryNodes != null ? TrajectoryNodes.Length : 0;
                if (m_TrajectoryNodeCount > CurrentNodeIndex)
                {
                    var nextNode = TrajectoryNodes[CurrentNodeIndex];
                    m_CurrentTarget = nextNode.Item1;
                }
            }
            this.cancelled = true;
            Util.PlaySound(EvisDash.beginSoundString, base.gameObject);

            base.characterMotor.useGravity = false;
            var childLocator = base.GetModelChildLocator();

            this.rootTransform = childLocator.FindChild("LagganArmature");
            base.PlayCrossfade("FullBody, Override", "LagannImpact3", 0.2f);

            this.CreateBlinkEffect(Util.GetCorePosition(base.gameObject));

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == c_HitboxGroupName);
            }

            this.overlapAttack = new OverlapAttack
            {
                attacker         = base.gameObject,
                damage           = damageCoefficient * base.characterBody.damage,
                pushAwayForce    = this.pushForce,
                isCrit           = base.RollCrit(),
                damageColorIndex = DamageColorIndex.Default,
                inflictor        = base.gameObject,
                procChainMask    = default(ProcChainMask),
                procCoefficient  = procCoefficient,
                teamIndex        = base.characterBody.teamComponent.teamIndex,
                hitBoxGroup      = hitBoxGroup,
                hitEffectPrefab  = Modules.Assets.punchImpactEffect,
                impactSound      = Modules.Assets.drillRushHitSoundEvent.index,
            };
        }
Example #13
0
        // Token: 0x06000328 RID: 808 RVA: 0x0000D234 File Offset: 0x0000B434
        public bool FireMeleeOverlap(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude)
        {
            bool result = false;

            if (animator && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
            {
                attack.forceVector = base.transform.forward * forceMagnitude;
                result             = attack.Fire(null);
            }
            return(result);
        }
Example #14
0
        public override void OnEnter()
        {
            base.OnEnter();
            if (TTGL_SurvivorPlugin.rideMeExtendedInstalled)
            {
                TTGL_SurvivorPlugin.ExpulseAnyRider(base.gameObject);
                TTGL_SurvivorPlugin.ExitSeat(base.gameObject);
            }
            this.animator = base.GetModelAnimator();
            if (base.isGrounded)
            {
                base.PlayCrossfade("FullBody, Override", "LagannBurrowerStrikeBurrow", this.playbackRateString, burrowingDuration, 0.2f);
                DisplayMound();
            }
            else
            {
                falling = true;
                fell    = true;
                base.PlayCrossfade("FullBody, Override", "LagannBurrowerStrikeFall", 0.2f);
                if (NetworkServer.active)
                {
                    base.characterBody.AddBuff(RoR2Content.Buffs.HiddenInvincibility);
                }
                if (base.isAuthority)
                {
                    base.characterMotor.onMovementHit += this.OnMovementHit;
                    base.characterMotor.velocity.y     = GroundSlam.initialVerticalVelocity;
                }
            }

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "LagannImpactHitbox");
            }

            this.attack = new OverlapAttack
            {
                attacker         = base.gameObject,
                damage           = PrepareLagannBurrowerStrike.damageCoefficient * base.characterBody.damage,
                pushAwayForce    = 300f,
                isCrit           = base.RollCrit(),
                damageColorIndex = DamageColorIndex.Default,
                inflictor        = base.gameObject,
                procChainMask    = default(ProcChainMask),
                procCoefficient  = 1f,
                teamIndex        = base.characterBody.teamComponent.teamIndex,
                hitBoxGroup      = hitBoxGroup,
                hitEffectPrefab  = Modules.Assets.punchImpactEffect,
                impactSound      = Modules.Assets.drillRushHitSoundEvent.index,
            };
        }
Example #15
0
        /// private List<HealthComponent> victimsStruck = new List<HealthComponent>();

        public override void OnEnter()
        {
            base.OnEnter();
            this.duration     = ShoulderBash.baseDuration;
            this.shieldCancel = false;


            base.characterBody.isSprinting = true;

            Util.PlayScaledSound(Croco.Leap.leapSoundString, base.gameObject, 1.75f);


            if (base.isAuthority && base.inputBank && base.characterDirection)
            {
                this.forwardDirection = ((base.inputBank.moveVector == Vector3.zero) ? base.characterDirection.forward : base.inputBank.moveVector).normalized;
            }

            this.RecalculateSpeed();

            if (base.characterMotor && base.characterDirection)
            {
                base.characterMotor.velocity.y *= 0.5f;
                base.characterMotor.velocity    = this.forwardDirection * this.dashSpeed;
            }

            Vector3 b = base.characterMotor ? base.characterMotor.velocity : Vector3.zero;

            this.previousPosition = base.transform.position - b;

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "HeadH");
            }
            //hitBoxGroup = Array.Find<HitBoxGroup>(modelTransform.GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "HeadH");

            this.attack                 = new OverlapAttack();
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = ShoulderBash.chargeDamageCoefficient * this.damageStat;
            this.attack.hitEffectPrefab = Loader.SwingChargedFist.overchargeImpactEffectPrefab;
            this.attack.forceVector     = Vector3.up * Toolbot.ToolbotDash.upwardForceMagnitude;
            this.attack.pushAwayForce   = Toolbot.ToolbotDash.awayForceMagnitude;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();

            // if (base.isAuthority) EffectManager.SimpleMuzzleFlash(EnforcerPlugin.Assets.shoulderBashFX, base.gameObject, "ShieldHitbox", true);
        }
Example #16
0
 public override void OnEnter()
 {
     base.OnEnter();
     this.animator                  = base.GetModelAnimator();
     this.duration                  = Uppercut.baseDuration / this.attackSpeedStat;
     this.overlapAttack             = base.InitMeleeOverlap(Uppercut.baseDamageCoefficient, Uppercut.hitEffectPrefab, base.GetModelTransform(), Uppercut.hitboxString);
     this.overlapAttack.forceVector = Vector3.down * Uppercut.upwardForceStrength;
     if (base.characterDirection && base.inputBank)
     {
         base.characterDirection.forward = base.inputBank.aimDirection;
     }
     Util.PlaySound(Uppercut.enterSoundString, base.gameObject);
     this.PlayAnim();
 }
        public override void OnEnter()
        {
            base.OnEnter();
            this.animator = base.GetModelAnimator();
            var childLocator = base.GetModelChildLocator();

            this.rootTransform = childLocator.FindChild("LagganArmature");
            base.characterMotor.Motor.SetPosition(this.spawnLocation + (this.spawnRotation * 4f));

            base.PlayAnimation("FullBody, Override", "BurrowerStrikePop", this.playbackRateString, LagannBurrowerStrike.maxDuration);
            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "LagannImpactHitbox");
            }

            this.attack = new OverlapAttack
            {
                attacker         = base.gameObject,
                damage           = PrepareLagannBurrowerStrike.damageCoefficient * base.characterBody.damage,
                damageType       = DamageType.BypassArmor,
                pushAwayForce    = 300f,
                isCrit           = base.RollCrit(),
                damageColorIndex = DamageColorIndex.WeakPoint,
                inflictor        = base.gameObject,
                procChainMask    = default(ProcChainMask),
                procCoefficient  = procCoefficient,
                teamIndex        = base.characterBody.teamComponent.teamIndex,
                hitBoxGroup      = hitBoxGroup,
                hitEffectPrefab  = Modules.Assets.punchImpactEffect,
                impactSound      = Modules.Assets.drillRushHitSoundEvent.index,
            };
            base.characterMotor.useGravity = false;
            if (NetworkServer.active)
            {
                base.characterBody.AddBuff(RoR2Content.Buffs.HiddenInvincibility);
            }
            if (base.isAuthority)
            {
                base.characterMotor.onMovementHit += this.OnMovementHit;
            }
            EffectManager.SpawnEffect(Assets.earthMoundEffect, new EffectData
            {
                origin   = this.spawnLocation,
                rotation = Util.QuaternionSafeLookRotation(this.spawnRotation) * Quaternion.Euler(new Vector3(90, 0, 0))
            }, false);
        }
Example #18
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.tracker = base.GetComponent <HenryTracker>();
            this.target  = this.tracker.GetTrackingTarget();

            if (base.characterBody)
            {
                base.characterBody.bodyFlags |= CharacterBody.BodyFlags.IgnoreFallDamage;
            }
            if (base.isGrounded)
            {
                base.SmallHop(base.characterMotor, 10f);
            }

            if (this.target && this.target.healthComponent && this.target.healthComponent.alive)
            {
                this.targetIsValid = true;
            }

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Punch");
            }

            this.attack                 = new OverlapAttack();
            this.attack.damageType      = DamageType.Generic;
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damage          = DashPunch.damageCoefficient * this.damageStat;
            this.attack.procCoefficient = DashPunch.procCoefficient;
            this.attack.hitEffectPrefab = DashPunch.hitEffectPrefab;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();
            this.attack.impactSound     = DashPunch.impactSound.index;
            this.attack.pushAwayForce   = DashPunch.pushForce * 0.2f;

            Util.PlaySound("HenryStinger", base.gameObject);
            base.PlayAnimation("FullBody, Override", "DashPunch");

            if (base.isGrounded)
            {
                EffectManager.SimpleEffect(Modules.Assets.dustEffect, base.characterBody.footPosition, base.transform.rotation, false);
            }
        }
Example #19
0
 // Token: 0x06002E10 RID: 11792 RVA: 0x000C40A0 File Offset: 0x000C22A0
 protected override void AuthorityModifyOverlapAttack(OverlapAttack overlapAttack)
 {
     base.AuthorityModifyOverlapAttack(overlapAttack);
     overlapAttack.damage      = this.damageCoefficient * this.damageStat + this.bonusDamage;
     overlapAttack.forceVector = base.characterMotor.velocity + base.GetAimRay().direction *Mathf.Lerp(this.minPunchForce, this.maxPunchForce, this.charge);
     if (base.fixedAge + Time.fixedDeltaTime >= this.duration)
     {
         HitBoxGroup hitBoxGroup = base.FindHitBoxGroup("PunchLollypop");
         if (hitBoxGroup)
         {
             this.hitBoxGroup          = hitBoxGroup;
             overlapAttack.hitBoxGroup = hitBoxGroup;
         }
     }
 }
Example #20
0
        public override void OnEnter()
        {
            Debug.LogWarning("In PrimarySkill");
            base.OnEnter();
            this.duration     = this.baseDuration / this.attackSpeedStat;
            this.fireDuration = 0.25f * this.duration;
            base.characterBody.SetAimTimer(2f);
            this.animator     = base.GetModelAnimator();
            this.muzzleString = "Muzzle";
            HitBox hitbox = null;


            var       gameObject = GameObject.Find("spine upper weapon_end");
            Transform transform  = gameObject.transform;

            //ChildLocator childLocator = ExampleSurvivor.ExampleSurvivor.childLocator;

            //Transform transform = childLocator.FindChild("spine upper weapon_end");
            //Transform transform = ExampleSurvivor.ExampleSurvivor.characterPrefab.transform.Find("Armature/Hips/Spine/Chest/arm right wrist weapon_end/spine upper weapon/spine upper weapon_end");
            if (transform == null)
            {
                Debug.LogError("transform == null");
            }
            CapsuleCollider collider = transform.GetComponent <CapsuleCollider>();

            if (collider == null)
            {
                Debug.LogError("collider == null");
            }



            try{
                hitbox      = transform.GetComponent <CapsuleCollider>().gameObject.AddComponent <HitBox>();
                this.hitBox = hitbox;
                if (hitbox == null)
                {
                    Debug.LogError("hitbox == null");
                }
            }
            catch
            { Debug.LogError("error while adding Hitbox"); }

            overlapAttack            = base.InitMeleeOverlap(1000, tracerEffectPrefab, base.GetModelTransform(), hitbox.name);
            overlapAttack.damageType = DamageType.BleedOnHit;

            base.PlayAnimation("Gesture, Override", "Slash", "FireArrow.playbackRate", this.duration);
        }
Example #21
0
        // Token: 0x06000327 RID: 807 RVA: 0x0000D1A0 File Offset: 0x0000B3A0
        public OverlapAttack InitMeleeOverlap(float damageCoefficient, GameObject hitEffectPrefab, Transform modelTransform, string hitboxGroupName)
        {
            OverlapAttack overlapAttack = new OverlapAttack();

            overlapAttack.attacker        = base.gameObject;
            overlapAttack.inflictor       = base.gameObject;
            overlapAttack.teamIndex       = TeamComponent.GetObjectTeam(overlapAttack.attacker);
            overlapAttack.damage          = damageCoefficient * this.damageStat;
            overlapAttack.hitEffectPrefab = hitEffectPrefab;
            overlapAttack.isCrit          = this.RollCrit();
            if (modelTransform)
            {
                overlapAttack.hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxGroupName);
            }
            return(overlapAttack);
        }
Example #22
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.animator = base.GetModelAnimator();
            this.duration = this.baseDuration / this.attackSpeedStat;
            this.hasSwung = false;

            this.overlapAttack = base.InitMeleeOverlap(this.baseDamageCoefficient, WhirlwindBase.hitEffectPrefab, base.GetModelTransform(), this.hitboxString);

            if (base.characterDirection && base.inputBank)
            {
                base.characterDirection.forward = base.inputBank.aimDirection;
            }

            base.SmallHop(base.characterMotor, this.smallHopVelocity);
            this.PlayAnim();
        }
 private bool OverlapAttack_Fire(On.RoR2.OverlapAttack.orig_Fire orig, OverlapAttack self, List <HealthComponent> hitResults)
 {
     if (self.attacker)
     {
         if (self.attacker.GetComponent <CharacterBody>() is CharacterBody characterBody && characterBody.inventory)
         {
             if (characterBody.inventory.GetItemCount(this.ItemIndex) is int count && count > 0)
             {
                 for (int i = 0; i < count; i++)
                 {
                     orig(self, hitResults);
                 }
             }
         }
     }
     return(orig(self, hitResults));
 }
 public void ResetOverlap()
 {
     this.attack = new OverlapAttack();
     this.attack.procChainMask     = this.projectileController.procChainMask;
     this.attack.procCoefficient   = this.projectileController.procCoefficient * this.procCoefficient;
     this.attack.attacker          = this.projectileController.owner;
     this.attack.inflictor         = base.gameObject;
     this.attack.teamIndex         = this.projectileController.teamFilter.teamIndex;
     this.attack.attackerFiltering = this.attackerFiltering;
     this.attack.damage            = this.damageCoefficient * this.projectileDamage.damage;
     this.attack.forceVector       = this.bonusForce + this.projectileDamage.force * base.transform.forward;
     this.attack.hitEffectPrefab   = this.impactEffect;
     this.attack.isCrit            = this.projectileDamage.crit;
     this.attack.damageColorIndex  = this.projectileDamage.damageColorIndex;
     this.attack.damageType        = this.useDamageTypeOverride ? this.damageTypeOverride : this.projectileDamage.damageType;
     this.attack.hitBoxGroup       = base.GetComponent <HitBoxGroup>();
 }
Example #25
0
 private bool OverlapAttack_Fire(On.RoR2.OverlapAttack.orig_Fire orig, OverlapAttack self, List <HealthComponent> hitResults)
 {
     if (self.attacker)
     {
         if (self.attacker.GetComponent <CharacterBody>() is CharacterBody characterBody && characterBody.inventory)
         {
             if (characterBody.inventory.GetItemCount(this.ItemIndex) is int count && count > 0)
             {
                 List <OverlapAttack> attacks;
                 if (childAttacks.TryGetValue(self, out attacks))
                 {
                     foreach (var attack in attacks)
                     {
                         orig(attack, hitResults);
                     }
                 }
                 else
                 {
                     attacks = new List <OverlapAttack>();
                     for (int i = 0; i < count; i++)
                     {
                         OverlapAttack overlapAttack = new OverlapAttack();
                         overlapAttack.attacker          = self.attacker;
                         overlapAttack.attackerFiltering = self.attackerFiltering;
                         overlapAttack.damage            = self.damage;
                         overlapAttack.damageColorIndex  = self.damageColorIndex;
                         overlapAttack.damageType        = self.damageType;
                         overlapAttack.forceVector       = self.forceVector;
                         overlapAttack.hitBoxGroup       = self.hitBoxGroup;
                         overlapAttack.hitEffectPrefab   = self.hitEffectPrefab;
                         overlapAttack.inflictor         = self.inflictor;
                         overlapAttack.isCrit            = self.isCrit;
                         overlapAttack.procChainMask     = self.procChainMask;
                         overlapAttack.procCoefficient   = self.procCoefficient;
                         overlapAttack.teamIndex         = self.teamIndex;
                         attacks.Add(overlapAttack);
                         orig(overlapAttack, hitResults);
                     }
                     childAttacks.Add(self, attacks);
                 }
             }
         }
     }
     return(orig(self, hitResults));
 }
Example #26
0
 public override void OnEnter()
 {
     procCoefficient              = FireVoidspikes.procCoefficient;
     selfForce                    = FireVoidspikes.selfForce;
     hitEffectPrefab              = FireVoidspikes.hitEffectPrefab;
     swipeEffectPrefab            = FireVoidspikes.swipeEffectPrefab;
     enterSoundString             = FireVoidspikes.enterSoundString;
     attackSoundString            = FireVoidspikes.attackSoundString;
     walkSpeedPenaltyCoefficient  = FireVoidspikes.walkSpeedPenaltyCoefficient;
     projectileCount              = FireVoidspikes.projectileCount;
     projectileYawSpread          = FireVoidspikes.projectileYawSpread;
     projectileDamageCoefficient  = FireVoidspikes.projectileDamageCoefficient;
     projectileSpeed              = FireVoidspikes.projectileSpeed;
     projectileSpeedPerProjectile = FireVoidspikes.projectileSpeedPerProjectile;
     projectilePrefab             = Prefabs.Projectiles.ImpOverlord.IchorSpikePrefab.prefab;
     base.OnEnter();
     duration       = baseDuration / attackSpeedStat;
     modelAnimator  = GetModelAnimator();
     modelTransform = GetModelTransform();
     base.characterMotor.walkSpeedPenaltyCoefficient = walkSpeedPenaltyCoefficient;
     attack                 = new OverlapAttack();
     attack.attacker        = base.gameObject;
     attack.inflictor       = base.gameObject;
     attack.teamIndex       = GetTeam();
     attack.damage          = damageCoefficient * damageStat;
     attack.hitEffectPrefab = hitEffectPrefab;
     attack.isCrit          = Util.CheckRoll(critStat, base.characterBody.master);
     attack.procCoefficient = procCoefficient;
     attack.damageType      = DamageType.Generic;
     Util.PlaySound(enterSoundString, base.gameObject);
     if (base.isAuthority)
     {
         chosenAnim = ((!Util.CheckRoll(50f)) ? 1 : 0);
     }
     if ((bool)modelAnimator)
     {
         string animationStateName = ((chosenAnim == 1) ? "FireVoidspikesL" : "FireVoidspikesR");
         PlayAnimation("Gesture, Additive", animationStateName, "FireVoidspikes.playbackRate", duration);
         PlayAnimation("Gesture, Override", animationStateName, "FireVoidspikes.playbackRate", duration);
     }
     if ((bool)base.characterBody)
     {
         base.characterBody.SetAimTimer(duration + 3f);
     }
 }
 private void Start()
 {
     this.attack = new OverlapAttack();
     this.attack.procChainMask         = this.projectileController.procChainMask;
     this.attack.procCoefficient       = this.projectileController.procCoefficient * this.overlapProcCoefficient;
     this.attack.attacker              = this.projectileController.owner;
     this.attack.inflictor             = base.gameObject;
     this.attack.teamIndex             = this.projectileController.teamFilter.teamIndex;
     this.attack.damage                = this.overlapCoefficient * this.projectileDamage.damage;
     this.attack.forceVector           = this.projectileDamage.force * base.transform.forward;
     this.attack.hitEffectPrefab       = this.impactEffect;
     this.attack.isCrit                = this.projectileDamage.crit;
     this.attack.damageColorIndex      = this.projectileDamage.damageColorIndex;
     this.attack.damageType            = this.projectileDamage.damageType;
     this.attack.procChainMask         = this.projectileController.procChainMask;
     this.attack.maximumOverlapTargets = this.overlapMaxTargets;
     this.attack.hitBoxGroup           = base.GetComponent <HitBoxGroup>();
 }
Example #28
0
        protected override OverlapAttack CreateAttack(HitBoxGroup hitBoxGroup)
        {
            var attack = new OverlapAttack();

            attack.damageType      = DamageType.BypassArmor;
            attack.attacker        = base.gameObject;
            attack.inflictor       = base.gameObject;
            attack.teamIndex       = base.GetTeam();
            attack.damage          = c_DamageCoefficient * baseDamageCoeficient * this.damageStat;
            attack.procCoefficient = procCoefficient;
            attack.hitEffectPrefab = this.hitEffectPrefab;
            attack.forceVector     = Vector3.zero;
            attack.pushAwayForce   = 0f;
            attack.hitBoxGroup     = hitBoxGroup;
            attack.isCrit          = base.RollCrit();
            attack.impactSound     = this.impactSound;
            return(attack);
        }
Example #29
0
        // Token: 0x06004013 RID: 16403 RVA: 0x0010C7BC File Offset: 0x0010A9BC
        private void ResetOverlapAttack()
        {
            if (!this.hitboxGroup)
            {
                Transform modelTransform = base.GetModelTransform();
                if (modelTransform)
                {
                    this.hitboxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "HeadCh");
                }
            }
            this.attack           = new OverlapAttack();
            this.attack.attacker  = base.gameObject;
            this.attack.inflictor = base.gameObject;
            this.attack.teamIndex = TeamComponent.GetObjectTeam(this.attack.attacker);
            this.attack.damage    = ChargeAgu.damageCoefficient * this.damageStat;

            this.attack.forceVector   = Vector3.up * 1f;
            this.attack.pushAwayForce = 1f;
            this.attack.hitBoxGroup   = this.hitboxGroup;
        }
        private bool OverlapAttack_Fire(On.RoR2.OverlapAttack.orig_Fire orig, OverlapAttack self, List <HurtBox> hitResults)
        {
            bool didAHit = orig(self, hitResults);

            HitboxGroupRevealer hitboxGroupRevealer = _hitboxGroupRevealers.Find((revealer) => {
                return(revealer != null && revealer.hitboxGroup == self.hitBoxGroup);
            });

            if (hitboxGroupRevealer == null)
            {
                hitboxGroupRevealer = self.hitBoxGroup.gameObject.AddComponent <HitboxGroupRevealer>();
                _hitboxGroupRevealers.Add(hitboxGroupRevealer);

                hitboxGroupRevealer.init(self.hitBoxGroup, _hitboxBoxPrefab, self.attacker);
            }

            hitboxGroupRevealer.reveal(true);

            return(didAHit);
        }