public void CheckSettings() { this.DeactivateModifier(); var unit_part_favored_terrain = this.Owner.Master.Value?.Get <UnitPartFavoredTerrain>(); if (unit_part_favored_terrain == null) { return; } BlueprintArea current_area = Game.Instance.CurrentlyLoadedArea; if (current_area == null) { return; } foreach (var ft in unit_part_favored_terrain.Entries) { if (ft.Settings.Contains <LootSetting>(current_area.LootSetting)) { this.ActivateModifier(ft.Source.GetRank() * 2, ft.Source); break; } } }
public static void To(this BlueprintArea area) { var areaEnterPoints = BlueprintExensions.BlueprintsOfType <BlueprintAreaEnterPoint>(); var blueprint = areaEnterPoints.FirstOrDefault(bp => bp is BlueprintAreaEnterPoint ep && ep.Area == area); if (blueprint is BlueprintAreaEnterPoint enterPoint) { GameHelper.EnterToArea(enterPoint, AutoSaveMode.None); } }
static public void Load() { BlueprintUnit irovetti = library.Get <BlueprintUnit>("8b2cbf4590ed9e84591cd9a1f55bbdb8"); flagIsRisiaSpawned = Helpers.Create <BlueprintUnlockableFlag>(); library.AddAsset(flagIsRisiaSpawned, "942339abe7b76dfb00324d433a0a9342"); flagIsRisiaSpawned.Lock(); flagIsRisiaSpawned.name = "flagIsRisiaSpawned"; logger.Log("rua rua rua rua 1"); spawner = HelpersNeu.CreateSpawner(irovetti, "c47dab2a47b4826ed16201142956d607", new UnityEngine.Vector3(11.77268f, 1.241176f, 1.633618f), UnityEngine.Quaternion.identity, false, false, new List <BlueprintSummonPool>()); logger.Log("rua rua rua rua 2"); /*EntityReference spawnerIrovettiRef = new EntityReference { * UniqueId = "7d4ab0ca-92d9-4960-9225-c341558a47c8" //irovetti * }; * UnitSpawner spawnerIrovetti = spawnerIrovettiRef.FindView() as UnitSpawner; * spawner = UnityEngine.Object.Instantiate<UnitSpawner>(spawnerIrovetti); * spawner.transform.SetPositionAndRotation(new UnityEngine.Vector3(11.77268f, 1.241176f, 1.633618f), UnityEngine.Quaternion.identity); * spawner.UniqueId = "c47dab2a-47b4-826e-d162-01142956d607";*/ EntityReference spawnerRef = new EntityReference { UniqueId = spawner.UniqueId }; logger.Log("rua rua rua rua 3"); BlueprintArea ElkTemple = library.Get <BlueprintArea>("340a310b850e1ed469a60388012734f9"); logger.Log("rua rua rua rua 4"); AreaDidLoadTrigger compNeu = Helpers.Create <AreaDidLoadTrigger>(); compNeu.Conditions = new ConditionsChecker { Conditions = new Condition[] { /*Helpers.Create<FlagUnlocked>(a => { * a.ConditionFlag = flagIsRisiaSpawned; * a.Not = true; * })*/ } }; compNeu.Actions = new ActionList { Actions = new GameAction[] { Helpers.Create <Spawn>(a => { a.Spawners = new EntityReference[] { spawnerRef }; a.ActionsOnSpawn = new ActionList(); }), Helpers.Create <UnlockFlag>(a => a.flag = flagIsRisiaSpawned) } }; logger.Log("rua rua rua rua 5"); ElkTemple.AddComponent(compNeu); logger.Log("rua rua rua rua 6"); }
public void CheckSettings() { BlueprintArea currentlyLoadedArea = Game.Instance.CurrentlyLoadedArea; if (currentlyLoadedArea != null && ((IEnumerable <LootSetting>) this.Settings).Contains <LootSetting>(currentlyLoadedArea.LootSetting)) { this.ActivateModifier(); } else { this.DeactivateModifier(); } }
public static void mod_ShowRestUI() { if (!KingmakerPatchSettings.Game.RestAnywhere) { source_ShowRestUI(); return; } if (Kingmaker.Game.Instance.UnitGroupsController.Party.IsInCombat) { EventBus.RaiseEvent <IWarningNotificationUIHandler>(h => h.HandleWarning(WarningNotificationType.RestInCombatImpossible)); return; } BlueprintArea currentlyLoadedArea = Kingmaker.Game.Instance.CurrentlyLoadedArea; currentlyLoadedArea.CampingSettings.CampingAllowed = true; var component = currentlyLoadedArea.GetComponent <OverrideCampingAction>(); if (component) { component.OnRestActions.Run(); if (component.SkipRest) { return; } } if (Kingmaker.Game.Instance.IsModeActive(GameModeType.FullScreenUi)) { return; } if (Kingmaker.Game.Instance.IsModeActive(GameModeType.GlobalMap)) { if (!Kingmaker.Game.Instance.IsModeActive(GameModeType.Pause) && !Kingmaker.Game.Instance.IsModeActive(GameModeType.FullScreenUi)) { Kingmaker.Game.Instance.RestController.Start(null); } } else { Kingmaker.Game.Instance.ClickEventsController.SetPointerMode(PointerMode.RestMarker); } }
public static String CollationName(this BlueprintArea bp) { var typeName = bp.GetType().Name.Replace("Blueprint", ""); if (typeName == "Area") { return($"Area CR{bp.CR}"); } if (bp.IsGlobalMap) { return($"GlobalMap"); } if (bp.IsIndoor) { return("Indoor"); } return(typeName); }
static public void Load() { BlueprintArea templeElk = library.Get <BlueprintArea>("340a310b850e1ed469a60388012734f9"); BlueprintAreaPart.AdditionalDynamicEntry newDynamicSceneEntry = new BlueprintAreaPart.AdditionalDynamicEntry { Scene = new SceneReference("RisiaElkScene"), Condition = new ConditionsChecker { Conditions = new Condition[] { /*new FlagUnlocked { * ConditionFlag = library.Get<BlueprintUnlockableFlag>("eccd6891ce0466c4fbe09a55838b19ab"), * SpecifiedValues = (new int[]{1}).ToList<int>() * }*/ } }, AdditionalDataBank = "" }; BlueprintAreaPart.AdditionalDynamicEntry[] oldDynamicScenes = dynamicScenesGetter(templeElk) as BlueprintAreaPart.AdditionalDynamicEntry[]; var tmp = oldDynamicScenes.ToList(); tmp.Add(newDynamicSceneEntry); dynamicScenesSetter(templeElk, tmp.ToArray <BlueprintAreaPart.AdditionalDynamicEntry>()); }
public static void Postfix(BlueprintArea __instance, CameraMode __result) { Main.Log("hi"); __result = CameraMode.Default; }
static public void Load() { /*EntityReference spawnerIrovettiRef = new EntityReference { * UniqueId = "7d4ab0ca-92d9-4960-9225-c341558a47c8" //irovetti * }; * UnitSpawner spawnerIrovetti = spawnerIrovettiRef.FindView() as UnitSpawner; * spawner = UnityEngine.Object.Instantiate<UnitSpawner>(spawnerIrovetti); * spawner.transform.SetPositionAndRotation(new UnityEngine.Vector3(11.77268f, 1.241176f, 1.633618f), UnityEngine.Quaternion.identity); * spawner.UniqueId = "c47dab2a-47b4-826e-d162-01142956d607";*/ EntityReference spawnerRef = new EntityReference { UniqueId = consts.GUIDs["RisiaElkTempleSpawner_D"] }; EntityReference spawnerBossRef = new EntityReference { UniqueId = consts.GUIDs["RisiaBossElkTempleSpawner_D"] }; UnitFromSpawner risiaEval = Helpers.Create <UnitFromSpawner>(a => a.Spawner = spawnerRef); UnitFromSpawner risiaBossEval = Helpers.Create <UnitFromSpawner>(a => a.Spawner = spawnerBossRef); BlueprintArea ElkTemple = library.Get <BlueprintArea>("340a310b850e1ed469a60388012734f9"); var compNeu = Helpers.Create <AreaDidLoadTrigger>(); compNeu.Conditions = new ConditionsChecker { Conditions = new Condition[] { Helpers.Create <FlagUnlocked>(a => { a.ConditionFlag = flagIsRisiaSpawned; a.Not = true; }) } }; compNeu.Actions = new ActionList { Actions = new GameAction[] { Helpers.Create <ArcaneTide_ReplaceViewAction>(a => { a.dollData_key = "dolldata0"; a.unitEV = risiaEval; }), Helpers.Create <UnlockFlag>(a => a.flag = flagIsRisiaSpawned) } }; var compNeuBoss = Helpers.Create <AreaDidLoadTrigger>(); compNeuBoss.Conditions = new ConditionsChecker { Conditions = new Condition[] { Helpers.Create <FlagUnlocked>(a => { a.ConditionFlag = flagIsRisiaBossSpawned; a.Not = true; }) } }; compNeuBoss.Actions = new ActionList { Actions = new GameAction[] { Helpers.Create <ArcaneTide_ReplaceViewAction>(a => { a.dollData_key = "dolldata1"; a.unitEV = risiaBossEval; }), Helpers.Create <UnlockFlag>(a => a.flag = flagIsRisiaBossSpawned), Helpers.Create <SwitchToNeutral>(a => { a.Target = risiaBossEval; a.Faction = library.Get <BlueprintFaction>("72f240260881111468db610b6c37c099"); //Player Faction }) /*Helpers.Create<AddFact>(a => { * a.Fact = RisiaAddSpecialSpells.addSpecialSpellFeat; * a.Unit = risiaBossEval; * })*/ } }; ElkTemple.AddComponent(compNeu); ElkTemple.AddComponent(compNeuBoss); }