Ejemplo n.º 1
0
        public static void AddQuestGiverThree(IncidentParms parms, List <Pawn> __result, IncidentWorker_TravelerGroup __instance)
        {
            if (__result == null || __result.Count == 0)
            {
                return;
            }

            if (__instance.def.defName != "TravelerGroup")
            {
                //Log.Message($"Skip Incident: {__instance.def.defName}");
                return;
            }

            var newQuestPawn = RimQuestUtility.GetNewQuestGiver(__result);

            if (newQuestPawn == null || newQuestPawn?.Faction == null)
            {
                return;
            }

            var questPawns = Find.World.GetComponent <RimQuestTracker>().questPawns;

            if (!questPawns.Any(x => x.pawn == newQuestPawn))
            {
                var questPawn = new QuestPawn(newQuestPawn);
                if (questPawn != null)
                {
                    questPawns.Add(questPawn);
                }
            }
        }
Ejemplo n.º 2
0
        //PawnGroupKindWorker_Trader
        public static void AddQuestGiverTwo(PawnGroupMakerParms parms, PawnGroupMaker groupMaker, Pawn trader,
                                            List <Thing> wares, List <Pawn> outPawns)
        {
            LongEventHandler.QueueLongEvent(() =>
            {
                var pawn = outPawns.FirstOrDefault(x => x.Spawned);
                Map map  = pawn?.MapHeld;
                if (map != null)
                {
                    List <Pawn> newPawnList = map.mapPawns.AllPawnsSpawned.FindAll(x => x.Faction == pawn.Faction && !x.IsPrisoner);
                    var newQuestPawn        = RimQuestUtility.GetNewQuestGiver(outPawns);
                    if (newQuestPawn?.Faction == null)
                    {
                        return;
                    }

                    var questPawns = Find.World.GetComponent <RimQuestTracker>().questPawns;
                    if (!questPawns.Any(x => x.pawn == newQuestPawn))
                    {
                        var questPawn = new QuestPawn(newQuestPawn);
                        if (questPawn != null)
                        {
                            questPawns.Add(questPawn);
                        }
                    }
                }
            }, "RQ_LoadingScreen".Translate(), true, null);
        }
Ejemplo n.º 3
0
        //public class PawnUIOverlay
        //public static void DrawPawnGUIOverlay(PawnUIOverlay __instance)
        //{

        //}


        //IncidentWorker_VisitorGroup
        //TryConvertOneSmallTrader
        public static void AddQuestGiver(List <Pawn> pawns, Faction faction, Map map, ref bool __result)
        {
            if (!__result || !(pawns?.Count > 1))
            {
                return;
            }

            var newQuestPawn = RimQuestUtility.GetNewQuestGiver(pawns);

            if (newQuestPawn == null || newQuestPawn?.Faction == null)
            {
                return;
            }

            var questPawns = Find.World.GetComponent <RimQuestTracker>().questPawns;

            if (!questPawns.Any(x => x.pawn == newQuestPawn))
            {
                var questPawn = new QuestPawn(newQuestPawn);
                if (questPawn != null)
                {
                    questPawns.Add(questPawn);
                }
            }
        }