private static void GenerateMap() { MapParent mapParent = (MapParent)WorldObjectMaker.MakeWorldObject(WorldObjectDefOf.Settlement); mapParent.Tile = TileFinder.RandomStartingTile(); mapParent.SetFaction(Faction.OfPlayer); Find.WorldObjects.Add(mapParent); GetOrGenerateMapUtility.GetOrGenerateMap(mapParent.Tile, new IntVec3(50, 1, 50), null); }
public static void BeginArenaFight(List <PawnKindDef> lhs, List <PawnKindDef> rhs, Action <ArenaResult> callback) { MapParent mapParent = (MapParent)WorldObjectMaker.MakeWorldObject(WorldObjectDefOf.Debug_Arena); mapParent.Tile = TileFinder.RandomSettlementTileFor(Faction.OfPlayer, mustBeAutoChoosable: true, (int tile) => lhs.Concat(rhs).Any((PawnKindDef pawnkind) => Find.World.tileTemperatures.SeasonAndOutdoorTemperatureAcceptableFor(tile, pawnkind.race))); mapParent.SetFaction(Faction.OfPlayer); Find.WorldObjects.Add(mapParent); Map orGenerateMap = GetOrGenerateMapUtility.GetOrGenerateMap(mapParent.Tile, new IntVec3(50, 1, 50), null); MultipleCaravansCellFinder.FindStartingCellsFor2Groups(orGenerateMap, out IntVec3 first, out IntVec3 second); List <Pawn> lhs2 = SpawnPawnSet(orGenerateMap, lhs, first, Faction.OfAncients); List <Pawn> rhs2 = SpawnPawnSet(orGenerateMap, rhs, second, Faction.OfAncientsHostile); DebugArena component = mapParent.GetComponent <DebugArena>(); component.lhs = lhs2; component.rhs = rhs2; component.callback = callback; }
public static void BeginArenaFight(List <PawnKindDef> lhs, List <PawnKindDef> rhs, Action <ArenaResult> callback) { MapParent mapParent = (MapParent)WorldObjectMaker.MakeWorldObject(WorldObjectDefOf.Debug_Arena); mapParent.Tile = TileFinder.RandomFactionBaseTileFor(Faction.OfPlayer, true, (int tile) => lhs.Concat(rhs).Any((PawnKindDef pawnkind) => Find.World.tileTemperatures.SeasonAndOutdoorTemperatureAcceptableFor(tile, pawnkind.race))); mapParent.SetFaction(Faction.OfPlayer); Find.WorldObjects.Add(mapParent); Map orGenerateMap = GetOrGenerateMapUtility.GetOrGenerateMap(mapParent.Tile, new IntVec3(50, 1, 50), null); IntVec3 spot = default(IntVec3); IntVec3 spot2 = default(IntVec3); MultipleCaravansCellFinder.FindStartingCellsFor2Groups(orGenerateMap, out spot, out spot2); List <Pawn> lhs2 = ArenaUtility.SpawnPawnSet(orGenerateMap, lhs, spot, Faction.OfSpacer); List <Pawn> rhs2 = ArenaUtility.SpawnPawnSet(orGenerateMap, rhs, spot2, Faction.OfSpacerHostile); DebugArena component = ((WorldObject)mapParent).GetComponent <DebugArena>(); component.lhs = lhs2; component.rhs = rhs2; component.callback = callback; }
public static Map GetOrGenerateMap(int tile, WorldObjectDef suggestedMapParentDef) { return(GetOrGenerateMapUtility.GetOrGenerateMap(tile, Find.World.info.initialMapSize, suggestedMapParentDef)); }