private static void OnPrisonerReleased(Hero hero, IFaction arg2, EndCaptivityDetail arg3) { if (hero == null) { return; } ZenDzeeRomanceHelper.EndLoverRomances(hero, ZenDzeeRomanceHelper.RomanceLevel_Prisoner); if (hero != Hero.MainHero && !Hero.MainHero.IsPrisoner) { MenuContext currentMenuContext = Campaign.Current.CurrentMenuContext; if (currentMenuContext == null) { return; } if (currentMenuContext.GameMenu.StringId == "zendzee_town_wait_menus" && ZenDzeeRomanceHelper.GetLover(Hero.MainHero, ZenDzeeRomanceHelper.RomanceLevel_Prisoner) == null) { GameMenu.SwitchToMenu("town_wait_menus"); } } }
private static void OnRomanticStateChanged(Hero hero1, Hero hero2, Romance.RomanceLevelEnum level) { if ((int)level == ZenDzeeRomanceHelper.RomanceLevel_Lovers) { #if ENABLE_LOGS InformationManager.DisplayMessage(new InformationMessage(hero1.Name + " and " + hero2.Name + " started romance as lovers.")); #endif } else if (level == Romance.RomanceLevelEnum.Marriage) { ZenDzeeRomanceHelper.EndLoverRomances(hero1); ZenDzeeRomanceHelper.EndLoverRomances(hero2); } }
public static void Prefix_DailyTickHero(ref Hero hero) { if (!hero.IsFemale || hero.IsDead || hero.Age < 18f || hero.IsPregnant) { return; } Settlement settlement = hero.CurrentSettlement; if (hero.IsHumanPlayerCharacter && !hero.IsPrisoner && hero.Spouse != null && hero.Spouse.CurrentSettlement == settlement) { return; } Hero lover; if (settlement != null) { lover = ZenDzeeRomanceHelper.GetLover(hero, ZenDzeeRomanceHelper.RomanceLevel_Prisoner); if (lover != null) { ZenDzeeRomanceHelper.FakeSpouses(hero, lover); return; } } lover = ZenDzeeRomanceHelper.GetLover(hero, ZenDzeeRomanceHelper.RomanceLevel_Lovers); if (lover != null) { if (lover.IsDead) { ZenDzeeRomanceHelper.EndLoverRomances(lover); return; } if (!lover.IsPrisoner) { ZenDzeeRomanceHelper.FakeSpouses(hero, lover); return; } } }
private static void OnHeroKilled(Hero victim, Hero killer, KillCharacterAction.KillCharacterActionDetail actionDetail, bool showNotification) { ZenDzeeRomanceHelper.EndLoverRomances(victim); }