Beispiel #1
0
 public static void SetOrbBaseDamage(InventoryOrb orb)
 {
     if (OrbDamageLookup.TryGetValue((int)orb.OrbType, out int storedOrbDamage))
     {
         orb.BaseDamage = storedOrbDamage;
     }
 }
Beispiel #2
0
        internal static void AddOrb(this GameSave gameSave, EInventoryOrbType orbType, EOrbSlot orbSlot)
        {
            var orbCollection = gameSave.Inventory.OrbInventory.Inventory;
            var orbTypeKey    = (int)orbType;
            var newOrb        = new InventoryOrb(orbType);

            if (!orbCollection.ContainsKey(orbTypeKey))
            {
                orbCollection.Add(orbTypeKey, newOrb);
            }

            switch (orbSlot)
            {
            case EOrbSlot.Melee:
                gameSave.DataKeyBools[MeleeOrbPrefixKey + orbTypeKey] = true;
                break;

            case EOrbSlot.Spell:
                orbCollection[orbTypeKey].IsSpellUnlocked = true;
                break;

            case EOrbSlot.Passive:
                orbCollection[orbTypeKey].IsPassiveUnlocked = true;
                break;

            case EOrbSlot.All:
                gameSave.DataKeyBools.Add(MeleeOrbPrefixKey + orbTypeKey, true);
                orbCollection[orbTypeKey].IsSpellUnlocked   = true;
                orbCollection[orbTypeKey].IsPassiveUnlocked = true;
                break;
            }
        }
Beispiel #3
0
        public static void OverrideOrbNames(EInventoryOrbType orbType, string suffix)
        {
            var    Localizer       = TimeSpinnerGame.Localizer;
            string locKey          = $"inv_orb_{orbType}";
            string spellLocKey     = $"{locKey}_spell";
            string ringLocKey      = $"{locKey}_passive";
            string actualOrbName   = new InventoryOrb(orbType).Name;
            string actualSpellName = new InventoryOrb(orbType).AsDynamic().SpellName;
            string actualRingName  = new InventoryOrb(orbType).AsDynamic().PassiveName;

            if (!actualOrbName.EndsWith(suffix))
            {
                Localizer.OverrideKey(locKey, $"{actualOrbName} {suffix}");
            }
            if (!actualSpellName.EndsWith(suffix))
            {
                Localizer.OverrideKey(spellLocKey, $"{actualSpellName} {suffix}");
            }
            if (!actualRingName.EndsWith(suffix))
            {
                Localizer.OverrideKey(ringLocKey, $"{actualRingName} {suffix}");
            }
        }