Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 private bool CheckMarriedProper(string NPC)
 {
     if (Spouses.Contains(NPC) ^ Modworks.Player.GetFriendshipStatus(NPC) == FriendshipStatus.Married)
     {
         Marry(NPC);                                                                                               //fix desynced status
     }
     return(Spouses.Contains(NPC));
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public void MakePrimarySpouse(string NPC)
 {
     if (PrimarySpouse == NPC ^ VanillaSpouse == NPC)
     {
         StorePrimarySpouse();
     }
     if (!CheckMarriedProper(NPC))
     {
         Marry(NPC);
     }
     Spouses.Remove(NPC);
     PrimarySpouse = NPC;
     VanillaSpouse = NPC;
     RollSpouseRoom();
 }
Esempio n. 7
0
 public bool IsValidSpouse(string NPC)
 {
     if (string.IsNullOrWhiteSpace(NPC))
     {
         return(false);
     }
     if (Spouses.Contains(NPC))
     {
         return(true);
     }
     if (PrimarySpouse == NPC)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 8
0
        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
            }
        }
Esempio n. 9
0
 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);
     }
 }
Esempio n. 10
0
 public bool ReconcileFams(Person indi)
 {
     Spouses.Add(indi);
     // Is the provided indi the husb or wife?
     return(MomId == indi.Id || DadId == indi.Id);
 }
Esempio n. 11
0
 private bool CanAddSpouseCommandExecute(object arg)
 {
     return(Person != null && !Spouses.Any());
 }
Esempio n. 12
0
 private bool CanSetSpouseCommandExecute(Object param)
 {
     return(!Spouses.Any());
 }
Esempio n. 13
0
 public bool IsValidSpouse(string NPC)
 {
     return(!string.IsNullOrWhiteSpace(NPC) &&
            (Spouses.Contains(NPC) || PrimarySpouse == NPC));
 }