Exemplo n.º 1
0
            public override bool Test(Sim a, WeddingArch target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    SimDescription partner = a.Partner;
                    if (partner == null)
                    {
                        return(false);
                    }
                    Sim createdSim = partner.CreatedSim;
                    if ((createdSim == null) || !a.IsEngaged)
                    {
                        return(false);
                    }
                    if (createdSim.LotCurrent != target.LotCurrent)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WeddingArch.LocalizeString(a.IsFemale, "FianceNotOnLot", new object[] { createdSim }));
                        return(false);
                    }

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

                    return(CommonSocials.CanGetMarriedNow(a, createdSim, isAutonomous, false, ref greyedOutTooltipCallback));
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
Exemplo n.º 2
0
            public override bool Test(Sim actor, TimePortal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (TravelUtil.PlayerMadeTravelRequest)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("PlayerMadeTravelRequest");
                    return(false);
                }

                if (!TimePortal.sTimeTravelerHasBeenSummoned)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("sTimeTravelerHasBeenSummoned");
                    return(false);
                }

                if (target.InUse && !target.IsActorUsingMe(actor))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("InUse");
                    return(false);
                }

                if (!target.Active)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Active Fail");
                    return(false);
                }

                if (target.IsBroken)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":MustRepairTimePortal", new object[] { actor }));
                    return(false);
                }

                return(PublicTest(actor, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Exemplo n.º 3
0
            public override bool Test(Sim a, EquestrianCenter target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                PetPool pool;

                if (!PetPoolManager.TryGetPetPool(PetPoolType.BuySellHorse, out pool, false))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.BuyHorse.LocalizeString(a.IsFemale, "PoolEmpty", new object[0x0]));
                    return(false);
                }

                /*
                 * if (!a.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.Horse, 0x1, true))
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.BuyHorse.LocalizeString(a.IsFemale, "TooManyPetsInHousehold", new object[0x0]));
                 *  return false;
                 * }
                 */

                Lot lotHome = a.LotHome;

                if ((lotHome != null) && lotHome.HasVirtualResidentialSlots)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(PetAdoption.LocalizeString(a.IsFemale, "CannotAdoptHorse", new object[0]));
                    return(false);
                }

                return(true);
            }
Exemplo n.º 4
0
        public static bool CommonTest(WeatherStone ths, Sim actor, WeatherStone.SummonWeatherType type, ref GreyedOutTooltipCallback greyedOutTooltipCallback, bool isAutonomous)
        {
            if (!isAutonomous)
            {
                switch (ths.CurrentWeatherStoneState)
                {
                case WeatherStone.WeatherStoneState.ReadyForSummoning:
                    return(true);

                case WeatherStone.WeatherStoneState.SummoningWeather:
                    if (type == ths.mSummonWeatherType)
                    {
                        return(true);
                    }

                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WeatherStone.LocalizeString(actor.IsFemale, "TryingToSummonTooltip", new object[0]));
                    break;

                case WeatherStone.WeatherStoneState.AfterSuccessfulSummon:
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WeatherStone.LocalizeString(actor.IsFemale, "StoneCurrentSummoningWeatherTooltip", new object[0]));
                    break;

                case WeatherStone.WeatherStoneState.AfterFailureSummon:
                case WeatherStone.WeatherStoneState.Resting:
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WeatherStone.LocalizeString(actor.IsFemale, "StoneRestingTooltip", new object[0]));
                    break;
                }
            }

            return(false);
        }
Exemplo n.º 5
0
            public override bool Test(Sim a, BarProfessional target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }
                return(true);

                if (a.SimDescription.AssignedRole is Bartending.Bartender && a.SimDescription.AssignedRole.RoleGivingObject != target)
                {
                    return(false);
                }
                if (a.IsSelectable)
                {
                    if (isAutonomous)
                    {
                        return(false);
                    }
                    if (target.LotCurrent.IsCommunityLot && !target.LotCurrent.IsOpenVenue())
                    {
                        return(false);
                    }
                }
                if (!Bartending.CanWorkAsBartendender(a, target.LotCurrent))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(BarProfessional.LocalizeString("BarTendHomeBarTakeOverGreyedOut", new object[0]));
                    return(false);
                }
                return((a.IsSelectable && (target.mBartender == null || !target.mBartender.IsSelectable)) || target.mBartender == null);
            }
Exemplo n.º 6
0
        public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (GameUtils.GetCurrentWorld() == WorldName.China)
                {
                    return(false);
                }

                MartialArts skill = actor.SkillManager.GetSkill <MartialArts>(SkillNames.MartialArts);
                MartialArts arts2 = target.SkillManager.GetSkill <MartialArts>(SkillNames.MartialArts);
                if (((skill != null) && skill.CanParticipateInTournaments) && ((arts2 != null) && arts2.CanParticipateInTournaments))
                {
                    SimDescription tournamentChallenger = skill.TournamentChallenger;
                    if ((tournamentChallenger != null) && (tournamentChallenger == target.SimDescription))
                    {
                        if (MartialArts.IsSimsMotiveSparWorthy(actor))
                        {
                            return(true);
                        }
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Common.LocalizeEAString(actor.IsFemale, "Gameplay/Objects/HobbiesSkills/BoardBreaker:CannotBeFatigued", new object[] { actor }));
                    }
                }

                greyedOutTooltipCallback = Common.DebugTooltip("CanParticipateInTournaments fail");
                return(false);
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return(false);
            }
        }
Exemplo n.º 7
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                OccultImaginaryFriend friend;

                if (!OccultImaginaryFriend.TryGetOccultFromSim(target, out friend) || friend.IsReal)
                {
                    return(false);
                }

                if (friend.OwnerSimDescriptionId != a.SimDescription.SimDescriptionId)
                {
                    return(false);
                }

                Relationship relationship = Relationship.Get(a, target, false);
                bool         flag         = (relationship != null) && (relationship.CurrentLTRLiking >= OccultImaginaryFriend.kRelationshipThresholdBeforeCanTurnFriendReal);

                if (a.Inventory.Find <IImaginaryFriendPotion>(true) == null)
                {
                    if (flag)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(OccultImaginaryFriend.LocalizeString(a.IsFemale, "NeedImaginaryFriendPotion", new object[] { a }));
                    }
                    return(false);
                }

                if (!flag)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(OccultImaginaryFriend.LocalizeString(new bool[] { a.IsFemale, target.IsFemale }, "NeedRelToUseImaginaryFriendPotion", new object[] { a, target }));
                    return(false);
                }

                return(true);
            }
Exemplo n.º 8
0
            public override bool Test(Sim actor, Urnstone target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                MagicControl control = MagicControl.GetBestControl(actor, this);

                if (control == null)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("No Control");
                    return(false);
                }

                if (target == null)
                {
                    return(false);
                }
                if (target.DeadSimsDescription == null)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Gameplay/ActorSystems/OccultWitch:SimMovedOn", new object[0x0]));
                    return(false);
                }
                if (target.DeadSimsDescription.ChildOrBelow)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Gameplay/ActorSystems/OccultWitch:ReviveDead", new object[0x0]));
                    return(false);
                }
                if (target.DeadSimsDescription.IsPet)
                {
                    return(false);
                }
                if ((target.DeadSimsDescription.CreatedSim != null) && target.DeadSimsDescription.CreatedSim.IsDying())
                {
                    return(false);
                }
                return(true);
            }
Exemplo n.º 9
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }

                if (actor == null || target == null)
                {
                    return(false);
                }

                if (actor.IsNPC)
                {
                    return(false);
                }

                NiecHelperSituation situationOfType = actor.GetSituationOfType <NiecHelperSituation>();

                if (situationOfType != null)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Already Added Situation\n" + "WorkingNHSCount: " + NiecHelperSituation.WorkingNiecHelperSituationCount + "\nAHWorkingNHSCount: " + NiecHelperSituation.Spawn.ActiveHouseholdWorkingNHS_Count() + "\nSimsCount: " + NFinalizeDeath.SC_GetObjects <Sim>().Length);
                    return(false);
                }

                return(true);
            }
Exemplo n.º 10
0
            public override bool Test(Sim actor, ScienceLab target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (actor.Inventory.Find <IVoucherCloneMe>() == null)
                {
                    return(false);
                }

                /*
                 * if (!Household.ActiveHousehold.CanAddSpeciesToHousehold(actor.SimDescription.Species))
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, "Gameplay/Objects/RabbitHoles/ScienceLab:HouseholdTooLarge", new object[0x0]));
                 *  return false;
                 * }
                 * if (actor.OccultManager.HasAnyOccultType())
                 * {
                 *  return false;
                 * }
                 *
                 * if (actor.SimDescription.IsGhost)
                 * {
                 *  return false;
                 * }
                 */

                if (GameUtils.IsOnVacation())
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, "Ui/Tooltip/Vacation/GreyedoutTooltip:InteractionNotValidOnVacation", new object[0x0]));
                    return(false);
                }
                return(true);
            }
Exemplo n.º 11
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!Jetpack.IsAllowedToUseJetpack(a))
                {
                    return(false);
                }
                if (isAutonomous)
                {
                    if (!a.Inventory.ContainsType(typeof(Jetpack), 0x1))
                    {
                        return(false);
                    }
                }
                else if (a.GetActiveJetpack() == null)
                {
                    return(false);
                }

                /*
                 * if (a.SimDescription.IsVisuallyPregnant)
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.SimDescription.IsFemale, "Gameplay/ActorSystems/OccultImaginaryFriend:ImaginaryFriendModeDisabledPregnancy", new object[] { a.SimDescription }));
                 *  return false;
                 * }
                 */

                SocialJig socialjig = null;

                if (!Jetpack.CheckSpaceForFlyAroundJig(a, target, ref socialjig, true, true))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Gameplay/Objects/EP11/Jetpack:NotEnoughSpace", new object[] { target }));
                    return(false);
                }
                return(true);
            }
Exemplo n.º 12
0
            public override bool Test(Sim a, JuiceKeg target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (target.IsHaunted)
                    {
                        return(false);
                    }

                    if (!Woohooer.Settings.mUnlockTeenActions)
                    {
                        if (a.SimDescription.TeenOrBelow)
                        {
                            return(false);
                        }
                    }

                    if (target.IsEmpty())
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(JuiceKeg.LocalizeString("OutOfJuice", new object[0x0]));
                        return(false);
                    }
                    return(true);
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
Exemplo n.º 13
0
            public override bool Test(Sim a, BotMakingStation target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                /*
                 * if (!a.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.Human, 0x1, true))
                 * {
                 *  string localizedString = BotMakingStation.LocalizeString(a.IsFemale, "HouseholdIsFull", new object[0x0]);
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(localizedString);
                 *  return false;
                 * }
                 */
                if ((a != null) && (a.SkillManager != null))
                {
                    BotBuildingSkill element = a.SkillManager.GetElement(SkillNames.BotBuilding) as BotBuildingSkill;
                    if ((element != null) && (element.SkillLevel > BotMakingStation.kMinSkillToCreateServoBot))
                    {
                        if (a.FamilyFunds >= BotMakingStation.kCostToBuildServoBot)
                        {
                            if (target.InUse && !target.mActorsUsingMe.Contains(a))
                            {
                                greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(BotMakingStation.LocalizeString("StationInUse", new object[0x0]));
                                return(false);
                            }
                            return(true);
                        }

                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(BotMakingStation.LocalizeString(a.IsFemale, "LackTheSimoleansToCreateServobot", new object[0x0]));
                    }
                    else
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(BotMakingStation.LocalizeString(a.IsFemale, "LackTheRequiredSkillLevelToCreateAServobot", new object[0x0]));
                    }
                }
                return(false);
            }
Exemplo n.º 14
0
            public override bool Test(Sim a, Hospital target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if ((a.IsRobot || a.OccultManager.HasOccultType(OccultTypes.Mummy)) || a.OccultManager.HasOccultType(OccultTypes.PlantSim))
                {
                    return(false);
                }
                if (a.FamilyFunds < Hospital.CreateBabyWith.kCostOfBabyMaking)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(LocalizationHelper.InsufficientFunds);
                    return(false);
                }

                /*
                 * if (!a.SimDescription.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human, 1, true))
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:HouseholdFull", new object[0]));
                 *  return false;
                 * }
                 */
                if (this.GetSims(a).Count == 0)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:NoFriendsNearBy", new object[0]));
                    return(false);
                }
                if ((a.CurrentInteraction == null) || (!a.InteractionQueue.HasInteractionOfType(this) && !a.InteractionQueue.HasInteractionOfType(Hospital.BeForcedToMakeBabyWith.Singleton)))
                {
                    return(true);
                }
                greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:HaveToWait", new object[0]));
                return(false);
            }
Exemplo n.º 15
0
            public override bool Test(Sim a, EquestrianCenter target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.IsActorUsingMe(a))
                {
                    return(false);
                }

                Posture posture = a.Posture as RidingPosture;

                if (posture == null)
                {
                    posture = a.Posture as LeadingHorsePosture;
                    if (posture == null)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.OfferStallionAsStud.LocalizeString(a.IsFemale, "NeedHorse", new object[] { a }));
                        return(false);
                    }
                }

                Sim container = posture.Container as Sim;

                if (!container.IsSelectable)
                {
                    return(false);
                }

                if (container.SimDescription.IsFemale)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.OfferStallionAsStud.LocalizeString(a.IsFemale, "NeedMaleHorse", new object[] { a }));
                    return(false);
                }
                else if (container.SimDescription.Child)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.OfferStallionAsStud.LocalizeString(a.IsFemale, "NeedAdultHorse", new object[] { a }));
                    return(false);
                }
                else if (container.SimDescription.Elder)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.OfferStallionAsStud.LocalizeString(container.IsFemale, "ElderPetsTooOldForBreed", new object[] { container }));
                    return(false);
                }

                /*
                 * if (container.SimDescription.IsUnicorn)
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.OfferStallionAsStud.LocalizeString(a.IsFemale, "UnicornCannotBeOffered", new object[] { a }));
                 *  return false;
                 * }
                 */

                Motives motives = container.Motives;

                if (motives.HasMotive(CommodityKind.StallionOffered) && (motives.GetValue(CommodityKind.StallionOffered) >= EquestrianCenter.kOfferStallionMotiveThreshold))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.OfferStallionAsStud.LocalizeString(a.IsFemale, "Cooldown", new object[] { a, container }));
                    return(false);
                }
                return(true);
            }
Exemplo n.º 16
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (a == target)
                    {
                        return(false);
                    }

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

                    if (!CelebrityManager.CanSocialize(a, target))
                    {
                        return(false);
                    }

                    if (target.SimDescription.IsVisuallyPregnant)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(target.IsFemale, "Gameplay/Actors/Sim:PregnantFailure", new object[0]));
                        return(false);
                    }

                    SwimmingInPool posture = a.Posture as SwimmingInPool;
                    SwimmingInPool pool2   = target.Posture as SwimmingInPool;
                    if (posture == null)
                    {
                        return(false);
                    }

                    if ((pool2 != null) && (pool2.ContainerPool == posture.ContainerPool))
                    {
                        return(false);
                    }

                    if (!Pool.SimOutfitSupportsSkinnyDipping(target, ref greyedOutTooltipCallback))
                    {
                        return(false);
                    }
                    return(true);
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
Exemplo n.º 17
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);
                }
            }
Exemplo n.º 18
0
                /*
                 * public override void PopulatePieMenuPicker(ref InteractionInstanceParameters parameters, out List<ObjectPicker.TabInfo> listObjs, out List<ObjectPicker.HeaderInfo> headers, out int NumSelectableRows)
                 * {
                 *  NumSelectableRows = 2;
                 *  Sim actor = parameters.Actor as Sim;
                 *  List<Sim> sims = new List<Sim>();
                 *
                 *  foreach (Sim sim in actor.LotCurrent.GetSims())
                 *  {
                 *      if (sim.SimDescription.ToddlerOrAbove)
                 *      {
                 *          sims.Add(sim);
                 *      }
                 *  }
                 *
                 *  base.PopulateSimPicker(ref parameters, out listObjs, out headers, sims, true);
                 * }
                 */

                public override bool Test(Sim a, TriasTrvalKi target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
                {
                    //if (a.IsNPC) return false;

                    if (a.SimDescription.IsPet || a.Service is GrimReaper || a.SimDescription.ChildOrBelow)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Sorry, Can't Run Travel to Oais Eirts");
                        return(false);
                    }
                    return(true);
                }
Exemplo n.º 19
0
 public override bool Test(Sim a, Plant target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (!WaterTestDisregardGardeningSkill1(target, a))
     {
         return(false);
     }
     if (!target.mDormant)
     {
         return(true);
     }
     greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString("Gameplay/Objects/Gardening:DormantPlant"));
     return(false);
 }
Exemplo n.º 20
0
 public override bool Test(Sim a, JapLowDinnerTable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (target.ActorsUsingMe.Contains(a))
     {
         return(false);
     }
     if (target.InUse && target.ActorsUsingMe.Count >= 4)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("No Free Spots");
         return(false);
     }
     return(true);
 }
Exemplo n.º 21
0
 public override bool Test(Sim a, CraftersConsignment target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (target.Charred)
     {
         return(false);
     }
     if (DisplayHelper.GetObjectsICanBuyInDisplay(a, target).Count == 0)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(CraftersConsignment.LocalizeString(a.IsFemale, "NothingOnDisplay", new object[0]));
         return(false);
     }
     return(true);
 }
Exemplo n.º 22
0
            public override bool Test(Sim a, Phone target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Base fail");
                    return(false);
                }

                MartialArts skill = a.SkillManager.GetSkill <MartialArts>(SkillNames.MartialArts);

                if ((skill == null) || !skill.CanParticipateInTournaments)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("CanParticipateInTournaments fail");
                    return(false);
                }

                SimDescription tournamentChallenger = skill.TournamentChallenger;

                if (tournamentChallenger == null)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("tournamentChallenger fail");
                    return(false);
                }

                /* Removed
                 * if (GameUtils.GetCurrentWorld() != WorldName.China)
                 * {
                 *  Phone.CallInviteOverSparTournamentChallenger.Definition.GreyedOutTooltipHelper helper = new Phone.CallInviteOverSparTournamentChallenger.Definition.GreyedOutTooltipHelper(a.SimDescription, tournamentChallenger, "CanSparOnlyInChina");
                 *  greyedOutTooltipCallback = new GreyedOutTooltipCallback(helper.Callback);
                 *  return false;
                 * }
                 */
                if (tournamentChallenger.Household == a.Household)
                {
                    Phone.CallInviteOverSparTournamentChallenger.Definition.GreyedOutTooltipHelper helper2 = new Phone.CallInviteOverSparTournamentChallenger.Definition.GreyedOutTooltipHelper(a.SimDescription, tournamentChallenger, "ChallengerPartOfHousehold");
                    greyedOutTooltipCallback = new GreyedOutTooltipCallback(helper2.Callback);
                    return(false);
                }
                if (!CanSimInviteOver(a, isAutonomous) || !CanInviteOverToLot(a.LotCurrent, isAutonomous))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Sims3.Gameplay.Visa.TravelUtil.LocalizeString(a.IsFemale, "CannotInviteOver", new object[] { a }));
                    return(false);
                }
                if ((tournamentChallenger.CreatedSim != null) && (tournamentChallenger.CreatedSim.LotCurrent == a.LotCurrent))
                {
                    Phone.CallInviteOverSparTournamentChallenger.Definition.GreyedOutTooltipHelper helper3 = new Phone.CallInviteOverSparTournamentChallenger.Definition.GreyedOutTooltipHelper(a.SimDescription, tournamentChallenger, "ChallengerOnTheSameLot");
                    greyedOutTooltipCallback = new GreyedOutTooltipCallback(helper3.Callback);
                    return(false);
                }
                return(true);
            }
Exemplo n.º 23
0
            public override bool Test(Sim a, EquestrianCenter target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.IsActorUsingMe(a))
                {
                    return(false);
                }

                Posture posture = a.Posture as RidingPosture;

                if (posture == null)
                {
                    posture = a.Posture as LeadingHorsePosture;
                    if (posture == null)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.SellHorse.LocalizeString(a.IsFemale, "SimNeedsToBeRidingAHorse", new object[] { a }));
                        return(false);
                    }
                }

                Sim container = posture.Container as Sim;

                if (!container.IsSelectable)
                {
                    return(false);
                }

                SimDescription simDescription = container.SimDescription;

                if (simDescription.Child)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/EquestrianCenter/OfferStallionAsStud:NeedAdultHorse", new object[] { a }));
                    return(false);
                }

                /*
                 * if (simDescription.IsUnicorn)
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(EquestrianCenter.SellHorse.LocalizeString(a.IsFemale, "UnicornCannotBeSold", new object[0x0]));
                 *  return false;
                 * }
                 */

                SocialWorkerPetPutUp instance = SocialWorkerPetPutUp.Instance;
                Lot lotHome = container.LotHome;

                if ((((instance != null) && (lotHome != null)) && (instance.IsServiceRequested(lotHome) || instance.IsAnySimAssignedToLot(lotHome))) && (instance.PetToPutUp == simDescription))
                {
                    return(false);
                }
                return(true);
            }
Exemplo n.º 24
0
            public override bool Test(Sim actor, BarProfessional target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                SimDescription theActor = actor.SimDescription;

                if (theActor != null)
                {
                    if (theActor.IsVampire == false)
                    {
                        return(false);
                    }
                }

                if (!target.IsBartenderAvailable())
                {
                    return(false);
                }
                if (actor == target.mBartender)
                {
                    return(false);
                }
                if (target.LotCurrent.IsResidentialLot)
                {
                    return(false);
                }
                if (isAutonomous)
                {
                    if (BarProfessional.IsRunningBarInteraction(actor))
                    {
                        return(false);
                    }
                    if (target.mBartender != null && !Bartending.CanWorkAsBartendender(target.mBartender, target.LotCurrent, true))
                    {
                        return(false);
                    }
                    if (Bartending.HasTabOpen(actor, target.LotCurrent))
                    {
                        return(false);
                    }
                }
                if (DrinkDescription != null)
                {
                    int num = BarProfessional.GetCost(DrinkDescription, target.LotCurrent.GetMetaAutonomyType, actor, target) * 1;
                    if (num > actor.FamilyFunds)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(BarProfessional.LocalizeString("NotEnoughMoney", new object[0]));
                        return(false);
                    }
                }
                return(true);
            }
Exemplo n.º 25
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }
                if (actor.IsNPC)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Death Good System: No Allow NPC");
                    return(false);
                }

                return(true);
            }
Exemplo n.º 26
0
            public override bool Test(Sim actor, TimePortal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!target.Active)
                {
                    return(false);
                }

                if (target.IsBroken)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, TimePortal.sLocalizationKey + ":MustRepairTimePortal", new object[] { actor }));
                    return(false);
                }

                return(PublicTest(actor, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Exemplo n.º 27
0
                public override bool Test(Sim a, JapLowDinnerTable target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
                {
                    ObjectGuid containedObject = Slots.GetContainedObject(target.ObjectId, 2820733094u);

                    if (containedObject == ObjectGuid.InvalidObjectGuid)
                    {
                        return(false);
                    }
                    PreparedFood preparedFood = containedObject.ObjectFromId <PreparedFood>();

                    if (!JapLowDinnerTable.CheckIfHasFood(preparedFood))
                    {
                        return(false);
                    }
                    if (!JapLowDinnerTable.kServeOrEatSpoiledFood && preparedFood.IsSpoiled)
                    {
                        return(false);
                    }
                    if (JapLowDinnerTable.kOnlyRecipesThatUseFork && (preparedFood.CookingProcess == null || preparedFood.CookingProcess.Recipe == null || preparedFood.CookingProcess.Recipe.Utensil != "fork"))
                    {
                        return(false);
                    }
                    if (!JapLowDinnerTable.kServeOrEatBurntFood && preparedFood.CookingProcess != null && preparedFood.CookingProcess.FoodState == FoodCookState.Burnt)
                    {
                        return(false);
                    }
                    if (target.ActorsUsingMe.Contains(a))
                    {
                        return(false);
                    }
                    if (target.InUse && target.ActorsUsingMe.Count >= 4)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("No Free Spots");
                        return(false);
                    }
                    if (isAutonomous)
                    {
                        if (a.SimDescription.IsRobot)
                        {
                            return(false);
                        }
                        if (a.BuffManager.HasElement(BuffNames.Stuffed))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
Exemplo n.º 28
0
            public override bool Test(Sim actor, TimeMachine target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!GameUtils.IsInstalled(ProductVersion.EP11))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Pack Fail");
                    return(false);
                }

                if (actor.BuffManager.HasElement(BuffNames.TimeTraveled))
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(TimeMachine.LocalizeString("TimeTravelGreyedOutTooltip", new object[] { actor }));
                    return(false);
                }

                return(TimePortalTravelEx.Definition.PublicTest(actor, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Exemplo n.º 29
0
                public override bool Test(Sim a, RestockItem target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
                {
                    //If restock from inventory, check does the item exist
                    StoreSetBase sBase = RestockItemHelperClass.FindParentShopBase(target);

                    if (sBase == null)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(CMStoreSet.LocalizeString("GrayNeedsPedestal", new object[0] {
                        }));
                        return(false);
                    }

                    if (sBase.Charred)
                    {
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(CMStoreSet.LocalizeString("GrayCharred", new object[0] {
                        }));
                        return(false);
                    }

                    if (RestockItemHelperClass.RestockFromInventory(target, sBase.Info.RestockCraftable))
                    {
                        if (sBase.Info.RegisterId == ObjectGuid.InvalidObjectGuid && !sBase.Info.RestockCraftable)
                        {
                            greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(CMStoreSet.LocalizeString("GrayNeedsRegister", new object[0] {
                            }));
                            return(false);
                        }

                        if (sBase.Info.RegisterId != ObjectGuid.InvalidObjectGuid && RestockItemHelperClass.ReturnRestocableObjectFromRegister(target, sBase.Info.RegisterId) == null)
                        {
                            greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(CMStoreSet.LocalizeString("GrayInventoryEmpty", new object[0] {
                            }));
                            return(false);
                        }
                    }
                    else
                    {
                        //Should restock buy items be disabled
                        if (target.info.Type == ItemType.Buy && !sBase.Info.RestockBuyMode)
                        {
                            greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(CMStoreSet.LocalizeString("GrayRestockBuyModeDisabled", new object[0] {
                            }));
                            return(false);
                        }
                    }
                    return(true);
                }
Exemplo n.º 30
0
                /*
                 *  public override void PopulatePieMenuPicker(ref InteractionInstanceParameters parameters, out List<ObjectPicker.TabInfo> listObjs, out List<ObjectPicker.HeaderInfo> headers, out int NumSelectableRows)
                 *  {
                 *      NumSelectableRows = 1;
                 *      Sim actor = parameters.Actor as Sim;
                 *      List<Sim> sims = new List<Sim>();
                 *
                 *      foreach (Sim sim in actor.LotCurrent.GetSims())
                 *      {
                 *          if (sim != actor && sim.SimDescription.TeenOrAbove)
                 *          {
                 *              sims.Add(sim);
                 *          }
                 *      }
                 *
                 *      base.PopulateSimPicker(ref parameters, out listObjs, out headers, sims, true);
                 *  }
                 */

                public override bool Test(Sim a, NiecAutoKill target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
                {
                    if (a.IsInActiveHousehold)
                    {
                        if (isAutonomous)
                        {
                            return(false);
                        }
                        greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Death Good System: Not Allow Active Household and Allow NPC to Sim");
                        return(true);
                    }
                    if (a.Service is GrimReaper)
                    {
                        return(false);
                    }
                    return(true);
                }