Esempio n. 1
0
        public override bool TryExecute(IncidentParms parms)
        {
            Map map = (Map)parms.target;

            if (!this.TryResolveParms(parms))
            {
                return(false);
            }

            Pawn pawn = PawnGenerator.GeneratePawn(DefOfs.C_PawnKindDefOf.IoM_WanderingTrader, parms.faction);

            if (pawn == null)
            {
                return(false);
            }
            IntVec3 loc;

            RCellFinder.TryFindRandomPawnEntryCell(out loc, map);
            GenSpawn.Spawn(pawn, loc, map);
            IntVec3 chillSpot;

            RCellFinder.TryFindRandomSpotJustOutsideColony(pawn, out chillSpot);
            LordJob_IntrusiveWanderer lordJob = new LordJob_IntrusiveWanderer(chillSpot, pawn, ChatType);
            Lord lord = LordMaker.MakeNewLord(parms.faction, lordJob, map);

            lord.AddPawn(pawn);
            this.TryConvertOnePawnToSmallTrader(pawn, parms.faction, map);
            string label = "LetterLabelSingleVisitorArrives".Translate();
            string text3 = "IoM_WandererArrives".Translate(new object[]
            {
                pawn.Name
            });

            text3 = text3.AdjustedFor(pawn);
            Find.LetterStack.ReceiveLetter(label, text3, LetterType.Good, pawn, null);
            return(true);
        }
Esempio n. 2
0
        public static void PerformPostChatActions(Pawn talker, Pawn talkee, IoMChatType chatType)
        {
            if (chatType != IoMChatType.ConvertTau)
            {
                Need_Soul talkerSoul = CorruptionStoryTrackerUtilities.GetPawnSoul(talker);
                Need_Soul talkeeSoul = CorruptionStoryTrackerUtilities.GetPawnSoul(talkee);

                if (talkerSoul != null && talkeeSoul != null)
                {
                    if (chatType != IoMChatType.InquisitorInvestigation)
                    {
                        if (talkerSoul.NoPatron && talkeeSoul.NoPatron)
                        {
                            if (Rand.Range(4, 6) + GetChatIntrigueFactor(talker, talkee) > 0)
                            {
                                talkeeSoul.GainNeed(-0.0005f);
                            }
                            else
                            {
                                talkee.needs.mood.thoughts.memories.TryGainMemoryThought(ThoughtDefOf.SleepDisturbed, talker);
                            }
                        }
                        else if (talkerSoul.NoPatron && !talkeeSoul.NoPatron)
                        {
                            StartReligiousSocialFight(talker, talkee);
                        }
                        else if (!talkerSoul.NoPatron && !talkeeSoul.NoPatron)
                        {
                            talkeeSoul.GainNeed(0.005f);
                        }
                        else if (!talkerSoul.NoPatron && talkeeSoul.NoPatron)
                        {
                            if (Rand.Range(-2, 0) + GetChatIntrigueFactor(talker, talkee) > 0)
                            {
                                talkeeSoul.GainNeed(-0.0005f);
                            }
                            else
                            {
                                StartReligiousSocialFight(talker, talkee);
                            }
                        }
                    }
                    else
                    {
                        //switch (talkeeSoul.CurCategory)
                        //{
                        //    case SoulAffliction.Lost:
                        //        {

                        //            return;
                        //        }
                        //    case SoulAffliction.Corrupted:
                        //        {

                        //            return;
                        //        }
                        //    case SoulAffliction.Tainted:
                        //        {

                        //            return;
                        //        }
                        //}
                        Lord lord = talker.GetLord();
                        LordJob_IntrusiveWanderer lordJob = lord.LordJob as LordJob_IntrusiveWanderer;
                        lordJob.InquisitorFoundHeretic = true;
                    }
                }
            }
            else
            {
            }
        }