private static void conversation_set_up_safe_passage_barter_on_consequence(DialogueParams param) { BarterManager instance = BarterManager.Instance; Hero oneToOneConversationHero = Hero.OneToOneConversationHero; PartyBase mainParty = PartyBase.MainParty; PartyBase otherParty = MobileParty.ConversationParty?.Party; BarterManager.BarterContextInitializer initContext = new BarterManager.BarterContextInitializer(BarterManager.Instance.InitializeSafePassageBarterContext); int persuasionCostReduction = 0; bool isAIBarter = false; if (Hero.OneToOneConversationHero == null) { Barterable[] array = new Barterable[1]; array[0] = new SafePassageBarterable(null, Hero.MainHero, otherParty, PartyBase.MainParty); instance.StartBarterOffer(Hero.MainHero, oneToOneConversationHero, mainParty, otherParty, null, initContext, persuasionCostReduction, isAIBarter, array); } else { Barterable[] array = new Barterable[2]; array[0] = new SafePassageBarterable(oneToOneConversationHero, Hero.MainHero, otherParty, PartyBase.MainParty); array[1] = new NoAttackBarterable(Hero.MainHero, oneToOneConversationHero, mainParty, otherParty, CampaignTime.Days(5f)); instance.StartBarterOffer(Hero.MainHero, oneToOneConversationHero, mainParty, otherParty, null, initContext, persuasionCostReduction, isAIBarter, array); } }
private static void barter_for_peace_consequence_delegate(DialogueParams param) // looks like a lot, I just stole most of this from tw >_> { BarterManager instance = BarterManager.Instance; Hero mainHero = Hero.MainHero; Hero oneToOneConversationHero = Hero.OneToOneConversationHero; PartyBase mainParty = PartyBase.MainParty; MobileParty conversationParty = MobileParty.ConversationParty; PartyBase otherParty = (conversationParty != null) ? conversationParty.Party : null; Hero beneficiaryOfOtherHero = null; BarterManager.BarterContextInitializer initContext = new BarterManager.BarterContextInitializer(BarterManager.Instance.InitializeMakePeaceBarterContext); int persuasionCostReduction = 0; bool isAIBarter = false; Barterable[] array = new Barterable[1]; int num = 0; Hero originalOwner = conversationParty.MapFaction.Leader; Hero mainHero2 = Hero.MainHero; MobileParty conversationParty2 = MobileParty.ConversationParty; array[num] = new PeaceBarterable(originalOwner, conversationParty.MapFaction, mainHero.MapFaction, CampaignTime.Years(1f)); instance.StartBarterOffer(mainHero, oneToOneConversationHero, mainParty, otherParty, beneficiaryOfOtherHero, initContext, persuasionCostReduction, isAIBarter, array); }
public IBarterResultToken ContextInitializer(BarterManager.BarterContextInitializer initializer) { _context.ContextInitializer = initializer; return(this); }