Esempio n. 1
0
        public IEnumerator SpreadShot(int pellets)
        {
            slowWalkDisableTimer = 15f;
            GameCameras.instance.cameraShakeFSM.SendEvent("SmallShake");
            HP_Sprites.StartGunAnims();
            HP_Sprites.StartFlash();
            HP_Sprites.StartMuzzleFlash(HP_DirectionHandler.finalDegreeDirection);
            PlayGunSounds("Shotgun");

            float direction = HP_DirectionHandler.finalDegreeDirection;

            for (int i = 0; i < pellets; i++)
            {
                yield return(new WaitForEndOfFrame());

                GameObject         bullet = HP_Prefabs.SpawnBullet(direction);
                HP_BulletBehaviour hpbb   = bullet.GetComponent <HP_BulletBehaviour>();
                hpbb.bulletDegreeDirection += UnityEngine.Random.Range(-20, 20);
                hpbb.pierce = PlayerData.instance.equippedCharm_13;
                bullet.transform.localScale = new Vector3(0.3f, 0.3f, 0.1f);

                Destroy(bullet, HP_Stats.bulletRange);
            }

            yield return(new WaitForSeconds(0.05f));

            isFiring = false;
        }
Esempio n. 2
0
        public IEnumerator BurstShot(int burst)
        {
            GameCameras.instance.cameraShakeFSM.SendEvent("EnemyKillShake");
            for (int i = 0; i < burst; i++)
            {
                HP_HeatHandler.IncreaseHeat(0.5f);

                GameObject bullet = HP_Prefabs.SpawnBullet(HP_DirectionHandler.finalDegreeDirection);
                PlayGunSounds("rifle");
                Destroy(bullet, .2f);

                HP_Sprites.StartGunAnims();
                HP_Sprites.StartFlash();
                HP_Sprites.StartMuzzleFlash(HP_DirectionHandler.finalDegreeDirection);
                yield return(new WaitForSeconds(0.12f)); //0.12f This yield will determine the time inbetween shots

                if (h_state.dashing || h_state.jumping)
                {
                    break;
                }
            }
            isFiring             = false;
            isBursting           = false;
            slowWalkDisableTimer = 4f * burst;
        }
Esempio n. 3
0
        public IEnumerator SingleShot()
        {
            HP_HeatHandler.IncreaseHeat(HP_Stats.heatPerShot);
            GameCameras.instance.cameraShakeFSM.SendEvent("EnemyKillShake");
            GameObject         bullet = HP_Prefabs.SpawnBullet(HP_DirectionHandler.finalDegreeDirection);
            HP_BulletBehaviour hpbb   = bullet.GetComponent <HP_BulletBehaviour>();

            hpbb.fm = FireModes.Single;

            //Charm 14 Steady Body
            hpbb.noDeviation = (PlayerData.instance.equippedCharm_14 && HeroController.instance.cState.onGround) ? true : false;
            //Charm 13 Mark of Pride gives perfect accuracy and pierce
            hpbb.perfectAccuracy = (PlayerData.instance.equippedCharm_13 && (HP_HeatHandler.currentHeat < 10)) ? true : false;
            hpbb.pierce          = PlayerData.instance.equippedCharm_13;

            //set the origin position of where the bullet was spawned
            hpbb.bulletOriginPosition = bullet.transform.position;

            Destroy(bullet, HP_Stats.bulletRange + 3f);

            HP_Sprites.StartGunAnims();
            HP_Sprites.StartFlash();
            HP_Sprites.StartMuzzleFlash(HP_DirectionHandler.finalDegreeDirection);

            slowWalkDisableTimer = 10f;

            string weaponType = PlayerData.instance.equippedCharm_13 ? "sniper" : "rifle";

            PlayGunSounds("sniper");
            if (weaponType == "sniper")
            {
                bullet.transform.localScale = new Vector3(1.8f, 1.8f, 0.1f);
            }

            yield return(new WaitForSeconds(0.02f));

            isFiring = false;
        }
Esempio n. 4
0
        public IEnumerator FireFlare()
        {
            airStrikeActive              = false;
            HP_Stats.currentPrimaryAmmo -= 1;
            HP_SpellControl.artifactActivatedEffect.SetActive(false);

            GameCameras.instance.cameraShakeFSM.SendEvent("EnemyKillShake");
            GameObject bullet = HP_Prefabs.SpawnBullet(HP_DirectionHandler.finalDegreeDirection);

            PlayGunSounds("flare");

            HP_BulletBehaviour bullet_behaviour = bullet.GetComponent <HP_BulletBehaviour>();

            bullet_behaviour.flareRound = true;

            HP_Sprites.StartGunAnims();
            HP_Sprites.StartFlash();
            HP_Sprites.StartMuzzleFlash(HP_DirectionHandler.finalDegreeDirection);

            yield return(new WaitForSeconds(0.04f));

            isFiring = false;
        }