Пример #1
0
            public override bool Test(Sim a, HotTubBase target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if ((target.Repairable != null) && (target.Repairable.Broken))
                    {
                        return(false);
                    }

                    HotTubPosture posture = a.Posture as HotTubPosture;
                    if ((posture != null) && (posture.Container == target))
                    {
                        return(false);
                    }

                    if (target.mSimsAreWooHooing)
                    {
                        return(false);
                    }

                    if (isAutonomous && a.HasTrait(TraitNames.Hydrophobic))
                    {
                        return(false);
                    }

                    if (target.SeatingGroup.Count == target.UseCount)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(HotTubBase.LocalizeString(a.IsFemale, "AllSeatsTaken", new object[0x0]));
                        return(false);
                    }

                    if (a.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel)
                    {
                        greyedOutTooltipCallback = new GrayedOutTooltipHelper(a.IsFemale, "ClothesStolenTooltip", null).GetTooltip;
                        return(false);
                    }

                    if (HotTubBase.StressExitFromHeat(a, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }

                    if (IsSkinnyDipping)
                    {
                        // Custom
                        return(CommonSkinnyDip.CanSkinnyDipAtLocation(a, target.Position, ref greyedOutTooltipCallback, false, true));
                    }

                    return(true);
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
Пример #2
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    InteractionInstance currentInteraction = a.CurrentInteraction;
                    if (((currentInteraction != null) && (currentInteraction.Target == target)) && ((currentInteraction is CuddleSeated) || (currentInteraction is NestedCuddleInteraction)))
                    {
                        return(false);
                    }

                    IHasSeatingGroup container = a.Posture.Container as IHasSeatingGroup;
                    if (container != null)
                    {
                        Seat seat = container.SeatingGroup[a];
                        if ((seat != null) && (seat is IHotTubSeat))
                        {
                            if (target.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel)
                            {
                                greyedOutTooltipCallback = new GrayedOutTooltipHelper(target.IsFemale, "ClothesStolenTooltip", null).GetTooltip;
                                return(false);
                            }
                        }
                    }

                    string reason;
                    if (!CommonSocials.CanGetRomantic(a, target, isAutonomous, false, true, ref greyedOutTooltipCallback, out reason))
                    {
                        return(false);
                    }

                    if (!StartSeatedCuddleA.Definition.CanCuddle(a, target, ref greyedOutTooltipCallback, true))
                    {
                        return(false);
                    }

                    return(true);
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                    return(false);
                }
            }
Пример #3
0
        public static bool CanSkinnyDipAtLocation(Sim a, Vector3 position, ref GreyedOutTooltipCallback greyedOutTooltipCallback, bool okIfNoExistingSkinnyDippers, bool okIfAloneAndRomantic)
        {
            if (!GameUtils.IsInstalled(ProductVersion.EP3))
            {
                return(false);
            }

            if (a.Posture is CarryingChildPosture)
            {
                return(false);
            }
            if (a.HasTrait(TraitNames.NeverNude) || a.HasTrait(TraitNames.Shy))
            {
                return(false);
            }

            if (Woohooer.Settings.mAllowTeenSkinnyDip)
            {
                if (a.SimDescription.ChildOrBelow)
                {
                    return(false);
                }
            }
            else
            {
                if (a.SimDescription.TeenOrBelow)
                {
                    return(false);
                }
            }

            /*
             * if (a.SimDescription.IsVisuallyPregnant)
             * {
             *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Common.LocalizeEAString(a.IsFemale, "Gameplay/Actors/Sim:PregnantFailure", new object[0x0]));
             *
             *  return false;
             * }
             */
            if (!Pool.SimOutfitSupportsSkinnyDipping(a, ref greyedOutTooltipCallback))
            {
                return(false);
            }

            bool        flag        = okIfNoExistingSkinnyDippers;
            bool        notRomantic = false;
            bool        result      = false;
            bool        kidsAround  = false;
            LotLocation location    = new LotLocation();
            ulong       lotLocation = World.GetLotLocation(position, ref location);
            bool        outside     = World.IsPositionOutside(position);
            short       mRoom       = location.mRoom;

            List <Sim> lotSims = new List <Sim>();

            if (Woohooer.Settings.mEnforceSkinnyDipPrivacy)
            {
                Lot lot = LotManager.GetLot(lotLocation);
                if ((lot != null) && (!lot.IsWorldLot))
                {
                    lotSims = new List <Sim>(lot.GetSims());
                    if (outside)
                    {
                        List <Sim> list2 = new List <Sim>(Sims3.Gameplay.Queries.GetObjects <Sim>(position, Pool.kRadiusToCheckForKids));
                        foreach (Sim sim in list2)
                        {
                            if (sim.LotCurrent == null)
                            {
                                continue;
                            }

                            if (sim.LotCurrent.LotId != lotLocation)
                            {
                                lotSims.Add(sim);
                            }
                        }
                    }
                }
            }

            foreach (Sim sim2 in lotSims)
            {
                if (sim2 == a)
                {
                    continue;
                }

                if (sim2.SimDescription.ToddlerOrBelow)
                {
                    continue;
                }

                bool checkAge = false;
                if (Woohooer.Settings.mAllowTeenSkinnyDip)
                {
                    if (sim2.SimDescription.ChildOrBelow)
                    {
                        checkAge = true;
                    }
                }
                else
                {
                    if (sim2.SimDescription.TeenOrBelow)
                    {
                        checkAge = true;
                    }
                }

                if (checkAge)
                {
                    if (sim2.LotCurrent == null)
                    {
                        continue;
                    }

                    if (sim2.LotCurrent.LotId == lotLocation)
                    {
                        kidsAround = true;
                    }
                    else if (outside && sim2.IsOutside)
                    {
                        kidsAround = true;
                    }
                    continue;
                }

                if (sim2.IsSkinnyDipping())
                {
                    flag = true;
                }

                if (okIfAloneAndRomantic && (sim2.RoomId == mRoom))
                {
                    notRomantic = notRomantic || !sim2.IsInRomanticRelationshipWith(a);
                }
            }

            if (flag)
            {
                result = true;
            }

            if ((a.HasTrait(TraitNames.Daredevil) || a.HasTrait(TraitNames.PartyAnimal)) || a.HasTrait(TraitNames.Inappropriate))
            {
                result = true;
            }

            if (okIfAloneAndRomantic && !notRomantic)
            {
                result = true;
            }

            float hoursPassedOfDay = SimClock.HoursPassedOfDay;

            if ((hoursPassedOfDay <= (World.GetSunriseTime() + Pool.kTimeOffsetFromSunriseWhenCanGoSkinnyDip)) || (hoursPassedOfDay >= (World.GetSunsetTime() + Pool.kTimeOffsetFromSunsetWhenCanGoSkinnyDip)))
            {
                result = true;
            }

            if (result && kidsAround)
            {
                greyedOutTooltipCallback = new GrayedOutTooltipHelper(a.IsFemale, "KidsAroundTooltip", null).GetTooltip;
                return(false);
            }

            return(result);
        }
Пример #4
0
            public override bool Test(Sim a, HotTubBase target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if ((target.Repairable != null) && (target.Repairable.Broken))
                    {
                        return false;
                    }

                    HotTubPosture posture = a.Posture as HotTubPosture;
                    if ((posture != null) && (posture.Container == target))
                    {
                        return false;
                    }

                    if (target.mSimsAreWooHooing)
                    {
                        return false;
                    }

                    if (isAutonomous && a.HasTrait(TraitNames.Hydrophobic))
                    {
                        return false;
                    }

                    if (target.SeatingGroup.Count == target.UseCount)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(HotTubBase.LocalizeString(a.IsFemale, "AllSeatsTaken", new object[0x0]));
                        return false;
                    }

                    if (a.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel)
                    {
                        greyedOutTooltipCallback = new GrayedOutTooltipHelper(a.IsFemale, "ClothesStolenTooltip", null).GetTooltip;
                        return false;
                    }

                    if (HotTubBase.StressExitFromHeat(a, ref greyedOutTooltipCallback))
                    {
                        return false;
                    }

                    if (IsSkinnyDipping)
                    {
                        // Custom
                        return CommonSkinnyDip.CanSkinnyDipAtLocation(a, target.Position, ref greyedOutTooltipCallback, false, true);
                    }

                    return true;
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return false;
                }
            }
Пример #5
0
        public static bool CanSkinnyDipAtLocation(Sim a, Vector3 position, ref GreyedOutTooltipCallback greyedOutTooltipCallback, bool okIfNoExistingSkinnyDippers, bool okIfAloneAndRomantic)
        {
            if (!GameUtils.IsInstalled(ProductVersion.EP3))
            {
                return false;
            }

            if (a.Posture is CarryingChildPosture)
            {
                return false;
            }
            if (a.HasTrait(TraitNames.NeverNude) || a.HasTrait(TraitNames.Shy))
            {
                return false;
            }

            if (Woohooer.Settings.mAllowTeenSkinnyDip)
            {
                if (a.SimDescription.ChildOrBelow)
                {
                    return false;
                }
            }
            else
            {
                if (a.SimDescription.TeenOrBelow)
                {
                    return false;
                }
            }
            /*
            if (a.SimDescription.IsVisuallyPregnant)
            {
                greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Common.LocalizeEAString(a.IsFemale, "Gameplay/Actors/Sim:PregnantFailure", new object[0x0]));
              
                return false;
            }
            */
            if (!Pool.SimOutfitSupportsSkinnyDipping(a, ref greyedOutTooltipCallback))
            {
                return false;
            }

            bool flag = okIfNoExistingSkinnyDippers;
            bool notRomantic = false;
            bool result = false;
            bool kidsAround = false;
            LotLocation location = new LotLocation();
            ulong lotLocation = World.GetLotLocation(position, ref location);
            bool outside = World.IsPositionOutside(position);
            short mRoom = location.mRoom;

            List<Sim> lotSims = new List<Sim>();

            if (Woohooer.Settings.mEnforceSkinnyDipPrivacy)
            {
                Lot lot = LotManager.GetLot(lotLocation);
                if ((lot != null) && (!lot.IsWorldLot))
                {
                    lotSims = new List<Sim>(lot.GetSims());
                    if (outside)
                    {
                        List<Sim> list2 = new List<Sim>(Sims3.Gameplay.Queries.GetObjects<Sim>(position, Pool.kRadiusToCheckForKids));
                        foreach (Sim sim in list2)
                        {
                            if (sim.LotCurrent == null) continue;

                            if (sim.LotCurrent.LotId != lotLocation)
                            {
                                lotSims.Add(sim);
                            }
                        }
                    }
                }
            }

            foreach (Sim sim2 in lotSims)
            {
                if (sim2 == a) continue;
                
                if (sim2.SimDescription.ToddlerOrBelow) continue;

                bool checkAge = false;
                if (Woohooer.Settings.mAllowTeenSkinnyDip)
                {
                    if (sim2.SimDescription.ChildOrBelow)
                    {
                        checkAge = true;
                    }
                }
                else
                {
                    if (sim2.SimDescription.TeenOrBelow)
                    {
                        checkAge = true;
                    }
                }

                if (checkAge)
                {
                    if (sim2.LotCurrent == null) continue;

                    if (sim2.LotCurrent.LotId == lotLocation)
                    {
                        kidsAround = true;
                    }
                    else if (outside && sim2.IsOutside)
                    {
                        kidsAround = true;
                    }
                    continue;
                }

                if (sim2.IsSkinnyDipping())
                {
                    flag = true;
                }

                if (okIfAloneAndRomantic && (sim2.RoomId == mRoom))
                {
                    notRomantic = notRomantic || !sim2.IsInRomanticRelationshipWith(a);
                }
            }

            if (flag)
            {
                result = true;
            }

            if ((a.HasTrait(TraitNames.Daredevil) || a.HasTrait(TraitNames.PartyAnimal)) || a.HasTrait(TraitNames.Inappropriate))
            {
                result = true;
            }

            if (okIfAloneAndRomantic && !notRomantic)
            {
                result = true;
            }

            float hoursPassedOfDay = SimClock.HoursPassedOfDay;
            if ((hoursPassedOfDay <= (World.GetSunriseTime() + Pool.kTimeOffsetFromSunriseWhenCanGoSkinnyDip)) || (hoursPassedOfDay >= (World.GetSunsetTime() + Pool.kTimeOffsetFromSunsetWhenCanGoSkinnyDip)))
            {
                result = true;
            }

            if (result && kidsAround)
            {
                greyedOutTooltipCallback = new GrayedOutTooltipHelper(a.IsFemale, "KidsAroundTooltip", null).GetTooltip;
                return false;
            }

            return result;
        }