Пример #1
0
        // Token: 0x06000003 RID: 3 RVA: 0x000020B0 File Offset: 0x000002B0
        public override IEnumerable <Gizmo> GetGizmos()
        {
            SetUpCampSettings settings = LoadedModManager.GetMod <SetUpCamp>().GetSettings <SetUpCampSettings>();

            foreach (Gizmo g in base.GetGizmos())
            {
                yield return(g);

                g.disabledReason = null;
            }
            IEnumerator <Gizmo> enumerator = null;
            bool flag = this.HasMap && SetUpCampSettings.permanentCamps;

            if (flag)
            {
                yield return(new Command_Action
                {
                    defaultLabel = "Destroy Camp",
                    defaultDesc = "Destroy the camp if there's no colonists, tame animals or prisoners on the map.",
                    icon = SetUpCampTextures.CampCommandTexDelete,
                    action = delegate()
                    {
                        bool flag2 = !base.Map.mapPawns.AnyPawnBlockingMapRemoval;
                        if (flag2)
                        {
                            Find.WindowStack.Add(new Dialog_MessageBox("Are you sure you wish to destroy this camp? This is irreversible.", "Yes", delegate()
                            {
                                Messages.Message("Camp destroyed.", MessageTypeDefOf.PositiveEvent);
                                this.shouldBeDeleted = true;
                            }, "No", delegate()
                            {
                            }, "CONFIRM", false));
                        }
                        else
                        {
                            Messages.Message("Camp is still in use.", MessageTypeDefOf.RejectInput);
                            this.shouldBeDeleted = false;
                        }
                    }
                });
            }
            yield break;
        }
Пример #2
0
        // Token: 0x0600000A RID: 10 RVA: 0x0000218C File Offset: 0x0000038C
        public static void Camp(Caravan caravan)
        {
            SetUpCampSettings settings = LoadedModManager.GetMod <SetUpCamp>().GetSettings <SetUpCampSettings>();
            int   minSize = SetUpCampSettings.MinSize;
            int   maxSize = SetUpCampSettings.MaxSize;
            float num     = CaravanPawnsCountScore(caravan);
            int   num2    = Mathf.RoundToInt(num * 900f);
            int   num3    = new System.Random().Next(minSize, maxSize);
            float num4    = Mathf.Max(num * EnemyPointsPerCaravanPawnsScoreRange.RandomInRange, 45f);
            Pawn  pawn    = caravan.PawnsListForReading[0];

            tmpCaravanPawns.Clear();
            tmpCaravanPawns.AddRange(caravan.PawnsListForReading);
            Map map = CaravanIncidentUtility.GetOrGenerateMapForIncident(caravan, new IntVec3(num3, 1, num3), DefDatabase <WorldObjectDef> .GetNamed("CaravanCamp", true));

            MultipleCaravansCellFinder.FindStartingCellsFor2Groups(map, out IntVec3 playerStartingSpot, out IntVec3 intVec);
            CaravanEnterMapUtility.Enter(caravan, map, (Pawn x) => CellFinder.RandomSpawnCellForPawnNear(playerStartingSpot, map, 4), 0, true);
            tmpCaravanPawns.Clear();
            CameraJumper.TryJumpAndSelect(pawn);
            Find.TickManager.CurTimeSpeed = 0;
            Messages.Message("The caravan formed a camp.", MessageTypeDefOf.TaskCompletion);
        }
Пример #3
0
 // Token: 0x06000016 RID: 22 RVA: 0x0000250A File Offset: 0x0000070A
 public override void DoSettingsWindowContents(Rect inRect)
 {
     SetUpCampSettings.DoSettingsWindowContents(inRect);
 }