private static bool Prefix(BlueprintParametrizedFeatureWeaponTraining __instance, UnitDescriptor unit, LevelUpState state, FeatureSelectionState selectionState, IFeatureSelectionItem item, ref bool __result) { if (__instance.GetType() == typeof(BlueprintParametrizedFeatureWeaponTraining)) { if (item.Param.WeaponCategory != null && !AdvancedWeaponTraining._weaponTrainingToWeaponCategory[__instance.WeaponTraining].Contains((WeaponCategory)item.Param.WeaponCategory)) { __result = false; return(false); } } return(true); }
bool IFeatureSelection.CanSelect(UnitDescriptor unit, LevelUpState state, FeatureSelectionState selectionState, IFeatureSelectionItem item) { if (!item.Param.HasValue) { return(false); } if (HasNoSuchFeature) { var feat = item.Param.Value.Blueprint as BlueprintFeature; if (feat != null && unit.HasFact(feat)) { return(false); } } return(CanSelect(unit, item.Param.Value)); }
public bool SelectFeature([NotNull] FeatureSelectionState selection, [NotNull] IFeatureSelectionItem item) { return(this.AddAction(new SelectFeature(selection, item), false)); }