コード例 #1
0
        public void Update()
        {
            //Melee attack with the gun out



            if (WeaponSwapHandler.currentWeapon == WeaponType.Ranged && !isFiring && hc_instance.CanCast())
            {
                if (InputHandler.Instance.inputActions.dreamNail.WasPressed)
                {
                    //Log("Concussion Blast");
                    //Stats.StartBothCooldown();
                    //FireGun(FireModes.Concuss);
                    Log("[AttackHandler] Changing Firemode from : " + Stats.cardinalFiringMode + " to : " + !Stats.cardinalFiringMode);
                    Stats.ToggleFireMode();
                }
                else if (fireSpread && Stats.canFire)
                {
                    Stats.StartBothCooldown();
                    FireGun(FireModes.Spread);
                    //FireGun(FireModes.Burst);
                    fireSpread = false;
                }
                else if (OrientationHandler.heldAttack && Stats.canFire)
                {
                    Stats.StartBothCooldown();
                    FireGun(FireModes.Single);
                    //FireGun(FireModes.Burst);
                }
                else if (OrientationHandler.pressingAttack && Stats.canFire && false)
                {
                    if (Stats.currentPrimaryAmmo > 0)
                    {
                        //HP_Stats.ReduceAmmunition();
                        Stats.StartBothCooldown();
                        FireGun(FireModes.Spread);
                        //FireGun((PlayerData.instance.equippedCharm_11) ? FireModes.Spread : FireModes.Single);
                    }
                    else if (clickTimer <= 0)
                    {
                        clickTimer = 3f;
                        AudioHandler.PlaySoundsMisc("cantfire");
                    }
                }
            }
            else if (hc_instance.cState.superDashing && !isFiring && WeaponSwapHandler.currentWeapon == WeaponType.Ranged)
            {
                if (Stats.canFire && OrientationHandler.heldAttack)
                {
                    Stats.StartBothCooldown(30f);
                    StartCoroutine(FireGAU());
                    return;
                }
            }
            else if (!isFiring)
            {
                hc_instance.WALK_SPEED = 2.5f;
            }

            //TODO: Slow down the player while firing MOVE TO HP STATS LATER
            if (slowWalk)
            {
                h_state.inWalkZone = true;
            }
            else
            {
                h_state.inWalkZone = false;
            }
        }
コード例 #2
0
ファイル: AttackHandler.cs プロジェクト: xolxam/Hollow-Point
        public void Update()
        {
            //Melee attack with the gun out
            if (WeaponSwapAndStatHandler.instance.currentWeapon == WeaponType.Ranged && !isFiring && hc_instance.CanCast())
            {
                /*
                 * if (InputHandler.Instance.inputActions.dreamNail.WasPressed)
                 * {
                 *  Log("[AttackHandler] Changing Firemode from : " + Stats.instance.cardinalFiringMode + " to : " + !Stats.instance.cardinalFiringMode );
                 *  Stats.instance.ToggleFireMode();
                 * }
                 */
                if (OrientationHandler.heldAttack && Stats.instance.canFire)
                {
                    if (PlayerData.instance.MPCharge >= Stats.instance.SoulCostPerShot())
                    {
                        FireGun(FireModes.Single);
                    }
                    else if (clickTimer <= 0)
                    {
                        AudioHandler.instance.PlayMiscSoundEffect(AudioHandler.HollowPointSoundType.ClickSFXGO, alteredPitch: false);
                        clickTimer = 1f;
                    }

                    //FireGun(FireModes.Burst);
                }
            }
            else if (!isFiring)
            {
                hc_instance.WALK_SPEED = 2.5f;
            }

            //TODO: Slow down the player while firing MOVE TO HP STATS LATER
            if (slowWalk)
            {
                h_state.inWalkZone = true;
            }
            else
            {
                h_state.inWalkZone = false;
            }
        }