private string MaybeTheySuckAndDontHaveItYet(Buff buff, Pawn pawn, Caravan caravan, ThingSetMakerDef thingSetMakerDef) { if (thingSetMakerDef == eventDef.rewardFirstPlace && !MFI_Utilities.CaravanOrRichestColonyHasAnyOf(buff.RelevantThingDef(), caravan, out _)) { Thing thing = ThingMaker.MakeThing(buff.RelevantThingDef()); thing.stackCount = Mathf.Min(thing.def.stackLimit, 75); //suck it, stackXXL users. CaravanInventoryUtility.GiveThing(caravan, thing); string anReward = Find.ActiveLanguageWorker.WithDefiniteArticlePostProcessed(thing.Label); return("\n\n" + "MFI_SinceYouSuckAndDidntHaveIt".Translate(anReward)); } return(string.Empty); }
private IEnumerable <DiaOption> DialogueOptions(Pawn participatingPawn) { var annualExpoDialogueOutcome = $"Something went wrong with More Faction Interaction. Contact the mod author with this year's theme. If you bring a log (press CTRL + F12 now), you get a cookie. P: {participatingPawn} C: {caravan} E: {activity} H: {host}"; var broughtArt = (activity == MFI_DefOf.MFI_CulturalSwap) & MFI_Utilities.TryGetBestArt(caravan, out var art, out _); yield return(new DiaOption("MFI_AnnualExpoFirstOption".Translate()) { action = () => DetermineOutcome(out annualExpoDialogueOutcome), linkLateBind = () => { var endpoint = DialogueResolver(annualExpoDialogueOutcome, broughtArt); if (broughtArt) { endpoint.options[0].linkLateBind = () => EventRewardWorker_CulturalSwap.DialogueResolverArtOffer( "MFI_culturalSwapOutcomeWhoaYouActuallyBroughtArt", art, caravan); } return endpoint; } }); #if DEBUG var devModeTest = new DiaOption("DevMode: Test chances and outcomes") { action = DebugLogChances }; if (!Prefs.DevMode) { yield break; } yield return(devModeTest); yield return(new DiaOption("restart") { action = GenCommandLine.Restart }); #endif }
private IEnumerable <DiaOption> DialogueOptions(Pawn pawn, Caravan caravan, EventDef eventDef, Faction host) { string annualExpoDialogueOutcome = $"Something went wrong with More Faction Interaction. Contact the mod author with this year's theme. If you bring a log (press CTRL + F12 now), you get a cookie. P: {pawn} C: {caravan} E: {eventDef} H: {host}"; bool broughtArt = (eventDef == MFI_DefOf.MFI_CulturalSwap & MFI_Utilities.TryGetBestArt(caravan, out Thing art, out Pawn owner)); yield return(new DiaOption(text: "MFI_AnnualExpoFirstOption".Translate()) { action = () => DetermineOutcome(pawn: pawn, caravan: caravan, eventDef: eventDef, annualExpoDialogueOutcome: out annualExpoDialogueOutcome, host), linkLateBind = () => { DiaNode endpoint = DialogueResolver(annualExpoDialogueOutcome, broughtArt); if (broughtArt) { endpoint.options.First().linkLateBind = () => EventRewardWorker_CulturalSwap.DialogueResolverArtOffer("MFI_culturalSwapOutcomeWhoaYouActuallyBroughtArt", art, caravan); } return endpoint; } }); }