Exemplo n.º 1
0
 void Awake()
 {
     gun = GetComponentInChildren <Gun>();
 }
Exemplo n.º 2
0
        public void CharmUpdate(PlayerData data, HeroController controller)
        {
            if (furyParticle == null)
            {
                furyParticle = HollowPointPrefabs.SpawnObjectFromDictionary("FuryParticlePrefab", HeroController.instance.transform);
                furyParticle.SetActive(false);
            }

            if (furyBurst == null)
            {
                furyBurst = HollowPointPrefabs.SpawnObjectFromDictionary("FuryBurstPrefab", HeroController.instance.transform);
                furyBurst.SetActive(false);
            }

            Log("Charm Update Called");
            //Initialise stats
            currentEquippedGun = WeaponSwapAndStatHandler.instance.EquipWeapon();

            current_weapon                = currentEquippedGun.gunName;
            current_class                 = currentEquippedGun.gunSubClass;
            current_damagePerShot         = currentEquippedGun.damageBase;
            current_damagePerLevel        = currentEquippedGun.damageScale;
            current_energyGainOnHit       = currentEquippedGun.energyGainOnHit;
            current_bulletLifetime        = currentEquippedGun.bulletLifetime;
            current_boostMultiplier       = currentEquippedGun.boostMultiplier;
            current_bulletVelocity        = currentEquippedGun.bulletVelocity;
            current_fireRateCooldown      = currentEquippedGun.fireRate;
            current_soulCostPerShot       = currentEquippedGun.soulCostPerShot;
            current_heatPerShot           = currentEquippedGun.heatPerShot;
            current_soulGainedPerHit      = currentEquippedGun.soulGainOnHit;
            current_soulGainedPerKill     = currentEquippedGun.soulGainOnHit;
            current_soulRegenSpeed        = currentEquippedGun.soulRegenSpeed;
            current_minWeaponSpreadFactor = currentEquippedGun.minWeaponSpreadFactor;
            current_walkSpeed             = 3f;

            current_class = WeaponSwapAndStatHandler.instance.ChangeClass(current_class);

            if (pd_instance.equippedCharm_6) //Fury of the Fallen
            {
                current_soulGainedPerKill += 10;
                current_soulRegenSpeed    -= 0.10f;
                current_energyGainOnHit   *= 2;
            }

            if (pd_instance.equippedCharm_19) //Shaman Stone
            {
                current_fireRateCooldown *= 0.75f;
                current_heatPerShot      += 10;
            }

            if (pd_instance.equippedCharm_21) //Soul Eater
            {
                current_soulGainedPerKill     += 24;
                current_soulGainedPerHit      += 3;
                current_soulRegenSpeed        -= 0.015f;
                current_heatPerShot           += 15;
                current_minWeaponSpreadFactor += 3;
            }

            if (pd_instance.equippedCharm_25) //Strength
            {
                current_damagePerShot    += 3;
                current_damagePerLevel   += 2;
                current_fireRateCooldown *= 0.75f;
                current_heatPerShot      += 15f;
            }

            Log("currentFireCooldown " + current_fireRateCooldown);

            if (pd_instance.equippedCharm_28) //Shape of Unn
            {
                current_bulletVelocity        *= 1.2f;
                current_heatPerShot           -= 10;
                current_minWeaponSpreadFactor -= 3;
            }

            if (pd_instance.equippedCharm_27) //Joni
            {
                current_soulRegenSpeed -= 0.033f;
            }

            //Dash Master
            if (pd_instance.equippedCharm_31)
            {
                current_boostMultiplier *= 1.35f;
            }

            //Spell Twister
            if (pd_instance.equippedCharm_33)
            {
                current_soulCostPerShot = (int)(current_soulCostPerShot * 0.75f);
            }


            if (pd_instance.equippedCharm_7)
            {
                current_energyGainOnHit = (int)(current_energyGainOnHit * 1.5f);
            }
            current_energyRequirement = (pd_instance.equippedCharm_34) ? 140 : 100;   //Deep Focus
            current_energyPenalty     = (pd_instance.equippedCharm_23) ? 0.7f : 0.5f; // Fragile Heart

            if (pd_instance.equippedCharm_24)                                         //Fragile Greed
            {
                current_soulGainedPerKill *= 3;
                current_soulGainedPerHit  *= 0;
                current_soulRegenTimer    *= 2f;
                current_fireRateCooldown  *= 0.80f;
            }

            recentlyKilledTimer = 0;
            hc_instance.NAIL_CHARGE_TIME_DEFAULT = 0.75f;

            //Charge Abilities
            adrenalineCharges      = 0;
            adrenalineEnergy       = 0;
            heal_ChargesDecayTimer = 0;
            adenalineCooldownTimer = 0;
            adrenalineOnCooldown   = false;

            fireModeIcon?.Invoke("hudicon_omni.png");
            adrenalineChargeIcons?.Invoke("0");
            nailArtIcon?.Invoke("true");

            PlayerData.instance.focusMP_amount = current_soulCostPerShot;

            //Minimum value setters, NOTE: soul cost doesnt like having it at 1 so i set it up as 2 minimum
            if (current_soulCostPerShot < 2)
            {
                current_soulCostPerShot = 2;
            }
            if (current_walkSpeed < 1)
            {
                current_walkSpeed = 1;
            }
            if (current_fireRateCooldown < 0.01f)
            {
                current_fireRateCooldown = 0.05f;
            }
            if (current_soulRegenSpeed < 0.01f)
            {
                current_soulRegenSpeed = 0.005f;
            }
            if (current_bulletVelocity > 80)
            {
                current_bulletVelocity = 80;
            }
            if (current_heatPerShot < 1)
            {
                current_heatPerShot = 1;
            }
            if (current_minWeaponSpreadFactor < 1)
            {
                current_minWeaponSpreadFactor = 1;
            }
        }