public void AddExp(int expGain) { exp += expGain; while (exp >= needExp) { exp -= needExp; AddLevel(); } onStatsChanged.Invoke(); }
public void IncreaseLevel() { spiritualLevel += 1; maxHealth += healthIncrease; maxEnergy += energyIncrease; currentEnergy = maxEnergy; currentHealth = maxHealth; if (onStatsChangedCallback != null) { onStatsChangedCallback.Invoke(); } }
public void Recruit(Villager villager) { Villagers.Add(villager); m_VillagerGraphics.Spawn(); UpdateStats(); OnStatsChanged?.Invoke(); }
private void SubscribeChange() { if (onStatsChangedCallback != null) { onStatsChangedCallback.Invoke(); } }
public void Invoke_StatsChanged() { OnStatsChanged?.Invoke(); #if UNITY_WEBGL PlayerPrefs.SetFloat("baseProgrammingTap", baseProgrammingTap); PlayerPrefs.SetFloat("permanentProgrammingTapMultiplier", permanentProgrammingTapMultiplier); PlayerPrefs.SetFloat("baseArtisticTap", baseArtisticTap); PlayerPrefs.SetFloat("permanentArtisticTapMultiplier", permanentArtisticTapMultiplier); PlayerPrefs.SetFloat("baseSoundTap", baseSoundTap); PlayerPrefs.SetFloat("permanentSoundTapMultiplier", permanentSoundTapMultiplier); PlayerPrefs.SetFloat("baseGameDesignTap", baseGameDesignTap); PlayerPrefs.SetFloat("permanentGameDesignTapMultiplier", permanentGameDesignTapMultiplier); PlayerPrefs.SetFloat("baseProgrammingDPS", baseProgrammingDPS); PlayerPrefs.SetFloat("permanentProgrammingDPSMultiplier", permanentProgrammingDPSMultiplier); PlayerPrefs.SetFloat("baseArtisticDPS", baseArtisticDPS); PlayerPrefs.SetFloat("permanentArtisticDPSMultiplier", permanentArtisticDPSMultiplier); PlayerPrefs.SetFloat("baseSoundDPS", baseSoundDPS); PlayerPrefs.SetFloat("permanentSoundDPSMultiplier", permanentSoundDPSMultiplier); PlayerPrefs.SetFloat("baseGameDesignDPS", baseGameDesignDPS); PlayerPrefs.SetFloat("permanentGameDesignDPSMultiplier", permanentGameDesignDPSMultiplier); PlayerPrefs.SetFloat("studioProductivity", studioProductivity); PlayerPrefs.SetFloat("allTapsMultiplier", allTapsMultiplier); #endif }
public void Sacrifice(Villager villager) { SacrificesValues.Add(villager); Villagers.Remove(villager); m_VillagerGraphics.Despawn(); UpdateStats(); OnStatsChanged?.Invoke(); }
public void IncreaseHealth(int amount = 1) { currentHealth += amount; if (currentHealth > maxHealth) { currentHealth = maxHealth; } onStatsChangedCallback.Invoke(); }
public static Stats operator -(Stats stats1, Stats stats2) { Stats newStats = new Stats(); newStats.health = stats1.health - stats2.health; newStats.health = Mathf.Clamp(stats1.health - stats2.health, 0, newStats.maxHealth); newStats.resistance = stats1.resistance - stats2.resistance; newStats.damage = stats1.damage - stats2.damage; newStats.iceDamage = stats1.iceDamage - stats2.iceDamage; newStats.fireDamage = stats1.fireDamage - stats2.fireDamage; newStats.electricDamage = stats1.electricDamage - stats2.electricDamage; newStats.critMultiplier = stats1.critMultiplier - stats2.critMultiplier; newStats.critChance = stats1.critChance - stats2.critChance; newStats.dodgeChance = stats1.dodgeChance - stats2.dodgeChance; newStats.criticalSweetSpotDuration = stats1.criticalSweetSpotDuration - stats2.criticalSweetSpotDuration; OnStatsChanged?.Invoke(); return(newStats); }
public void SetStatAmount(UserStat.GameCategory statType, int statAmount) { GetSingleStat(statType).SetStatAmount(statAmount); OnStatsChanged?.Invoke(this, EventArgs.Empty); }
public static void StatsChanged() { // StatPanel.UpdateStats OnStatsChanged?.Invoke(); }