Exemple #1
0
        public override bool IsPossible()
        {
            if (target is Map map)
            {
                map = target as Map;
            }
            else
            {
                return(false);
            }

            pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, Helper.AnyPlayerMap);
            if (pawn == null)
            {
                return(false);
            }

            IntVec3 intVec;

            if (!RCellFinder.TryFindPartySpot(pawn, out intVec))
            {
                return(false);
            }

            return(true);
        }
Exemple #2
0
        public static bool TryStartMassFuneral(Map map)
        {
            if (Utils.CurrentDay() == 7 || Utils.CurrentDay() == 14)
            {
                Pawn pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, map);

                if (pawn == null)
                {
                    return(false);
                }
                IntVec3 intVec;
                if (!RCellFinder.TryFindPartySpot(pawn, out intVec))
                {
                    return(false);
                }
                foreach (Pawn deadPawn in Resources.deadPawnsForMassFuneralBuried)
                {
                    if (deadPawn != null)
                    {
                        deadPawnsNames = deadPawnsNames + deadPawn.Label + "\n";
                    }
                }
                Lord lord = LordMaker.MakeNewLord(pawn.Faction, new LordJob_RimStory(Resources.lastGrave.Position, pawn), map, null);
                Find.LetterStack.ReceiveLetter("FuneralLetter".Translate(), "FuneralDesc".Translate() + deadPawnsNames, LetterDefOf.NeutralEvent, Resources.lastGrave);

                deadPawnsNames = "";
                return(true);
            }
            return(false);
        }
Exemple #3
0
        public override bool IsPossible()
        {
            pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, Helper.AnyPlayerMap);
            if (pawn == null)
            {
                return(false);
            }

            if (!RCellFinder.TryFindPartySpot(pawn, out intVec))
            {
                return(false);
            }

            return(true);
        }
Exemple #4
0
        public bool TryStartGathering(Map map)
        {
            Pawn pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, map);

            if (pawn == null)
            {
                Messages.Message("ElectionFail_ColonistsNotFound".Translate(), MessageSound.RejectInput);
                return(false);
            }

            lastElectionTick = Find.TickManager.TicksGame;
            allowElection    = false;
            LordMaker.MakeNewLord(pawn.Faction, new LordJob_Joinable_LeaderElection(Position), map, null);
            Find.LetterStack.ReceiveLetter("Election".Translate(), "ElectionGathering".Translate(), LetterDefOf.Good, new TargetInfo(Position, map, false), null);
            return(true);
        }
        public override void TryExecute()
        {
            Pawn pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, Helper.AnyPlayerMap);

            if (pawn == null)
            {
                return;
            }
            if (!RCellFinder.TryFindPartySpot(pawn, out IntVec3 intVec))
            {
                return;
            }
            Verse.AI.Group.LordMaker.MakeNewLord(pawn.Faction, new LordJob_Joinable_Party(intVec, pawn), Helper.AnyPlayerMap, null);
            string text = "LetterNewParty".Translate(pawn.LabelShort, pawn);

            Find.LetterStack.ReceiveLetter("LetterLabelNewParty".Translate(), text, LetterDefOf.PositiveEvent, new TargetInfo(intVec, Helper.AnyPlayerMap, false), null, null);
        }
Exemple #6
0
        public static bool TryStartGathering(Map map)
        {
            Pawn pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, map);

            if (pawn == null)
            {
                Messages.Message("ElectionFail_ColonistsNotFound".Translate(), MessageSound.RejectInput);
                return(false);
            }
            IntVec3 intVec;

            if (!RCellFinder.TryFindPartySpot(pawn, out intVec))
            {
                Messages.Message("Couldn't find a suitable safe spot for the election.", MessageSound.RejectInput);
                return(false);
            }
            LordMaker.MakeNewLord(pawn.Faction, new LordJob_Joinable_LeaderElection(intVec), map, null);
            Find.LetterStack.ReceiveLetter("Election".Translate(), "ElectionGathering".Translate(), LetterDefOf.Good, new TargetInfo(intVec, map, false), null);
            return(true);
        }
Exemple #7
0
        public bool TryStartEvent(Map map)
        {
            if (faction != null)
            {
                bool flag = true;
                foreach (int y in yearsWhenEventStarted)
                {
                    if (y == Utils.CurrentYear())
                    {
                        flag = false;
                    }
                }

                if (Utils.CurrentDay() == date.day && Utils.CurrentQuadrum() == date.quadrum && Utils.CurrentHour() >= Resources.minHour && Utils.CurrentHour() <= Resources.maxHour && Utils.CurrentYear() != date.year && flag)
                {
                    Pawn pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, map);
                    if (pawn == null)
                    {
                        return(false);
                    }
                    IntVec3 intVec;
                    if (!RCellFinder.TryFindPartySpot(pawn, out intVec))
                    {
                        return(false);
                    }

                    yearsWhenEventStarted.Add(Utils.CurrentYear());

                    yearsWhenEventStarted.Add(Utils.CurrentYear());
                    Lord lord = LordMaker.MakeNewLord(pawn.Faction, new LordJob_Joinable_Party(intVec, pawn), map, null);
                    //Find.LetterStack.ReceiveLetter("Day of "+faction.Name+" defeat", "Your colonists are celebrating " + faction.Name + "'s defeat on \n" + date, LetterDefOf.PositiveEvent);
                    Find.LetterStack.ReceiveLetter("DayOfVictory".Translate(faction.Name), "DayOfVictoryDesc".Translate(new object[] { faction.Name, date }), LetterDefOf.PositiveEvent);
                    return(true);
                }

                flag = true;
            }
            return(false);
        }
Exemple #8
0
        public bool TryStartEvent(Map map)
        {
            bool flag = true;

            foreach (int y in yearsWhenEventStarted)
            {
                if (y == Utils.CurrentYear())
                {
                    flag = false;
                }
            }


            if (Utils.CurrentDay() == date.day && Utils.CurrentQuadrum() == date.quadrum && Utils.CurrentHour() >= Resources.minHour && Utils.CurrentHour() <= Resources.maxHour && Utils.CurrentYear() != date.year && flag)
            {
                Pawn pawn = PartyUtility.FindRandomPartyOrganizer(Faction.OfPlayer, map);


                if (pawn == null)
                {
                    return(false);
                }
                IntVec3 intVec;
                if (!RCellFinder.TryFindPartySpot(pawn, out intVec))
                {
                    return(false);
                }

                yearsWhenEventStarted.Add(Utils.CurrentYear());
                Lord lord = LordMaker.MakeNewLord(pawn.Faction, new LordJob_Joinable_Party(intVec, pawn), map, null);
                //Find.LetterStack.ReceiveLetter("Memorial Day", "Colonist are gathering to honor fallen colonists.", LetterDefOf.PositiveEvent);
                Find.LetterStack.ReceiveLetter("AMemorialDayLetter".Translate(), "AMemorialDayDesc".Translate(), LetterDefOf.PositiveEvent);
                return(true);
            }

            flag = true;
            return(false);
        }