Esempio n. 1
0
        protected virtual bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            IEnumerable <TOption> options = GetOptions();

            if (options == null)
            {
                return(true);
            }

            if (MatchAll)
            {
                foreach (TOption option in options)
                {
                    if (!option.Test(me, false, actor))
                    {
                        return(false);
                    }
                }

                return(true);
            }
            else
            {
                foreach (TOption option in options)
                {
                    if (option.Test(me, false, actor))
                    {
                        return(true);
                    }
                }

                return(false);
            }
        }
Esempio n. 2
0
        public static void GenerateCrossWorldThumbnail(MiniSimDescription miniSim, SimDescription sim, bool forceGeneration)
        {
            if (forceGeneration || (sim.HomeWorld == GameUtils.GetCurrentWorld()))
            {
                ThumbnailTechnique technique = sim.IsDead ? ThumbnailTechnique.Sepia : ThumbnailTechnique.Default;

                ResourceKey travelThumbnailOutfitForSim = MiniSimDescription.GetTravelThumbnailOutfitForSim(sim);
                if (travelThumbnailOutfitForSim.InstanceId != 0x0L)
                {
                    ThumbnailManager.GenerateHouseholdSimThumbnail(travelThumbnailOutfitForSim, travelThumbnailOutfitForSim.InstanceId, 0x0, ThumbnailSizeMask.Large, technique, false, true, sim.AgeGenderSpecies);
                    ThumbnailManager.GenerateTravelSimThumbnail(travelThumbnailOutfitForSim, miniSim.mThumbKey.mDescKey.InstanceId, ThumbnailSizeMask.Large, technique);
                }
                else
                {
                    SimOutfit outfit = sim.GetOutfit(OutfitCategories.Everyday, 0);
                    if ((outfit != null) && (outfit.IsValid))
                    {
                        sim.mDefaultOutfitKey = outfit.Key;

                        ThumbnailManager.GenerateHouseholdSimThumbnail(sim.DefaultOutfitKey, sim.DefaultOutfitKey.InstanceId, 0, ThumbnailSizeMask.Large, technique, false, true, sim.AgeGenderSpecies);
                        ThumbnailManager.GenerateTravelSimThumbnail(sim.DefaultOutfitKey, miniSim.mThumbKey.mDescKey.InstanceId, ThumbnailSizeMask.Large, technique);
                    }
                }
            }
        }
Esempio n. 3
0
            protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
            {
                if (mFilter == null)
                {
                    return(false);
                }

                foreach (SimSelection.ICriteria item in mFilter.mElements)
                {
                    if (item.CanBeRandomCriteria && RandomUtil.CoinFlip())
                    {
                        continue;
                    }

                    ITestableOption testable = item as ITestableOption;
                    if (testable == null)
                    {
                        continue;
                    }

                    if (!testable.Test(me, false, actor))
                    {
                        return(false);
                    }
                }

                return(true);
            }
Esempio n. 4
0
            public override bool Get(MiniSimDescription me, IMiniSimDescription actor, Dictionary <int, int> results)
            {
                try
                {
                    if (me.CASGenealogy == null)
                    {
                        return(false);
                    }

                    if (me.CASGenealogy.IChildren == null)
                    {
                        return(false);
                    }

                    int count = me.CASGenealogy.IChildren.Count;

                    results[count] = count;
                    return(true);
                }
                catch
                {
                    // Sim may not have a valid celebrity manager
                    return(false);
                }
            }
Esempio n. 5
0
        protected bool Run(IMiniSimDescription a, IMiniSimDescription b)
        {
            try
            {
                if (b is SimDescription)
                {
                    SimDescription sim = b as SimDescription;

                    if (!Test(a, sim))
                    {
                        return(true);
                    }

                    return(PrivateRun(a, sim));
                }
                else
                {
                    MiniSimDescription sim = b as MiniSimDescription;

                    if (!Test(a, sim))
                    {
                        return(true);
                    }

                    return(PrivateRun(a, sim));
                }
            }
            catch (Exception e)
            {
                Common.Exception(a, b as SimDescription, e);
                return(false);
            }
        }
Esempio n. 6
0
            public override bool Get(MiniSimDescription me, IMiniSimDescription actor, Dictionary <int, int> results)
            {
                int level = Genealogies.GetFamilyLevel(me.CASGenealogy);

                results[level] = level;
                return(true);
            }
Esempio n. 7
0
        public static SimDescription ImportWithCheck(MiniSimDescription miniSim)
        {
            // Custom
            //   Importing a sim that already exists in town causes issues with the long-term relationship system, don't do it
            SimDescription simDescription = SimDescription.Find(miniSim.SimDescriptionId);

            if (simDescription == null)
            {
                simDescription = UnpackSimAndUpdateRel(miniSim);
                if (simDescription != null)
                {
                    Household.CreateTouristHousehold();
                    Household.TouristHousehold.AddTemporary(simDescription);

                    miniSim.Instantiated = true;

                    (Sims3.UI.Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimCurrentWorldChanged(true, miniSim);

                    if (simDescription.AgingState == null)
                    {
                        simDescription.AgingState = new AgingState(simDescription);
                    }
                    simDescription.AgingState.MergeTravelInformation(miniSim);

                    simDescription.PushAgingEnabledToAgingManager();
                }
            }

            return(simDescription);
        }
Esempio n. 8
0
        protected override bool Run(MiniSimDescription me, bool singleSelection)
        {
            if (!Prompt(me)) return false;

            Annihilation.Cleanse(me);
            return true;
        }
Esempio n. 9
0
        public bool GetAgelessForeign(MiniSimDescription desc)
        {
            if (desc.HomeWorld != WorldName.Undefined && desc.HomeWorld != WorldName.UserCreated)
            {
                return(mAgelessForeign.ContainsKey(desc.HomeWorld));
            }

            if (mWorldForSims.ContainsKey(desc.SimDescriptionId))
            {
                string world = mWorldForSims[desc.SimDescriptionId];

                string name = world.Replace(".world", "");

                WorldName worldName = WorldName.Undefined;

                try
                {
                    worldName = unchecked ((WorldName)ResourceUtils.HashString32(name.Replace(" ", "")));
                }
                catch
                {
                    return(true);
                }

                return(mAgelessForeign.ContainsKey(worldName));
            }

            return(true);
        }
Esempio n. 10
0
        protected static void RepairMiniSim(SimDescription sim)
        {
            if (sim == null)
            {
                return;
            }

            MiniSimDescription miniSim = MiniSimDescription.Find(sim.SimDescriptionId);

            if (miniSim != null)
            {
                if (sim.Partner != null)
                {
                    if (miniSim.PartnerSimDescriptionId != sim.Partner.SimDescriptionId)
                    {
                        Overwatch.Log(Relationships.GetFullName(sim) + " MiniSim Partner Reset");

                        miniSim.PartnerSimDescriptionId = sim.Partner.SimDescriptionId;
                    }
                }
                else
                {
                    if (miniSim.PartnerSimDescriptionId != 0)
                    {
                        Overwatch.Log(Relationships.GetFullName(sim) + " MiniSim Partner Cleared");

                        miniSim.PartnerSimDescriptionId = 0;
                    }
                }
            }
        }
Esempio n. 11
0
        protected override OptionResult Run(GameHitParameters <GameObject> parameters)
        {
            if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt")))
            {
                return(OptionResult.Failure);
            }

            // Store for later use
            List <SimDescription> sims = new List <SimDescription>(GameStates.TravelHousehold.AllSimDescriptions);

            GameStates.sTravelData = null;

            WorldData.SetVacationWorld(false, true);

            WorldName currentWorld = GameUtils.GetCurrentWorld();

            foreach (SimDescription sim in sims)
            {
                MiniSimDescription miniSim = MiniSimDescription.Find(sim.SimDescriptionId);
                if (miniSim != null)
                {
                    miniSim.mHomeWorld = currentWorld;
                }

                sim.mHomeWorld = currentWorld;
            }

            if (Sim.ActiveActor != null)
            {
                (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimAgeChanged(Sim.ActiveActor.ObjectId);
            }

            return(OptionResult.SuccessClose);
        }
Esempio n. 12
0
        public static SimDescription UnpackSim(MiniSimDescription ths, bool updateGenealogy)
        {
            try
            {
                if (ths == null)
                {
                    return(null);
                }

                // Calling ImportSimDescription prior to the Aging Manager being available is invalid, don't allow it
                if (AgingManager.Singleton == null)
                {
                    return(null);
                }

                SimDescription             desc      = new SimDescription();
                ResourceKeyContentCategory installed = ResourceKeyContentCategory.kInstalled;

                DownloadContent.ImportSimDescription(ths.mTravelKey, desc, ref installed);

                desc.SimDescriptionId = ths.mSimDescriptionId;

                if (desc.CareerManager != null)
                {
                    // Fixup for careers require a household, which is not set until later in this process

                    desc.CareerManager.mJob    = null;
                    desc.CareerManager.mSchool = null;
                }

                desc.Fixup();

                if (updateGenealogy && !GameStates.IsTravelling)
                {
                    if (desc.DefaultOutfitKey == ResourceKey.kInvalidResourceKey)
                    {
                        SimOutfit outfit = desc.GetOutfit(OutfitCategories.Everyday, 0x0);
                        if ((outfit == null) || (!outfit.IsValid))
                        {
                            desc.Dispose(false, false);
                            return(null);
                        }

                        desc.UpdateFromOutfit(OutfitCategories.Everyday);
                    }
                    desc.CASGenealogy = ths.CASGenealogy;
                }

                Corrections.CleanupBrokenSkills(desc, null);

                OccultTypeHelper.ValidateOccult(desc, null);

                return(desc);
            }
            catch (Exception e)
            {
                Common.Exception(ths.FullName, e);
                return(null);
            }
        }
Esempio n. 13
0
        private static void UpdateInWorldRelationships(MiniSimDescription ths, SimDescription myDesc)
        {
            foreach (MiniRelationship relationship in ths.mMiniRelationships)
            {
                MiniSimDescription description = Find(relationship.SimDescriptionId);
                if ((description != null) && description.Instantiated)
                {
                    SimDescription y = SimDescription.Find(relationship.SimDescriptionId);
                    if (y == null)
                    {
                        description.Instantiated = false;
                    }
                    else
                    {
                        Relationship     unsafely;
                        MiniRelationship mrB = description.FindMiniRelationship(ths, false);

                        // Custom
                        if (mrB != null)
                        {
                            if (GameStates.IsTravelling)
                            {
                                unsafely = Relationship.GetUnsafely(myDesc, y);
                            }
                            else
                            {
                                unsafely = Relationship.Get(myDesc, y, true);
                            }
                            unsafely.UpdateFromMiniRelationship(relationship, mrB);
                        }
                    }
                }
            }
        }
Esempio n. 14
0
        public new List <SimDescription> CreateNewbornsBeforePacking(float bonusMoodPoints, bool addToFamily, int numSims, int numPets)
        {
            SimDescription        geneticMom = null, geneticDad = null, robotDad = null;
            MiniSimDescription    miniMom = null, miniDad = null, miniRoboDad = null;
            List <SimDescription> results;

            GetParentDescriptions(ref geneticMom, ref miniMom, ref geneticDad, ref miniDad, ref robotDad, ref miniRoboDad);

            if (RobotDadDescriptionID != 0uL)
            {
                results = CreateNewbornsBeforePacking(geneticMom, robotDad, geneticDad, bonusMoodPoints, addToFamily, numSims, numPets);
            }
            else
            {
                results = CreateNewbornsBeforePacking(geneticMom, geneticDad, bonusMoodPoints, addToFamily, numSims, numPets);
            }

            if (miniMom != null)
            {
                geneticMom.Dispose(true, true);
            }

            if (miniDad != null)
            {
                geneticDad.Dispose(true, true);
            }

            if (miniRoboDad != null)
            {
                robotDad.Dispose(true, true);
            }

            return(results);
        }
Esempio n. 15
0
        public static void PackUpToMiniSimDescription(SimDescription ths)
        {
            if (ths.CreatedSim != null)
            {
                ths.CreatedSim.Destroy();
                Common.Sleep();
            }
            if (Find(ths.SimDescriptionId) != null)
            {
                SimDescription father = null;

                if (ths.Pregnancy != null)
                {
                    if ((ths.Pregnancy.mDad == null) || ths.Pregnancy.mDad.HasBeenDestroyed)
                    {
                        if (SimDescription.Find(ths.Pregnancy.DadDescriptionId) == null)
                        {
                            MiniSimDescription description = Find(ths.Pregnancy.DadDescriptionId);
                            if (description != null)
                            {
                                father = UnpackSim(description);
                                father.Genealogy.SetSimDescription(father);

                                Household.TouristHousehold.AddTemporary(father);
                            }
                        }
                    }
                }

                PackSim(ths);

                if (father != null)
                {
                    father.Dispose(true, true);
                }
            }
            else
            {
                MiniSimDescription.AddMiniSim(ths);
                ths.Household.RemoveTemporary(ths);

                MiniSimDescription miniSim;
                if (MiniSimDescription.sMiniSims.TryGetValue(ths.SimDescriptionId, out miniSim))
                {
                    GenerateCrossWorldThumbnail(miniSim, ths, true);
                }

                ths.Dispose(true, true);
            }

            ths.mPackingDescriptionTask = null;
            if (!GameStates.IsTravelling)
            {
                (Sims3.Gameplay.UI.Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimCurrentWorldChanged(false, ths);
            }

            ths.ClearOutfits(true);
        }
Esempio n. 16
0
        protected override bool PrivateAllow(IMiniSimDescription a, MiniSimDescription b)
        {
            if (!Fixup(a as SimDescription))
            {
                return(false);
            }

            return(Allow(a.CASGenealogy as Genealogy, b.Genealogy));
        }
Esempio n. 17
0
        protected override bool Run(SimDescription a, MiniSimDescription b)
        {
            if (!Fixup(a))
            {
                return(false);
            }

            return(Run(a.Genealogy, b.Genealogy));
        }
Esempio n. 18
0
        protected bool Test(MiniSimDescription me)
        {
            if (!AllowSpecies(me))
            {
                return(false);
            }

            return(PrivateAllow(me));
        }
Esempio n. 19
0
        protected override bool PrivateAllow(MiniSimDescription me)
        {
            if (!base.PrivateAllow(me))
            {
                return(false);
            }

            return(Allow(me.Genealogy));
        }
Esempio n. 20
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            Genealogy genealogy = actor.CASGenealogy as Genealogy;
            if (genealogy == null) return false;

            if (me.Genealogy.IsSufficientlyRelatedToRuleOutRomance(genealogy)) return false;

            return true;
        }
Esempio n. 21
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            if (me.LastName == null)
            {
                return(false);
            }

            return(me.LastName.Trim().ToLower().StartsWith(mPrefix));
        }
Esempio n. 22
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            if (me.HouseholdMembers == null)
            {
                return(false);
            }

            return(!me.HouseholdMembers.Contains(actor.SimDescriptionId));
        }
Esempio n. 23
0
        protected bool Test(IMiniSimDescription a, MiniSimDescription b)
        {
            if (!AllowSpecies(a, b))
            {
                return(false);
            }

            return(PrivateAllow(a, b));
        }
Esempio n. 24
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            Genealogy genealogy = actor.CASGenealogy as Genealogy;
            if (genealogy == null) return false;

            if (!me.Genealogy.IsBloodRelated(genealogy)) return false;

            return true;
        }
Esempio n. 25
0
        public static List <KnownInfo> GetKnownInfo(HudModel ths, IMiniSimDescription simDesc)
        {
            if ((ths.mSavedCurrentSim != null) && (ths.mSavedCurrentSim.SimDescription != null) && (simDesc != null))
            {
                if (ths.mSavedCurrentSim.SimDescription == simDesc)
                {
                    return(GetKnownInfoAboutSelf(ths, simDesc));
                }

                if (simDesc is SimDescription)
                {
                    if (ths.mSavedCurrentSim.SocialComponent != null)
                    {
                        foreach (Relationship relationship in ths.mSavedCurrentSim.SocialComponent.Relationships)
                        {
                            if (relationship == null)
                            {
                                continue;
                            }

                            SimDescription otherSimDescription = relationship.GetOtherSimDescription(ths.mSavedCurrentSim.SimDescription);
                            if (otherSimDescription != simDesc)
                            {
                                continue;
                            }

                            InformationLearnedAboutSim learnedInfo = relationship.InformationAbout(otherSimDescription);
                            return(GetKnownInfoList(ths, otherSimDescription, learnedInfo));
                        }
                    }
                }
                else
                {
                    MiniSimDescription tsd = MiniSimDescription.Find(ths.mSavedCurrentSim.SimDescription.SimDescriptionId);
                    if (tsd != null)
                    {
                        foreach (MiniRelationship relationship in tsd.MiniRelationships)
                        {
                            if (relationship == null)
                            {
                                continue;
                            }

                            if (relationship.SimDescriptionId != simDesc.SimDescriptionId)
                            {
                                continue;
                            }

                            MiniSimDescription otherTsd = MiniSimDescription.Find(relationship.SimDescriptionId);
                            return(relationship.GetKnownInfo(tsd, otherTsd));
                        }
                    }
                }
            }

            return(new List <KnownInfo>());
        }
Esempio n. 26
0
        public new List <SimDescription> CreateNewbornsBeforePacking(float bonusMoodPoints, bool bAddToFamily, int householdSimMembers, int householdPetMembers)
        {
            MiniSimDescription miniDescription = null;
            SimDescription     description;

            if (mDad == null || mDad.HasBeenDestroyed)
            {
                description = SimDescription.Find(DadDescriptionId);

                if (description == null)
                {
                    miniDescription = MiniSimDescription.Find(DadDescriptionId);

                    if (miniDescription != null)
                    {
                        description = miniDescription.UnpackSim();
                        description.Genealogy.SetSimDescription(description);
                    }
                }
            }
            else
            {
                description = mDad.SimDescription;
            }

            float  averageMoodForBirth = GetAverageMoodForBirth(description, bonusMoodPoints);
            Random pregoRandom         = new Random(mRandomGenSeed);
            int    numForBirth         = GetNumForBirth(description, pregoRandom, householdSimMembers, householdPetMembers);
            Random gen = new Random(mRandomGenSeed);
            List <SimDescription> list = new List <SimDescription>();

            for (int i = 0; i < numForBirth; i++)
            {
                DetermineGenderOfBaby(gen);
                CASAgeGenderFlags gender = mGender;
                mGender = CASAgeGenderFlags.None;
                SimDescription description2 = AlienUtilsEx.MakeAlienBaby(description, mMom.SimDescription, gender, averageMoodForBirth, pregoRandom, false);
                description2.WasCasCreated = false;

                if (bAddToFamily)
                {
                    mMom.Household.Add(description2);
                    Sim sim = description2.Instantiate(mMom.Position);
                    CheckForGhostBaby(sim);
                }

                list.Add(description2);
            }

            if (miniDescription != null)
            {
                description.Dispose(true, true);
            }

            return(list);
        }
Esempio n. 27
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            MiniSimDescription miniSim = Sim.GetMiniSimForProtection();

            if (miniSim != null)
            {
                miniSim.AddProtection(MiniSimDescription.ProtectionFlag.PartialFromPlayer);
            }
            return(true);
        }
Esempio n. 28
0
        public static void Add(SimDescription sim, MiniSimDescription miniSim)
        {
            sChecks.Add(new Check(sim, miniSim));

            if (sTask == null)
            {
                sTask = new AgingCheckTask();            
                sTask.AddToSimulator();
            }
        }
Esempio n. 29
0
        protected override bool Run(MiniSimDescription me, bool singleSelection)
        {
            if (!Prompt(me))
            {
                return(false);
            }

            Annihilation.Cleanse(me);
            return(true);
        }
Esempio n. 30
0
        public static void Add(SimDescription sim, MiniSimDescription miniSim)
        {
            sChecks.Add(new Check(sim, miniSim));

            if (sTask == null)
            {
                sTask = new AgingCheckTask();
                sTask.AddToSimulator();
            }
        }
Esempio n. 31
0
        protected virtual bool PrivateAllow(IMiniSimDescription a, MiniSimDescription b)
        {
            SimDescription simA = a as SimDescription;

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

            return(PrivateAllow(simA, b));
        }
Esempio n. 32
0
 public void Validate()
 {
     foreach (ulong sim in sims)
     {
         IMiniSimDescription desc = MiniSimDescription.Find(sim);
         if (desc == null)
         {
             sims.Remove(sim);
         }
     }
 }
Esempio n. 33
0
        public bool GetAgelessForeign(MiniSimDescription desc)
        {
            WorldName name = GetHomeWorld(desc as IMiniSimDescription);

            if (name != WorldName.Undefined)
            {
                return(mAgelessForeign.ContainsKey(name));
            }

            return(true);
        }
Esempio n. 34
0
            protected static List <TraitNames> GetTraits(MiniSimDescription sim)
            {
                List <TraitNames> traits = new List <TraitNames>();

                if (sim.Traits != null)
                {
                    traits.AddRange(sim.Traits);
                }

                return(traits);
            }
Esempio n. 35
0
        public static void MergeTravelInformation(SimDescription ths, MiniSimDescription msd, Dictionary<ulong,SimDescription> allSims)
        {
            Common.StringBuilder msg = new Common.StringBuilder("MergeTravelInformation " + ths.FullName + Common.NewLine);

            msg += "A";
            Traveler.InsanityWriteLog(msg);

            foreach (MiniRelationship relationship in msd.MiniRelationships)
            {
                SimDescription y = null;
                if (!allSims.TryGetValue(relationship.SimDescriptionId, out y))
                {
                    y = SimDescription.Find(relationship.SimDescriptionId);
                }

                if (y != null)
                {
                    Relationship unsafely = null;

                    try
                    {
                        unsafely = Relationship.GetUnsafely(ths, y);
                    }
                    catch (Exception e)
                    {
                        Common.Exception(ths, e);
                    }

                    if (unsafely != null)
                    {
                        float change = relationship.Value - unsafely.LTR.Liking;
                        if (change != 0f)
                        {
                            unsafely.LTR.UpdateLiking(change);
                        }
                        RomanceVisibilityState.MergeTravelInformationOnTravelBackHome(relationship, unsafely);
                    }
                }
            }

            msg += "B";
            Traveler.InsanityWriteLog(msg);

            ths.CASGenealogy = msd.CASGenealogy;

            AgingCheckTask.Add(ths, msd);

            msg += "C";
            Traveler.InsanityWriteLog(msg);
        }
Esempio n. 36
0
        protected static void Update(MiniSimDescription miniSim)
        {
            if (miniSim == null) return;

            while ((AgingManager.Singleton == null) || (AlarmManager.Global == null))
            {
                SpeedTrap.Sleep();
            }

            if (MiniSims.UpdateThumbnailKey(miniSim) == MiniSims.Results.Success)
            {
                //Common.DebugNotify("Updated: " + miniSim.FullName);

                SpeedTrap.Sleep();
            }
        }
Esempio n. 37
0
 protected override bool PrivateAllow(MiniSimDescription me)
 {
     return true;
 }
Esempio n. 38
0
        public bool GetAgelessForeign(MiniSimDescription desc)
        {
            if (desc.HomeWorld != WorldName.Undefined && desc.HomeWorld != WorldName.UserCreated)
            {
                return mAgelessForeign.ContainsKey(desc.HomeWorld);
            }

            if (mWorldForSims.ContainsKey(desc.SimDescriptionId))
            {
                string world = mWorldForSims[desc.SimDescriptionId];

                string name = world.Replace(".world", "");

                WorldName worldName = WorldName.Undefined;

                try
                {
                    worldName = unchecked((WorldName)ResourceUtils.HashString32(name.Replace(" ", "")));
                }
                catch
                {                    
                    return true;
                }                

                return mAgelessForeign.ContainsKey(worldName);
            }            

            return true;
        }
Esempio n. 39
0
 public Check(SimDescription sim, MiniSimDescription miniSim)
 {
     mSim = sim;
     mMiniSim = miniSim;
 }
Esempio n. 40
0
        public static bool IsOccult(MiniSimDescription sim, OccultTypes type)
        {
            switch (type)
            {
                case OccultTypes.Vampire:
                    return sim.IsVampire;
                case OccultTypes.Frankenstein:
                    return sim.IsFrankenstein;
                case OccultTypes.Mummy:
                    return sim.IsMummy;
                case OccultTypes.Unicorn:
                    return sim.IsUnicorn;
                case OccultTypes.Genie:
                    return sim.IsGenie;
                case OccultTypes.Fairy:
                    return sim.IsFairy;
                case OccultTypes.Ghost:
                    return sim.IsDead || sim.IsPlayableGhost;
                case OccultTypes.Werewolf:
                    return sim.IsWerewolf;
                case OccultTypes.Witch:
                    return sim.IsWitch;
                case OccultTypes.Mermaid:
                    return sim.IsMermaid;
                case OccultTypes.Robot:
                    return sim.IsEP11Bot;
            }

            return false;
        }
Esempio n. 41
0
        public static bool IsDead(MiniSimDescription sim)
        {
            if (sim == null) return true;

            if (sim.IsPlayableGhost) return false;

            return sim.IsDead;
        }
Esempio n. 42
0
        protected override bool PrivateAllow(MiniSimDescription me)
        {
            if (IsFirst) return true;

            foreach (IMiniSimDescription a in mA)
            {
                if (Test(a, me)) return true;
            }

            return false;
        }
Esempio n. 43
0
        public static bool Matches(MiniSimDescription sim, SimType type)
        {
            switch(type)
            {
                case SimType.MiniSim:
                    return true;
                case SimType.Dead:
                    return IsDead(sim);
                case SimType.Alive:
                    return !IsDead(sim);
                case SimType.Service:
                    return sim.IsServicePerson;
                case SimType.Mummy:
                    return sim.IsMummy;
                case SimType.Alien:
                    return sim.IsAlien;
                case SimType.Animal:
                    return !sim.IsHuman;
                case SimType.Fairy:
                    return sim.IsFairy;
                case SimType.Frankenstein:
                case SimType.SimBot:
                    return sim.IsFrankenstein;
                case SimType.PlayableGhost:
                    return sim.IsPlayableGhost;
                case SimType.Unicorn:
                    return sim.IsUnicorn;
                case SimType.Vampire:
                    return sim.IsVampire;
                case SimType.Werewolf:
                    return sim.IsWerewolf;
                case SimType.Witch:
                    return sim.IsWitch;
                case SimType.Genie:
                    return sim.IsGenie;
                case SimType.Mermaid:
                    return sim.IsMermaid;
                case SimType.Human:
                    return sim.IsHuman;
                case SimType.Married:
                    return sim.IsMarried;
                case SimType.Partnered:
                    return sim.HasPartner;
                case SimType.Foreign:
                    return (sim.HomeWorld != GameUtils.GetCurrentWorld());
                case SimType.Local:
                    return (sim.HomeWorld == GameUtils.GetCurrentWorld());
                case SimType.Plumbot:
                    return sim.IsEP11Bot;
                case SimType.Dog:
                    return sim.IsADogSpecies;
                case SimType.Cat:
                    return sim.IsCat;
                case SimType.Horse:
                    return sim.IsHorse;
                case SimType.Deer:
                    return sim.IsDeer;
                case SimType.Raccoon:
                    return sim.IsRaccoon;
                case SimType.Role:
                    return sim.HasAssignedRole;
                case SimType.Employed:
                    return sim.JobIcon != string.Empty;
                case SimType.Unemployed:
                    return sim.JobIcon == string.Empty;
                case SimType.HasDegree:
                    return sim.mDegrees.Count > 0;
                case SimType.Degreeless:
                    return sim.mDegrees.Count == 0;
            }

            return false;
        }
Esempio n. 44
0
        protected override bool PrivateAllow(MiniSimDescription me)
        {
            // Base class checks IsValidDescription
            //if (!base.Allow(me)) return false;

            if (me.ToddlerOrBelow) return false;

            if (mTest != null)
            {
                if (!mTest.Test(me)) return false;
            }

            return true;
        }
Esempio n. 45
0
 protected virtual bool PrivateAllow(SimDescription a, MiniSimDescription b)
 {
     return false;
 }
Esempio n. 46
0
 protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
 {
     return ValidChoices.ContainsKey(me.SimDescriptionId);
 }
Esempio n. 47
0
        protected override bool PrivateAllow(MiniSimDescription me)
        {
            //if (!base.Allow(me)) return false;

            return true;
        }
Esempio n. 48
0
        public static void OnPickFromPanel(MiniSimDescription ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit)
        {
            try
            {
                Sims3.Gameplay.UI.PieMenu.ClearInteractions();
                Sims3.Gameplay.UI.PieMenu.HidePieMenuSimHead = true;
                Sims3.UI.Hud.PieMenu.sIncrementalButtonIndexing = true;

                Sim activeActor = Sim.ActiveActor;
                if (activeActor != null)
                {
                    if (activeActor.InteractionQueue.CanPlayerQueue())
                    {
                        List<InteractionObjectPair> interactions = new List<InteractionObjectPair>();

                        if (GameUtils.IsInstalled(ProductVersion.EP8))
                        {
                            InteractionDefinition interaction = new Mailbox.WriteLoveLetter.Definition(ths.SimDescriptionId);
                            interactions.Add(new InteractionObjectPair(interaction, activeActor));
                        }

                        IPhone targetObject = activeActor.Inventory.Find<IPhone>();
                        if (targetObject != null)
                        {
                            interactions.Add(new InteractionObjectPair(GetCallInviteOverForeignVisitorsFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetCallChatFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetCallInviteToAttendGraduationFromRelationPanelDefinition(ths), targetObject));
                        }
                        if (GameUtils.IsInstalled(ProductVersion.EP9))
                        {
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendChatTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendInsultTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendPictureTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendSecretAdmirerTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendBreakUpTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendWooHootyTextFromRelationPanelDefinition(ths), targetObject));
                        }

                        if (CelebrityManager.CanSocialize(activeActor.SimDescription, ths))
                        {
                            Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(null, eventArgs, gameObjectHit, interactions, InteractionMenuTypes.Normal);
                        }
                        else
                        {
                            GreyedOutTooltipCallback greyedOutTooltipCallbackForced = delegate
                            {
                                return Common.LocalizeEAString("Gameplay/CelebritySystem/CelebrityManager:NotAbleToSocialize");
                            };
                            Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(null, eventArgs, gameObjectHit, interactions, InteractionMenuTypes.Normal, "Gameplay/Abstracts/GameObject:NoInteractions", false, greyedOutTooltipCallbackForced);
                        }
                    }
                    else
                    {
                        Vector2 mousePosition;
                        if (eventArgs.DestinationWindow != null)
                        {
                            mousePosition = eventArgs.DestinationWindow.WindowToScreen(eventArgs.MousePosition);
                        }
                        else
                        {
                            mousePosition = eventArgs.MousePosition;
                        }
                        Sims3.Gameplay.UI.PieMenu.ShowGreyedOutTooltip(Common.LocalizeEAString("Gameplay/Abstracts/GameObject:TooManyInteractions"), mousePosition);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(ths.FullName, e);
            }
        }
Esempio n. 49
0
 protected override bool Run(MiniSimDescription me, bool singleSelection)
 {
     Perform(me);
     return true;
 }
Esempio n. 50
0
 static FamilyTreeDialog()
 {
     sConstructorStub = new MiniSimDescription();
     sConstructorStub.mGenealogy = new Genealogy();
 }
Esempio n. 51
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            //if (!base.Allow(me, actor)) return false;

            return true;
        }
Esempio n. 52
0
 protected override bool Run(MiniSimDescription me, bool singleSelection)
 {
     return Annihilation.Cleanse(me);
 }
Esempio n. 53
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            if (me.FirstName == null) return false;

            return me.FirstName.Trim().ToLower().StartsWith(mPrefix);
        }
Esempio n. 54
0
 protected virtual bool Run(SimDescription a, MiniSimDescription b)
 {
     return false;
 }
Esempio n. 55
0
        protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
        {
            if (me.HouseholdMembers == null) return false;

            return !me.HouseholdMembers.Contains (actor.SimDescriptionId);
        }
Esempio n. 56
0
        protected bool Test(IMiniSimDescription a, MiniSimDescription b)
        {
            if (!AllowSpecies(a, b)) return false;

            return PrivateAllow(a, b);
        }
Esempio n. 57
0
 protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
 {
     return me.IsMale;
 }
Esempio n. 58
0
        protected virtual bool PrivateAllow(IMiniSimDescription a, MiniSimDescription b)
        {
            SimDescription simA = a as SimDescription;
            if (simA == null) return false;

            return PrivateAllow(simA, b);
        }
Esempio n. 59
0
 protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
 {
     return !IsMyAncestor(me.CASGenealogy as Genealogy, actor.CASGenealogy as Genealogy);
 }
Esempio n. 60
0
            protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor)
            {
                if (mFilter == null) return false;

                foreach (SimSelection.ICriteria item in mFilter.mElements)
                {
                    ITestableOption testable = item as ITestableOption;
                    if (testable == null) continue;

                    if (!testable.Test(me, false, actor))
                    {
                        return false;
                    }
                }

                return true;
            }