summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/PerkManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Thronefall_v1.0/Decompile/PerkManager.cs')
-rw-r--r--Thronefall_v1.0/Decompile/PerkManager.cs193
1 files changed, 193 insertions, 0 deletions
diff --git a/Thronefall_v1.0/Decompile/PerkManager.cs b/Thronefall_v1.0/Decompile/PerkManager.cs
new file mode 100644
index 0000000..540b858
--- /dev/null
+++ b/Thronefall_v1.0/Decompile/PerkManager.cs
@@ -0,0 +1,193 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public class PerkManager : MonoBehaviour
+{
+ public const int MaxLevel = 1000000;
+
+ public static PerkManager instance;
+
+ [Header("Equippables: ")]
+ [SerializeField]
+ private List<Equippable> currentlyEquipped;
+
+ [SerializeField]
+ private List<Equippable> unlockedEquippables;
+
+ [Header("Leveling system: ")]
+ public int xp;
+
+ public int level = 1;
+
+ [SerializeField]
+ private List<MetaLevel> metaLevels;
+
+ public float heavyArmor_HpMultiplyer;
+
+ public float heavyArmor_SpeedMultiplyer;
+
+ public float godsLotion_RegenRateMultiplyer;
+
+ public float godsLotion_RegenDelayMultiplyer;
+
+ public float racingHorse_SpeedMultiplyer;
+
+ public float gladiatorSchool_TrainingSpeedMultiplyer;
+
+ public float elliteWarriors_TrainingSpeedMultiplyer;
+
+ public float tauntTheTiger_damageMultiplyer;
+
+ public Equippable tigerGodPerk;
+
+ public float tauntTheTurtle_hpMultiplyer;
+
+ public Equippable turtleGodPerk;
+
+ public float tauntTheFalcon_speedMultiplyer;
+
+ public float tauntTheFalcon_chasePlayerTimeMultiplyer;
+
+ public Equippable falconGodPerk;
+
+ public Equippable ratGodPerk;
+
+ public Equippable warriorMode;
+
+ public float warriorModeAllyDmgMulti = 0.5f;
+
+ public float warriorModeSelfDmgMultiMax = 2f;
+
+ public Equippable commanderMode;
+
+ public float commanderModeAllyDmgMulti = 1.5f;
+
+ public float commanderModeSelfDmgMulti = 0.5f;
+
+ public Equippable glassCanon;
+
+ public float glassCanon_dmgMulti = 1.5f;
+
+ public Equippable healintSpirits;
+
+ public float healingSpirits_healMulti = 1.5f;
+
+ public Equippable iceMagic;
+
+ public float iceMagic_AdditionalsSlowMutli = 0.75f;
+
+ public float iceMagic_SlowDurationMulti = 2f;
+
+ public Equippable rangedResistence;
+
+ public float rangedResistence_AmountMulti = 1.3f;
+
+ public Equippable meleeResistence;
+
+ public float meleeResistence_AmountMulti = 1.3f;
+
+ public float powerTower_attackSpeedBonus = 2f;
+
+ public Equippable treasureHunter;
+
+ public int treasureHunterGoldAmount = 40;
+
+ public Equippable cheeseGod;
+
+ public Equippable godOfDeath;
+
+ public float godOfDeath_playerRespawnMultiplyer = 2f;
+
+ public Equippable destructionGod;
+
+ public List<Equippable> UnlockedEquippables => unlockedEquippables;
+
+ public List<Equippable> CurrentlyEquipped => currentlyEquipped;
+
+ public List<MetaLevel> MetaLevels => metaLevels;
+
+ public MetaLevel NextMetaLevel
+ {
+ get
+ {
+ if (level - 1 >= metaLevels.Count || level >= 1000000)
+ {
+ return null;
+ }
+ return metaLevels[level - 1];
+ }
+ }
+
+ public bool WarriorModeActive => IsEquipped(warriorMode);
+
+ public bool CommanderModeActive => IsEquipped(commanderMode);
+
+ public bool GlassCanonActive => IsEquipped(glassCanon);
+
+ public bool HealingSpiritsActive => IsEquipped(healintSpirits);
+
+ public bool IceMagicActive => IsEquipped(iceMagic);
+
+ public bool RangedResistenceActive => IsEquipped(rangedResistence);
+
+ public bool MeleeResistenceActive => IsEquipped(meleeResistence);
+
+ public bool TreasureHunterActive => IsEquipped(treasureHunter);
+
+ public bool CheeseGodActive => IsEquipped(cheeseGod);
+
+ public bool GodOfDeathActive => IsEquipped(godOfDeath);
+
+ public bool DestructionGodActive => IsEquipped(destructionGod);
+
+ private void Awake()
+ {
+ if ((bool)instance)
+ {
+ Object.Destroy(base.gameObject);
+ return;
+ }
+ instance = this;
+ Object.DontDestroyOnLoad(base.transform.root.gameObject);
+ }
+
+ public static bool IsEquipped(Equippable _perk)
+ {
+ if (!instance)
+ {
+ return false;
+ }
+ return instance.currentlyEquipped.Contains(_perk);
+ }
+
+ public static void SetEquipped(Equippable _perk, bool _equipped)
+ {
+ if (!instance)
+ {
+ return;
+ }
+ if (_equipped)
+ {
+ if (!instance.currentlyEquipped.Contains(_perk))
+ {
+ instance.currentlyEquipped.Add(_perk);
+ }
+ }
+ else if (instance.currentlyEquipped.Contains(_perk))
+ {
+ instance.currentlyEquipped.Remove(_perk);
+ }
+ }
+
+ public void CallAfterLoadToUnlockPerksAndStuff()
+ {
+ level = Mathf.Min(level, 1000000);
+ for (int i = 0; i < Mathf.Min(metaLevels.Count, level - 1); i++)
+ {
+ if (!unlockedEquippables.Contains(metaLevels[i].reward) || metaLevels[i].reward.GetType() == typeof(PerkPoint))
+ {
+ unlockedEquippables.Add(metaLevels[i].reward);
+ }
+ }
+ }
+}