Ejemplo 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;
 }
Ejemplo n.º 2
0
        public void Divorce(string NPC)
        {
            bool swap = false;

            if (PrimarySpouse == NPC)
            {
                StorePrimarySpouse();
                swap = true;
            }
            Modworks.Player.SetFriendshipPoints(NPC, 0);
            Modworks.Player.SetFriendshipStatus(NPC, FriendshipStatus.Divorced);
            Dates.Remove(NPC);
            Engagements.Remove(NPC);
            Spouses.Remove(NPC);
            Divorces.Add(NPC);
            if (swap)
            {
                MakePrimarySpouse(GetNextPrimarySpouse());
            }
            //delete the NPC
            var npc = Game1.getCharacterFromName(NPC);

            npc.currentLocation.characters.Remove(npc);
            npc = null;
        }
Ejemplo n.º 3
0
 private bool CheckEngagedProper(string NPC)
 {
     if (Engagements.ContainsKey(NPC) ^ Modworks.Player.GetFriendshipStatus(NPC) == FriendshipStatus.Engaged)
     {
         Engage(NPC);                                                                                                      //fix desynced status
     }
     return(Engagements.ContainsKey(NPC));
 }
Ejemplo n.º 4
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);
 }
Ejemplo 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);
 }
        public Result AddEngagement(Engagements objEngagement, string siteUrl)
        {
            Result res = new Result();

            try
            {
                res = CRUDOperations.AddListItem <Engagements>(Lists.Lists.Engagements, objEngagement);

                res.StatusCode = StatusCode.Success;
                res.Message    = Messages.MsgSuccessAdd;
                return(res);
            }
            catch (Exception ex)
            {
                string guid = RestAPI.WriteException(ex, MethodBase.GetCurrentMethod().Name, MethodBase.GetCurrentMethod().DeclaringType.Name);
                res.Message    = Messages.MsgSomethingWentWrong;
                res.StatusCode = StatusCode.Error;
                return(res);
            }
        }
Ejemplo n.º 7
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);
     }
 }
 public IHttpActionResult UpdateProject(Engagements objEngagement)
 {
     return(Ok(objPhasesOperations.UpdateEngagement(objEngagement, Constants.SiteUrl)));
 }
 public IHttpActionResult Post(Engagements objEngagement)
 {
     return(Ok(objPhasesOperations.AddEngagement(objEngagement, Constants.SiteUrl)));
 }