Ejemplo n.º 1
0
 private void OnSessionLaunched(CampaignGameStarter campaignGameStarter)
 {
     campaignGameStarter.AddGameMenu(
         FastDialogueSubModule.FastEncounterMenu,
         "{=!}{ENCOUNTER_TEXT}",
         Init,
         GameOverlays.MenuOverlayType.Encounter,
         GameMenu.MenuFlags.none,
         null);
     campaignGameStarter.AddGameMenuOption(
         FastDialogueSubModule.FastEncounterMenu,
         $"{FastDialogueSubModule.FastEncounterMenu}_attack",
         "{=o1pZHZOF}Attack!",
         args =>
     {
         return(ShouldShowWarOptions() && ReflectionUtils.ForceCall <bool>(GetGlobalCampaignBehaviorManager(), "game_menu_encounter_attack_on_condition", new object[] { args }));
     },
         ConsequenceOf("game_menu_encounter_attack_on_consequence"),
         false,
         -1,
         false);
     campaignGameStarter.AddGameMenuOption(
         FastDialogueSubModule.FastEncounterMenu,
         $"{FastDialogueSubModule.FastEncounterMenu}_troops",
         "{=rxSz5dY1}Send troops.",
         (args) =>
     {
         return(ShouldShowWarOptions() && ReflectionUtils.ForceCall <bool>(GetGlobalCampaignBehaviorManager(), "game_menu_encounter_order_attack_on_condition", new object[] { args }));
     },
         ConsequenceOf("game_menu_encounter_order_attack_on_consequence"),
         false,
         -1,
         false);
     campaignGameStarter.AddGameMenuOption(
         FastDialogueSubModule.FastEncounterMenu,
         $"{FastDialogueSubModule.FastEncounterMenu}_getaway",
         "{=qNgGoqmI}Try to get away.",
         ConditionOf("game_menu_encounter_leave_your_soldiers_behind_on_condition"),
         ConsequenceOf("game_menu_encounter_leave_your_soldiers_behind_accept_on_consequence"),
         false,
         -1,
         false);
     campaignGameStarter.AddGameMenuOption(
         FastDialogueSubModule.FastEncounterMenu,
         $"{FastDialogueSubModule.FastEncounterMenu}_talk",
         "{=qNgGoqmI}Converse.",
         args =>
     {
         args.optionLeaveType = GameMenuOption.LeaveType.Conversation;
         return(true);
     },
         args =>
     {
         PlayerEncounter.DoMeeting();
     },
         false,
         -1,
         false);
     campaignGameStarter.AddGameMenuOption(
         FastDialogueSubModule.FastEncounterMenu,
         $"{FastDialogueSubModule.FastEncounterMenu}_surrend",
         "{=3nT5wWzb}Surrender.",
         ConditionOf("game_menu_encounter_surrender_on_condition"),
         args =>
     {
         PlayerEncounter.PlayerSurrender = true;
         PlayerEncounter.Update();
     },
         false,
         -1,
         false);
     campaignGameStarter.AddGameMenuOption(
         FastDialogueSubModule.FastEncounterMenu,
         $"{FastDialogueSubModule.FastEncounterMenu}_leave",
         "{=2YYRyrOO}Leave...",
         ConditionOf("game_menu_encounter_leave_on_condition"),
         (args) =>
     {
         MenuHelper.EncounterLeaveConsequence(args);
         if (PartyBase.MainParty.IsMobile && PartyBase.MainParty.MobileParty != null)
         {
             PartyBase.MainParty.MobileParty.IsDisorganized = false;
         }
     },
         true,
         -1,
         false);
 }