public override void OpenCommunications(Pawn negotiator)
        {
            Dialog_NodeTree dialog = new Dialog_NodeTree(ExtortionCommunication_Dialogs.MakeExtortionRootNode(pw),
                                                         false, false, "ProblemHackerExtortionDialogTitle".Translate());

            Find.WindowStack.Add(dialog);
            FindExt.DynamicCommManagerFor(pw.rootMap).RemoveCommunication(this);
        }
        public override void OpenCommunications(Pawn negotiator)
        {
            Dialog_NodeTree dialog = new Dialog_NodeTree(ContactHackedAllyBase_Dialogs.MakeContactHackedAllyBaseRootNode(pw),
                                                         false, false, "ProblemHackerContactHackedAllyBaseTitle".Translate(pw.alliedBase.Name));

            Find.WindowStack.Add(dialog);
            FindExt.DynamicCommManagerFor(pw.rootMap).RemoveCommunication(this);
        }
Пример #3
0
        public override void OpenCommunications(Pawn negotiator)
        {
            Dialog_NodeTree dialog = new Dialog_NodeTree(MakeAnswerWeakContactAttemptRootNode(negotiator),
                                                         false, false, "PH_WCA_RootTitle".Translate());

            Find.WindowStack.Add(dialog);
            FindExt.DynamicCommManagerFor(pw.rootMap).RemoveCommunication(this);
        }
 public override DiaOption GetOption(Faction faction, Pawn negotiator)
 {
     return(new DiaOption("PH_HackedAllyFC_ParentOption".Translate(faction.Name, pw.alliedBase.Name))
     {
         linkLateBind = delegate {
             FindExt.DynamicCommManagerFor(pw.rootMap).RemoveFactionCommunication(this);
             return MakeHackedAllyResponse(faction, negotiator);
         }
     });
 }
        private static void Prefix(JobDriver_UseCommsConsole __instance)
        {
            Communication comm = __instance.job.commTarget as Communication;

            if (comm == null)
            {
                return;
            }
            __instance.AddFailCondition(() => !FindExt.DynamicCommManagerFor(__instance.GetActor().Map).Contains(comm) || !comm.IsAllowedFor(__instance.GetActor()));
        }
Пример #6
0
 protected override void Finish()
 {
     RemoveHacking();
     FindExt.ResearchTaskManager.UnregisterResearchCompletionAction(DefDatabase <ResearchProjectDef> .GetNamed("HackingCountermeasures"),
                                                                    this.HackingCountermeasuresImplemented);
     FindExt.ResearchTaskManager.UnregisterResearchCompletionAction(DefDatabase <ResearchProjectDef> .GetNamed("DisruptHacking"),
                                                                    this.DisruptHackingAttempt);
     FindExt.DynamicCommManagerFor(this.rootMap).RemoveAllCommunicationsOfType <WeakContactAttempt> ();
     FindExt.DynamicCommManagerFor(this.rootMap).RemoveAllCommunicationsOfType <ContactHackedAllyBase> ();
     FindExt.DynamicCommManagerFor(this.rootMap).RemoveAllCommunicationsOfType <ExtortionCommunication> ();
     FindExt.DynamicCommManagerFor(this.rootMap).RemoveAllFactionCommunicationsOfType <HackedAllyFactionCommunication> ();
     base.Finish();
 }
Пример #7
0
        internal void SetHackedAllyCommStatus(HackedAllyCommunicationState newState)
        {
            if (this.alliedCommState == newState)
            {
                return;
            }

            this.commStateLastTick = Find.TickManager.TicksGame;

            switch (newState)
            {
            case HackedAllyCommunicationState.WeakContactAttempt:
                FindExt.DynamicCommManagerFor(this.rootMap).AddFactionCommunication(new HackedAllyFactionCommunication(this));
                SendWeakContactAttempt();
                break;
            }

            this.alliedCommState = newState;
        }
        static IEnumerable <ICommunicable> ConcatHelper(Pawn pawn, IEnumerable <ICommunicable> options, List <FloatMenuOption> list)
        {
            foreach (Communication comm in FindExt.DynamicCommManagerFor(pawn.Map).GetCommsFor(pawn))
            {
                if (!comm.IsAllowedFor(pawn, out string disabledReason))
                {
                    list.Add(new FloatMenuOption(comm.GetCallLabel() + " (" + disabledReason.Translate() + ")",
                                                 null, MenuOptionPriority.Default, null, null, 0, null, null));
                }
                else
                {
                    yield return(comm);
                }
            }

            foreach (var opt in options)
            {
                yield return(opt);
            }
        }
Пример #9
0
 internal void SendWeakContactAttempt()
 {               //Will look for keys "PH_WCA_LetterText<0-3>" incrementing per weak contact attempt
     FindExt.DynamicCommManagerFor(this.rootMap).AddCommunicationWithLetter(new WeakContactAttempt(this), "PH_WCA_LetterTitle".Translate(),
                                                                            "PH_WCA_LetterText".Translate(), LetterDefOf.NeutralEvent, true, WeakContactAttemptDuration);
 }
Пример #10
0
 internal void SendExtortionThreat()
 {
     CalculateExtortionAmount();
     //	Find.LetterStack.ReceiveLetter ("ProblemHackerExtortionLetterLabel".Translate (), text, LetterDefOf.ThreatSmall);
     FindExt.DynamicCommManagerFor(this.rootMap).AddCommunicationWithStandardNotification(new ExtortionCommunication(this), MaxPreparingTicks, true);
 }