Example #1
0
        //For steel rains that tracks targets
        public static IEnumerator StartSteelRain(GameObject enemyGO, int totalShells)
        {
            HP_UIHandler.UpdateDisplay();
            //Modding.Logger.Log("SPELL CONTROL STEEL RAIN TRACK");
            Transform targetCoordinates = enemyGO.transform;
            Vector3   enemyPos          = targetCoordinates.position;


            for (int shells = 0; shells < totalShells; shells++)
            {
                yield return(new WaitForSeconds(0.45f));

                if ((enemyGO != null) || (targetCoordinates != null))
                {
                    enemyPos = targetCoordinates.position;
                }

                GameObject         shell = Instantiate(HP_Prefabs.bulletPrefab, enemyPos + new Vector3(Range(-5, 5), Range(25, 50), -0.1f), new Quaternion(0, 0, 0, 0));
                HP_BulletBehaviour hpbb  = shell.GetComponent <HP_BulletBehaviour>();
                hpbb.isFireSupportBullet = true;
                hpbb.ignoreCollisions    = true;
                hpbb.targetDestination   = enemyPos + new Vector3(0, Range(2, 8), -0.1f);
                shell.SetActive(true);

                yield return(new WaitForSeconds(0.5f));
            }
        }
Example #2
0
        //========================================FIRE SUPPORT SPAWN METHODS====================================

        //Regular steel rain (non tracking)
        public static IEnumerator StartSteelRainNoTrack(Vector3 targetCoordinates, int totalShells)
        {
            HP_UIHandler.UpdateDisplay();
            Modding.Logger.Log("SPELL CONTROL STEEL RAIN NO TRACKING");
            for (int shells = 0; shells < totalShells; shells++)
            {
                yield return(new WaitForSeconds(0.45f));

                GameObject         shell = Instantiate(HP_Prefabs.bulletPrefab, targetCoordinates + new Vector3(Range(-5, 5), Range(25, 50), -0.1f), new Quaternion(0, 0, 0, 0));
                HP_BulletBehaviour hpbb  = shell.GetComponent <HP_BulletBehaviour>();
                hpbb.isFireSupportBullet = true;
                hpbb.ignoreCollisions    = true;
                hpbb.targetDestination   = targetCoordinates + new Vector3(0, Range(2, 8), -0.1f);
                shell.SetActive(true);
                yield return(new WaitForSeconds(0.5f));
            }
        }
Example #3
0
        public void CharmUpdate(PlayerData data, HeroController controller)
        {
            Log("Charm Update Called");
            HP_AttackHandler.airStrikeActive = false;
            bulletSprite = "";

            //Default Dash speeds
            default_dash_cooldown       = 0.6f;
            default_dash_cooldown_charm = 0.4f;
            default_dash_speed          = 20f;
            default_dash_speed_sharp    = 28f;
            default_dash_time           = 0.25f;
            default_gravity             = 0.79f;

            //Initialise stats
            currentPrimaryAmmo = 10;
            bulletRange        = .20f + (PlayerData.instance.nailSmithUpgrades * 0.02f);
            bulletVelocity     = 44f;
            burstSoulCost      = 1;
            fireRateCooldown   = 12.5f;
            fireSoulCost       = 5;
            grenadeAmnt        = 2 + (int)(Math.Floor((float)(PlayerData.instance.nailSmithUpgrades + 1) / 2));
            heatPerShot        = 1f;
            max_soul_regen     = 25;
            soulGained         = 2;
            soulConsumed       = 0;
            soulRegenTimer     = 2.75f;
            walkSpeed          = 3.5f;

            //Charm 3 Grubsong
            soulRegenTimer = (PlayerData.instance.equippedCharm_3) ? 1.25f : 2.75f;

            //Charm 6 Fury of the Fallen
            if (PlayerData.instance.equippedCharm_6)
            {
                walkSpeed        += 2f;
                soulRegenTimer   -= 1f;
                fireRateCooldown -= 0.4f;
            }

            //Charm 8 Lifeblood Heart
            currentPrimaryAmmo += (PlayerData.instance.equippedCharm_8)? 2 : 0;

            //Charm 11 Flukenest, add additional soul cost
            if (PlayerData.instance.equippedCharm_11)
            {
                heatPerShot      += 3f;
                fireSoulCost     += 7;
                fireRateCooldown += 6.5f;
                bulletRange      += -0.025f;
            }

            //Charm 13 Mark of Pride, increase range, increases heat, increases soul cost, decrease firing speed (SNIPER MODULE)
            if (PlayerData.instance.equippedCharm_13)
            {
                bulletRange      += 0.5f;
                bulletVelocity   += 15f;
                heatPerShot      -= 0.55f;
                fireSoulCost     += 5;
                fireRateCooldown += 3.75f;
                walkSpeed        += -1f;
            }
            //yeet

            //Charm 14 Steady Body
            //walkSpeed = (PlayerData.instance.equippedCharm_14) ? (walkSpeed) : walkSpeed;

            //Charm 16 Sharp Shadow and Fury of the fallen sprite changes
            bulletSprite = (PlayerData.instance.equippedCharm_16) ? "shadebullet.png" : bulletSprite;
            bulletSprite = (PlayerData.instance.equippedCharm_6) ? "furybullet.png" : bulletSprite;

            //Charm 18 Long Nail
            bulletVelocity += (PlayerData.instance.equippedCharm_18) ? 20f : 0;

            //Charm 19 Shaman Stone
            grenadeAmnt += (PlayerData.instance.equippedCharm_19) ? (PlayerData.instance.nailSmithUpgrades + 2) : 0;

            soulGained += (PlayerData.instance.equippedCharm_20) ? 1 : 0;

            //Charm 21 Soul Eater
            if (PlayerData.instance.equippedCharm_21)
            {
                fireSoulCost   -= 2;
                max_soul_regen += 10;
                soulGained     += 2;
            }

            //Charm 23 Fragile/Unbrekable Heart
            hasActivatedAdrenaline = (PlayerData.instance.equippedCharm_23) ? false : true;

            //Charm 25 Fragile Strength
            heatPerShot += (PlayerData.instance.equippedCharm_25) ? 0.25f : 0;

            //Charm 32 Quick Slash, increase firerate, decrease heat,
            if (PlayerData.instance.equippedCharm_32)
            {
                heatPerShot      += 0.3f;
                fireSoulCost     += 1;
                fireRateCooldown -= 2.5f;
                walkSpeed        += -2.25f;
            }

            //Charm 37 Sprint
            walkSpeed += 1.75f;

            //Charm 37 Sprintmaster

            //Minimum value setters, NOTE: soul cost doesnt like having it at 1 so i set it up as 2 minimum
            fireSoulCost     = (fireSoulCost < 2) ? 2 : fireSoulCost;
            walkSpeed        = (walkSpeed < 1) ? 1 : walkSpeed;
            fireRateCooldown = (fireRateCooldown < 1f)? 1f: fireRateCooldown;

            ShardAmountChanged?.Invoke(currentPrimaryAmmo);

            HP_UIHandler.UpdateDisplay();
        }
Example #4
0
        public static IEnumerator StartInfusion()
        {
            artifactActivatedEffect.SetActive(false);
            LoadAssets.sfxDictionary.TryGetValue("infusionsound.wav", out AudioClip ac);
            AudioSource aud = infusionSoundGO.GetComponent <AudioSource>();

            aud.PlayOneShot(ac);

            buff_duration = (PlayerData.instance.screamLevel > 1) ? 150f : 80f;

            //Charm 9 lifeblood core
            buff_duration += (PlayerData.instance.equippedCharm_9) ? 200f : 0;

            //Joni's Blessing

            /*
             * if (PlayerData.instance.equippedCharm_27)
             * {
             *  buff_duration = -40f;
             *  int mpCharge = PlayerData.instance.MPCharge;
             *  int grenadeAmount = (int)(mpCharge/15f);
             *
             *  HP_Stats.grenadeAmnt += grenadeAmount;
             *  HeroController.instance.TakeMP(mpCharge);
             * }
             */
            buffActive = true;

            HP_Stats.ReduceAmmunition();

            if (PlayerData.instance.equippedCharm_34)
            {
                buff_duration = -40f;
                HeroController.instance.AddHealth(4);
            }

            //To make sure the minimum buff duration is always at 30f
            buff_duration = (buff_duration < 30f) ? 30f : buff_duration;

            GameCameras.instance.cameraShakeFSM.SendEvent("BigShake");

            HP_UIHandler.UpdateDisplay();

            //Gives fancy effects to when you infuse yourself, should add a sound soon
            Instantiate(sharpFlash, HeroController.instance.transform).SetActive(true);
            Instantiate(focusBurstAnim, HeroController.instance.transform).SetActive(true);

            SpriteFlash knightFlash = HeroController.instance.GetAttr <SpriteFlash>("spriteFlash");

            knightFlash.flashBenchRest();

            GameObject artChargeEffect = Instantiate(HeroController.instance.artChargedEffect, HeroController.instance.transform.position, Quaternion.identity);

            artChargeEffect.SetActive(true);
            artChargeEffect.transform.SetParent(HeroController.instance.transform);
            Destroy(artChargeEffect, buff_duration / 10f);

            GameObject artChargeFlash = Instantiate(HeroController.instance.artChargedFlash, HeroController.instance.transform.position, Quaternion.identity);

            artChargeFlash.SetActive(true);
            artChargeFlash.transform.SetParent(HeroController.instance.transform);
            Destroy(artChargeFlash, 0.5f);

            GameObject dJumpFlash = Instantiate(HeroController.instance.dJumpFlashPrefab, HeroController.instance.transform.position, Quaternion.identity);

            dJumpFlash.SetActive(true);
            dJumpFlash.transform.SetParent(HeroController.instance.transform);
            Destroy(dJumpFlash, 0.5f);

            yield return(null);
        }