Beispiel #1
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile dataFile = file as BooterHelper.DataBootFile;
            if (dataFile == null)
            {
                return;
            }

            mIndex++;

            string personalityName = row.GetString("Name");

            if (string.IsNullOrEmpty(personalityName))
            {
                BooterLogger.AddError(file + " : Method " + mIndex + " Unnamed");
                return;
            }

            BooterLogger.AddTrace("Found " + personalityName);

            if (GetPersonality(personalityName) != null)
            {
                BooterLogger.AddError(personalityName + " Name already in use");
                return;
            }

            Type classType = row.GetClassType("FullClassName");

            if (classType == null)
            {
                BooterLogger.AddError(personalityName + " No Class");
                return;
            }

            SimPersonality personality = null;

            try
            {
                personality = classType.GetConstructor(new Type[0]).Invoke(new object[0]) as SimPersonality;
            }
            catch
            { }

            if (personality == null)
            {
                BooterLogger.AddError(personalityName + ": Constructor Fail " + row.GetString("FullClassName"));
            }
            else
            {
                XmlDbTable optionTable = dataFile.GetTable(personalityName);
                if (personality.Parse(row, optionTable))
                {
                    sLookup.Add(personalityName.ToLower(), personality);
                }
                else
                {
                    BooterLogger.AddError(personalityName + ": Parsing Fail");
                }
            }
        }
Beispiel #2
0
        public ScoringStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Scoring", Name))
            {
                mScoring = row.GetString("Scoring");
                if (string.IsNullOrEmpty(mScoring))
                {
                    BooterLogger.AddError(Name + " Empty Scoring");
                }
                else if (ScoringLookup.GetScoring(mScoring) == null)
                {
                    BooterLogger.AddError(Name + " Invalid Scoring: " + mScoring);
                }
            }

            if (row.GetString("Minimum") == "Strength")
            {
                mMinimum = int.MinValue;
            }
            else
            {
                mMinimum = row.GetInt("Minimum", int.MinValue);
            }

            mMinMutation = row.GetString("MinMutation");
        }
Beispiel #3
0
        public SocialSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Social", Guid))
            {
                mSocial = row.GetString("Social");

                if (mSocial != "Braaaiiins")
                {
                    if (ActionData.Get(mSocial) == null)
                    {
                        BooterLogger.AddError(Guid + " Invalid Social: " + mSocial);
                    }
                }
            }

            if (BooterLogger.Exists(row, "RoomOnly", Guid))
            {
                mRoomOnly = row.GetBool("RoomOnly");
            }

            mScoring = row.GetString("Scoring");

            if (!string.IsNullOrEmpty(mScoring))
            {
                if (ScoringLookup.GetScoring(mScoring) == null)
                {
                    BooterLogger.AddError(Guid + " Invalid Scoring: " + mScoring);
                }

                mMinimum = row.GetInt("Minimum", 0);
            }
        }
Beispiel #4
0
 public void OnPreLoad()
 {
     if (GameUtils.IsInstalled(ProductVersion.EP10))
     {
         BooterLogger.AddError(SocialRHSReplacer.Perform <CommonSocials>("Invite to VIP Room", "InviteToVIP"));
     }
 }
Beispiel #5
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BooterHelper.DataBootFile careerFile = new BooterHelper.DataBootFile(file.ToString(), row.GetString("Careers"), false);
            if (!careerFile.IsValid)
            {
                BooterLogger.AddError(file.ToString() + ": Unknown Careers File " + row.GetString("Careers"));
                return;
            }

            BooterHelper.DataBootFile careerEventsFile = new BooterHelper.DataBootFile(careerFile.ToString(), row.GetString("CareerEvents"), false);

            if (careerEventsFile.IsValid)
            {
                foreach (Career career in CareerManager.CareerList)
                {
                    XmlDbTable table3 = careerEventsFile.GetTable(career.Guid.ToString());
                    if (table3 != null)
                    {
                        LoadCareerEvents(career, careerEventsFile, table3);
                    }
                }
            }

            BooterHelper.DataBootTable table = new BooterHelper.DataBootTable(careerFile, "CareerList");
            if (!table.IsValid)
            {
                BooterLogger.AddError(file.ToString() + ": No CareerList " + careerFile.ToString());
                return;
            }

            table.Load(new CareerLoader(careerEventsFile).LoadCareer);
        }
Beispiel #6
0
        public MoodletSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "BuffName", Guid))
            {
                if (!row.TryGetEnum <BuffNames>("BuffName", out mBuff, BuffNames.Undefined))
                {
                    mBuff = (BuffNames)row.GetUlong("BuffName", 0);
                    if (mBuff == 0)
                    {
                        mBuff = (BuffNames)ResourceUtils.HashString64(row.GetString("BuffName"));
                    }

                    if (!BuffManager.BuffDictionary.ContainsKey((ulong)mBuff))
                    {
                        BooterLogger.AddError(Guid + " Unknown BuffName: " + row.GetString("BuffName"));
                    }
                }
            }

            mMoodValue = row.GetInt("MoodValue", 0);

            mDuration = row.GetInt("Duration", 30);
            if (mDuration <= 0)
            {
                mDuration = -1;
            }

            mOrigin = (Origin)row.GetUlong("Origin", 0);
            if (mOrigin == Origin.None)
            {
                mOrigin = (Origin)ResourceUtils.HashString64(row.GetString("Origin"));
            }
        }
Beispiel #7
0
        public OccultSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Occult", Guid))
            {
                if (!row.TryGetEnum <OccultTypes>("Occult", out mOccult, OccultTypes.None))
                {
                    BooterLogger.AddError(" Unknown Occult: " + row.GetString("Occult"));
                }
            }

            if (BooterLogger.Exists(row, "Remove", Guid))
            {
                mRemove = row.GetBool("Remove");
            }

            if (BooterLogger.Exists(row, "DropOthers", Guid))
            {
                mDropOthers = row.GetBool("DropOthers");
            }

            if (BooterLogger.Exists(row, "AllowIfOthers", Guid))
            {
                mAllowIfOthers = row.GetBool("AllowIfOthers");
            }
        }
 public void OnPreLoad()
 {
     if (GameUtils.IsInstalled(ProductVersion.EP2))
     {
         BooterLogger.AddError(SocialRHSReplacer.Perform <FinishMakeoverFreestyle>("Makeover Freestyle", "OnFinishMakeoverFreestyle"));
     }
 }
Beispiel #9
0
 public void OnPreLoad()
 {
     if (GameUtils.IsInstalled(ProductVersion.EP7))
     {
         BooterLogger.AddError(ActionDataReplacer.Perform <CommonSocials>("TestMagicWandEquipped"));
     }
 }
Beispiel #10
0
            protected void LoadStage(BooterHelper.BootFile file, XmlDbRow row)
            {
                Type type = row.GetClassType("FullClassName");

                if (type == null)
                {
                    BooterLogger.AddError("Invalid FullClassName: " + row.GetString("FullClassName"));
                    return;
                }

                Stage stage = null;

                try
                {
                    stage = type.GetConstructor(new Type[] { typeof(XmlDbRow) }).Invoke(new object[] { row }) as Stage;
                }
                catch (Exception e)
                {
                    BooterLogger.AddError("Contructor Fail: " + row.GetString("FullClassName"));

                    Common.Exception(file + Common.NewLine + row.GetString("FullClassName") + " Fail", e);
                }

                if (stage != null)
                {
                    mStages.Add(stage);
                }
            }
Beispiel #11
0
 public void OnPreLoad()
 {
     if (GameUtils.IsInstalled(ProductVersion.EP2))
     {
         BooterLogger.AddError(SocialRHSReplacer.Perform <Vaccinate>("Vaccinate", "BeforeVaccinate"));
         BooterLogger.AddError(SocialRHSReplacer.Perform <Vaccinate>("Diagnose", "BeforeDiagnose"));
     }
 }
Beispiel #12
0
        public override bool Parse(XmlDbRow row)
        {
            mIndex = row.GetInt("Index", -1);
            if (mIndex < 0)
            {
                BooterLogger.AddError("Invalid Index for " + mParentType + "." + mFieldName);
                return(false);
            }

            return(base.Parse(row));
        }
Beispiel #13
0
            public ActionDataSetting(string name, XmlDbRow row)
                : this(name)
            {
                mFlags = Flags.None;

                if (row.Exists("Autonomous"))
                {
                    mAutonomous = row.GetBool("Autonomous");
                    mFlags     |= Flags.Autonomous;
                }

                if (row.Exists("UserDirected"))
                {
                    mUserDirected = row.GetBool("UserDirected");
                    mFlags       |= Flags.UserDirected;
                }

                if (row.Exists("AllowPregnant"))
                {
                    mAllowPregnant = row.GetBool("AllowPregnant");
                    mFlags        |= Flags.AllowPregnant;
                }

                if (row.Exists("ActorAgeSpecies"))
                {
                    mActorAgeSpecies = row.GetEnum <CASAGSAvailabilityFlags>("ActorAgeSpecies", CASAGSAvailabilityFlags.All);
                    if (mActorAgeSpecies == CASAGSAvailabilityFlags.All)
                    {
                        BooterLogger.AddError("Unknown ActorAgeSpecies: " + row.GetString("ActorAgeSpecies"));
                    }
                    else
                    {
                        mFlags |= Flags.ActorAgeSpecies;

                        mActorAgeSpeciesList = null;
                    }
                }

                if (row.Exists("TargetAgeSpecies"))
                {
                    mTargetAgeSpecies = row.GetEnum <CASAGSAvailabilityFlags>("TargetAgeSpecies", CASAGSAvailabilityFlags.All);
                    if (mTargetAgeSpecies == CASAGSAvailabilityFlags.All)
                    {
                        BooterLogger.AddError("Unknown TargetAgeSpecies: " + row.GetString("TargetAgeSpecies"));
                    }
                    else
                    {
                        mFlags |= Flags.TargetAgeSpecies;

                        mTargetAgeSpeciesList = null;
                    }
                }
            }
Beispiel #14
0
        protected WeatherSettings GetSeason(XmlDbRow row)
        {
            Season season = row.GetEnum <Season>("Season", Season.Spring | Season.Summer | Season.Fall | Season.Winter);

            if (season == (Season.Spring | Season.Summer | Season.Fall | Season.Winter))
            {
                BooterLogger.AddError("Unknown Season: " + row.GetString("Season"));
                return(null);
            }

            return(Tempest.Settings.GetWeather(season, false));
        }
Beispiel #15
0
        public void OnPreLoad()
        {
            BooterLogger.AddError(SocialRHSReplacer.Perform <CommonSocials>("Trick Or Treat", "OnTrickOrTreatAccept"));

            InteractionTuning tuning = Tunings.GetTuning <Sprinkler, Sprinkler.PlayWithSprinkler.Definition>();

            if (tuning != null)
            {
                CommodityChange change = new CommodityChange(CommodityKind.Temperature, 10, false, 20, OutputUpdateType.ContinuousFlow, false, false, UpdateAboveAndBelowZeroType.Either);
                tuning.mTradeoff.mOutputs.Add(change);
            }
        }
Beispiel #16
0
        public override bool ValidateStages(Dictionary <string, int> stages)
        {
            int stage;

            if (!stages.TryGetValue(mNextStage.First, out stage))
            {
                BooterLogger.AddError(Name + " NextStage Missing: " + mNextStage.First);
                return(false);
            }

            mNextStage.Second = stage;
            return(true);
        }
Beispiel #17
0
            public Data(XmlDbRow row, VectorBooter.Test test)
            {
                mGuid = row.GetString("GUID");

                mDelta = row.GetInt("Delta", 0);

                if (mDelta == 0)
                {
                    BooterLogger.AddError(mGuid + " Missing Delta");
                }

                mTest = test;
            }
Beispiel #18
0
            public ITUNSettings(string name, XmlDbRow row)
                : this(name)
            {
                mFlags = Flags.None;

                if (row.Exists("Autonomous"))
                {
                    mAutonomous = row.GetBool("Autonomous");
                    mFlags     |= Flags.Autonomous;
                }

                if (row.Exists("UserDirected"))
                {
                    mUserDirected = row.GetBool("UserDirected");
                    mFlags       |= Flags.UserDirected;
                }

                if (row.Exists("AgeSpecies"))
                {
                    mAgeSpecies = row.GetEnum <CASAGSAvailabilityFlags>("AgeSpecies", CASAGSAvailabilityFlags.None);
                    if (mAgeSpecies == CASAGSAvailabilityFlags.None)
                    {
                        BooterLogger.AddError("Unknown AgeSpecies: " + row.GetString("AgeSpecies"));
                    }
                    else
                    {
                        mFlags |= Flags.AgeSpecies;

                        mAgeSpeciesList = null;
                    }
                }

                if (row.Exists("Availability"))
                {
                    mAvailability = row.GetEnum <Availability.FlagField>("Availability", Availability.FlagField.None);
                    if (mAvailability == Availability.FlagField.None)
                    {
                        BooterLogger.AddError("Unknown Availability: " + row.GetString("Availability"));
                    }
                    else
                    {
                        mFlags |= Flags.Availability;
                    }
                }

                if (row.Exists("Advertised"))
                {
                    ParseAdvertised(row.GetStringList("Advertised", ','));
                }
            }
Beispiel #19
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            SkillNames skill;

            if (!ParserFunctions.TryParseEnum <SkillNames>(row.GetString("Skill"), out skill, SkillNames.None))
            {
                BooterLogger.AddError("Invalid Skill: " + row.GetString("Skill"));
                return;
            }

            sData.Add(skill, true);

            BooterLogger.AddTrace(" Child Skill: " + row.GetString("Skill"));
        }
Beispiel #20
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            BuffNames buff;

            if (!ParserFunctions.TryParseEnum <BuffNames>(row.GetString("Moodlet"), out buff, BuffNames.Undefined))
            {
                BooterLogger.AddError("Invalid Moodlet: " + row.GetString("Moodlet"));
                return;
            }

            sData.Add(buff, true);

            BooterLogger.AddTrace(" Bad Lot Moodlet: " + row.GetString("Moodlet"));
        }
Beispiel #21
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            Type type = row.GetClassType("Type");

            if (type == null)
            {
                BooterLogger.AddError("Invalid Type: " + row.GetString("Type"));
                return;
            }

            sData.Add(type, true);

            BooterLogger.AddTrace(" Discount Type: " + row.GetString("Type"));
        }
Beispiel #22
0
        public object Convert(string value, bool fireError)
        {
            T result;

            if (Convert(value, out result) == OptionResult.Failure)
            {
                if (fireError)
                {
                    BooterLogger.AddError("Value Conversion failed: " + value);
                }
                return(null);
            }

            return(result);
        }
Beispiel #23
0
        public void OnPreLoad()
        {
            Tunings.Inject <Sim, Sim.GiveGift.Definition, Definition>(false);

            sOldSingleton = Singleton;
            Singleton     = new Definition();

            if (GameUtils.IsInstalled(ProductVersion.EP4))
            {
                BooterLogger.AddError(SocialRHSReplacer.Perform <GiveGiftEx>("Give Gift", "OnGiveGiftAccept"));
                BooterLogger.AddError(SocialRHSReplacer.Perform <GiveGiftEx>("Give Gift", "OnGiveGiftReject"));

                BooterLogger.AddError(ActionDataReplacer.Perform <GiveGiftEx>("GiveGiftProceduralTest"));
            }
        }
Beispiel #24
0
        public GenericTest(XmlDbRow row)
        {
            string name = row.GetString("GUID");

            foreach (string e in row.GetStringList("Event", ','))
            {
                EventTypeId id;
                if (!ParserFunctions.TryParseEnum <EventTypeId>(e, out id, EventTypeId.kEventNone))
                {
                    BooterLogger.AddError(name + " Unknown Event: " + e);
                }

                mEvents.Add(id);
            }
        }
Beispiel #25
0
        public DeathSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Type", Guid))
            {
                if (!row.TryGetEnum <SimDescription.DeathType>("Type", out mType, SimDescription.DeathType.None))
                {
                    BooterLogger.AddError(" Unknown Type: " + row.GetString("Type"));
                }
            }

            if (BooterLogger.Exists(row, "AllowActive", Guid))
            {
                mAllowActive = row.GetBool("AllowActive");
            }
        }
Beispiel #26
0
        public override bool ValidateStages(Dictionary <string, int> stages)
        {
            for (int i = 0; i < mNextStages.Length; i++)
            {
                int stage;
                if (!stages.TryGetValue(mNextStages[i].First, out stage))
                {
                    BooterLogger.AddError(" NextStages missing: " + mNextStages[i]);
                    return(false);
                }

                mNextStages[i].Second = stage;
            }

            return(true);
        }
Beispiel #27
0
        protected override void Perform(BooterHelper.BootFile file, XmlDbRow row)
        {
            string guid = row.GetString("GUID");

            if (string.IsNullOrEmpty(guid))
            {
                BooterLogger.AddError("Invalid GUID: " + guid);
                return;
            }
            else if (sVectors.ContainsKey(guid))
            {
                BooterLogger.AddError("Duplicate GUID: " + guid);
                return;
            }

            sVectors.Add(guid, new Data(guid, file, row));
        }
Beispiel #28
0
        public FindSimSymptom(XmlDbRow row)
            : base(row)
        {
            mScoring = row.GetString("Scoring");

            if (!string.IsNullOrEmpty(mScoring))
            {
                if (ScoringLookup.GetScoring(mScoring) == null)
                {
                    BooterLogger.AddError(Guid + " Invalid Scoring: " + mScoring);
                }

                mMinimum = row.GetInt("Minimum", 0);
            }

            mAllowActive = row.GetBool("AllowActive");
        }
Beispiel #29
0
        public void SetToDefault()
        {
            List <ITUNSettings> itunSettings = InteractionBooter.GetSettings(mKey);

            foreach (ITUNSettings setting in itunSettings)
            {
                mSettings[setting.mName] = setting;
            }

            Dictionary <string, bool> matched = new Dictionary <string, bool>();

            foreach (InteractionTuning tuning in InteractionTuning.sAllTunings.Values)
            {
                ITUNSettings setting = GetSettings(tuning, false);
                if (setting == null)
                {
                    continue;
                }

                matched.Add(setting.mName, true);
            }

            foreach (ITUNSettings setting in itunSettings)
            {
                if (matched.ContainsKey(setting.mName))
                {
                    continue;
                }

                BooterLogger.AddError("Unmatched ITUN:" + Common.NewLine + " ObjectName: " + setting.mName.Replace("|", Common.NewLine + " InteractionName:"));
            }

            foreach (TunableStore setting in TuningBooter.GetSettings(mKey))
            {
                AddTunable(setting, true);
            }

            foreach (ActionDataSetting setting in SocialBooter.GetSettings(mKey))
            {
                ActionData data = ActionData.Get(setting.mName);
                if (data != null)
                {
                    mActionData[data.Key] = setting;
                }
            }
        }
Beispiel #30
0
        public virtual bool Parse(XmlDbRow row)
        {
            mParentType = row.GetClassType("FullClassName");
            if (mParentType == null)
            {
                BooterLogger.AddError("Unknown FullClassName: " + row.GetString("FullClassName"));
                return(false);
            }

            mFieldName = row.GetString("FieldName");
            if (string.IsNullOrEmpty(mFieldName))
            {
                BooterLogger.AddError("FieldName missing for " + mParentType.ToString());
                return(false);
            }

            return(true);
        }