public override void OnEnter() { base.OnEnter(); if (base.isAuthority) { this.duration = HURT.baseDuration / this.attackSpeedStat; this.modelAnimator = base.GetModelAnimator(); Transform modelTransform = base.GetModelTransform(); this.attack = new ExtendedOverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = TeamComponent.GetObjectTeam(this.attack.attacker); this.attack.damage = damageCoefficient * this.damageStat; this.attack.hitEffectPrefab = HURT.hitEffectPrefab; this.attack.pushAwayForce = this.forceMagnitude; this.attack.procCoefficient = 1; this.attack.upwardsForce = this.forceMagnitude; this.attack.isCrit = RollCrit(); if (base.GetComponent <HANDOverclockController>().overclockOn&& Util.CheckRoll(30, base.characterBody.master) && base.isAuthority) { this.attack.damageType = DamageType.Stun1s; } if (modelTransform && base.isAuthority) { this.attack.hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Hammer"); ChildLocator component = modelTransform.GetComponent <ChildLocator>(); if (component) { this.hammerChildTransform = component.FindChild("SwingCenter"); } } if (this.modelAnimator && base.isAuthority) { int layerIndex = this.modelAnimator.GetLayerIndex("Gesture"); if (this.modelAnimator.GetCurrentAnimatorStateInfo(layerIndex).IsName("FullSwing3") || this.modelAnimator.GetCurrentAnimatorStateInfo(layerIndex).IsName("FullSwing1")) { base.PlayCrossfade("Gesture", "FullSwing2", "FullSwing.playbackRate", this.duration / (1f - this.returnToIdlePercentage), 0.2f); } else if (this.modelAnimator.GetCurrentAnimatorStateInfo(layerIndex).IsName("FullSwing2")) { base.PlayCrossfade("Gesture", "FullSwing3", "FullSwing.playbackRate", this.duration / (1f - this.returnToIdlePercentage), 0.2f); } else { base.PlayCrossfade("Gesture", "FullSwing1", "FullSwing.playbackRate", this.duration / (1f - this.returnToIdlePercentage), 0.2f); } } if (base.characterBody) { base.characterBody.SetAimTimer(2f); } } }
public override void OnEnter() { base.OnEnter(); if (base.isAuthority) { this.duration = this.baseDuration / base.attackSpeedStat; this.modelAnimator = base.GetModelAnimator(); Transform modelTransform = base.GetModelTransform(); this.attack = new ExtendedOverlapAttack(); this.attack.attacker = base.gameObject; this.attack.inflictor = base.gameObject; this.attack.teamIndex = TeamComponent.GetObjectTeam(this.attack.attacker); this.attack.damage = this.attackDamageCoefficient * this.damageStat; this.attack.isCrit = RollCrit(); this.attack.damageType = DamageType.Stun1s; this.blastAttack = new BlastAttack(); this.blastAttack.attacker = base.gameObject; this.blastAttack.inflictor = base.gameObject; this.blastAttack.teamIndex = TeamComponent.GetObjectTeam(base.gameObject); this.blastAttack.baseDamage = this.damageStat * this.blastDamageCoefficient; this.blastAttack.baseForce = 16; this.blastAttack.position = base.transform.position; this.blastAttack.radius = 15; this.blastAttack.procCoefficient = 1f; this.blastAttack.falloffModel = BlastAttack.FalloffModel.None; this.blastAttack.damageType = DamageType.Stun1s; this.blastAttack.crit = RollCrit(); if (base.GetComponent <HANDOverclockController>().overclockOn&& Util.CheckRoll(30, base.characterBody.master)) { this.attack.damageType = DamageType.IgniteOnHit; } if (modelTransform) { this.attack.hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Hammer"); ChildLocator component = modelTransform.GetComponent <ChildLocator>(); if (component) { this.hammerChildTransform = component.FindChild("SwingCenter"); } } if (this.modelAnimator) { base.PlayAnimation("Gesture", "Slam", "Slam.playbackRate", this.duration); } if (base.characterBody) { base.characterBody.SetAimTimer(2f); } } }