public void InitHelperPanels(bool set) { // Debug.Log($"Init helper panels {gameObject.name} {set}\n"); if (!set) { if (rune_buttons != null) { rune_buttons.gameObject.SetActive(false); } if (firearm && firearm.ammo_panel) { firearm.ammo_panel.gameObject.SetActive(false); } return; } if (stats.ammo != -1) { firearm.setAmmo((int)(Mathf.Max(1, stats.ammo) * (1f + StaticRune.GetTimeBonus(rune.runetype, rune.toy_type)))); firearm.InitAmmoPanel(); } else { InitRuneButtons(); } }
public void UpdateStats() { // Debug.Log("Updating stats " + stats.Length + "\n"); int actives = 0; int special_actives = 0; if (stats == null) { return; } for (int i = 0; i < stats.Length; i++) { bool special = Get.isSpecial(stats[i].effect_type); stats[i].checkFinisher(); if (stats[i].active && special) { special_actives++; } if (stats[i].active && !special) { actives++; } } int my_i = 0; int my_special_i = 0; StatBit[] my_stats = new StatBit[actives]; StatBit[] my_special_stats = new StatBit[special_actives]; float current_time_bonus = StaticRune.GetTimeBonus(runetype, toy_type); for (int i = 0; i < stats.Length; i++) { stats[i].setModifier(current_time_bonus, distance_bonus); if (!stats[i].active) { continue; } bool special = Get.isSpecial(stats[i].effect_type); if (special) { my_special_stats[my_special_i] = stats[i]; my_special_i++; } else { my_stats[my_i] = stats[i]; my_i++; } } stat_sum = new StatSum(level, xp, my_stats, runetype); special_stat_sum = new StatSum(level, xp, my_special_stats, runetype); }
public void UpdateTimeOfDay() { float current_time_bonus = StaticRune.GetTimeBonus(runetype, toy_type); if (stats == null) { return; } for (int i = 0; i < stats.Length; i++) { //if (!stats[i].active) continue; stats[i].setModifier(current_time_bonus, distance_bonus); } }
void SetTimeBonus(TimeName name) { if (time_bonus == null) { return; } if (StaticRune.GetTimeBonus(parent.rune.runetype, parent.rune.toy_type) > 0) { time_bonus.gameObject.SetActive(false); } else { time_bonus.gameObject.SetActive(false); } }