private LocationCharacter CreateLocationCharacter() { String actionSetCode = "as_human_villager_in_tavern"; UniqueTroopDescriptor uniqueNo = default(UniqueTroopDescriptor); LocationCharacter locationCharacter = new LocationCharacter(new AgentData(new PartyAgentOrigin(null, this._sneaker.CharacterObject, -1, uniqueNo, false)).Monster(Campaign.Current.HumanMonsterSettlement).NoHorses(false), SandBoxManager.Instance.AgentBehaviorManager.AddWandererBehaviors, "sms_npc_sneck", false, LocationCharacter.CharacterRelations.Friendly, actionSetCode, true, false, null, false, false, false); return(locationCharacter); }
public static bool Prefix(ref LocationCharacter __result, ref Location __instance) { Traverse traverse = HarmonyLib.Traverse.Create(__instance); List <LocationCharacter> _characterList = traverse.Field <List <LocationCharacter> >("_characterList").Value; if (null == _characterList) { __result = null; return(false); } return(true); }
public static bool Prefix(ref Location __instance, LocationCharacter character) { if (null == __instance || null == __instance.Name) { if (null != __instance) { Traverse traverse = HarmonyLib.Traverse.Create(__instance); CanUseDoor aiCanEnterDelegate = traverse.Field <CanUseDoor>("_aiCanEnterDelegate").Value; String aiCanEnter = traverse.Field <String>("_aiCanEnter").Value; if (null == aiCanEnterDelegate && null == aiCanEnter) { return(false); } } } return(true); }