public void Engage(string NPC, bwdyworks.GameDate weddingDay = null) { //var backup = Game1.player.spouse; //Game1.player.spouse = NPC; SetDateable(NPC, true); if (weddingDay == null) { weddingDay = bwdyworks.GameDate.CreateWeddingDate(); } Modworks.Log.Info("Engaged to " + NPC + ", to be wed on " + weddingDay.GetSeasonString() + " " + weddingDay.Day); StorePrimarySpouse(); if (Modworks.Player.GetFriendshipPoints(NPC) < 2500) { Modworks.Player.SetFriendshipPoints(NPC, 2500); } Modworks.Player.SetFriendshipStatus(NPC, FriendshipStatus.Engaged); //Game1.player.spouse = NPC; Game1.player.friendshipData[NPC].Proposer = Game1.player.UniqueMultiplayerID; Game1.player.friendshipData[NPC].WeddingDate = new WorldDate(Game1.year, weddingDay.GetSeasonString().ToLower(), weddingDay.Day); Spouses.Remove(NPC); Dates.Remove(NPC); Divorces.Remove(NPC); Engagements.Add(NPC, weddingDay); //Game1.player.spouse = backup; }
private bool CheckMarriedProper(string NPC) { if (Spouses.Contains(NPC) ^ Modworks.Player.GetFriendshipStatus(NPC) == FriendshipStatus.Married) { Marry(NPC); //fix desynced status } return(Spouses.Contains(NPC)); }
public void Forget(string NPC, bool resetFriendship = true) { if (resetFriendship) { Modworks.Player.SetFriendshipPoints(NPC, 0); } Modworks.Player.SetFriendshipStatus(NPC, FriendshipStatus.Friendly); Spouses.Remove(NPC); Engagements.Remove(NPC); Divorces.Remove(NPC); Dates.Remove(NPC); }
private bool CheckPrimarySpouseProper(string NPC) { //couple of ways primary can go sideways: //if poly priamry is set and vanilla is not //if vanilla is set and poly primary is not //if the spouse is still in the main poly spouses array when they should be primary if ((PrimarySpouse == NPC ^ VanillaSpouse == NPC) || (Spouses.Contains(NPC) && (PrimarySpouse == NPC || VanillaSpouse == NPC))) { MakePrimarySpouse(NPC); //fix desynced status } return(PolyData.PrimarySpouse == NPC); }
public void Date(string NPC) { SetDateable(NPC, true); if (Modworks.Player.GetFriendshipPoints(NPC) < 2000) { Modworks.Player.SetFriendshipPoints(NPC, 2000); } Modworks.Player.SetFriendshipStatus(NPC, FriendshipStatus.Dating); Spouses.Remove(NPC); Engagements.Remove(NPC); Divorces.Remove(NPC); Dates.Add(NPC); }
public void MakePrimarySpouse(string NPC) { if (PrimarySpouse == NPC ^ VanillaSpouse == NPC) { StorePrimarySpouse(); } if (!CheckMarriedProper(NPC)) { Marry(NPC); } Spouses.Remove(NPC); PrimarySpouse = NPC; VanillaSpouse = NPC; RollSpouseRoom(); }
public bool IsValidSpouse(string NPC) { if (string.IsNullOrWhiteSpace(NPC)) { return(false); } if (Spouses.Contains(NPC)) { return(true); } if (PrimarySpouse == NPC) { return(true); } return(false); }
public void StorePrimarySpouse() { string s = PrimarySpouse; if (string.IsNullOrWhiteSpace(s)) { s = VanillaSpouse; } if (!string.IsNullOrWhiteSpace(s)) { //CheckPrimarySpouseProper(s); //make sure data is valid first PrimarySpouse = null; VanillaSpouse = null; Spouses.Add(s); CheckMarriedProper(s); //make sure everything looks right } }
public void Marry(string NPC, bool wedding = false) { SetDateable(NPC, true); if (Modworks.Player.GetFriendshipPoints(NPC) < 2500) { Modworks.Player.SetFriendshipPoints(NPC, 2500); } if (Game1.player.HouseUpgradeLevel < 1) { Game1.player.HouseUpgradeLevel = 1; //prevent crash } Modworks.Player.SetFriendshipStatus(NPC, FriendshipStatus.Married); Dates.Remove(NPC); Engagements.Remove(NPC); Divorces.Remove(NPC); Spouses.Add(NPC); if (string.IsNullOrWhiteSpace(PrimarySpouse)) { MakePrimarySpouse(NPC); } }
public bool ReconcileFams(Person indi) { Spouses.Add(indi); // Is the provided indi the husb or wife? return(MomId == indi.Id || DadId == indi.Id); }
private bool CanAddSpouseCommandExecute(object arg) { return(Person != null && !Spouses.Any()); }
private bool CanSetSpouseCommandExecute(Object param) { return(!Spouses.Any()); }
public bool IsValidSpouse(string NPC) { return(!string.IsNullOrWhiteSpace(NPC) && (Spouses.Contains(NPC) || PrimarySpouse == NPC)); }