public static bool Prefix(BlueprintCharacterClass characterClass, BlueprintCharacterClass[] additionalClasses, UnitDescriptor unit, BlueprintArchetype[] archetypeList, ref int __result)
 {
     try
     {
         if (currentFact == null || characterClass != Helpers.sorcererClass)
         {
             return(true);
         }
         var level = unit.Get <UnitPartBloodline>()?.CalcLevel(currentFact.Blueprint);
         if (level.HasValue)
         {
             Log.Write($"ReplaceCasterLevelOfAbility: modify level of {currentFact.Name}: {level}");
             __result = level.Value;
             return(false);
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
     return(true);
 }
 public static void Apply_NoStatsAndHitPoints(this ApplyClassMechanics instance, LevelUpState state, UnitDescriptor unit)
 {
     if (state.SelectedClass != null)
     {
         ClassData classData = unit.Progression.GetClassData(state.SelectedClass);
         if (classData != null)
         {
             //GetMethodDel<ApplyClassMechanics, Action<ApplyClassMechanics, LevelUpState, ClassData, UnitDescriptor>>
             //    ("ApplyBaseStats")(null, state, classData, unit);
             //GetMethodDel<ApplyClassMechanics, Action<ApplyClassMechanics, LevelUpState, ClassData, UnitDescriptor>>
             //    ("ApplyHitPoints")(null, state, classData, unit);
             GetMethodDel <ApplyClassMechanics, Action <ApplyClassMechanics, ClassData, UnitDescriptor> >
                 ("ApplyClassSkills")(null, classData, unit);
             GetMethodDel <ApplyClassMechanics, Action <ApplyClassMechanics, LevelUpState, UnitDescriptor> >
                 ("ApplyProgressions")(null, state, unit);
         }
     }
 }
Exemplo n.º 3
0
 public static bool isValidShareSpellTarget(UnitEntityData target, UnitDescriptor caster)
 {
     return(caster.Pet == target && caster.HasFact(ac_share_spell) ||
            caster.Unit == target ||
            caster.HasFact(share_spells_feat) && target.Descriptor.HasFact(bonded_mind_feat));
 }