summaryrefslogtreecommitdiff
path: root/GameCode/PerkManager.cs
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-05-19 16:05:01 +0800
committerchai <215380520@qq.com>2024-05-19 16:05:01 +0800
commitc5f145786f4c6d2fe4bea831dfc16e52228920a5 (patch)
treea6ead7ea8266c767d58ed0f816dcd7a1dd75bd65 /GameCode/PerkManager.cs
parent48b64e573a1709dc923cb9162b55be0246b3ff63 (diff)
* move
Diffstat (limited to 'GameCode/PerkManager.cs')
-rw-r--r--GameCode/PerkManager.cs193
1 files changed, 0 insertions, 193 deletions
diff --git a/GameCode/PerkManager.cs b/GameCode/PerkManager.cs
deleted file mode 100644
index 540b858..0000000
--- a/GameCode/PerkManager.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-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);
- }
- }
- }
-}