public override void OnEnter() { base.OnEnter(); spiralEnergyComponent = base.GetComponent <SpiralEnergyComponent>(); Util.PlaySound(BaseChargeFist.enterSFXString, base.gameObject); this.chargeLoopSFX = Util.PlaySound(BaseChargeFist.startChargeLoopSFXString, base.gameObject); PlayEnterAnimation(); CreateChargeEffect(); var healthComponent = base.healthComponent; this.initialEnergy = healthComponent.barrier + healthComponent.shield; this.previousEnergy = initialEnergy; if (NetworkServer.active) { base.characterBody.AddBuff(RoR2.RoR2Content.Buffs.HiddenInvincibility); } }
public override void OnEnter() { base.OnEnter(); this.spiralEnergy = base.GetComponent <SpiralEnergyComponent>(); this.muzzleString = swingIndex % 2 == 0 ? "LeftDrillMuzzle" : "RightDrillMuzzle"; 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(); base.StartAimMode(0.5f + this.duration, false); 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 = damageCoefficient * this.damageStat; this.attack.procCoefficient = 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; }