public static void DropThingsNear(IntVec3 dropCenter, IEnumerable <Thing> things, int openDelay = 110, bool canInstaDropDuringInit = true, bool leaveSlag = false, bool canRoofPunch = true) { foreach (Thing current in things) { List <Thing> list = new List <Thing>(); list.Add(current); DropPodUtility.tempList.Add(list); } DropPodUtility.DropThingGroupsNear(dropCenter, DropPodUtility.tempList, openDelay, canInstaDropDuringInit, leaveSlag, canRoofPunch); DropPodUtility.tempList.Clear(); }
public override void Generate() { foreach (Pawn current in MapInitData.colonists) { current.SetFactionDirect(Faction.OfColony); PawnComponentsUtility.AddAndRemoveDynamicComponents(current, false); current.needs.mood.thoughts.TryGainThought(ThoughtDefOf.NewColonyOptimism); foreach (Pawn current2 in MapInitData.colonists) { if (current2 != current) { DamageDef def; def = DamageDefOf.Blunt; Thought_SocialMemory thought_SocialMemory = (Thought_SocialMemory)ThoughtMaker.MakeThought(ThoughtDefOf.CrashedTogether); thought_SocialMemory.SetOtherPawn(current2); current.needs.mood.thoughts.TryGainThought(thought_SocialMemory); current2.TakeDamage(new DamageInfo(def, 1)); } } } Genstep_Colonists.CreateInitialWorkSettings(); bool startedDirectInEditor = MapInitData.StartedDirectInEditor; List <List <Thing> > list = new List <List <Thing> >(); foreach (Pawn current3 in MapInitData.colonists) { if (MapInitData.startedFromEntry && Rand.Value < 0.5f) { current3.health.AddHediff(HediffDefOf.CryptosleepSickness, null, null); } List <Thing> list2 = new List <Thing>(); list2.Add(current3); Thing thing = ThingMaker.MakeThing(ThingDefOf.MealSurvivalPack, null); thing.stackCount = 10; list2.Add(thing); Thing thing2 = ThingMaker.MakeThing(ThingDefOf.Medicine, null); thing2.stackCount = 8; list2.Add(thing2); list.Add(list2); } List <Thing> list3 = new List <Thing> { ThingMaker.MakeThing(ThingDefOf.Gun_SurvivalRifle, null), ThingMaker.MakeThing(ThingDefOf.Gun_Pistol, null), ThingMaker.MakeThing(ThingDefOf.MeleeWeapon_Knife, ThingDefOf.Plasteel), Genstep_Colonists.GenerateRandomPet() }; int num = 0; foreach (Thing current4 in list3) { current4.SetFactionDirect(Faction.OfColony); list[num].Add(current4); num++; if (num >= list.Count) { num = 0; } } bool canInstaDropDuringInit = startedDirectInEditor; DropPodUtility.DropThingGroupsNear(MapGenerator.PlayerStartSpot, list, 110, canInstaDropDuringInit, true, true); }