コード例 #1
0
ファイル: BuyHorseEx.cs プロジェクト: Robobeurre/NRaas
            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;
            }
 public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         if (a.FamilyFunds < CollegeOfBusiness.kCostOfResumeInterviewClass)
         {
             return false;
         }
         if (!SimClock.IsTimeBetweenTimes(CollegeOfBusiness.AttendResumeWritingAndInterviewTechniquesClass.kStartAvailibilityTime, CollegeOfBusiness.AttendResumeWritingAndInterviewTechniquesClass.kEndAvailibilityTime))
         {
             return false;
         }
         /*
         if (!GameUtils.IsUniversityWorld())
         {
             return false;
         }
         */
         return true;
     }
     catch (Exception e)
     {
         Common.Exception(a, target, e);
         return false;
     }
 }
コード例 #3
0
 public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         if (a.FamilyFunds < CollegeOfBusiness.kCostOfBudgetClass)
         {
             return false;
         }
         if (!SimClock.IsTimeBetweenTimes(CollegeOfBusiness.AttendBudgetClass.kStartAvailibilityTime, CollegeOfBusiness.AttendBudgetClass.kEndAvailibilityTime))
         {
             return false;
         }
         /*
         if (!GameUtils.IsUniversityWorld())
         {
             return false;
         }
         */
         float num = 0f;
         if (CollegeOfBusiness.AttendBudgetClass.sCooldownDict.TryGetValue(a.SimDescription.SimDescriptionId, out num))
         {
             return ((SimClock.ElapsedTime(TimeUnit.Hours) - num) > CollegeOfBusiness.AttendBudgetClass.kInteractionCooldown);
         }
         return true;
     }
     catch (Exception e)
     {
         Common.Exception(a, target, e);
         return false;
     }
 }
コード例 #4
0
ファイル: FlyToLotEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim actor, Jetpack target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!Jetpack.IsAllowedToUseJetpack(actor))
                {
                    return false;
                }
                if (actor.GetActiveJetpack() == null)
                {
                    return false;
                }
                if (actor.GetActiveJetpack() != target)
                {
                    return false;
                }

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

            }
コード例 #5
0
            public override bool Test(Sim actor, Lot target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                // Stops the dead from leaving the cemetery
                if ((actor.SimDescription.IsDead) && (!actor.SimDescription.IsPlayableGhost)) return false;

                return base.Test(actor, target, isAutonomous, ref greyedOutTooltipCallback);
            }
コード例 #6
0
ファイル: Book_PutAwayEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim a, Book target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target is BookToddler)
                {
                    if (!a.Inventory.Contains(target))
                    {
                        if (isAutonomous) return false;
                    }

                    if (a.LotHome != a.LotCurrent) return false;
                }
                else
                {
                    if (a.Inventory.Contains(target) && (a.LotCurrent != a.LotHome))
                    {
                        return false;
                    }
                }

                if (target.InUse || (Bookshelf.FindClosestBookshelf(a, target, a.Inventory.Contains(target)) == null))
                {
                    return false;
                }

                if (!target.IsServiceableBySim(a))
                {
                    return false;
                }

                return true;
            }
コード例 #7
0
ファイル: CloneFromSampleEx.cs プロジェクト: Robobeurre/NRaas
 public override bool Test(Sim a, ScienceResearchStation target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (target.Repairable.Broken)
     {
         greyedOutTooltipCallback = new GreyedOutTooltipCallback(target.StationIsBroken);
         return false;
     }
     ScienceSkill element = (ScienceSkill)a.SkillManager.GetElement(SkillNames.Science);
     if ((element == null) || (element.SkillLevel < ScientificSample.CloneFromSample.MinScienceSkillLevel))
     {
         greyedOutTooltipCallback = new GreyedOutTooltipCallback(ScienceResearchStation.DisplayLevelTooLowTooltip);
         return false;
     }
     new List<InventoryStack>();
     bool flag = false;
     foreach (InventoryStack stack in a.Inventory.InventoryItems.Values)
     {
         ScientificSample sample = null;
         if (stack != null)
         {
             sample = stack.List[0].Object as ScientificSample;
         }
         if ((sample != null) && ((sample.ScientificSampleType != ScientificSample.SampleType.Dna) /*|| (!GameUtils.IsUniversityWorld() && a.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human))*/ ))
         {
             flag = true;
             break;
         }
     }
     if (!flag)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(ScienceResearchStation.LocalizeString("SampleNotPresent", new object[0]));
         return false;
     }
     return flag;
 }
コード例 #8
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    HotairBalloon.InBalloonPosture posture = actor.Posture as HotairBalloon.InBalloonPosture;
                    if (posture == null)
                    {
                        return false;
                    }

                    if (posture.Balloon.GetOtherSim(actor) == null)
                    {
                        return false;
                    }

                    // Custom
                    return HotAirBalloonProposal.ProposalTest(posture.Balloon, actor, target, isAutonomous, ref greyedOutTooltipCallback);
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(actor, target, e);
                    return false;
                }
            }
コード例 #9
0
ファイル: TeleportEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim actor, Terrain target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if ((actor != null) && (actor.LotCurrent == actor.LotHome) && (Sims3.Gameplay.Queries.CountObjects<ITeleporter>(actor.LotHome) > 0x0))
                {
                    return false;
                }

                if (GoHere.Settings.mTeleportForAll) return true;

                if (GoHere.Settings.mVampireTeleport)
                {
                    if (actor.SimDescription.IsVampire) return true;

                    if (actor.SimDescription.IsPlayableGhost) return true;

                    if (actor.SimDescription.IsUnicorn) return true;

                    if (actor.SimDescription.IsGenie) return true;

                    if (actor.SimDescription.IsFairy) return true;

                    if (actor.SimDescription.IsWitch) return true;
                }

                return false;
            }
コード例 #10
0
 public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     using(WoohooTuningControl control = new WoohooTuningControl(parameters.InteractionObjectPair.Tuning, Woohooer.Settings.mAllowTeenSkinnyDip))
     {
         return base.Test(ref parameters, ref greyedOutTooltipCallback);
     }
 }
コード例 #11
0
ファイル: PourJuiceEx.cs プロジェクト: Robobeurre/NRaas
            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;
                }
            }
コード例 #12
0
            public override bool Test(Sim a, VoucherCloneMe target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                target.TargetScienceLab = Voucher.FindNearestScienceLab(a);
                if (target.TargetScienceLab == null)
                {
                    return false;
                }

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

                if (a.OccultManager.HasAnyOccultType())
                {
                    return false;
                }

                if (a.SimDescription.IsGhost)
                {
                    return false;
                }
                */

                if (GameUtils.IsOnVacation())
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Ui/Tooltip/Vacation/GreyedoutTooltip:InteractionNotValidOnVacation", new object[0x0]));
                    return false;
                }

                return true;
            }
コード例 #13
0
ファイル: OfferToMakeRealEx.cs プロジェクト: Robobeurre/NRaas
            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;
            }
コード例 #14
0
ファイル: AskAboutFunds.cs プロジェクト: Robobeurre/NRaas
        public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            try
            {
                if (target.Household == null)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("No Household");
                    return false;
                }

                if (target.Household == actor.Household)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Same Household");
                    return false;
                }

                if (target.Household.IsSpecialHousehold)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Special Household");
                    return false;
                }

                return true;
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
                return false;
            }
        }
コード例 #15
0
ファイル: GetMarriedEx.cs プロジェクト: Robobeurre/NRaas
            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;
                }
            }
コード例 #16
0
ファイル: PlantObjectHereEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim a, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.InUse)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("InUse");
                    return false;
                }

                PlantableComponent plantable = target.Plantable;
                if ((plantable == null) || plantable.InSeedSpawner)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("InSeedSpawner");
                    return false;
                }

                /*
                TerrainType type = (TerrainType)World.GetTerrainType(target.Position.x, target.Position.z, 0x0);
                if ((type != TerrainType.LotTerrain) && (type != TerrainType.WorldTerrain))
                {
                    return false;
                }
                */
                if (target.Parent != null)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Parent");
                    return false;
                }
                /*
                else if (!target.IsOutside)
                {
                    return false;
                }
                */
                else if (!BaseCommonPlantingTest(a, target, target.LotCurrent, ref greyedOutTooltipCallback))
                {
                    return false;
                }

                bool flag = true;
                /*
                Soil soilToPlace = GlobalFunctions.CreateObjectOutOfWorld("GardenSoil") as Soil;
                if (soilToPlace == null)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("GardenSoil");
                    return false;
                }

                soilToPlace.AddToWorld();
                soilToPlace.Ghost();
                flag = PlantObjectHere.CanPlaceSoil(a, target, soilToPlace);
                soilToPlace.Destroy();

                if (!flag)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("CanPlaceSoil");
                }
                */
                return flag;
            }
コード例 #17
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;
                }
            }
コード例 #18
0
ファイル: SpinEx.cs プロジェクト: Chain-Reaction/NRaas
 public override bool SkatableObjectTest(Sim a, ISkatableObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (!target.IsActorUsingMe(a))
     {
         return false;
     }
     SkateEx currentInteraction = a.CurrentInteraction as SkateEx;
     return ((currentInteraction != null) && currentInteraction.CanSingleSpin(ref greyedOutTooltipCallback));
 }
コード例 #19
0
ファイル: TeleportEx.cs プロジェクト: Robobeurre/NRaas
            public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!Test(parameters.Actor as Sim, parameters.Target as Terrain, parameters.Autonomous, ref greyedOutTooltipCallback))
                {
                    return InteractionTestResult.Def_TestFailed;
                }

                return base.Test(ref parameters, ref greyedOutTooltipCallback);
            }
コード例 #20
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;
            }
コード例 #21
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (a.LotCurrent == null) return true;

                if (a.LotCurrent.IsBaseCampLotType) return true;

                if (a.LotCurrent.CommercialLotSubType == CommercialLotSubType.kEP10_Resort) return true;

                return base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback);
            }
コード例 #22
0
ファイル: CallReturnHomeEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim a, Phone target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!target.IsUsableBy(a))
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Not Usable");
                    return false;
                }

                return Helpers.TravelUtilEx.CanSimTriggerTravelToHomeWorld(a, ref greyedOutTooltipCallback);
            }
コード例 #23
0
            /*
            public override InteractionInstance CreateInstance(ref InteractionInstanceParameters parameters)
            {
                InteractionInstance na = new FishAutonomouslyEx();
                na.Init(ref parameters);
                return na;
            }
            */

            public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                //if (parameters.Autonomous)
                {
                    GameObjectHit gameObjectHit = InteractionInstance.CreateFakeGameObjectHit(parameters.Target.Position);
                    InteractionObjectPair iop = new IopWithCustomTuning(FishHere.Singleton, Terrain.Singleton, parameters.InteractionObjectPair.Tuning, parameters.Target.GetType());
                    InteractionInstanceParameters parameters2 = new InteractionInstanceParameters(iop, parameters.Actor, parameters.Priority, parameters.Autonomous, parameters.CancellableByPlayer, gameObjectHit);
                    return FishHere.Singleton.Test(ref parameters2, ref greyedOutTooltipCallback);
                }
                //return InteractionTestResult.Gen_NotAutonomous;
            }
コード例 #24
0
ファイル: PurchaseBotEx.cs プロジェクト: Robobeurre/NRaas
 protected static bool CustomPurchaseTest(ServoBotPedestal ths, Sim Actor, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     /*
     if (!Actor.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human))
     {
         string localizedString = LocalizeString(Actor.IsFemale, "HouseholdFull", new object[0x0]);
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(localizedString);
         return false;
     }
     */
     return BaseCustomPurchaseTest(ths, Actor, isAutonomous, ref greyedOutTooltipCallback);
 }
コード例 #25
0
ファイル: Burn.cs プロジェクト: Robobeurre/NRaas
 public static bool CallbackTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         return Assassination.Allow(actor, target, SimDescription.DeathType.Burn, isAutonomous, false, false, ref greyedOutTooltipCallback);
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
         return false;
     }
 }
コード例 #26
0
ファイル: SimRiskyWoohoo.cs プロジェクト: Robobeurre/NRaas
 public static bool OnScoreNeutral(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         return true;
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
         return false;
     }
 }
コード例 #27
0
ファイル: SimRiskyWoohoo.cs プロジェクト: Robobeurre/NRaas
 public static bool OnScoreInsulting(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     try
     {
         return WoohooScoring.ScoreInsulting(actor, target, Common.IsAutonomous(actor), "InterestInRisky");
     }
     catch (Exception e)
     {
         Common.Exception(actor, target, e);
         return false;
     }
 }
コード例 #28
0
ファイル: StalkForPreyEx.cs プロジェクト: Robobeurre/NRaas
            public override bool Test(Sim a, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (SimTypes.IsSelectable(a))
                {
                    if (a.SkillManager.GetSkillLevel(SkillNames.CatHunting) < 1)
                    {
                        return false;
                    }
                }

                return base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback);
            }
コード例 #29
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.ChildOrBelow)
                        {
                            return false;
                        }
                    }
                    else
                    {
                        if (target.SimDescription.TeenOrBelow)
                        {
                            return false;
                        }
                    }
                    
                    if (!CelebrityManager.CanSocialize(a, target))
                    {
                        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;
                }
            }
コード例 #30
0
ファイル: SoloSpinEx.cs プロジェクト: Chain-Reaction/NRaas
 public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (a != target)
     {
         return false;
     }
     if (SkateHelper.CalculateIfActorIsOccultSkaterEx(a))
     {
         return false;
     }
     SkatingRink.Skate currentInteraction = a.CurrentInteraction as SkatingRink.Skate;
     return ((currentInteraction != null) && currentInteraction.CanSingleSpin(ref greyedOutTooltipCallback));
 }
コード例 #31
0
            public override bool Test(Sim a, Computer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!KamaSimtra.Settings.mShowRendezvousInteraction)
                {
                    return(false);
                }

                if (!target.IsComputerUsable(a, true, false, isAutonomous))
                {
                    return(false);
                }

                KamaSimtra skill = a.SkillManager.GetSkill <KamaSimtra>(KamaSimtra.StaticGuid);

                if (skill == null)
                {
                    return(false);
                }

                return(skill.CanWhore());
            }
コード例 #32
0
            public override bool Test(Sim a, IMirror target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (a.CurrentOutfitCategory == OutfitCategories.Singed)
                    {
                        return(false);
                    }

                    if (a.CurrentOutfitCategory == OutfitCategories.SkinnyDippingTowel)
                    {
                        return(false);
                    }

                    return(Sims.CASBase.PublicAllow(a.SimDescription, ref greyedOutTooltipCallback));
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
コード例 #33
0
ファイル: BedSurrogate.cs プロジェクト: Duglarogg/Sims3
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback callback)
            {
                try
                {
                    if (!base.Test(actor, target, isAutonomous, ref callback))
                    {
                        return(false);
                    }

                    return(CommonSurrogatePregnancy.SatisfiesImpregnate(actor, target, "BedImpregnate", isAutonomous, true, ref callback));
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(actor, target, e);
                }

                return(false);
            }
コード例 #34
0
ファイル: DebugAbductSim.cs プロジェクト: Duglarogg/Sims3
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!Aliens.Settings.Debugging)
                {
                    return(false);
                }

                if (Household.AlienHousehold == null)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Alien household is null.");
                    return(false);
                }

                if (AlienUtils.IsHouseboatAndNotDocked(target.LotCurrent))
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Target is on an undocked houseboat.");
                    return(false);
                }

                if (AlienUtilsEx.GetValidAliens() == null)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("No valid aliens.");
                    return(false);
                }

                if (!target.SimDescription.IsHuman)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Target is not human.");
                    return(false);
                }

                if (target.SimDescription.ChildOrBelow)
                {
                    greyedOutTooltipCallback = CreateTooltipCallback("Target is not teen or older.");
                    return(false);
                }

                return(true);
            }
コード例 #35
0
            public override bool Test(Sim a, TimePortal target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!TimePortal.sTimeTravelerHasBeenSummoned)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("sTimeTravelerHasBeenSummoned");
                    return(false);
                }

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

                if (target.IsBroken)
                {
                    greyedOutTooltipCallback = Common.DebugTooltip("Broken");
                    return(false);
                }

                return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
コード例 #36
0
ファイル: GetMailEx.cs プロジェクト: yakoder/NRaas
            public override bool Test(Sim a, Mailbox target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (a.LotHome == target.mLotCurrent)
                    {
                        if (!target.FlagUp)
                        {
                            return(false);
                        }

                        // Custom
                        if (mUnitData == null)
                        {
                            return(false);
                        }

                        if (!mUnitData.mIsVirtual)
                        {
                            return(true);
                        }

                        greyedOutTooltipCallback = delegate
                        {
                            return(Mailbox.LocalizeString("WrongUnitGreyedOutTooltip", new object[0x0]));
                        };
                    }
                    return(false);
                }
                catch (ResetException)
                {
                    throw;
                }
                catch (Exception e)
                {
                    Common.Exception(a, target, e);
                    return(false);
                }
            }
コード例 #37
0
 public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (isAutonomous)
     {
         return(false);
     }
     if (actor.IsNPC)
     {
         return(false);
     }
     if (target.IsInActiveHousehold)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Death Good System: Already Added");
         return(false);
     }
     if (target.Service is GrimReaper)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Warning: Add Active Family Death Good System?");
         return(true);
     }
     return(true);
 }
コード例 #38
0
        public static void OnAskedToGoSkinnyDipping(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
        {
            try
            {
                GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                Pool[] objects = actor.LotCurrent.GetObjects <Pool>();
                float  num     = 0f;
                Pool   pool    = null;

                foreach (Pool pool2 in objects)
                {
                    #region CHANGED
                    if (CanSkinnyDipAtLocation(actor, pool2.Position, ref greyedOutTooltipCallback))
                    #endregion
                    {
                        float distanceToObject = actor.GetDistanceToObject(pool2);
                        if ((pool == null) || (distanceToObject < num))
                        {
                            pool = pool2;
                            num  = distanceToObject;
                        }
                    }
                }

                if (pool != null)
                {
                    GetInPool entry = GetInPool.SkinnyDipSingleton.CreateInstance(pool, actor, i.GetPriority(), true, true) as GetInPool;
                    GetInPool pool4 = GetInPool.SkinnyDipSingleton.CreateInstance(pool, target, i.GetPriority(), true, true) as GetInPool;
                    entry.SkinnyDippingBuddyID = target.SimDescription.SimDescriptionId;
                    pool4.SkinnyDippingBuddyID = actor.SimDescription.SimDescriptionId;
                    actor.InteractionQueue.AddNext(entry);
                    target.InteractionQueue.AddNext(pool4);
                }
            }
            catch (Exception e)
            {
                Common.Exception(actor, target, e);
            }
        }
コード例 #39
0
ファイル: CommonSurrogate.cs プロジェクト: Duglarogg/Sims3
        // CommonWoohoo.WoohooStyle
        // Safe => Donate
        // Risky/TryForBaby => Impregnate

        public static bool CanDonate(Sim simA, Sim simB, ref GreyedOutTooltipCallback callback)
        {
            if (simA.SimDescription.Gender != simB.SimDescription.Gender)
            {
                callback = Common.DebugTooltip("Male-Female Donating Not Allowed (Yet)");
                return(false);
            }

            if (simA.IsRobot && simB.IsRobot)
            {
                callback = Common.DebugTooltip("Robot-Robot Donating Not Allowed");
                return(false);
            }

            if (!simA.IsRobot && !simB.IsRobot)
            {
                callback = Common.DebugTooltip("Meatbag-Meatbag Donating Not Allowed");
                return(false);
            }

            return(true);
        }
コード例 #40
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                bool result = false;
                CourtesansPerfume perfume = Courtesan.GetPerfume(target);

                if (perfume != null)
                {
                    if (perfume.GenderMatches(actor, target))
                    {
                        result = IsTalkingToOrAlreadyBuying(actor, target, result);
                    }
                }
                else
                {
                    if (Message.Sender.IsDebugging())
                    {
                        Message.Sender.Debug(this, "action is not enabled since perfume does not exist");
                    }
                }

                return(result);
            }
コード例 #41
0
            public override bool Test(Sim actor, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }

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

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

                if (situationOfType != null)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback("Already Added Situation");
                    return(false);
                }

                return(true);
            }
コード例 #42
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (a == target)
                {
                    return(false);
                }

                MagicControl control = MagicControl.GetBestControl(a, this);

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

                if (target.BuffManager.HasElement(BuffNames.SickAndTired))
                {
                    return(false);
                }

                return(CastSpellEx.CommonSpellTests(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
コード例 #43
0
		public static bool CommonPlantingTest(Sim a, GameObject target, Lot lotTryingToPlantingOn, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
		{
			if (!PlantableComponent.PlantInteractionOpportunityTest(a, target))
			{
				return false;
			}
			if (CameraController.IsMapViewModeEnabled())
			{
				greyedOutTooltipCallback = new GreyedOutTooltipCallback(MapViewGreyedTooltip);
				return false;
			}
			if (!PlantingLotTest(lotTryingToPlantingOn, a))
			{
				greyedOutTooltipCallback = new GreyedOutTooltipCallback(CanOnlyPlantOnHomeLot);
				return false;
			}
			if (!a.IsCat)  // TODO: Skill test
			{
				return false;
			}
			return true;
		}
コード例 #44
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                try
                {
                    if (!NestedSocialInteraction <CuddleSeated> .Test(a, target))
                    {
                        greyedOutTooltipCallback = Common.DebugTooltip("Not Cuddle Seated");
                        return(false);
                    }

                    SittingPosture posture = a.Posture as SittingPosture;
                    if (posture != null)
                    {
                        if (!(posture.Container is SaunaClassic))
                        {
                            greyedOutTooltipCallback = Common.DebugTooltip("Actor Not In Sauna");
                            return(false);
                        }
                    }

                    posture = target.Posture as SittingPosture;
                    if (posture != null)
                    {
                        if (!(posture.Container is SaunaClassic))
                        {
                            greyedOutTooltipCallback = Common.DebugTooltip("Target Not In Sauna");
                            return(false);
                        }
                    }

                    return(true);
                }
                catch (Exception exception)
                {
                    Common.Exception(a, target, exception);
                }
                return(false);
            }
コード例 #45
0
ファイル: YouShouldEx.cs プロジェクト: yakoder/NRaas
            public override List <Sim> GetYouShouldTargets(Sim thisActor, Sim pushedSocialActor)
            {
                InteractionPriority priority = new InteractionPriority(InteractionPriorityLevel.UserDirected);

                SocialInteractionA.Definition pushedSocialDefinition = new SocialInteractionA.Definition(mPushedSocialActionKey, new string[0x0], null, false);
                pushedSocialDefinition.ChecksToSkip = mChecksToSkip;

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

                foreach (Sim sim in pushedSocialActor.LotCurrent.GetAllActors())
                {
                    if (sim == thisActor)
                    {
                        continue;
                    }

                    if (sim == pushedSocialActor)
                    {
                        continue;
                    }

                    GreyedOutTooltipCallback tooltipCallback = null;
                    if (!PushedSocialTest(pushedSocialActor, sim, pushedSocialDefinition, priority, tooltipCallback))
                    {
                        continue;
                    }

                    GreyedOutTooltipCallback callback = null;
                    if (!Assassination.CanBeKilled(sim, ref callback))
                    {
                        continue;
                    }

                    list.Add(sim);
                }

                return(list);
            }
コード例 #46
0
        public bool Satisfies(ManagerCareer manager, SimDescription sim, Lot newLot, bool inspecting)
        {
            if (!inspecting)
            {
                Occupation career = CareerManager.GetStaticOccupation(mCareer);
                if (career == null)
                {
                    return(false);
                }

                if ((GameUtils.IsFutureWorld()) && (!career.AvailableInFutureWorld))
                {
                    return(false);
                }

                if (sim.IsEP11Bot)
                {
                    if (!sim.HasTrait(TraitNames.ProfessionalChip))
                    {
                        return(false);
                    }
                }

                if (sim.CreatedSim != null)
                {
                    if ((sim.Occupation == null) || (sim.Occupation.Guid != mCareer))
                    {
                        GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                        if (!career.CanAcceptCareer(sim.CreatedSim.ObjectId, ref greyedOutTooltipCallback))
                        {
                            return(false);
                        }
                    }
                }
            }

            return(PrivateSatisfies(manager, sim, newLot, inspecting));
        }
コード例 #47
0
            public override bool Test(Sim a, Terrain target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (SimTypes.IsSelectable(a))
                {
                    if (a.SkillManager.GetSkillLevel(SkillNames.CatHunting) < 1)
                    {
                        return(false);
                    }

                    CatHuntingSkill skill = a.SkillManager.GetSkill <CatHuntingSkill>(SkillNames.CatHunting);
                    if ((skill == null) || (!skill.CanCatchPreyOfType(CatHuntingSkill.PreyType.Fish)))
                    {
                        return(false);
                    }
                }

                if (!a.IsCat)
                {
                    return(false);
                }

                return(PetManager.PetSkillFatigueTest(a, ref greyedOutTooltipCallback));
            }
コード例 #48
0
        public static bool FightFirstAction(GoToLotSituation parent, GoToLotSituation.MeetUp meetUp)
        {
            try
            {
                GreyedOutTooltipCallback callBack = null;
                if (SocialTest.TestFight(parent.mSimA, parent.mSimB, null, true, ref callBack))
                {
                    StoryProgression.Main.Situations.IncStat("First Action: Fight");

                    meetUp.ForceSituationSpecificInteraction(parent.mSimA, parent.mSimB, new SocialInteractionA.Definition("Fight!", null, null, false), null, meetUp.OnSocialSucceeded, meetUp.OnSocialFailed);
                    return(true);
                }
                else
                {
                    return(EnemyFirstAction(parent, meetUp));
                }
            }
            catch (Exception e)
            {
                Common.DebugException(parent.mSimA, parent.mSimB, e);
                return(false);
            }
        }
コード例 #49
0
ファイル: PrankCoworker.cs プロジェクト: yakoder/NRaas
            public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                OmniCareer omni = a.Occupation as OmniCareer;

                if (omni != null)
                {
                    if (!omni.CanPrank())
                    {
                        return(false);
                    }
                }

                Business business = OmniCareer.Career <Business>(a.Occupation);

                if (!isAutonomous && (business != null))
                {
                    if ((business != null) && !business.IsRegularWorkTime())
                    {
                        return(!business.IsPrankSet);
                    }
                }
                return(false);
            }
コード例 #50
0
 public override bool Test(Sim a, WashingMachine target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if (!target.CanDoLaundry())
     {
         return(false);
     }
     if (target.mWashState == WashingMachine.WashState.HasDirtyLaundry)
     {
         return(true);
     }
     if (a.IsSelectable && target.LotCurrent.IsCommunityLot && a.FamilyFunds < target.Tuning.kCostToOperate)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(WashingMachine.LocalizeString("InsufficientFunds"));
         return(false);
     }
     if (!target.LotCurrent.IsResidentialLot)
     {
         return(true);
     }
     if (Sims3.Gameplay.Queries.CountObjects <ClothingPileDry>(target.LotCurrent) > 0U)
     {
         return(true);
     }
     foreach (Hamper hamper in target.LotCurrent.GetObjects <Hamper>())
     {
         if (hamper.HasClothingPiles())
         {
             return(true);
         }
     }
     if (a.Inventory.ContainsType(typeof(ClothingPileDry), 1))
     {
         return(true);
     }
     greyedOutTooltipCallback = new GreyedOutTooltipCallback(WashingMachine.DoLaundry.Definition.NoLaundryTooltip);
     return(false);
 }
コード例 #51
0
ファイル: Book_PutAwayEx.cs プロジェクト: yakoder/NRaas
            public override bool Test(Sim a, Book target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target is BookToddler)
                {
                    if (!a.Inventory.Contains(target))
                    {
                        if (isAutonomous)
                        {
                            return(false);
                        }
                    }

                    if (a.LotHome != a.LotCurrent)
                    {
                        return(false);
                    }
                }
                else
                {
                    if (a.Inventory.Contains(target) && (a.LotCurrent != a.LotHome))
                    {
                        return(false);
                    }
                }

                if (target.InUse || (Bookshelf.FindClosestBookshelf(a, target, a.Inventory.Contains(target)) == null))
                {
                    return(false);
                }

                if (!target.IsServiceableBySim(a))
                {
                    return(false);
                }

                return(true);
            }
コード例 #52
0
            public override bool Test(Sim a, ScienceResearchStation target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.Repairable.Broken)
                {
                    greyedOutTooltipCallback = new GreyedOutTooltipCallback(target.StationIsBroken);
                    return(false);
                }
                ScienceSkill element = (ScienceSkill)a.SkillManager.GetElement(SkillNames.Science);

                if ((element == null) || (element.SkillLevel < ScientificSample.CloneFromSample.MinScienceSkillLevel))
                {
                    greyedOutTooltipCallback = new GreyedOutTooltipCallback(ScienceResearchStation.DisplayLevelTooLowTooltip);
                    return(false);
                }
                new List <InventoryStack>();
                bool flag = false;

                foreach (InventoryStack stack in a.Inventory.InventoryItems.Values)
                {
                    ScientificSample sample = null;
                    if (stack != null)
                    {
                        sample = stack.List[0].Object as ScientificSample;
                    }
                    if ((sample != null) && ((sample.ScientificSampleType != ScientificSample.SampleType.Dna) /*|| (!GameUtils.IsUniversityWorld() && a.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human))*/))
                    {
                        flag = true;
                        break;
                    }
                }
                if (!flag)
                {
                    greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(ScienceResearchStation.LocalizeString("SampleNotPresent", new object[0]));
                    return(false);
                }
                return(flag);
            }
コード例 #53
0
            public override bool Test(Sim a, CommonDoor target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (/*!target.CanBeLocked ||*/ target.IsInPublicResidentialRoom)
                {
                    return(false);
                }
                if (target.GetContainedObject(unchecked ((Slot)(-1474234202))) is IVelvetRopes)
                {
                    return(false);
                }
                Door door = target as Door;

                if ((door == null) || door.IsNPCDoor)
                {
                    return(false);
                }
                if ((this.mLockType == CommonDoor.tLock.Anybody) && (target.LockType == CommonDoor.tLock.Anybody))
                {
                    return(false);
                }
                if ((this.mLockType == CommonDoor.tLock.Pets) && (!GameUtils.IsInstalled(ProductVersion.Undefined | ProductVersion.EP5) /*|| target.LotCurrent.IsOwned*/))
                {
                    return(false);
                }

                /*
                 * if (a.LotHome != target.LotCurrent)
                 * {
                 *  return false;
                 * }
                 * if (!a.LotHome.IsResidentialLot)
                 * {
                 *  return a.LotHome.IsDormitoryLot;
                 * }
                 */
                return(true);
            }
コード例 #54
0
        // Methods
        public override bool Test(Sim a, RabbitHole target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
        {
            if (!(a.Occupation is OmniCareer))
            {
                return(false);
            }

            GreyedOutTooltipCallback callback = null;
            LawEnforcement           job      = OmniCareer.Career <LawEnforcement>(a.Occupation);

            if ((job != null) && job.CanRaidCriminalWarehouses)
            {
                Hideout hideout = target as Hideout;
                if (hideout != null)
                {
                    DateAndTime time;
                    if (!hideout.mSimToLastRaidTimestamp.TryGetValue(a, out time))
                    {
                        return(true);
                    }
                    if (SimClock.ElapsedTime(TimeUnit.Hours, time, SimClock.CurrentTime()) >= Hideout.kMinimumDurationBetweenCriminalRaids)
                    {
                        return(true);
                    }
                    if (callback == null)
                    {
                        callback = delegate
                        {
                            return(Hideout.RaidCriminals.LocalizeString("CannotUseHideout", new object[] { a }));
                        };
                    }
                    greyedOutTooltipCallback = callback;
                    return(false);
                }
            }
            return(false);
        }
コード例 #55
0
ファイル: SendWooHootyTextEx.cs プロジェクト: yakoder/NRaas
        public new Phone.Call.AcceptanceTestResult CustomAcceptanceTest(SimDescription simDescription)
        {
            if (!RentScheduler.IsAllowedOnLotNow(simDescription, base.Actor.LotCurrent) && !RentScheduler.InviteToLotNow(base.Actor, simDescription, base.Actor.LotCurrent))
            {
                return(Phone.Call.AcceptanceTestResult.ForceReject);
            }

            Sim createdSim = simDescription.CreatedSim;

            if ((createdSim != null) && (GroupingSituation.ShouldSoftReject(base.Actor, createdSim) || GroupingSituation.ShouldHardReject(base.Actor, createdSim)))
            {
                return(Phone.Call.AcceptanceTestResult.ForceReject);
            }

            GreyedOutTooltipCallback greyedOutTooltipCallback = null;
            ActiveTopic topic = null;

            if (!SimWoohoo.PublicTest(base.Actor, createdSim, topic, base.Autonomous, ref greyedOutTooltipCallback))
            {
                return(Phone.Call.AcceptanceTestResult.ForceReject);
            }

            return(Phone.Call.AcceptanceTestResult.DontCare);
        }
コード例 #56
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (isAutonomous)
                {
                    return(false);
                }

                if (a != target)
                {
                    return(false);
                }

                if (!target.SimDescription.IsPlayableGhost)
                {
                    return(false);
                }

                Assassination skill = a.SkillManager.GetSkill <Assassination>(Assassination.StaticGuid);

                if (skill == null)
                {
                    return(false);
                }

                if (!skill.IsGhost())
                {
                    return(false);
                }

                if (Urnstone.FindGhostsGrave(a) == null)
                {
                    return(false);
                }

                return(true);
            }
コード例 #57
0
ファイル: FlyToLotEx.cs プロジェクト: yakoder/NRaas
            public override bool Test(Sim actor, Jetpack target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!Jetpack.IsAllowedToUseJetpack(actor))
                {
                    return(false);
                }
                if (actor.GetActiveJetpack() == null)
                {
                    return(false);
                }
                if (actor.GetActiveJetpack() != target)
                {
                    return(false);
                }

                /*
                 * if (actor.SimDescription.IsPregnant)
                 * {
                 *  greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(actor.IsFemale, "Gameplay/Actors/Sim:PregnantFailure", new object[0x0]));
                 *  return false;
                 * }
                 */
                return(true);
            }
コード例 #58
0
ファイル: SetFrontDoor.cs プロジェクト: yakoder/NRaas
            public override bool Test(Sim a, Door target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (target.LotCurrent == null)
                {
                    return(false);
                }
                switch (target.GetAdjoiningRoom(0x0, eRoomDefinition.LightBlocking))
                {
                case 0x8fff:
                case 0x0:
                    return(false);
                }
                if (target.LotCurrent.GetFrontDoor(eFrontDoorType.kFrontDoorTypeOverride) == target)
                {
                    return(false);
                }
                int roomConnectedToOutside = target.LotCurrent.GetRoomConnectedToOutside(target);

                if (target.LotCurrent.ValidateRoomForFrontDoor(roomConnectedToOutside, target.Level) == float.MaxValue)
                {
                    return(false);
                }
                return(true);
            }
コード例 #59
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                /*
                 * if (a.SimDescription.IsVisuallyPregnant)
                 * {
                 *  return false;
                 * }
                 * if (target.SimDescription.IsVisuallyPregnant)
                 * {
                 *  return false;
                 * }
                 */

                InteractionInstance currentInteraction = a.CurrentInteraction;

                if (((currentInteraction != null) && (currentInteraction.Target == target)) && ((currentInteraction is CuddleSeated) || (currentInteraction is NestedCuddleInteraction)))
                {
                    return(false);
                }

                string reason;

                return(CommonSocials.CanGetRomantic(a, target, isAutonomous, false, true, ref greyedOutTooltipCallback, out reason) && CanCuddle(a, target, ref greyedOutTooltipCallback, true));
            }
コード例 #60
0
        private static List <SocialInteractionCandidate> GetInternal(string name, Sim actor, Sim target, LongTermRelationshipTypes group, bool isActive, ActiveTopic topic, bool isAutonomous, Dictionary <LongTermRelationshipTypes, Dictionary <bool, List <string> > > interactionCategories)
        {
            Dictionary <bool, List <string> > dictionary;
            List <string> list2;
            bool          flag = interactionCategories.TryGetValue(group, out dictionary);

            if (!flag)
            {
                sMsg += Common.NewLine + " Try Default";

                group = LongTermRelationshipTypes.Default;
                flag  = interactionCategories.TryGetValue(group, out dictionary);
            }
            List <SocialInteractionCandidate> list = new List <SocialInteractionCandidate>();

            if (flag && dictionary.TryGetValue(isActive, out list2))
            {
                sMsg += Common.NewLine + " Choices = " + list2.Count;

                foreach (string str in list2)
                {
                    ActionData data = ActionData.Get(str);
                    GreyedOutTooltipCallback greyedOutTooltipCallback = null;

                    InteractionTestResult result = data.Test(actor, target, isAutonomous, topic, ref greyedOutTooltipCallback);

                    sMsg += Common.NewLine + "  " + str + " = " + result;

                    if ((IUtil.IsPass(result) || (greyedOutTooltipCallback != null)) || Sims3.Gameplay.UI.PieMenu.PieMenuShowFailureReason)
                    {
                        list.Add(new SocialInteractionCandidate(str, data.GetParentMenu(actor, target), topic));
                    }
                }
            }
            return(list);
        }