public void FireAttack() { if (overlapAttack != null) { var hitThisFixedUpdate = overlapAttack.Fire(); totalHitTicks++; if (hitThisFixedUpdate) { if (body.characterMotor) { storedHitPauseVelocity += body.characterMotor.velocity; body.characterMotor.velocity = Vector3.zero; } if (armAnimator) { armAnimator.speed = 0f; } if (swingEffect) { ScaleParticleSystemDuration component = swingEffect.GetComponent <ScaleParticleSystemDuration>(); if (component) { component.newDuration = 20f; } } hitPauseTime = hitPauseDuration / attackSpeedStat; } } }
// 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); }
private void Attack() { if (base.isAuthority) { if (attack.Fire() && !base.isGrounded && !this.hasHopped) { base.SmallHop(base.characterMotor, SharpClaws.hopVelocity); this.hasHopped = true; } if (!this.hasFired) { //play swipe effect } } }
public override void FixedUpdate() { base.FixedUpdate(); if (NetworkServer.active && (bool)modelAnimator && modelAnimator.GetFloat("SwipeForward.hitBoxActive") > 0.1f) { if (!hasSlashed) { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, base.gameObject, "SwingCenter", transmit: true); HealthComponent healthComponent = base.characterBody.healthComponent; CharacterDirection component = base.characterBody.GetComponent <CharacterDirection>(); if ((bool)healthComponent) { healthComponent.TakeDamageForce(selfForceMagnitude * component.forward, alwaysApply: true); } hasSlashed = true; } attack.forceVector = base.transform.forward * forceMagnitude; attack.Fire(); } if (base.fixedAge >= duration && base.isAuthority) { outer.SetNextStateToMain(); } }
private void FireSpikeFan(Ray aimRay, string muzzleName, string hitBoxGroupName) { Util.PlaySound(attackSoundString, base.gameObject); EffectManager.SimpleMuzzleFlash(swipeEffectPrefab, base.gameObject, muzzleName, transmit: false); slashCount++; if (base.isAuthority) { Vector3 forward = base.characterDirection.forward; if ((bool)modelTransform) { attack.hitBoxGroup = FindHitBoxGroup(hitBoxGroupName); attack.forceVector = forward * forceMagnitude; attack.Fire(); } if ((bool)base.characterMotor) { base.characterMotor.ApplyForce(forward * selfForce, alwaysApply: true); } for (int i = 0; i < projectileCount; i++) { FireSpikeAuthority(aimRay, 0f, ((float)projectileCount / 2f - (float)i) * projectileYawSpread, projectileSpeed + projectileSpeedPerProjectile * (float)i); } } }
private void HandleSlash(string animatorParamName, string muzzleName, string hitBoxGroupName) { if (!(modelAnimator.GetFloat(animatorParamName) > 0.1f)) { return; } Util.PlaySound(slashSoundString, base.gameObject); EffectManager.SimpleMuzzleFlash(swipeEffectPrefab, base.gameObject, muzzleName, transmit: true); slashCount++; if ((bool)modelTransform) { attack.hitBoxGroup = Array.Find(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitBoxGroupName); } if ((bool)base.healthComponent) { base.healthComponent.TakeDamageForce(base.characterDirection.forward * selfForce, alwaysApply: true); } attack.ResetIgnoredHealthComponents(); if ((bool)base.characterDirection) { attack.forceVector = base.characterDirection.forward * forceMagnitude; } attack.Fire(); }