public override void PostMapGenerate(Map map) { foreach (var data in MapDefOfLocal.Camp.MapData) { if (data.key.Kind != null) { data.key.Kind = Faction.RandomPawnKind(); } } MapGeneratorHandler.GenerateMap(MapDefOfLocal.Camp, map, out savedPawns, fog: false, unFogRoom: true, spawnPawns: true, createRoof: true, forceFaction: Faction.OfPlayer); if (TryGetEnemyFaction(Faction, out Faction enemyFac)) { int @int = Rand.Int; IncidentParms raidParms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, map); raidParms.forced = true; raidParms.faction = enemyFac; raidParms.raidStrategy = RaidStrategyDefOf.ImmediateAttack; raidParms.raidArrivalMode = PawnsArrivalModeDefOf.EdgeWalkIn; raidParms.points = Rand.Range(400, 1000); raidParms.pawnGroupMakerSeed = @int; var incident = new FiringIncident(IncidentDefOf.RaidEnemy, null, raidParms); Find.Storyteller.TryFire(incident); } }
public override void PostMapGenerate(Map map) { base.PostMapGenerate(map); MapGeneratorHandler.GenerateMap(MapGenerator, map, out List <Pawn> pawns, false, true, true, false, true, true, true, Faction); UnlimitedTime = true; }
private void DoEnter(bool first) { if (first) { generator = MapGenDefGetter; IntVec3 mapSize = new IntVec3(generator.size.x, 1, generator.size.z); mapHolder = (RandomPlaceWorldObject)WorldObjectMaker.MakeWorldObject(WorldObjectsDefOfLocal.RandomPlace); mapHolder.Tile = parent.Tile; Find.WorldObjects.Add(mapHolder); PreMapGenerate(mapHolder); Map map = null; LongEventHandler.QueueLongEvent(delegate { map = Verse.MapGenerator.GenerateMap(mapSize, mapHolder, MapGeneratorDefOfLocal.EmptyMap); LongEventHandler.ExecuteWhenFinished(delegate { PostMapGenerate(map, mapHolder); MapGeneratorHandler.GenerateMap(generator, map, out List <Pawn> pawns, ClearMap, SetTerrain, Fog, UnFogRooms, SpawnPawns, CreateRoof, GeneratePlants, forceFaction, forceLord, BreakdownBuildings); var things = GenRadial.RadialDistinctThingsAround(parent.Position, parent.Map, CollectThingsRadius, false).Where(x => x.Faction == Faction.OfPlayer); foreach (var t in things) { t.DeSpawn(); GenSpawn.Spawn(t, generator.PawnsSpawnPos, map); } PostMapDefGenerate(map, mapHolder); if (OneUse) { parent.Destroy(); } }); }, "GeneratingMapForNewEncounter", doAsynchronously: false, null); } else { var things = GenRadial.RadialDistinctThingsAround(parent.Position, parent.Map, CollectThingsRadius, false).Where(x => x.Faction == Faction.OfPlayer); foreach (var t in things) { t.DeSpawn(); GenSpawn.Spawn(t, generator.PawnsSpawnPos, mapHolder.Map); } } }
public override void DoWindowContents(Rect inRect) { int size = defSize * 25; Text.Font = GameFont.Small; if (Widgets.RadioButtonLabeled(new Rect(0, 0, 170, 20), "Fog", Fog)) { Fog = !Fog; } if (Widgets.RadioButtonLabeled(new Rect(0, 40, 170, 20), "UnFogRooms", RoomFog)) { RoomFog = !RoomFog; } if (Widgets.RadioButtonLabeled(new Rect(0, 80, 170, 20), "Set Terrain", Terrain)) { Terrain = !Terrain; } if (Widgets.RadioButtonLabeled(new Rect(0, 110, 170, 20), "Spawn pawns", Pawns)) { Pawns = !Pawns; } if (Widgets.RadioButtonLabeled(new Rect(0, 140, 170, 20), "Spawn roof", Roof)) { Roof = !Roof; } if (Widgets.RadioButtonLabeled(new Rect(0, 170, 170, 20), "Generate plants", GeneratePlants)) { GeneratePlants = !GeneratePlants; } int y = 0; Rect scrollRectFact = new Rect(0, 200, 190, 200); Rect scrollVertRectFact = new Rect(0, 0, scrollRectFact.x, size); Widgets.BeginScrollView(scrollRectFact, ref scrollPosition, scrollVertRectFact); foreach (var def in DefDatabase <MapGeneratorBlueprints.MapGenerator.MapGeneratorDef> .AllDefs) { if (Widgets.ButtonText(new Rect(0, y, 170, 20), def.defName)) { MapGeneratorHandler.GenerateMap(def, Find.CurrentMap, out List <Pawn> spawnedPawns, true, Terrain, Fog, RoomFog, Pawns, Roof, GeneratePlants, Find.FactionManager.RandomEnemyFaction()); } y += 22; } Widgets.EndScrollView(); }
public override void PostMapGenerate() { base.PostMapGenerate(); LordJob_DefendBase lordJob_DefendBase = new LordJob_DefendBase(Faction, new IntVec3(56, 0, 55)); Lord lord = LordMaker.MakeNewLord(Faction, lordJob_DefendBase, Map); MapGeneratorHandler.GenerateMap(MapDefOfLocal.ConcantrationCamp, Map, out List <Pawn> pawns, true, true, true, false, true, true, true, Faction, lord); GeneratePrisoners(); Find.LetterStack.ReceiveLetter("ConcantrationCampTitle".Translate(), "ConcantrationCamp".Translate(), LetterDefOf.NeutralEvent); }
public override void PostMapGenerate() { base.PostMapGenerate(); MapGeneratorHandler.GenerateMap(MapGenerator, Map, out List <Pawn> pawns, false, true, true, false, true, true, true, Faction); int startCaravans = Rand.Range(2, 5); for (int i = 0; i < startCaravans; i++) { SendNewCaravan(); } }
public override void PostMapGenerate() { base.PostMapGenerate(); if (RandomPlaceDef != null) { List <Pawn> pawns = null; if (RandomPlaceDef.Map != null) { MapGeneratorHandler.GenerateMap(RandomPlaceDef.Map, Map, out pawns, true, true, true, false, true, true, true, Faction, RandomPlaceDef.ExtraLord?.GetLord(Faction, Map), RandomPlaceDef.RefuelGenerators); } RandomPlaceDef.Worker?.PostMapGenerate(Map, pawns); } }
public override void PostMapGenerate(Map map) { base.PostMapGenerate(map); MapGeneratorHandler.GenerateMap(mapGeneratorDef, map, out List <Pawn> pawns, false, true, true, false, true, true, true, GssRaids.GssFaction); Informator = PawnGenerator.GeneratePawn(PawnKindDefOf.AncientSoldier); GenSpawn.Spawn(Informator, mapGeneratorDef.PawnsSpawnPos, map); Visited = true; UnlimitedTime = true; ShowInfo(); }
public override void PostMapGenerate() { base.PostMapGenerate(); foreach (var cell in Map.AllCells) { Map.terrainGrid.SetTerrain(cell, TerrainDefOf.Soil); } MapGeneratorHandler.GenerateMap(MapDefOfLocal.Doomsday, Map, out List <Pawn> pawns, true, true, true, false, true, true, true, Faction); IntVec3 spawnPos = new IntVec3(126, 0, 163); Thing thing = ThingMaker.MakeThing(ThingDefOfLocal.DoomsdayUltimateBomb); thing.SetFaction(Faction); Weapon = (Building_DoomsdayGun)GenSpawn.Spawn(thing, spawnPos, Map); ShowHelp(); }
public override void PostMapGenerate(Map map) { base.PostMapGenerate(map); MapGeneratorHandler.GenerateMap(MapDefOfLocal.BaseX1, map, out List <Pawn> pawns, true, true, true, false, true, true, true, Find.FactionManager.FirstFactionOfDef(MoreEvents.FactionDefOfLocal.Pirate)); var mutantsFaction = Find.FactionManager.FirstFactionOfDef(MoreEvents.FactionDefOfLocal.Mutants); if (mutantsFaction == null) { Log.Warning("Mutants is null."); } foreach (var p in pawns) { if (p.RaceProps.Animal) { p.GetLord()?.Notify_PawnLost(p, PawnLostCondition.Undefined, null); p.SetFaction(mutantsFaction); LordJob_AnimalDefendPointAggresive lordJob = new LordJob_AnimalDefendPointAggresive(p.Faction, p.Position); Lord lord = LordMaker.MakeNewLord(p.Faction, lordJob, map); lord.numPawnsLostViolently = int.MaxValue; lord.AddPawn(p); } } DiaNode node = new DiaNode("Quest_Laboratory_Info1".Translate()); DiaOption option = new DiaOption("OK"); node.options.Add(option); option.resolveTree = true; var dialog = new Dialog_NodeTree(node); Find.WindowStack.Add(dialog); UnlimitedTime = true; DoDestroyDestroyable(); }
public override void PostMapGenerate(Map map) { base.PostMapGenerate(map); DefDatabase <MapGeneratorBlueprints.MapGenerator.MapGeneratorDef> .AllDefsListForReading.Where(gen => gen.targetTags != null && gen.targetTags.Contains(MapGenerator)).TryRandomElementByWeight(w => w.Commonality, out MapGeneratorBlueprints.MapGenerator.MapGeneratorDef result); Lord defendLord = LordMaker.MakeNewLord(TargetPawn.Faction, new LordJob_DefendPawn(TargetPawn), map); defendLord.numPawnsLostViolently = int.MaxValue; MapGeneratorHandler.GenerateMap(result, map, out List <Pawn> pawns, true, true, true, false, true, true, true, TargetPawn.Faction, defendLord); TargetPawn = (Pawn)GenSpawn.Spawn(TargetPawn, pawns.RandomElement().Position, map); Lord leaderLord = LordMaker.MakeNewLord(TargetPawn.Faction, new LordJob_DefendPoint(TargetPawn.Position), map); leaderLord.AddPawn(TargetPawn); UnlimitedTime = true; Site.RemoveAfterLeave = false; Site.RemoveIfAllDie = true; }