public static void GenerateOutpost(OG_OutpostData outpostDataParameter) { int mainRoomZoneAbs = 0; int mainRoomZoneOrd = 0; outpostData = outpostDataParameter; outpostData.triggerIntrusion = null; outpostData.outpostThingList = new List<Thing>(); // Clear the whole area, remove any roof and water. ClearAnythingInOutpostArea(); // Create the empty outpost allowed area. Area_Allowed outpostArea; Find.AreaManager.TryMakeNewAllowed(AllowedAreaMode.Humanlike, out outpostArea); outpostArea.SetLabel(OG_Util.OutpostAreaLabel); // Area cells are set in the Building_AreaGenerator to avoid an error at start-up. // Create the intrusion trigger. outpostData.triggerIntrusion = (TriggerIntrusion)ThingMaker.MakeThing(ThingDef.Named("TriggerIntrusion")); GetMainRoom4Zone(mainEntranceDirection, out mainRoomZoneAbs, out mainRoomZoneOrd); IntVec3 triggerIntrusionPosition = Zone.GetZoneOrigin(outpostData.areaSouthWestOrigin, mainRoomZoneAbs, mainRoomZoneOrd) + new IntVec3(5, 0, 5); GenSpawn.Spawn(outpostData.triggerIntrusion, triggerIntrusionPosition); GenerateOutpostLayout(); // Display the generated layout. /*for (int zoneOrd = 0; zoneOrd < verticalZonesNumber; zoneOrd++) { for (int zoneAbs = 0; zoneAbs < horizontalZonesNumber; zoneAbs++) { ZoneProperties zone = zoneMap[zoneOrd, zoneAbs]; Log.Message("Layout: zoneMap[" + zoneOrd + "," + zoneAbs + "] => " + zone.zoneType.ToString() + "," + zone.rotation.ToString() + "," + zone.linkedZoneRelativeRotation.ToString()); } }*/ GenerateOutpostZones(outpostData.areaSouthWestOrigin); GenerateSasToLinkMediumAndMainRooms(outpostData.areaSouthWestOrigin); // Generate laser fences. OG_LaserFence.GenerateLaserFence(zoneMap, ref outpostData); // All buildings have been spawned. Try to reconnect everything to the nearest net. ReconnectEverything(); // Generate battle remains. OG_WarfieldEffects.GenerateWarfieldEffects(zoneMap, horizontalZonesNumber, verticalZonesNumber, outpostData); // Damage outpost to reflect its history. OG_RuinEffects.GenerateRuinEffects(ref outpostData); // Generate some inhabitants. OG_Inhabitants.GenerateInhabitants(ref outpostData); // Spawn the no-roof area generator. SpawnAreaGenerator(outpostData.areaSouthWestOrigin); // Initialize command console data. outpostData.outpostThingList = OG_Util.RefreshThingList(outpostData.outpostThingList); commandConsole.outpostThingList = outpostData.outpostThingList.ListFullCopy<Thing>(); commandConsole.dropZoneCenter = outpostData.dropZoneCenter; // Initialize orbital relay data. orbitalRelay.InitializeLandingAndOutpostData(outpostData.landingPadCenter, outpostData.landingPadRotation, outpostData.areaSouthWestOrigin + new IntVec3(OG_BigOutpost.areaSideLength / 2, 0, OG_BigOutpost.areaSideLength / 2)); // Initialize intrusion trigger data. outpostData.triggerIntrusion.commandConsole = commandConsole; SendWelcomeLetter(outpostData); }
static void SendWelcomeLetter(OG_OutpostData outpostData) { string eventTitle = ""; string eventText = ""; LetterType letterType = LetterType.BadNonUrgent; int sectorCoordX = Find.Map.WorldCoords.x; int sectorCoordZ = Find.Map.WorldCoords.z; int rimLawNumber = Rand.RangeInclusive(25, 1350); if (outpostData.isMilitary) { eventTitle = "MiningCo. military outpost"; eventText = " MiningCo. warning message\n\n" + "Hello! I am Coralie, the AI in charge of outpost MIL-X" + sectorCoordX + ".Z" + sectorCoordZ + ".\n\n" + "My scanners detected the signature of your escape pods crashing nearby.\n\n" + "WARNING! You are entering an MiningCo. military sector. No activity is authorized here.\n\n" + "Please notice that anyone found in the sector will be shot on sight with regards to the RimLaw RL-" + rimLawNumber + ".\n\n" + "---- End of transmision ---"; letterType = LetterType.BadUrgent; } else { eventTitle = "MiningCo. civil outpost"; eventText = " MiningCo. information message\n\n" + "Hello! I am Coralie, the AI in charge of outpost CIV-X" + sectorCoordX + ".Z" + sectorCoordZ + ".\n\n" + "My scanners detected the signature of your escape pods crashing nearby.\n" + "My emotional analyzer tells me to be sorry for your ship and the people who most probably died within.\n\n" + "I remind you this sector is the legal property of MiningCo. However, the company generously grants you the right to pass through this sector.\n\n" + "Please notice that any intruder found inside the outpost perimeter will be shot on sight with regards to the RimLaw RL-" + rimLawNumber + ".\n\n" + "---- End of transmision ---"; letterType = LetterType.Good; } Find.LetterStack.ReceiveLetter(eventTitle, eventText, letterType); }