Beispiel #1
0
        public static void OnMoveInWith(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                bool isFemale = actor.IsFemale && target.IsFemale;
                if (actor.Household == target.Household)
                {
                    if (actor.IsSelectable && Household.RoommateManager.IsNPCRoommate(target))
                    {
                        Household.RoommateManager.MakeRoommateSelectable(target.SimDescription);
                    }

                    if (target.IsSelectable && Household.RoommateManager.IsNPCRoommate(actor))
                    {
                        Household.RoommateManager.MakeRoommateSelectable(actor.SimDescription);
                    }

                    actor.ShowTNSIfSelectable(SocialCallback.LocalizeString(isFemale, "MarriedSameHousehold", new object[] { actor, target }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, actor.ObjectId);
                }
                else
                {
                    int value = RandomUtil.GetInt(MovingSituation.kMarriageGiftAndTaxBenefits[0x0], MovingSituation.kMarriageGiftAndTaxBenefits[0x1]);

                    if (actor.IsSelectable || target.IsSelectable)
                    {
                        MovingDialogEx.Show(new GameplayMovingModelEx(actor, target));
                    }

                    actor.ModifyFunds(value);
                    actor.ShowTNSIfSelectable(SocialCallback.LocalizeString(isFemale, "MarriedDifferentHouseholds", new object[] { value, actor, target }), StyledNotification.NotificationStyle.kGameMessagePositive, ObjectGuid.InvalidObjectGuid, actor.ObjectId);
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
Beispiel #2
0
 public static void OnAskToMoveInAccepted(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
 {
     try
     {
         if (!MovingSituation.MovingInProgress)
         {
             using (GameplayMovingModelEx.ProtectFunds protect = new GameplayMovingModelEx.ProtectFunds(target.Household))
             {
                 MovingDialogEx.Show(new GameplayMovingModelEx(target, actor.Household));
             }
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
     }
 }