Example #1
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"));
            }
        }
Example #2
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);
            }
        }
Example #3
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");
            }
        }
Example #4
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");
        }
Example #5
0
 public FirestarterSymptom(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "Maximum", Guid))
     {
         mMaximum = row.GetInt("Maximum");
     }
 }
Example #6
0
 public StoryStage(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "NextStage", Name))
     {
         mNextStage.First = row.GetString("NextStage");
     }
 }
Example #7
0
 public CounterStage(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "Counter", Name))
     {
         mCounter = row.GetString("Counter");
     }
 }
Example #8
0
 public TestSettingStage(XmlDbRow row)
     : base(row)
 {
     if (BooterLogger.Exists(row, "Setting", Name))
     {
         mSetting = row.GetString("Setting");
     }
 }
Example #9
0
        public IncrementalStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Maximum", Name))
            {
                mMaximum = row.GetInt("Maximum", 0);
            }

            mMaxMutation = row.GetString("MaxMutation");
        }
Example #10
0
        public WeightBaseSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Minimum", Guid))
            {
                mMinimum = row.GetFloat("Minimum");
            }

            if (BooterLogger.Exists(row, "Maximum", Guid))
            {
                mMaximum = row.GetFloat("Maximum");
            }
        }
Example #11
0
        public CancelInteractionSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "All", Guid))
            {
                mAll = row.GetBool("All");
            }

            if (BooterLogger.Exists(row, "AffectSleep", Guid))
            {
                mAffectSleep = row.GetBool("AffectSleep");
            }
        }
Example #12
0
        public HitMissTimedStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "SuccessStage", Name))
            {
                mSuccessStage.First = row.GetString("SuccessStage");
            }

            if (BooterLogger.Exists(row, "FailureStage", Name))
            {
                mFailureStage.First = row.GetString("FailureStage");
            }
        }
Example #13
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");
            }
        }
Example #14
0
        public TestCounterStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Minimum", Name))
            {
                mMinimum = row.GetInt("Minimum", 0);
            }

            mMinMutation = row.GetString("MinMutation");

            if (BooterLogger.Exists(row, "Maximum", Name))
            {
                mMaximum = row.GetInt("Maximum", 0);
            }

            mMaxMutation = row.GetString("MaxMutation");
        }
Example #15
0
        public TimedStage(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "MinDuration", Name))
            {
                mMinDuration = row.GetInt("MinDuration", 0);
            }

            mMinMutation = row.GetString("MinMutation");

            if (BooterLogger.Exists(row, "MaxDuration", Name))
            {
                mMaxDuration = row.GetInt("MaxDuration", 0);
            }

            mMaxMutation = row.GetString("MaxMutation");
        }
Example #16
0
        public ImpregnateSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Clone", Guid))
            {
                mClone = row.GetBool("Clone");
            }

            if (BooterLogger.Exists(row, "AllowCloseRelations", Guid))
            {
                mAllowCloseRelations = row.GetBool("AllowCloseRelations");
            }

            if (row.Exists("HandlePlantSim"))
            {
                mHandlePlantSim = row.GetBool("HandlePlantSim");
            }
        }
Example #17
0
        public WeightedStage(XmlDbRow row)
            : base(row)
        {
            if (!BooterLogger.Exists(row, "NextStages", Name))
            {
                return;
            }
            if (!BooterLogger.Exists(row, "NextWeights", Name))
            {
                return;
            }

            List <string> nextStages  = row.GetStringList("NextStages", ',');
            List <string> nextWeights = row.GetStringList("NextWeights", ',');

            if (nextStages.Count != nextWeights.Count)
            {
                BooterLogger.AddError(Name + " NextStages/NextWeights Size Mismatch");

                mNextStages  = new Pair <string, int>[] { new Pair <string, int> ("", 0) };
                mNextWeights = new int[] { 1 };

                return;
            }

            mNextStages  = new Pair <string, int> [nextStages.Count];
            mNextWeights = new int[nextWeights.Count];

            for (int i = 0; i < nextStages.Count; i++)
            {
                mNextStages[i].First = nextStages[i];

                if (!int.TryParse(nextWeights[i], out mNextWeights[i]))
                {
                    BooterLogger.AddError(Name + " NextWeights not numeric: " + nextWeights[i]);
                    return;
                }
            }

            foreach (int weight in mNextWeights)
            {
                mTotalWeight += weight;
            }
        }
Example #18
0
        public ReactionSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Type", Guid))
            {
                if (!row.TryGetEnum <ReactionTypes>("Type", out mType, ReactionTypes.None))
                {
                    BooterLogger.AddError(Guid + " Unknown Type: " + row.GetString("Type"));
                }
            }

            if (BooterLogger.Exists(row, "Speed", Guid))
            {
                if (!row.TryGetEnum <ReactionSpeed>("Speed", out mSpeed, ReactionSpeed.None))
                {
                    BooterLogger.AddError(Guid + " Unknown Speed: " + row.GetString("Speed"));
                }
            }
        }
Example #19
0
        public IdleAnimationSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Mood", Guid))
            {
                if (!row.TryGetEnum <MoodFlavor>("Mood", out mMood, MoodFlavor.Uncomfortable))
                {
                    BooterLogger.AddError(" Unknown Mood: " + row.GetString("Mood"));
                }
            }

            if (BooterLogger.Exists(row, "Priority", Guid))
            {
                if (!row.TryGetEnum <IdleAnimationPriority>("Priority", out mPriority, IdleAnimationPriority.NonDistress))
                {
                    BooterLogger.AddError(" Unknown Priority: " + row.GetString("Priority"));
                }
            }
        }
Example #20
0
        public MotiveSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "Motive", Guid))
            {
                if (!row.TryGetEnum <CommodityKind>("Motive", out mMotive, CommodityKind.None))
                {
                    BooterLogger.AddError(" Unknown Motive: " + row.GetString("Motive"));
                }
            }

            if (BooterLogger.Exists(row, "DeltaValue", Guid))
            {
                mDeltaValue = row.GetInt("DeltaValue", 0);
            }

            if (BooterLogger.Exists(row, "LowerBound", Guid))
            {
                mLowerBound = row.GetInt("LowerBound", 0);
            }
        }
Example #21
0
        public SocialTest(XmlDbRow row)
        {
            string name = row.GetString("GUID");

            if (BooterLogger.Exists(row, "Socials", name))
            {
                mSocials = row.GetStringList("SocialName", ',');

                for (int i = mSocials.Count - 1; i >= 0; i--)
                {
                    if (ActionData.Get(mSocials[i]) == null)
                    {
                        BooterLogger.AddError(name + " Invalid Social: " + mSocials[i]);

                        mSocials.RemoveAt(i);
                    }
                }
            }

            if (BooterLogger.Exists(row, "AllowAccept", name))
            {
                mAllowAccept = row.GetBool("AllowAccept");
            }

            if (BooterLogger.Exists(row, "AllowReject", name))
            {
                mAllowReject = row.GetBool("AllowReject");
            }

            if (BooterLogger.Exists(row, "AllowRecipient", name))
            {
                mAllowRecipient = row.GetBool("AllowRecipient");
            }

            if (BooterLogger.Exists(row, "AllowInitiator", name))
            {
                mAllowInitiator = row.GetBool("AllowInitiator");
            }
        }
Example #22
0
        public ResistanceSymptom(XmlDbRow row)
            : base(row)
        {
            if (BooterLogger.Exists(row, "AffectSelf", Guid))
            {
                mAffectSelf = row.GetBool("AffectSelf");
            }

            if (BooterLogger.Exists(row, "AffectOther", Guid))
            {
                mAffectOther = row.GetBool("AffectOther");
            }

            if (BooterLogger.Exists(row, "Minimum", Guid))
            {
                mMinimum = row.GetInt("Minimum", 0);
            }

            if (BooterLogger.Exists(row, "Maximum", Guid))
            {
                mMaximum = row.GetInt("Maximum", 0);
            }
        }
Example #23
0
            public Stage(XmlDbRow row)
            {
                if (BooterLogger.Exists(row, "Name", "Stage"))
                {
                    mName = row.GetString("Name");
                }

                if (!row.TryGetEnum <VectorControl.StageType>("Type", out mType, VectorControl.StageType.None))
                {
                    BooterLogger.AddError(Name + " Invalid Type: " + row.GetString("Type"));
                }

                float infectionRate = row.GetFloat("InfectionRate", 0);

                mOutdoorInfectionRate = row.GetFloat("OutdoorInfectionRate", infectionRate);
                if (mOutdoorInfectionRate > 1)
                {
                    mOutdoorInfectionRate = 1;
                }

                mRoomInfectionRate = row.GetFloat("RoomInfectionRate", mOutdoorInfectionRate * 1.5f);
                if (mRoomInfectionRate > 1)
                {
                    mRoomInfectionRate = 1;
                }

                mSocialInfectionRate = row.GetFloat("SocialInfectionRate", mRoomInfectionRate * 1.5f);
                if (mSocialInfectionRate > 1)
                {
                    mSocialInfectionRate = 1;
                }
                mFightInfectionRate = row.GetFloat("FightInfectionRate", mSocialInfectionRate);
                if (mFightInfectionRate > 1)
                {
                    mFightInfectionRate = 1;
                }

                mWoohooInfectionRate = row.GetFloat("WoohooInfectionRate", mSocialInfectionRate * 1.5f);
                if (mWoohooInfectionRate > 1)
                {
                    mWoohooInfectionRate = 1;
                }

                mMutationRate = row.GetFloat("MutationRate", 0);

                mGoodRelationshipDelta = row.GetInt("GoodRelationshipDelta", 0);
                mBadRelationshipDelta  = row.GetInt("BadRelationshipDelta", 0);

                mSymptomScoring        = row.GetString("SymptomScoring");
                mSymptomScoringMinimum = row.GetInt("SymptomScoringMinimum", 0);

                mStoryUnknown    = row.GetString("StoryUnknown");
                mStoryIdentified = row.GetString("StoryIdentified");

                if (row.Exists("CanInoculate")) // Default is True
                {
                    mCanInoculate = row.GetBool("CanInoculate");
                }
                else if (row.Exists("CanInnoculate"))
                {
                    mCanInoculate = row.GetBool("CanInnoculate");
                }

                int numSymptoms = row.GetInt("NumSymptoms", 0) + 1;

                for (int i = 1; i <= numSymptoms; i++)
                {
                    if (i == numSymptoms)
                    {
                        if (row.Exists("SymptomChance" + i))
                        {
                            BooterLogger.AddError(Name + " More Symptoms than NumSymptoms");
                        }
                        break;
                    }

                    mSymptoms.Add(new SymptomChance(row, i));
                }

                int numResistances = row.GetInt("NumResistances", 0) + 1;

                for (int i = 1; i <= numResistances; i++)
                {
                    if (i == numResistances)
                    {
                        if (row.Exists("Resistance" + i))
                        {
                            BooterLogger.AddError(Name + " More Resistance than NumResistances");
                        }
                        break;
                    }

                    ResistanceBooter.Data resistance = ResistanceBooter.GetResistance(row.GetString("Resistance" + i));
                    if (resistance == null)
                    {
                        BooterLogger.AddError(Name + " Unknown Resistance " + i + ": " + row.GetString("Resistance" + i));
                    }
                    else
                    {
                        mResistances.Add(resistance);
                    }
                }

                int numMutables = row.GetInt("NumMutables", 0) + 1;

                for (int i = 1; i <= numMutables; i++)
                {
                    if (i == numMutables)
                    {
                        if (row.Exists("Mutable" + i))
                        {
                            BooterLogger.AddError(Name + " More Mutable than NumMutables");
                        }
                        break;
                    }

                    List <string> mutable = row.GetStringList("Mutable" + i, ',');
                    if (mutable.Count != 3)
                    {
                        BooterLogger.AddError(Name + " Unknown Mutable " + i + ": " + row.GetString("Mutable" + i));
                        continue;
                    }

                    int minimum;
                    if (!int.TryParse(mutable[1], out minimum))
                    {
                        BooterLogger.AddError(Name + " Mutable " + i + " Invalid Minimum: " + mutable[1]);
                        continue;
                    }

                    int maximum;
                    if (!int.TryParse(mutable[2], out maximum))
                    {
                        BooterLogger.AddError(Name + " Mutable " + i + " Invalid Maximum: " + mutable[2]);
                        continue;
                    }

                    mMutables.Add(new Mutable(mutable[0], minimum, maximum));
                }
            }
Example #24
0
            public Data(string guid, BooterHelper.BootFile file, XmlDbRow row)
            {
                mGuid = guid;

                if (BooterLogger.Exists(row, "InitialStrength", guid))
                {
                    mInitialStrength = row.GetInt("InitialStrength", 0);
                }

                mInfectionScoring = row.GetString("InfectionScoring");
                if (string.IsNullOrEmpty(mInfectionScoring))
                {
                    BooterLogger.AddError(Guid + " Missing InfectionScoring: " + mInfectionScoring);
                }
                else if (ScoringLookup.GetScoring(mInfectionScoring) == null)
                {
                    BooterLogger.AddError(Guid + " Missing InfectionScoring: " + mInfectionScoring);
                }

                mInfectionMinimum = row.GetInt("InfectionMinimum", 0);

                VectorStageTable table = new VectorStageTable(file as BooterHelper.DataBootFile, guid);

                if (!table.IsValid)
                {
                    BooterLogger.AddError(Guid + " Missing Stages: " + guid);
                }
                else
                {
                    Dictionary <string, int> namesToStages = new Dictionary <string, int>();

                    for (int i = 0; i < table.Stages.Count; i++)
                    {
                        if (namesToStages.ContainsKey(table.Stages[i].Name))
                        {
                            BooterLogger.AddError(Guid + " Stage " + i + ": Duplicate Name " + table.Stages[i].Name);
                            continue;
                        }

                        namesToStages.Add(table.Stages[i].Name, i);
                    }

                    for (int i = 0; i < table.Stages.Count; i++)
                    {
                        BooterLogger.AddTrace("Stage " + i);

                        table.Stages[i].ValidateStages(namesToStages);
                    }
                }

                mStages = table.Stages;

                mInoculationRating = row.GetInt("InoculationRating", 10);
                mInoculationCost   = row.GetInt("InoculationCost", 0);
                mResistanceCost    = row.GetInt("ResistanceCost", 0);

                mCanOutbreak = row.GetBool("CanOutbreak");

                mHighProtectionCost = row.GetInt("HighProtectionCost", 0);
                mLowProtectionCost  = row.GetInt("LowProtectionCost", 0);

                mMinimumStrainDifference = row.GetInt("MinimumStrainDifference", 0);

                mStrainMutationRate = row.GetInt("StrainMutationRate", -1);

                int numInstigators = row.GetInt("NumInstigators", 0) + 1;

                for (int i = 1; i <= numInstigators; i++)
                {
                    if (i == numInstigators)
                    {
                        if (row.Exists("Instigator" + i))
                        {
                            BooterLogger.AddError(Guid + " More Instigator then NumInstigators");
                        }
                        break;
                    }

                    mInstigators.Add(InstigatorBooter.GetInstigator(row.GetString("Instigator" + i)));
                }
            }