Esempio n. 1
0
            private static void Postfix(CharGenClassMartialStatsVM __instance, BlueprintCharacterClass valueClass, BlueprintArchetype valueArchetype, UnitDescriptor unit)
            {
                if (!settings.toggleMultiArchetype)
                {
                    return;
                }
                Mod.Debug("CharGenClassMartialStatsVM::Triggered");
                var controller = Game.Instance?.LevelUpController;

                if (controller == null)
                {
                    return;
                }
                var classData = controller.Preview?.Progression?.GetClassData(valueClass);

                if (classData == null)
                {
                    return;
                }
                Mod.Debug("Made it to override");
                __instance.Fortitude.Value = UIUtilityUnit.GetStatProgressionGrade(classData.FortitudeSave);
                __instance.Will.Value      = UIUtilityUnit.GetStatProgressionGrade(classData.WillSave);
                __instance.Reflex.Value    = UIUtilityUnit.GetStatProgressionGrade(classData.ReflexSave);
                __instance.BAB.Value       = UIUtilityUnit.GetStatProgressionGrade(classData.BaseAttackBonus);
            }
Esempio n. 2
0
            private static void Postfix(CharGenClassCasterStatsVM __instance, BlueprintCharacterClass valueClass, BlueprintArchetype valueArchetype)
            {
                if (!settings.toggleMultiArchetype)
                {
                    return;
                }
                var controller = Game.Instance?.LevelUpController;

                if (controller == null)
                {
                    return;
                }
                var classData = controller.Preview?.Progression?.GetClassData(valueClass);

                if (classData == null)
                {
                    return;
                }
                __instance.CanCast.Value = classData.Spellbook != null;
                if (classData.Spellbook == null)
                {
                    return;
                }
                var changeTypeArchetype = classData.Archetypes?.Where(a => a.ChangeCasterType).FirstOrDefault();

                __instance.MaxSpellsLevel.Value     = classData.Spellbook.MaxSpellLevel.ToString();
                __instance.CasterAbilityScore.Value = LocalizedTexts.Instance.Stats.GetText(classData.Spellbook.CastingAttribute);
                __instance.CasterMindType.Value     = ((changeTypeArchetype == null) ?
                                                       (UIUtilityUnit.GetCasterMindType(valueClass) ?? "—") : (UIUtilityUnit.GetCasterMindType(changeTypeArchetype) ?? "—"));
                __instance.SpellbookUseType.Value = UIUtilityUnit.GetCasterSpellbookUseType(classData.Spellbook);
            }
Esempio n. 3
0
        public static void RemoveAbility(this UnitEntityData ch, BlueprintAbility ability)
        {
            if (ability.IsSpell)
            {
                if (PartyEditor.IsOnPartyEditor() && PartyEditor.SelectedSpellbook.TryGetValue(ch.HashKey(), out var selectedSpellbook))
                {
                    if (UIUtilityUnit.SpellbookHasSpell(selectedSpellbook, ability))
                    {
                        selectedSpellbook.RemoveSpell(ability);
                        return;
                    }
                }
                foreach (var spellbook in ch.Spellbooks)
                {
                    if (UIUtilityUnit.SpellbookHasSpell(spellbook, ability))
                    {
                        spellbook.RemoveSpell(ability);
                    }
                }
            }
            var abilities = ch.Descriptor.Abilities;

            if (abilities.HasFact(ability))
            {
                abilities.RemoveFact(ability);
            }
        }
Esempio n. 4
0
 public static bool HasAbility(this UnitEntityData ch, BlueprintAbility ability)
 {
     if (ability.IsSpell)
     {
         if (PartyEditor.IsOnPartyEditor() && PartyEditor.SelectedSpellbook.TryGetValue(ch.HashKey(), out var selectedSpellbook))
         {
             return(UIUtilityUnit.SpellbookHasSpell(selectedSpellbook, ability));
         }
     }
     return(ch.Spellbooks.Any(spellbook => spellbook.IsKnown(ability)) || ch.Descriptor.Abilities.HasFact(ability));
 }
Esempio n. 5
0
        public static void RemoveAbility(this UnitEntityData ch, BlueprintAbility ability)
        {
            if (ability.IsSpell)
            {
                foreach (var spellbook in ch.Spellbooks)
                {
                    if (UIUtilityUnit.SpellbookHasSpell(spellbook, ability))
                    {
                        spellbook.RemoveSpell(ability);
                    }
                }
            }
            var abilities = ch.Descriptor.Abilities;

            if (abilities.HasFact(ability))
            {
                abilities.RemoveFact(ability);
            }
        }
Esempio n. 6
0
        static bool IsDeterminator(BlueprintFeature feat)
        {
            switch (UIUtilityUnit.GetFeatureGroup(feat))
            {
            case FeatureGroup.Domain:
            case FeatureGroup.SpecialistSchool:
            case FeatureGroup.OppositionSchool:
            case FeatureGroup.BloodLine:
            case FeatureGroup.MagusArcana:
            case FeatureGroup.EldritchScionArcana:
            case FeatureGroup.DraconicBloodlineSelection:
            case FeatureGroup.BlightDruidDomain:
            case FeatureGroup.ClericSecondaryDomain:
                return(true);

            default:
                return(false);
            }
        }