private bool conversation_begin_courtship_for_hero_on_condition() { ISettingsProvider settings = new MASettings(); if (Hero.OneToOneConversationHero.Age >= Campaign.Current.Models.AgeModel.HeroComesOfAge) { if (settings.Debug) { MAHelper.Print("MCM: " + MASettings.UsingMCM); MAHelper.Print("Difficulty: " + settings.Difficulty); MAHelper.Print("Orientation: " + settings.SexualOrientation); MAHelper.Print("Cheating: " + settings.Cheating); MAHelper.Print("Polygamy: " + settings.Polygamy); MAHelper.Print("Incest: " + settings.Incest); MAHelper.Print("Romantic Level: " + Romance.GetRomanticLevel(Hero.MainHero, Hero.OneToOneConversationHero).ToString()); } // OnNeNousDitPasTout/GrandesMaree Patch // In Fact we can't go through Romance.RomanceLevelEnum.Untested // because for the next modification, there will be another romance status // And we must have only have one romance status for each relation if (Romance.GetRomanticLevel(Hero.MainHero, Hero.OneToOneConversationHero) == Romance.RomanceLevelEnum.Untested) { Util.Util.CleanRomance(Hero.MainHero, Hero.OneToOneConversationHero); bool areMarried = Util.Util.AreMarried(Hero.MainHero, Hero.OneToOneConversationHero); if (areMarried) { ChangeRomanticStateAction.Apply(Hero.MainHero, Hero.OneToOneConversationHero, Romance.RomanceLevelEnum.Ended); MAHelper.Print("PATCH Married New Romantic Level: " + Romance.GetRomanticLevel(Hero.MainHero, Hero.OneToOneConversationHero).ToString()); } } } return(Hero.OneToOneConversationHero.IsWanderer && Hero.OneToOneConversationHero.IsPlayerCompanion); }
private static void LordHaveFunWIthPrisoner(Settlement settlement, MobileParty captorParty, Hero prisoner) { PartyBase settlementParty = settlement.Party; if (settlementParty == null) { return; } prisoner.StayingInSettlementOfNotable = settlement; if (Romance.GetRomanticLevel(captorParty.LeaderHero, prisoner) <= Romance.RomanceLevelEnum.Untested) { ChangeRomanticStateAction.Apply(captorParty.LeaderHero, prisoner, (Romance.RomanceLevelEnum)ZenDzeeRomanceHelper.RomanceLevel_Prisoner); } if (prisoner.IsHumanPlayerCharacter) { GameMenu.SwitchToMenu("zendzee_settlement_prisoner_wait"); } #if ENABLE_LOGS InformationManager.DisplayMessage(new InformationMessage(captorParty.LeaderHero.Name + " having fun with the prisoner " + prisoner.Name)); #endif // ENABLE_LOGS }
static void Main(string[] args) { Movie titanic = new Movie("Titanic", 9, 120); Movie actionMov = new Movie("action mov", 7, 100); Romance romancegenre = new Romance(); Action actionGenre = new Action(); actionGenre.movieInGenre.Add(actionMov); romancegenre.movieInGenre.Add(titanic); Episode one = new Episode(2); Episode two = new Episode(3); Episode three = new Episode(3); Episode four = new Episode(4); TV_Show One_Punch_man = new TV_Show(); One_Punch_man.Episodes.Add(one); One_Punch_man.Episodes.Add(two); One_Punch_man.Episodes.Add(three); One_Punch_man.Episodes.Add(four); Genre actRom = actionGenre + romancegenre; Console.WriteLine(actRom.movieInGenre); View.Display(actRom); Console.ReadKey(); }
private static bool PrisonerIsOwnedByHero(Hero prisoner, Hero captor) { if (prisoner.IsPrisoner) { int level = (int)Romance.GetRomanticLevel(captor, prisoner); return(level == ZenDzeeRomanceHelper.RomanceLevel_Prisoner || level == ZenDzeeRomanceHelper.RomanceLevel_Lovers); } return(false); }
public static void EndLoversRomance(Hero hero1, Hero hero2, int level = RomanceLevel_Lovers) { if (hero1 == null || hero2 == null) { return; } Romance.RomanticState state = Romance.GetRomanticState(hero1, hero2); if (state != null && (int)state.Level == level) { state.Level = Romance.RomanceLevelEnum.Ended; } }
// This will either skip or continue romance // CoupleAgreedOnMarriage = triggers marriage before bartering // CourtshipStarted = skip everything // return false = carry out entire romance private bool conversation_finalize_courtship_for_hero_on_condition() { ISettingsProvider settings = new MASettings(); Romance.RomanceLevelEnum romanticLevel = Romance.GetRomanticLevel(Hero.MainHero, Hero.OneToOneConversationHero); bool clanLeader = Hero.MainHero.Clan.Leader == Hero.MainHero && Hero.MainHero.Clan.Lords.Contains(Hero.OneToOneConversationHero); if (settings.Difficulty == "Realistic") { // Skip issues with bartering marriage within clans // If you are the leader of the clan then it is a problem if (clanLeader) { MAHelper.Print("Realistic: Clan Leader"); return(Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero) && romanticLevel == Romance.RomanceLevelEnum.CoupleAgreedOnMarriage); } if (Hero.OneToOneConversationHero.IsNoble || Hero.OneToOneConversationHero.IsMinorFactionHero) { MAHelper.Print("Realistic: Noble"); return(false); } return(Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero) && romanticLevel == Romance.RomanceLevelEnum.CoupleAgreedOnMarriage); } else { if (clanLeader) { if (settings.Difficulty == "Easy") { MAHelper.Print("Easy: Clan Leader"); return(Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero) && romanticLevel == Romance.RomanceLevelEnum.CoupleAgreedOnMarriage); } MAHelper.Print("Very Easy: Clan Leader"); return(Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero) && (romanticLevel == Romance.RomanceLevelEnum.CourtshipStarted || romanticLevel == Romance.RomanceLevelEnum.CoupleDecidedThatTheyAreCompatible)); } if (settings.Difficulty == "Easy" && (Hero.OneToOneConversationHero.IsNoble || Hero.OneToOneConversationHero.IsMinorFactionHero)) { MAHelper.Print("Easy: Noble"); return(false); } MAHelper.Print("Very Easy"); return(Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero) && (romanticLevel == Romance.RomanceLevelEnum.CourtshipStarted || romanticLevel == Romance.RomanceLevelEnum.CoupleDecidedThatTheyAreCompatible)); } }
private static void Prefix(Hero hero) { ISettingsProvider settings = new MASettings(); if (hero.IsFemale && hero.IsAlive && hero.Age > Campaign.Current.Models.AgeModel.HeroComesOfAge) { // If you are the MainHero go through advanced process if (hero == Hero.MainHero || hero == Hero.MainHero.Spouse || Hero.MainHero.ExSpouses.Contains(hero)) { if (hero.Spouse is null && (hero.ExSpouses.IsEmpty() || hero.ExSpouses is null)) { MAHelper.Print(" No Spouse"); return; } _spouses = new List <Hero>(); MAHelper.Print("Hero: " + hero); if (hero.Spouse is not null && hero == Hero.MainHero) { _spouses.Add(hero.Spouse); MAHelper.Print("Spouse to Collection: " + hero.Spouse); } if (settings.Polyamory && hero != Hero.MainHero) { MAHelper.Print("Polyamory"); if (hero.Spouse != Hero.MainHero) { _spouses.Add(Hero.MainHero); MAHelper.Print("Main Hero to Collection: " + Hero.MainHero); } if (Hero.MainHero.Spouse is not null && Hero.MainHero.Spouse != hero) { _spouses.Add(Hero.MainHero.Spouse); MAHelper.Print("Main Hero Spouse to Collection: " + Hero.MainHero.Spouse); } foreach (Hero exSpouse in Hero.MainHero.ExSpouses.Distinct().ToList()) { if (exSpouse != hero && exSpouse.IsAlive) { _spouses.Add(exSpouse); MAHelper.Print("Main Hero ExSpouse to Collection: " + exSpouse); } } } else { // Taken out of polyamory mode if (hero.Spouse != Hero.MainHero && hero != Hero.MainHero) { _spouses.Add(Hero.MainHero); MAHelper.Print("Spouse is Main Hero: " + Hero.MainHero); } if (hero == Hero.MainHero) { foreach (Hero exSpouse in hero.ExSpouses.Distinct().ToList()) { if (exSpouse.IsAlive) { _spouses.Add(exSpouse); MAHelper.Print("ExSpouse to Collection: " + exSpouse); } } } } if (_spouses.Count() > 1) { // The shuffle! List <int> attractionGoal = new(); int attraction = 0; foreach (Hero spouse in _spouses) { attraction += Romance.GetAttractionValueAsPercent(hero, spouse); attractionGoal.Add(attraction); MAHelper.Print("Spouse: " + spouse); MAHelper.Print("Attraction: " + attraction); } int attractionRandom = MBRandom.RandomInt(attraction); MAHelper.Print("Random: " + attractionRandom); int i = 0; while (i < _spouses.Count) { if (attractionRandom < attractionGoal[i]) { MAHelper.Print("Index: " + i); break; } i++; } hero.Spouse = _spouses[i]; _spouses[i].Spouse = hero; } else { var spouse = _spouses.FirstOrDefault(); if (spouse is not null) { hero.Spouse = spouse; spouse.Spouse = hero; } } if (hero.Spouse is null) { MAHelper.Print(" No Spouse"); } else { MAHelper.Print(" Spouse Assigned: " + hero.Spouse); } } } // Outside of female pregnancy behavior if (hero.Spouse is not null) { if (hero.IsFemale == hero.Spouse.IsFemale) { // Decided to do this at the end so that you are not always going out with the opposite gender MAHelper.Print(" Spouse Unassigned: " + hero.Spouse); hero.Spouse.Spouse = null; hero.Spouse = null; } } }
public static bool conversation_player_can_open_courtship_on_condition() { ISettingsProvider settings = new MASettings(); if (Hero.OneToOneConversationHero is null) { return(false); } bool flag = Hero.MainHero.IsFemale && settings.SexualOrientation == "Heterosexual" || !Hero.MainHero.IsFemale && settings.SexualOrientation == "Homosexual" || !Hero.OneToOneConversationHero.IsFemale && settings.SexualOrientation == "Bisexual"; Romance.RomanceLevelEnum romanceLevel = Romance.GetRomanticLevel(Hero.MainHero, Hero.OneToOneConversationHero); // better to use a local variable MAHelper.Print("Courtship Possible: " + Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero).ToString()); MAHelper.Print("Romantic Level: " + romanceLevel.ToString()); MAHelper.Print("Retry Courtship: " + settings.RetryCourtship.ToString()); if (Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero) && romanceLevel == Romance.RomanceLevelEnum.Untested) { if (Hero.OneToOneConversationHero.IsNoble || Hero.OneToOneConversationHero.IsMinorFactionHero) { if (Hero.OneToOneConversationHero.Spouse is null) { MBTextManager.SetTextVariable("FLIRTATION_LINE", flag ? "{=lord_flirt}My lord, I note that you have not yet taken a spouse." : "{=v1hC6Aem}My lady, I wish to profess myself your most ardent admirer.", false); } else { MBTextManager.SetTextVariable("FLIRTATION_LINE", flag ? "{=lord_cheating_flirt}My lord, I note that you might wish for a new spouse." : "{=v1hC6Aem}My lady, I wish to profess myself your most ardent admirer.", false); } } else { MBTextManager.SetTextVariable("FLIRTATION_LINE", flag ? "{=goodman_flirt}Goodman, I note that you have not yet taken a spouse." : "{=goodwife_flirt}Goodwife, I wish to profess myself your most ardent admirer.", false); } return(true); } bool areMarried = Util.Util.AreMarried(Hero.MainHero, Hero.OneToOneConversationHero); if (romanceLevel == Romance.RomanceLevelEnum.FailedInCompatibility || romanceLevel == Romance.RomanceLevelEnum.FailedInPracticalities || (romanceLevel == Romance.RomanceLevelEnum.Ended && settings.RetryCourtship && !areMarried) ) { if (Hero.OneToOneConversationHero.IsNoble || Hero.OneToOneConversationHero.IsMinorFactionHero) { MBTextManager.SetTextVariable("FLIRTATION_LINE", flag ? "{=2WnhUBMM}My lord, may you give me another chance to prove myself?" : "{=4iTaEZKg}My lady, may you give me another chance to prove myself?", false); } else { MBTextManager.SetTextVariable("FLIRTATION_LINE", flag ? "{=goodman_chance}Goodman, may you give me another chance to prove myself?" : "{=goodwife_chance}Goodwife, may you give me another chance to prove myself?", false); } // Retry Courtship feature! if (settings.RetryCourtship) { if (romanceLevel == Romance.RomanceLevelEnum.Ended) { // OnNeNousDitPasTout/GrandesMaree Patch // Patch we must have only have one romance status for each relation Util.Util.CleanRomance(Hero.MainHero, Hero.OneToOneConversationHero); } if (romanceLevel == Romance.RomanceLevelEnum.FailedInCompatibility || romanceLevel == Romance.RomanceLevelEnum.Ended) { ChangeRomanticStateAction.Apply(Hero.MainHero, Hero.OneToOneConversationHero, Romance.RomanceLevelEnum.CourtshipStarted); } else if (romanceLevel == Romance.RomanceLevelEnum.FailedInPracticalities) { ChangeRomanticStateAction.Apply(Hero.MainHero, Hero.OneToOneConversationHero, Romance.RomanceLevelEnum.CoupleDecidedThatTheyAreCompatible); } } return(true); } return(false); }
private static void Postfix1(ref bool __result) { __result = Hero.OneToOneConversationHero is not null && Romance.GetCourtedHeroInOtherClan(Hero.MainHero, Hero.OneToOneConversationHero) is null && Romance.MarriageCourtshipPossibility(Hero.MainHero, Hero.OneToOneConversationHero); }