public static void GiveFeat(UnitDescriptor unit, string Guid, WeaponCategory category)
        {
            BlueprintFeature feature = Kingmaker.Cheats.Utilities.GetBlueprintByGuid <BlueprintFeature>(Guid);
            FeatureParam     param   = new FeatureParam(new WeaponCategory?(category));

            if (unit.GetFeature(feature, param) == null)
            {
                unit.AddFact(Kingmaker.Cheats.Utilities.GetBlueprintByGuid <BlueprintFeature>(Guid), null, param);
            }
        }
Beispiel #2
0
 protected virtual bool CanSelect(UnitDescriptor unit, FeatureParam param) => true;
 static private Kingmaker.UnitLogic.Feature maybeAddFact(UnitDescriptor descriptor, BlueprintUnitFact feature, MechanicsContext context, FeatureParam param)
 {
     if (descriptor.Progression.Features.Enumerable.Where <Kingmaker.UnitLogic.Feature>(p => p.Blueprint == feature).Any(a => a.Param == param))
     {
         return(null);
     }
     return(descriptor.AddFact <Kingmaker.UnitLogic.Feature>(feature, context, param));
 }
Beispiel #4
0
 protected override bool CanSelect(UnitDescriptor unit, FeatureParam param)
 {
     // TODO: this doesn't seem to work.
     return(!CheckNotKnown || !unit.GetSpellbook(SpellcasterClass).IsKnown(param.Blueprint as BlueprintAbility));
 }