Esempio n. 1
0
        protected override bool TargetAllow(SimDescription target)
        {
            if (Target.TeenOrBelow)
            {
                IncStat("Too Young");
                return(false);
            }
            else if (Target.OccultManager == null)
            {
                IncStat("No Manager");
                return(false);
            }
            else if (OccultTypeHelper.CreateList(target, true).Count == 0)
            {
                IncStat("Not Occult");
                return(false);
            }
            else if (!GetValue <AllowPersonalityOccultOption, bool>(target))
            {
                IncStat("Occult Denied");
                return(false);
            }

            return(base.TargetAllow(target));
        }
Esempio n. 2
0
        protected virtual bool IsAvailable(Sim sim, IMagicalDefinition definition)
        {
            if ((Occult & definition.SpellSettings.mValidTypes) == OccultTypes.None)
            {
                return(false);
            }

            if (!OccultTypeHelper.HasType(sim, Occult))
            {
                return(false);
            }

            if (GetSkillLevel(sim.SimDescription) < GetMinSkillLevel(definition))
            {
                return(false);
            }

            //if (GetMana(sim) + definition.SpellSettings.mMinMana >= 100) return false;

            // fairy starts at 100 and goes to -100 for empty
            // witch at -100 and goes to 100 for empty
            // genie and unicorns are 0 for empty, 100 for full

            return(true);
        }
Esempio n. 3
0
        protected override ManagerStory.Story PrintStory(StoryProgressionObject manager, string name, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
        {
            List <OccultTypes> occults = OccultTypeHelper.CreateList(Sim);

            if (occults.Count == 0)
            {
                return(null);
            }

            OccultTypes occult = occults[occults.Count - 1];

            switch (occult)
            {
            case OccultTypes.Vampire:
            case OccultTypes.Werewolf:
            case OccultTypes.Fairy:
            case OccultTypes.Witch:
            case OccultTypes.Genie:
                //case OccultTypes.Mummy:
                name = "Became" + occult;
                break;

            default:
                if (!Manager.DebuggingEnabled)
                {
                    return(null);
                }
                break;
            }

            return(base.PrintStory(manager, name, parameters, extended, logging));
        }
Esempio n. 4
0
        public override void Perform(Sim sim, DiseaseVector vector)
        {
            if (sim.OccultManager == null)
            {
                return;
            }

            if (mRemove)
            {
                OccultTypeHelper.Remove(sim.SimDescription, mOccult, true);
            }
            else
            {
                if (sim.OccultManager.HasOccultType(mOccult))
                {
                    return;
                }

                if (mDropOthers)
                {
                    foreach (OccultTypes type in Enum.GetValues(typeof(OccultTypes)))
                    {
                        if (type == OccultTypes.None)
                        {
                            continue;
                        }

                        OccultTypeHelper.Remove(sim.SimDescription, type, true);
                    }
                }

                OccultTypeHelper.Add(sim.SimDescription, mOccult, false, true);
            }
        }
Esempio n. 5
0
        private static List <OccultTypes> GetSharedOccults(ref List <OccultTypes> abductee, ref List <OccultTypes> alien)
        {
            List <OccultTypes> types = new List <OccultTypes>();
            List <OccultTypes> valid = OccultTypeHelper.CreateListOfMissingOccults(new List <OccultTypes>()
            {
                OccultTypes.Frankenstein,
                OccultTypes.Mummy,
                OccultTypes.Robot,
                OccultTypes.Unicorn
            }, false);

            foreach (OccultTypes current in valid)
            {
                OccultTypes type = current;

                if (abductee.Contains(type) && alien.Contains(type))
                {
                    types.Add(type);
                    abductee.Remove(type);
                    alien.Remove(type);
                }
            }

            return(types);
        }
Esempio n. 6
0
            public override bool Test(Sim a, TanningBooth target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (OccultTypeHelper.HasType(a, OccultTypes.Vampire | OccultTypes.ImaginaryFriend | OccultTypes.Werewolf | OccultTypes.Robot | OccultTypes.Frankenstein | OccultTypes.Mummy))
                {
                    return(false);
                }

                return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Esempio n. 7
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!OccultTypeHelper.HasType(a, OccultTypes.Unicorn))
                {
                    return(false);
                }

                return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Esempio n. 8
0
            public override bool Test(Sim a, IFishContainer target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (!OccultTypeHelper.HasType(a, OccultTypes.Mermaid))
                {
                    return(false);
                }

                return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Esempio n. 9
0
        protected override IEnumerable <OccultTypes> GetOptions()
        {
            List <OccultTypes> results = new List <OccultTypes>();

            results = OccultTypeHelper.CreateListOfMissingOccults(new List <OccultTypes> {
                OccultTypes.Frankenstein, OccultTypes.Robot
            }, false);

            return(results);
        }
Esempio n. 10
0
        private static bool PrivateUsePoints(Sim sim, MagicWand wand, int points, OccultTypes type)
        {
            if (!OccultTypeHelper.HasType(sim, type))
            {
                return(false);
            }

            switch (type)
            {
            case OccultTypes.Genie:
                OccultGenie genie = sim.OccultManager.GetOccultType(OccultTypes.Genie) as OccultGenie;
                if (genie != null)
                {
                    genie.MagicPoints.UsePoints(points);
                    (Sims3.UI.Responder.Instance.HudModel as HudModel).FlashMagicMotiveBar();
                    return(true);
                }
                break;

            case OccultTypes.Fairy:
                sim.Motives.ChangeValue(CommodityKind.AuraPower, -points);
                (Sims3.UI.Responder.Instance.HudModel as HudModel).FlashMagicMotiveBar();
                return(true);

            case OccultTypes.Witch:
                if (wand != null)
                {
                    wand.DrainMotive(sim, CommodityKind.MagicFatigue, -points);
                    return(true);
                }
                else
                {
                    float num = (points * DefaultWand.kMotiveDrainMultiplier) * MagicWand.kMoonPhaseMotiveDrainMultiplier[World.GetLunarPhase()];
                    if (sim.BuffManager.HasElement(BuffNames.AnimalFamiliar))
                    {
                        num *= MagicWand.kFamiliarMotiveMultiplier;
                    }
                    sim.Motives.ChangeValue(CommodityKind.MagicFatigue, -num);
                    (Sims3.UI.Responder.Instance.HudModel as HudModel).FlashMagicMotiveBar();
                }
                break;

            case OccultTypes.Unicorn:
                OccultUnicorn unicorn = sim.OccultManager.GetOccultType(OccultTypes.Unicorn) as OccultUnicorn;
                if (unicorn != null)
                {
                    unicorn.MagicPoints.UsePoints(points);
                    (Sims3.UI.Responder.Instance.HudModel as HudModel).FlashMagicMotiveBar();
                    return(true);
                }
                break;
            }

            return(false);
        }
Esempio n. 11
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (!base.PrivateUpdate(frame))
            {
                return(false);
            }

            OccultTypeHelper.Add(Target, mOccult, false, true);

            return(true);
        }
Esempio n. 12
0
        protected static OccultTypes FirstOccult(SimDescription sim)
        {
            List <OccultTypes> types = OccultTypeHelper.CreateList(sim);

            if (types.Count == 0)
            {
                return(OccultTypes.None);
            }

            return(types[0]);
        }
Esempio n. 13
0
        public override bool InRabbitHole()
        {
            try
            {
                SimDescription oldSim = Actor.SimDescription;
                SimDescription newSim = Genetics.MakeDescendant(oldSim, oldSim, CASAgeGenderFlags.Child, oldSim.Gender, 100f, new Random(), false, true, true);
                newSim.WasCasCreated = false;

                /*
                 * if (!Household.ActiveHousehold.CanAddSpeciesToHousehold(Actor.SimDescription.Species))
                 * {
                 *  newSim.Dispose();
                 *  return false;
                 * }
                 */

                oldSim.Household.Add(newSim);
                newSim.FirstName = StringInputDialog.Show(Localization.LocalizeString("Gameplay/Objects/RabbitHoles/ScienceLab:NameCloneTitle", new object[0x0]), Localization.LocalizeString("Gameplay/Objects/RabbitHoles/ScienceLab:NameCloneDesc", new object[0x0]), string.Empty, 256, StringInputDialog.Validation.SimNameText);
                Target.SetupNewClone(oldSim, newSim, "ep4CloneTransitionChild");

                // Custom
                foreach (OccultTypes type in OccultTypeHelper.CreateList(oldSim))
                {
                    OccultTypeHelper.Add(newSim, type, false, false);
                }

                IGameObject voucher = Actor.Inventory.Find <IVoucherCloneMe>();
                if (voucher != null)
                {
                    Actor.Inventory.RemoveByForce(voucher);
                    voucher.Destroy();
                    voucher = null;
                }

                EventTracker.SendEvent(EventTypeId.kNewOffspring, Actor, newSim.CreatedSim);
                EventTracker.SendEvent(EventTypeId.kParentAdded, newSim.CreatedSim, Actor);
                EventTracker.SendEvent(EventTypeId.kChildBornOrAdopted, null, newSim.CreatedSim);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Esempio n. 14
0
        public override void Perform(Sim sim, DiseaseVector vector)
        {
            if (SimTypes.IsDead(sim.SimDescription))
            {
                return;
            }

            if (!mAllowActive)
            {
                if (SimTypes.IsSelectable(sim))
                {
                    return;
                }
            }

            if (sim.InteractionQueue == null)
            {
                return;
            }

            SimDescription.DeathType type = mType;
            if (type == SimDescription.DeathType.None)
            {
                List <SimDescription.DeathType> choices = new List <SimDescription.DeathType>();
                foreach (SimDescription.DeathType choice in Enum.GetValues(typeof(SimDescription.DeathType)))
                {
                    if (!OccultTypeHelper.IsInstalled(choice))
                    {
                        continue;
                    }

                    choices.Add(choice);
                }

                if (choices.Count == 0)
                {
                    return;
                }

                type = RandomUtil.GetRandomObjectFromList(choices);
            }

            InteractionInstance entry = Urnstone.KillSim.Singleton.CreateInstance(sim, sim, new InteractionPriority(InteractionPriorityLevel.MaxDeath, 0f), false, false);

            (entry as Urnstone.KillSim).simDeathType = type;
            sim.InteractionQueue.Add(entry);
        }
Esempio n. 15
0
        public override void OnDelayedWorldLoadFinished()
        {
            Overwatch.Log("CleanupOccult");

            foreach (SimDescription sim in Household.AllSimsLivingInWorld())
            {
                OccultTypeHelper.ValidateOccult(sim, Overwatch.Log);

                OccultTypeHelper.TestAndRebuildWerewolfOutfit(sim);

                // Compensate for a missing line in OccultWerewolf:FixupOccult
                if ((sim.CreatedSim != null) && (sim.ToddlerOrAbove) && (OccultTypeHelper.HasType(sim, OccultTypes.Werewolf)))
                {
                    World.ObjectSetVisualOverride(sim.CreatedSim.ObjectId, eVisualOverrideTypes.Werewolf, null);
                }
            }
        }
Esempio n. 16
0
            public override void SetValue(Values value, Values storeType)
            {
                mValue = value;

                if (value.mOccult != OccultTypes.None)
                {
                    mName = OccultTypeHelper.GetLocalizedName(value.mOccult);
                }
                else if (value.mDeathType != SimDescription.DeathType.None)
                {
                    mName = Urnstones.GetLocalizedString(false, value.mDeathType);
                }
                else
                {
                    mName = Common.Localize("Species:Human");
                }
            }
Esempio n. 17
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (!base.PrivateUpdate(frame))
            {
                return(false);
            }

            if ((!mFail) && (GetValue <AllowRevertOption, bool>()))
            {
                foreach (OccultTypes type in OccultTypeHelper.CreateList(Target, true))
                {
                    OccultTypeHelper.Remove(Target, type, true);
                }
            }

            return(true);
        }
Esempio n. 18
0
            public override bool Test(Sim a, GameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if (a.SimDescription.Toddler)
                {
                    if (!a.SimDescription.HasTrait(TraitNames.LycanthropyHuman))
                    {
                        return(false);
                    }
                }
                else
                {
                    if (!OccultTypeHelper.HasType(a, OccultTypes.Werewolf))
                    {
                        return(false);
                    }
                }

                return(base.Test(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Esempio n. 19
0
            public void OnSwitchWorlds(ICollection <SimDescription> travelers)
            {
                mPerformTravelActions = Traveler.Settings.mPerformTravelActions;

                StoreHouseholds(travelers);

                transitionedSettings.Clear();
                transitionedOccults.Clear();

                if (GameStates.sTravelData.mDestWorld == WorldName.FutureWorld)
                {
                    // need to figure out the issue with ITransition and expand this into a deriative search
                    // but I don't see a big use beyond this
                    transitionedSettings["DisableDescendants"]     = Traveler.Settings.mDisableDescendants;
                    transitionedSettings["ChanceOfOccultMutation"] = Traveler.Settings.mChanceOfOccultMutation;
                    transitionedSettings["ChanceOfOccultHybrid"]   = Traveler.Settings.mChanceOfOccultHybrid;
                    transitionedSettings["MaxOccult"] = Traveler.Settings.mMaxOccult;

                    // can't use the transtioned household because progenitors could be outside of the active household
                    foreach (FutureDescendantService.FutureDescendantHouseholdInfo info in FutureDescendantService.sPersistableData.ActiveDescendantHouseholdsInfo)
                    {
                        if (info.HasAncestorFromHousehold(Household.ActiveHousehold) && info.mProgenitorSimIds.Count > 0)
                        {
                            foreach (ulong num in info.mProgenitorSimIds)
                            {
                                SimDescription sim = SimDescription.Find(num);
                                if (sim != null)
                                {
                                    if (sim.OccultManager != null)
                                    {
                                        if (sim.OccultManager.HasAnyOccultType() && !transitionedOccults.ContainsKey(num))
                                        {
                                            transitionedOccults.Add(num, new List <OccultTypes>());
                                            transitionedOccults[num].AddRange(OccultTypeHelper.CreateList(sim.OccultManager.CurrentOccultTypes, true));
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
Esempio n. 20
0
            public override bool Test(Sim a, Sim target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
            {
                if ((isAutonomous) && (a == target))
                {
                    if (OccultTypeHelper.HasType(a, OccultTypes.Vampire))
                    {
                        return(false);
                    }
                }

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

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

                return(CastSpellEx.CommonSpellTests(a, target, isAutonomous, ref greyedOutTooltipCallback));
            }
Esempio n. 21
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!base.Run(me, singleSelection))
            {
                return(false);
            }

            foreach (SelectionCriteria.Occult.Values type in mTypes)
            {
                if (type.mOccult != OccultTypes.None)
                {
                    OccultTypeHelper.Add(me, type.mOccult, false, true);
                }
                else
                {
                    Urnstones.SimToPlayableGhost(me, type.mDeathType);
                }
            }

            return(true);
        }
Esempio n. 22
0
        public static void MergeOccults(OccultManager ths, OccultManager source)
        {
            Common.StringBuilder msg = new Common.StringBuilder("MergeOccults " + ths.mOwnerDescription.FullName + Common.NewLine);
            Traveler.InsanityWriteLog(msg);

            foreach (OccultTypes type in Enum.GetValues(typeof(OccultTypes)))
            {
                try
                {
                    switch (type)
                    {
                    case OccultTypes.None:
                    case OccultTypes.Ghost:
                        break;

                    default:
                        if ((source.HasOccultType(type)) && (!ths.HasOccultType(type)))
                        {
                            msg += Common.NewLine + "A " + type;
                            Traveler.InsanityWriteLog(msg);

                            ths.MergeOccult(type);
                        }

                        if ((!source.HasOccultType(type)) && (ths.HasOccultType(type)))
                        {
                            msg += Common.NewLine + "B " + type;
                            Traveler.InsanityWriteLog(msg);

                            OccultTypeHelper.Remove(ths.mOwnerDescription, type, false);
                        }
                        break;
                    }
                }
                catch (Exception e)
                {
                    Common.Exception(ths.mOwnerDescription, null, "Type: " + type, e);
                }
            }
        }
Esempio n. 23
0
        protected override bool Run(SimDescription me, bool singleSelection)
        {
            if (!base.Run(me, singleSelection))
            {
                return(false);
            }

            foreach (SelectionCriteria.Occult.Values type in mTypes)
            {
                if (type.mOccult == OccultTypes.Ghost)
                {
                    Urnstone stone = Urnstones.FindGhostsGrave(me);

                    if ((stone != null) && (me.CreatedSim != null))
                    {
                        stone.GhostToSim(me.CreatedSim, false, false);
                    }
                    else
                    {
                        me.SetDeathStyle(SimDescription.DeathType.None, false);
                        me.IsGhost           = false;
                        me.IsNeverSelectable = false;
                        me.ShowSocialsOnSim  = true;
                        me.AgingEnabled      = true;

                        if (stone != null)
                        {
                            stone.Destroy();
                        }
                    }
                }
                else
                {
                    OccultTypeHelper.Remove(me, type.mOccult, true);
                }
            }

            return(true);
        }
Esempio n. 24
0
        public string GetLocalizedName()
        {
            string result = null;

            if (mOccult != OccultTypes.None)
            {
                result += OccultTypeHelper.GetLocalizedName(mOccult) + " ";
            }

            if (mAgeSpecies != CASAgeGenderFlags.None)
            {
                CASAgeGenderFlags age     = mAgeSpecies & CASAgeGenderFlags.AgeMask;;
                CASAgeGenderFlags species = mAgeSpecies & CASAgeGenderFlags.SpeciesMask;

                result += Common.LocalizeEAString("UI/Feedback/CAS:" + age) + " ";
                result += Common.Localize("Species:" + species) + " ";
            }

            result += CommoditiesEx.GetMotiveLocalizedName(mKind);

            return(result);
        }
Esempio n. 25
0
        private static bool PrivateHasPoints(Sim sim, OccultTypes type, bool allowFailure)
        {
            if (!OccultTypeHelper.HasType(sim, type))
            {
                return(false);
            }

            switch (type)
            {
            case OccultTypes.Genie:
                OccultGenie genie = sim.OccultManager.GetOccultType(OccultTypes.Genie) as OccultGenie;
                if (genie != null)
                {
                    return(genie.MagicPoints.HasPoints());
                }
                break;

            case OccultTypes.Fairy:
                return(!sim.BuffManager.HasElement(BuffNames.FairyAuraFailure));

            case OccultTypes.Witch:
                if (allowFailure)
                {
                    return(true);
                }

                return(!sim.BuffManager.HasElement(BuffNames.DepletedMagic));

            case OccultTypes.Unicorn:
                OccultUnicorn unicorn = sim.OccultManager.GetOccultType(OccultTypes.Unicorn) as OccultUnicorn;
                if (unicorn != null)
                {
                    return(unicorn.MagicPoints.HasPoints());
                }
                break;
            }

            return(false);
        }
Esempio n. 26
0
        private static bool PrivateIsFailure(IMagicalInteraction interaction, OccultTypes testType, out bool fail, out bool epicFailure)
        {
            fail        = false;
            epicFailure = false;

            if (!OccultTypeHelper.HasType(interaction.Actor, testType))
            {
                return(false);
            }

            switch (testType)
            {
            case OccultTypes.Witch:
                SpellcastingSkill spellcasting = interaction.Actor.SkillManager.GetElement(SkillNames.Spellcasting) as SpellcastingSkill;
                MagicWand         wand         = MagicWand.GetWandToUse(interaction.Actor, spellcasting);
                if (wand != null)
                {
                    fail = RandomUtil.RandomChance(wand.SuccessChance(interaction.Actor, interaction.SpellLevel, spellcasting.SkillLevel));
                    if (!fail)
                    {
                        epicFailure = RandomUtil.RandomChance(wand.EpicFailChance(interaction.Actor));
                    }
                }
                break;

            case OccultTypes.Fairy:
                if (interaction.SpellLevel <= interaction.Actor.SkillManager.GetSkillLevel(SkillNames.FairyMagic))
                {
                    fail = true;
                }
                break;

            case OccultTypes.Genie:
            case OccultTypes.Unicorn:
                return(false);
            }

            return(fail);
        }
Esempio n. 27
0
        protected virtual bool IsAvailable(Sim sim, IMagicalDefinition definition)
        {
            if ((Occult & definition.SpellSettings.mValidTypes) == OccultTypes.None)
            {
                return(false);
            }

            if (!OccultTypeHelper.HasType(sim, Occult))
            {
                return(false);
            }

            if (GetSkillLevel(sim.SimDescription) < GetMinSkillLevel(definition))
            {
                return(false);
            }

            if (GetMana(sim) + definition.SpellSettings.mMinMana >= 100)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 28
0
        public static string GetStatus(SimDescription sim)
        {
            string str = sim.FullName;

            bool serviceOrRole = false;

            if (sim.AssignedRole != null)
            {
                serviceOrRole = true;
                ShoppingRegister register = sim.AssignedRole.RoleGivingObject as ShoppingRegister;
                if (register != null)
                {
                    str += ", " + register.RegisterRoleName(sim.IsFemale);
                }
                else
                {
                    string roleName;
                    if (Localization.GetLocalizedString(sim.AssignedRole.CareerTitleKey, out roleName))
                    {
                        str += ", " + roleName;
                    }
                }

                string hours = GetRoleHours(sim);
                if (!string.IsNullOrEmpty(hours))
                {
                    str += Common.NewLine + hours;
                }
            }
            else if (SimTypes.InServicePool(sim))
            {
                serviceOrRole = true;

                string serviceName;
                if (Localization.GetLocalizedString("Ui/Caption/Services/Service:" + sim.CreatedByService.ServiceType.ToString(), out serviceName))
                {
                    str += ", " + serviceName;
                }
            }

            if ((serviceOrRole) || (Tagger.Settings.mTagDataSettings[TagDataType.Orientation] && Tagger.Settings.mTagDataSettings[TagDataType.LifeStage] && (Tagger.Settings.mTagDataSettings[TagDataType.AgeInDays] || (Tagger.Settings.mTagDataSettings[TagDataType.DaysTillNextStage] && sim.AgingEnabled))))
            {
                str += Common.NewLine;
            }
            else
            {
                str += " - ";
            }

            if (sim.TeenOrAbove && !sim.IsPet && Tagger.Settings.mTagDataSettings[TagDataType.Orientation])
            {
                str += Common.Localize("SimType:" + TagDataHelper.GetOrientation(sim).ToString());
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.LifeStage])
            {
                if (Tagger.Settings.mTagDataSettings[TagDataType.Orientation])
                {
                    str += " ";
                }

                str += sim.AgeLocalizedText;
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.AgeInDays] || Tagger.Settings.mTagDataSettings[TagDataType.DaysTillNextStage])
            {
                str += " (";
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.AgeInDays])
            {
                str += Common.Localize("TagData:Age", sim.IsFemale, new object[] { Math.Round(Aging.GetCurrentAgeInDays(sim as IMiniSimDescription)) });
            }

            if (sim.AgingEnabled)
            {
                if (Tagger.Settings.mTagDataSettings[TagDataType.DaysTillNextStage])
                {
                    str += ", " + Common.Localize("TagData:Birthday", sim.IsFemale, new object[] { (int)(AgingManager.Singleton.AgingYearsToSimDays(AgingManager.GetMaximumAgingStageLength(sim)) - AgingManager.Singleton.AgingYearsToSimDays(sim.AgingYearsSinceLastAgeTransition)) });
                }
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.AgeInDays] || Tagger.Settings.mTagDataSettings[TagDataType.DaysTillNextStage])
            {
                str += ")";
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.Occult] && sim.OccultManager != null)
            {
                List <OccultTypes> types = OccultTypeHelper.CreateList(sim, false);

                if (types.Count > 0)
                {
                    str += Common.NewLine;

                    string occultString = "";
                    foreach (OccultTypes type in types)
                    {
                        occultString += ", " + OccultTypeHelper.GetLocalizedName(type);
                    }

                    str += Common.Localize("TagData:OccultTag", sim.IsFemale, new object[] { occultString.Remove(0, 2) });
                }
            }

            Sim createdSim = sim.CreatedSim;

            if (Tagger.Settings.Debugging)
            {
                if (createdSim != null)
                {
                    str += Common.NewLine + "Autonomy: ";
                    if (createdSim.Autonomy == null)
                    {
                        str += "None";
                    }
                    else
                    {
                        if (createdSim.Autonomy.AutonomyDisabled)
                        {
                            str += "Disabled";
                        }
                        else if (!AutonomyRestrictions.IsAnyAutonomyEnabled(createdSim))
                        {
                            str += "User Disabled";
                        }
                        else if (createdSim.Autonomy.IsRunningHighLODSimulation)
                        {
                            str += "High";
                        }
                        else
                        {
                            str += "Low";
                        }

                        if (createdSim.Autonomy.ShouldRunLocalAutonomy)
                        {
                            str += " Local";
                        }

                        if (createdSim.CanRunAutonomyImmediately())
                        {
                            str += " Ready";
                        }
                        else if (!createdSim.mLastInteractionWasAutonomous)
                        {
                            str += " Push";
                        }
                        else if (!createdSim.mLastInteractionSucceeded)
                        {
                            str += " Fail";
                        }

                        if (createdSim.Autonomy.InAutonomyManagerQueue)
                        {
                            str += " Queued";
                        }
                    }
                }
            }

            if (createdSim != null)
            {
                if (Tagger.Settings.mTagDataSettings[TagDataType.Mood])
                {
                    str += Common.NewLine;
                    int flavour = (int)createdSim.MoodManager.MoodFlavor;

                    str += Common.Localize("TagData:MoodTag", sim.IsFemale, new object[] { Common.LocalizeEAString(false, "Ui/Tooltip/HUD/SimDisplay:MoodFlavor" + flavour.ToString()) }) + " ";
                }

                if (Tagger.Settings.mTagDataSettings[TagDataType.MotiveInfo])
                {
                    if (!Tagger.Settings.mTagDataSettings[TagDataType.Mood])
                    {
                        str += Common.NewLine;
                    }

                    string motives = ", ";
                    int    num     = 0;
                    foreach (CommodityKind kind in (Sims3.UI.Responder.Instance.HudModel as HudModel).GetMotives(sim.CreatedSim))
                    {
                        if (sim.CreatedSim.Motives.HasMotive(kind))
                        {
                            if (num >= 6)
                            {
                                break;
                            }

                            motives += FetchMotiveLocalization(sim.Species, kind) + ": " + "(" + sim.CreatedSim.Motives.GetValue(kind).ToString("0.") + ") ";
                        }

                        num++;
                    }

                    str += Common.Localize("TagData:Motives", sim.IsFemale, new object[] { motives.Remove(0, 2) });
                }

                if (Tagger.Settings.mTagDataSettings[TagDataType.CurrentInteraction] && createdSim.CurrentInteraction != null)
                {
                    str += Common.NewLine;

                    try
                    {
                        str += createdSim.CurrentInteraction.ToString();
                    }
                    catch (Exception e)
                    {
                        Common.DebugException(createdSim, e);

                        str += createdSim.CurrentInteraction.GetType();
                    }

                    Tone tone = createdSim.CurrentInteraction.CurrentTone;
                    if (tone != null)
                    {
                        str += Common.NewLine + tone.ToString();
                    }

                    SocialInteractionBase social = createdSim.CurrentInteraction as SocialInteractionBase;
                    if ((social != null) && (social.Target != null))
                    {
                        str += " " + Common.Localize("TagData:With", sim.IsFemale, new object[] { social.Target.Name });
                    }

                    if (createdSim.CurrentInteraction is Terrain.GoHereWith)
                    {
                        InviteToLotSituation situtation = InviteToLotSituation.FindInviteToLotSituationInvolving(createdSim);
                        if (situtation != null)
                        {
                            if (situtation.SimA != createdSim)
                            {
                                str += " " + situtation.SimA.Name;
                            }
                            else if (situtation.SimB != createdSim)
                            {
                                str += situtation.SimB.Name;
                            }
                        }
                    }
                }
            }

            if (!SimTypes.IsSpecial(sim))
            {
                str += Common.NewLine + Common.Localize("TagData:CashTag", sim.IsFemale, new object[] { sim.FamilyFunds });

                if ((Tagger.Settings.mTagDataSettings[TagDataType.Debt] || Tagger.Settings.mTagDataSettings[TagDataType.NetWorth]) && sGetDebtAndNetworth.Valid)
                {
                    int bit = 0;
                    if (Tagger.Settings.mTagDataSettings[TagDataType.Debt])
                    {
                        bit = bit + 1;
                    }
                    if (Tagger.Settings.mTagDataSettings[TagDataType.NetWorth])
                    {
                        bit = bit + 4;
                    }

                    str += sGetDebtAndNetworth.Invoke <string>(new object[] { sim, bit });
                }

                if (Tagger.Settings.mTagDataSettings[TagDataType.Job])
                {
                    if (sim.Occupation != null)
                    {
                        str += Common.NewLine;
                        if (sim.Occupation.OfficeLocation != null)
                        {
                            str += Common.Localize("TagData:JobAt", sim.IsFemale, new object[] { sim.Occupation.CurLevelJobTitle, sim.Occupation.OfficeLocation.GetLocalizedName() });
                        }
                        else
                        {
                            str += Common.Localize("TagData:JobTag", sim.IsFemale, new object[] { sim.Occupation.CurLevelJobTitle });
                        }
                    }
                }

                if (Tagger.Settings.mTagDataSettings[TagDataType.PartnerInfo])
                {
                    if (sim.Partner != null)
                    {
                        Relationship rel    = sim.GetRelationship(sim.Partner, false);
                        string       status = "Happily";
                        if (rel != null)
                        {
                            if (rel.CurrentLTRLiking < -15)
                            {
                                status = "Unhappily";
                            }
                        }

                        str += Common.NewLine;

                        if (sim.IsMarried)
                        {
                            str += Common.Localize("TagData:Spouse", sim.IsFemale, new object[] { Common.Localize("TagData:" + status), sim.Partner });
                        }
                        else
                        {
                            str += Common.Localize("TagData:Partner", sim.IsFemale, new object[] { sim.Partner });
                        }
                    }
                }
            }

            if (sim.IsPregnant && Tagger.Settings.mTagDataSettings[TagDataType.PregnancyInfo])
            {
                IMiniSimDescription father = SimDescription.Find(sim.Pregnancy.DadDescriptionId);
                if (father == null)
                {
                    father = MiniSimDescription.Find(sim.Pregnancy.DadDescriptionId);
                }

                str += Common.NewLine;

                if (father != null)
                {
                    if (sim.Partner != null && father != sim.Partner && !sim.IsPet)
                    {
                        string uhoh = Common.Localize("TagData:Uhoh");
                        str += Common.Localize("TagData:Pregnancy", sim.IsFemale, new object[] { father, uhoh });
                    }
                    else
                    {
                        str += Common.Localize("TagData:Pregnancy", sim.IsFemale, new object[] { father });
                    }
                }
                else
                {
                    str += Common.Localize("TagData:PregnancyUnknown", sim.IsFemale);
                }
            }

            if (Tagger.Settings.mTagDataSettings[TagDataType.PersonalityInfo] && sGetClanInfo.Valid)
            {
                List <string> info = sGetClanInfo.Invoke <List <string> >(new object [] { sim });
                foreach (string personality in info)
                {
                    str += Common.NewLine + personality;
                }
            }

            return(str);
        }
Esempio n. 29
0
 protected override string GetLocalizedValue(OccultTypes value, ref ThumbnailKey icon)
 {
     return(OccultTypeHelper.GetLocalizedName(value));
 }
Esempio n. 30
0
 public override string GetLocalizedValue(OccultTypes value)
 {
     return(OccultTypeHelper.GetLocalizedName(value));
 }