예제 #1
0
        public OnyxInt GetSpellCastMaxNew(CharacterStats caster, CharacterClass spellClass, int spellLevel)
        {
            // Have to init this way because class initialization doesn't work
            if (!ConfigHasBeenInit)
            {
                ConfigHasBeenInit  = true;
                UseMod             = UserConfig.GetValueAsBool("SpellCastsPerLevel", "enableMod");
                BonusCastsPerLevel = UserConfig.GetValueAsInt("SpellCastsPerLevel", "BonusCastsPerLevel");
            }
            if (!UseMod)
            {
                return(orig_GetSpellCastMax(caster, spellClass, spellLevel));
            }

            OnyxInt onyxInt = OnyxInt.PositiveInfinity;

            if (caster != null && spellLevel >= 1)
            {
                onyxInt = this.SpellCastMaxLookup(spellClass, caster.GetClassPowerLevel(spellClass), spellLevel);
                if (onyxInt == -1)
                {
                    onyxInt = OnyxInt.PositiveInfinity;
                }
                if (onyxInt > 0)
                {
                    onyxInt += caster.GetBonusSpellCasts(spellClass, spellLevel) + BonusCastsPerLevel;
                }
            }
            return(onyxInt);
        }
예제 #2
0
 public void InitMods()
 {
     UseMod            = UserConfig.GetValueAsBool("ShipMoraleMod", "enableMod");
     MinimumMorale     = UserConfig.GetValueAsInt("ShipMoraleMod", "MinimumMorale");
     ConfigHasBeenInit = true;
 }