static bool Prefix(IncidentWorker_ManhunterPack __instance, ref bool __result, IncidentParms parms)
 {
     if (PES_Settings.DebugModeOn)
     {
         Log.Message("-=PS=- Patch_IncidentWorker_ManhunterPack_TryExecuteWorker Prefix", false);
         IncidentInterceptorUtility.DebugParms(parms, __instance.ToString());
     }
     if (parms.quest != null || parms.questScriptDef != null)
     {
         Log.Message("-=PS=- It's a quest! Bailout! MAYDAY!", false);
         return(true);
     }
     if (IncidentInterceptorUtility.isIntercepting_ManhunterPack == WorkerPatchType.ExecuteOrigin)
     {
         return(true);
     }
     if (IncidentInterceptorUtility.isIntercepting_ManhunterPack == WorkerPatchType.Forestall)
     {
         IncidentInterceptorUtility.CreateIncidentCaravan_Animal <InterceptedIncident_AnimalHerd_ManhunterPack>(__instance.def, parms);
         __result = true;
     }
     else
     {
         __result = IncidentInterceptorUtility.tmpIncident.SubstituionWorkerExecution();
     }
     return(false);
 }
        public override bool IsPossible()
        {
            worker     = new IncidentWorker_ManhunterPack();
            worker.def = IncidentDefOf.RaidEnemy;

            parms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, target);

            return(worker.CanFireNow(parms));
        }
Exemplo n.º 3
0
        public override void Execute(int amount, string boughtBy)
        {
            var currentMap = Find.CurrentMap;

            var parms = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.ThreatBig, currentMap);

            parms.forced = true;
            var manhunterWorker = new IncidentWorker_ManhunterPack();

            manhunterWorker.def = IncidentDef.Named("ManhunterPack");

            manhunterWorker.TryExecute(parms);
            AlertManager.BadEventNotification("Your viewers have sent a Manhunter Pack!");
        }
Exemplo n.º 4
0
 static bool Prefix(IncidentWorker_ManhunterPack __instance, ref bool __result, IncidentParms parms)
 {
     if (IncidentInterceptorUtility.isIntercepting_ManhunterPack == WorkerPatchType.ExecuteOrigin)
     {
         return(true);
     }
     if (IncidentInterceptorUtility.isIntercepting_ManhunterPack == WorkerPatchType.Forestall)
     {
         IncidentInterceptorUtility.CreateIncidentCaravan_Animal <InterceptedIncident_AnimalHerd_ManhunterPack>(parms);
         __result = true;
     }
     else
     {
         __result = IncidentInterceptorUtility.tmpIncident.SubstituionWorkerExecution();
     }
     return(false);
 }
        public override bool IsPossible(string message, Viewer viewer, bool separateChannel = false)
        {
            this.separateChannel = separateChannel;
            this.viewer          = viewer;
            string[] command = message.Split(' ');
            if (command.Length < 3)
            {
                VariablesHelpers.ViewerDidWrongSyntax(viewer.username, storeIncident.syntax, separateChannel);
                return(false);
            }

            if (!VariablesHelpers.PointsWagerIsValid(
                    command[2],
                    viewer,
                    ref pointsWager,
                    ref storeIncident,
                    separateChannel
                    ))
            {
                return(false);
            }

            target = Current.Game.AnyPlayerHomeMap;
            if (target == null)
            {
                return(false);
            }

            parms        = StorytellerUtility.DefaultParmsNow(IncidentCategoryDefOf.RaidBeacon, target);
            parms.points = IncidentHelper_PointsHelper.RollProportionalGamePoints(storeIncident, pointsWager, parms.points);

            worker     = new IncidentWorker_ManhunterPack();
            worker.def = IncidentDefOf.RaidEnemy;

            return(worker.CanFireNow(parms));
        }