Example #1
0
        protected virtual void OnHitEnemyAuthority()
        {
            if (!this.hasHopped)
            {
                if (base.characterMotor && !base.characterMotor.isGrounded)
                {
                    base.SmallHop(base.characterMotor, this.hitHopVelocity);
                }

                this.hasHopped = true;
            }

            if (!this.inHitPause)
            {
                this.storedVelocity     = base.characterMotor.velocity;
                this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, this.playbackRateString);
                this.hitPauseTimer      = this.hitStopDuration / this.attackSpeedStat;
                this.inHitPause         = true;
            }

            if (LagannDrillRush.spiralEnergyPercentagePerHit != 0f && this.spiralEnergy)
            {
                this.spiralEnergy.AddSpiralEnergyAuthority(LagannDrillRush.spiralEnergyPercentagePerHit * SpiralEnergyComponent.C_SPIRALENERGYCAP);
            }
        }
Example #2
0
        protected virtual void OnHitAuthority()
        {
            if (!this.hasHopped)
            {
                if (base.characterMotor && !base.characterMotor.isGrounded)
                {
                    base.SmallHop(base.characterMotor, Slash.hitHopVelocity);
                }

                if (base.skillLocator.utility.skillDef.skillNameToken == "PALADIN_UTILITY_DASH_NAME")
                {
                    base.skillLocator.utility.RunRecharge(1f);
                }

                this.hasHopped = true;
            }

            if (!this.inHitPause)
            {
                if (base.characterMotor.velocity != Vector3.zero)
                {
                    this.storedVelocity = base.characterMotor.velocity;
                }
                this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Punch.playbackRate");
                this.hitPauseTimer      = (2f * EntityStates.Merc.GroundLight.hitPauseDuration) / this.attackSpeedStat;
                this.inHitPause         = true;
            }
        }
Example #3
0
        public void FireAttack()
        {
            if (!this.hasFired)
            {
                this.hasFired = true;
                this.swordController.PlaySwingSound();

                if (base.isAuthority)
                {
                    base.AddRecoil(-1f * GroundSweep.attackRecoil, -2f * GroundSweep.attackRecoil, -0.5f * GroundSweep.attackRecoil, 0.5f * GroundSweep.attackRecoil);
                    EffectManager.SimpleMuzzleFlash(this.swordController.swingEffect, base.gameObject, "SwingDown", true);

                    base.characterMotor.velocity *= 0.25f;
                    base.characterMotor.velocity += Vector3.up * -AirSlam.dropVelocity;
                }
            }

            if (base.isAuthority)
            {
                Ray aimRay = base.GetAimRay();

                if (this.attack.Fire())
                {
                    this.swordController.PlayHitSound(2);

                    if (!this.inHitPause)
                    {
                        this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Whirlwind.playbackRate");
                        this.hitPauseTimer      = (4f * EntityStates.Merc.GroundLight.hitPauseDuration) / this.attackSpeedStat;
                        this.inHitPause         = true;
                    }
                }
            }
        }
Example #4
0
        public override void FixedUpdate()
        {
            base.FixedUpdate();
            this.hitPauseTimer -= Time.fixedDeltaTime;

            if (base.fixedAge >= this.duration * 0.2f)
            {
                Util.PlayScaledSound(WhirlwindBase.attackSoundString, base.gameObject, WhirlwindBase.slashPitch);
                EffectManager.SimpleMuzzleFlash(WhirlwindBase.swingEffectPrefab, base.gameObject, this.slashChildName, false);

                if (base.isAuthority && !this.hasSwung)
                {
                    this.hasSwung = true;

                    //unfinished
                    //if (base.attack(this.overlapAttack))
                }
            }

            if (base.isAuthority)
            {
                if (base.FireMeleeOverlap(this.overlapAttack, this.animator, "Sword.active", 0f, true))
                {
                    Util.PlaySound(WhirlwindBase.hitSoundString, base.gameObject);
                    if (!this.isInHitPause)
                    {
                        this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Whirlwind.playbackRate");
                        this.hitPauseTimer      = WhirlwindBase.hitPauseDuration / this.attackSpeedStat;
                        this.isInHitPause       = true;
                    }
                }

                if (this.hitPauseTimer <= 0f && this.isInHitPause)
                {
                    base.ConsumeHitStopCachedState(this.hitStopCachedState, base.characterMotor, this.animator);
                    this.isInHitPause = false;
                }

                if (!this.isInHitPause)
                {
                    if (base.characterMotor && base.characterDirection)
                    {
                        Vector3 velocity = base.characterDirection.forward * this.moveSpeedStat * Mathf.Lerp(this.moveSpeedBonusCoefficient, 1f, base.age / this.duration);
                        velocity.y = base.characterMotor.velocity.y;
                        base.characterMotor.velocity = velocity;
                    }
                }
                else
                {
                    base.characterMotor.velocity = Vector3.zero;
                    this.hitPauseTimer          -= Time.fixedDeltaTime;
                    this.animator.SetFloat("Whirlwind.playbackRate", 0f);
                }

                if (base.fixedAge >= this.duration)
                {
                    this.outer.SetNextStateToMain();
                }
            }
        }
Example #5
0
        public void FireAttack()
        {
            if (!this.hasFired)
            {
                this.hasFired = true;
                this.swordController.PlaySwingSound();

                if (base.isAuthority)
                {
                    string muzzleString = null;
                    if (this.swingIndex == 0)
                    {
                        muzzleString = "SwingRight";
                    }
                    else
                    {
                        muzzleString = "SwingLeft";
                    }

                    base.AddRecoil(-1f * Slash.attackRecoil, -2f * Slash.attackRecoil, -0.5f * Slash.attackRecoil, 0.5f * Slash.attackRecoil);
                    EffectManager.SimpleMuzzleFlash(this.swordController.swingEffect, base.gameObject, muzzleString, true);

                    Ray aimRay = base.GetAimRay();

                    if (this.swordController && this.swordController.swordActive)
                    {
                        ProjectileManager.instance.FireProjectile(Modules.Projectiles.swordBeam, aimRay.origin, Util.QuaternionSafeLookRotation(aimRay.direction), base.gameObject, StaticValues.beamDamageCoefficient * this.damageStat, 0f, Util.CheckRoll(this.critStat, base.characterBody.master), DamageColorIndex.WeakPoint, null, StaticValues.beamSpeed);
                    }

                    if (this.attack.Fire())
                    {
                        this.swordController.PlayHitSound(0);

                        if (!this.hasHopped)
                        {
                            if (base.characterMotor && !base.characterMotor.isGrounded)
                            {
                                base.SmallHop(base.characterMotor, Slash.hitHopVelocity);
                            }

                            if (base.skillLocator.utility.skillDef.skillNameToken == "PALADIN_UTILITY_DASH_NAME")
                            {
                                base.skillLocator.utility.RunRecharge(1f);
                            }

                            this.hasHopped = true;
                        }

                        if (!this.inHitPause)
                        {
                            this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Slash.playbackRate");
                            this.hitPauseTimer      = (2f * EntityStates.Merc.GroundLight.hitPauseDuration) / this.attackSpeedStat;
                            this.inHitPause         = true;
                        }
                    }
                }
            }
        }
Example #6
0
        public void FireAttack()
        {
            if (!this.hasFired)
            {
                this.hasFired = true;
                Util.PlayAttackSpeedSound(DiggerPlugin.Sounds.Swing, base.gameObject, this.attackSpeedStat);

                if (base.isAuthority)
                {
                    string muzzleString;
                    if (this.swingIndex == 0)
                    {
                        muzzleString = "SwingRight";
                    }
                    else
                    {
                        muzzleString = "SwingLeft";
                    }

                    GameObject effectPrefab = DiggerPlugin.Assets.swingFX;
                    if (base.characterBody.GetBuffCount(DiggerPlugin.Buffs.goldRushBuff) >= 0.8f * DiggerPlugin.DiggerPlugin.adrenalineCap)
                    {
                        effectPrefab = DiggerPlugin.Assets.empoweredSwingFX;
                    }

                    EffectManager.SimpleMuzzleFlash(effectPrefab, base.gameObject, muzzleString, true);

                    base.AddRecoil(-1f * Gouge.attackRecoil, -2f * Gouge.attackRecoil, -0.5f * Gouge.attackRecoil, 0.5f * Gouge.attackRecoil);
                }
            }

            if (base.isAuthority)
            {
                if (this.attack.Fire())
                {
                    //if (this.styleComponent) this.styleComponent.AddStyle(Gouge.styleCoefficient);

                    if (!this.hasHopped)
                    {
                        if (base.characterMotor && !base.characterMotor.isGrounded)
                        {
                            base.SmallHop(base.characterMotor, Gouge.hitHopVelocity);
                        }

                        this.hasHopped = true;
                    }

                    if (!this.inHitPause)
                    {
                        this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Swing.playbackRate");
                        this.hitPauseTimer      = (0.6f * Merc.GroundLight.hitPauseDuration) / this.attackSpeedStat;
                        this.inHitPause         = true;
                    }
                }
            }
        }
 // Token: 0x06003ECE RID: 16078 RVA: 0x000F80D0 File Offset: 0x000F62D0
 public override void FixedUpdate()
 {
     base.FixedUpdate();
     this.hitPauseTimer -= Time.fixedDeltaTime;
     if (base.isAuthority)
     {
         if (this.animator.GetFloat("Sword.active") > 0.2f && !this.hasSwung)
         {
             this.hasSwung = true;
             base.characterMotor.Motor.ForceUnground();
             Util.PlayAttackSpeedSound(Uppercut.attackSoundString, base.gameObject, Uppercut.slashPitch);
             EffectManager.SimpleMuzzleFlash(Uppercut.swingEffectPrefab, base.gameObject, Uppercut.slashChildName, true);
         }
         if (base.FireMeleeOverlap(this.overlapAttack, this.animator, "Sword.active", 0f, false))
         {
             Util.PlaySound(Uppercut.hitSoundString, base.gameObject);
             if (!this.isInHitPause)
             {
                 this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Uppercut.playbackRate");
                 this.hitPauseTimer      = Uppercut.hitPauseDuration / this.attackSpeedStat;
                 this.isInHitPause       = true;
             }
         }
         if (this.hitPauseTimer <= 0f && this.isInHitPause)
         {
             base.ConsumeHitStopCachedState(this.hitStopCachedState, base.characterMotor, this.animator);
             base.characterMotor.Motor.ForceUnground();
             this.isInHitPause = false;
         }
         if (!this.isInHitPause)
         {
             if (base.characterMotor && base.characterDirection)
             {
                 Vector3 velocity = base.characterDirection.forward * this.moveSpeedStat * Mathf.Lerp(Uppercut.moveSpeedBonusCoefficient, 0f, base.age / this.duration);
                 velocity.y = -Uppercut.yVelocityCurve.Evaluate(base.fixedAge / this.duration) * 2f;
                 base.characterMotor.velocity = velocity;
             }
         }
         else
         {
             base.fixedAge -= Time.fixedDeltaTime;
             base.characterMotor.velocity = Vector3.zero;
             this.hitPauseTimer          -= Time.fixedDeltaTime;
             this.animator.SetFloat("Uppercut.playbackRate", 0f);
         }
         if (base.fixedAge >= this.duration)
         {
             if (this.hasSwung)
             {
                 this.hasSwung = true;
                 this.overlapAttack.Fire(null);
             }
             this.outer.SetNextStateToMain();
         }
     }
 }
 protected virtual void OnHitEnemyAuthority()
 {
     if (!this.inHitPause)
     {
         this.storedVelocity     = base.characterMotor.velocity;
         this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, this.playbackRateString);
         this.hitPauseTimer      = this.hitStopDuration / this.attackSpeedStat;
         this.inHitPause         = true;
     }
 }
        protected virtual void OnHitEnemyAuthority()
        {
            Util.PlaySound("TTGLDrillRushHit", base.gameObject);

            if (!this.inHitPause)
            {
                this.storedVelocity     = base.characterMotor.velocity;
                this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, this.playbackRateString);
                this.hitPauseTimer      = this.hitStopDuration / this.attackSpeedStat;
                this.inHitPause         = true;
            }
        }
Example #10
0
        protected virtual void OnHitEnemyAuthority(List <HealthComponent> healthList)
        {
            Util.PlaySound(this.hitSoundString, base.gameObject);

            if (!this.hasHopped)
            {
                if (base.characterMotor && !base.characterMotor.isGrounded && this.hitHopVelocity > 0f)
                {
                    base.SmallHop(base.characterMotor, this.hitHopVelocity);
                }

                this.hasHopped = true;
            }

            if (!this.inHitPause && this.hitStopDuration > 0f)
            {
                this.storedVelocity     = base.characterMotor.velocity;
                this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Slash.playbackRate");
                this.hitPauseTimer      = this.hitStopDuration / this.attackSpeedStat;
                this.inHitPause         = true;
            }
        }
Example #11
0
        public void FireAttack()
        {
            if (!this.hasFired)
            {
                this.hasFired = true;
                this.swordController.PlaySwingSound();

                if (base.isAuthority)
                {
                    base.AddRecoil(-1f * GroundSweepAlt.attackRecoil, -2f * GroundSweepAlt.attackRecoil, -0.5f * GroundSweepAlt.attackRecoil, 0.5f * GroundSweepAlt.attackRecoil);
                    if (this.swordController.swordActive)
                    {
                        EffectManager.SimpleMuzzleFlash(this.swordController.empoweredSpinSlashEffect, base.gameObject, "SwingCenter", true);
                    }
                    else
                    {
                        EffectManager.SimpleMuzzleFlash(this.swordController.spinSlashEffect, base.gameObject, "SwingCenter", true);
                    }

                    Ray aimRay = base.GetAimRay();

                    if (this.attack.Fire())
                    {
                        if (!this.inHitPause)
                        {
                            if (base.characterMotor.velocity != Vector3.zero)
                            {
                                this.storedVelocity = base.characterMotor.velocity;
                            }
                            this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Whirlwind.playbackRate");
                            this.hitPauseTimer      = (4f * EntityStates.Merc.GroundLight.hitPauseDuration) / this.attackSpeedStat;
                            this.inHitPause         = true;
                        }
                    }

                    base.characterMotor.velocity += (base.characterDirection.forward * 25f);
                }
            }
        }
Example #12
0
        public void FireAttack()
        {
            float speedScale   = 0.7f * (Mathf.Sqrt(3.5f * base.attackSpeedStat));
            float attackRadius = 1.1f * Mathf.Sqrt(speedScale - 0.31f);

            if (base.isAuthority)
            {
                base.GetModelChildLocator().FindChild("SwingCenter").transform.localScale = Vector3.one * attackRadius;

                if (this.attack.Fire())
                {
                    //if (this.styleComponent) this.styleComponent.AddStyle(Crush.styleCoefficient);

                    if (!this.hasHopped)
                    {
                        if (base.characterMotor && !base.characterMotor.isGrounded)
                        {
                            base.SmallHop(base.characterMotor, Crush.hitHopVelocity);
                        }

                        this.hasHopped = true;
                    }

                    if (!this.inHitPause)
                    {
                        this.hitStopCachedState = base.CreateHitStopCachedState(base.characterMotor, this.animator, "Crush.playbackRate");
                        this.hitPauseTimer      = (0.6f * Merc.GroundLight.hitPauseDuration) / this.attackSpeedStat;
                        this.inHitPause         = true;
                    }
                }
            }


            if (!this.hasFired)
            {
                this.hasFired = true;
                Util.PlaySound(DiggerPlugin.Sounds.Crush, base.gameObject);

                base.AddRecoil(-1f * Crush.attackRecoil * speedScale,
                               -2f * Crush.attackRecoil * speedScale,
                               -0.5f * Crush.attackRecoil * speedScale,
                               0.5f * Crush.attackRecoil * speedScale);
                if (base.isAuthority)
                {
                    Ray aimRay = base.GetAimRay();

                    //float theta = Vector3.Angle(new Vector3(0, -1, 0), aimRay.direction);
                    //theta = Mathf.Min(theta, 90);
                    //Vector3 theSpot = aimRay.origin + ((1 + (theta / 30)) * aimRay.direction);

                    //nerdy math written by a nerd
                    //Vector2 move = new Vector2(characterMotor.moveDirection.x, characterMotor.moveDirection.z);
                    //Vector2 aim = new Vector2(aimRay.direction.x, aimRay.direction.z);
                    //float forward = Vector2.Dot(move, aim.normalized);
                    //Vector2 aimO = new Vector2(aimRay.direction.z, -1 * aimRay.direction.x);
                    //float right = Vector2.Dot(move, aimO.normalized);

                    //BlastAttack blastAttack = new BlastAttack();
                    //blastAttack.radius = attackRadius;
                    //blastAttack.procCoefficient = 1f;
                    //blastAttack.position = theSpot;
                    //blastAttack.attacker = base.gameObject;
                    //blastAttack.crit = this.RollCrit();
                    //blastAttack.baseDamage = base.characterBody.damage * Crush.damageCoefficient;
                    //blastAttack.falloffModel = BlastAttack.FalloffModel.SweetSpot;
                    //blastAttack.baseForce = 3f;
                    //blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker);
                    //blastAttack.damageType = DamageType.Generic;
                    //blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                    //BlastAttack.Result result = blastAttack.Fire();

                    Transform swingCenter = base.GetModelChildLocator().FindChild("CrushMuzzleExplosion").transform;

                    EffectData effectData = new EffectData();
                    effectData.origin = swingCenter.position;
                    effectData.scale  = attackRadius * 2.69f;
                    EffectManager.SpawnEffect(explodePrefab, effectData, false);

                    effectData.scale = 0.1f;
                    Vector3 left = Vector3.Cross(aimRay.direction, Vector3.up).normalized;
                    effectData.origin = aimRay.origin - (0.5f * left);
                    EffectManager.SpawnEffect(swingPrefab, effectData, false);
                    effectData.origin = aimRay.origin + left;
                    EffectManager.SpawnEffect(swingPrefab, effectData, false);

                    //I have been defeated
                    //f**k you
                    //base.GetModelChildLocator().FindChild("CrushMuzzleExplosion").transform.localScale = Vector3.one * attackRadius;

                    //EffectManager.SimpleMuzzleFlash(DiggerPlugin.DiggerPlugin.crushExplosionEffect, base.gameObject, "CrushMuzzleExplosion", true);
                    //GameObject effectPrefab = DiggerPlugin.Assets.crushFX;
                    //EffectManager.SimpleMuzzleFlash(effectPrefab, base.gameObject, "CrushMuzzleLeft", true);
                    //EffectManager.SimpleMuzzleFlash(effectPrefab, base.gameObject, "CrushMuzzleRight", true);
                }
            }
        }