Exemple #1
0
        private void Read(string name)
        {
            string filename = PRTY_FILES_PATH + name + ".prty";

            using (var file = File.Open(filename, FileMode.OpenOrCreate, FileAccess.Read))
            {
                if (file.Length == 0)
                {
                    Initialize();
                }
                else
                {
                    NameInput.Text = ReadText(file);
                    EnvironmentInput.SelectedIndex = EnvironmentData.FindIndex(ReadShort(file));
                    NumberOfPlayers             = ReadByte(file);
                    NumberOfPlayersDisplay.Text = NumberOfPlayers.ToString();
                    for (int i = 0; i < NumberOfPlayers; i++)
                    {
                        Players[i].Read(file);
                        Players[i].Visible = true;
                    }
                    for (int i = NumberOfPlayers; i < MAX_NUMBER_OF_PLAYERS; i++)
                    {
                        Players[i].Initialize();
                        Players[i].Visible = false;
                    }
                    for (int i = 0; i < 6; i++)
                    {
                        Relations[i].SelectedIndex = ReadByte(file);
                    }
                    BattleInput.SelectedIndex = BattleData.FindIndex(ReadShort(file));
                }
            }
        }
        protected override void OnRead(SQLiteDataReader reader)
        {
            int landingIndex = CBInputs.FindIndex(reader["ToolID"]);

            Elements[Count - 1].Add(CBInputs.CreateInput(Count, 1, landingIndex));
            Elements[Count - 1].Add(Button("Edit", EditAI, "#CCCCCC", Count, Count, 2));
            ToolAI toolAi = new ToolAI();

            toolAi.Priority             = int.Parse(reader["Priority"].ToString());
            toolAi.Quantity             = int.Parse(reader["Quantity"].ToString());
            toolAi.HPLow                = int.Parse(reader["HPLow"].ToString());
            toolAi.HPHigh               = int.Parse(reader["HPHigh"].ToString());
            toolAi.SPLow                = int.Parse(reader["SPLow"].ToString());
            toolAi.SPHigh               = int.Parse(reader["SPHigh"].ToString());
            toolAi.ActiveState1         = int.Parse(reader["ActiveState1"].ToString());
            toolAi.ActiveState2         = int.Parse(reader["ActiveState2"].ToString());
            toolAi.InactiveState1       = int.Parse(reader["InactiveState1"].ToString());
            toolAi.InactiveState2       = int.Parse(reader["InactiveState2"].ToString());
            toolAi.AllyCondition        = int.Parse(reader["AllyCondition"].ToString());
            toolAi.FoeCondition         = int.Parse(reader["FoeCondition"].ToString());
            toolAi.UserCondition        = int.Parse(reader["UserCondition"].ToString());
            toolAi.TargetElementRate    = reader["TargetElementRate"].ToString();
            toolAi.TargetStateRates     = reader["TargetStateRates"].ToString();
            toolAi.TargetStatConditions = reader["TargetStatConditions"].ToString();
            toolAi.TargetToolElement    = int.Parse(reader["TargetToolElement"].ToString());
            ToolAIs.Add(toolAi);
        }
 public void Read(FileStream file)
 {
     Player.SelectedIndex        = PlayerData.FindIndex(ReadByte(file));
     Class.SelectedIndex         = BattlerClassData.FindIndex(ReadByte(file));
     LevelInput.Text             = ReadByte(file).ToString();
     ZFormation.SelectedIndex    = ReadByte(file);
     XFormation.SelectedIndex    = ReadByte(file);
     Item1.SelectedIndex         = ItemData.FindIndex(ReadShort(file));
     Item2.SelectedIndex         = ItemData.FindIndex(ReadShort(file));
     Item3.SelectedIndex         = ItemData.FindIndex(ReadShort(file));
     Item4.SelectedIndex         = ItemData.FindIndex(ReadShort(file));
     Weapon1.SelectedIndex       = WeaponData.FindIndex(ReadShort(file));
     Weapon2.SelectedIndex       = WeaponData.FindIndex(ReadShort(file));
     Weapon3.SelectedIndex       = WeaponData.FindIndex(ReadShort(file));
     PassiveSkill1.SelectedIndex = PassiveSkillData.FindIndex(ReadShort(file));
     PassiveSkill2.SelectedIndex = PassiveSkillData.FindIndex(ReadShort(file));
 }
Exemple #4
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     ToolAttributes.Read(reader);
     ToolStateRates.Read(reader);
     PermanentStatMods.Read(reader);
     DefaultPriceInput.Text       = reader["DefaultPrice"].ToString();
     ConsumableInput.IsChecked    = reader["Consumable"].ToString() == "True" ? true : false;
     TurnsIntoInput.SelectedIndex = TurnsIntoData.FindIndex(reader["TurnsInto"]);
 }
        protected override void OnRead(SQLiteDataReader reader)
        {
            int landingIndex = TargetTableData.FindIndex(reader[TargetDBTable + "_ID"]);

            Elements[Count - 1].Add(TargetTableData.CreateInput(Count, 1, landingIndex));
            if (isDual())
            {
                AddSecondInput(reader[AttributeName].ToString());
            }
        }
Exemple #6
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     ToolAttributes.Read(reader);
     ToolStateRates.Read(reader);
     EquipBoosts.Read(reader);
     WeaponTypeInput.SelectedIndex = WeaponTypeData.FindIndex(reader["WeaponType"]);
     RangeInput.Text             = reader["Range"].ToString();
     CollideRangeInput.IsChecked = reader["CollideRange"].ToString() == "True" ? true : false;
     DefaultPriceInput.Text      = reader["DefaultPrice"].ToString();
     DefaultQuantityInput.Text   = reader["DefaultQuantity"].ToString();
 }
 public void SetInformation(ToolAI selectedBETool)
 {
     PriorityInput.Text = selectedBETool.Priority.ToString();
     QuantityInput.Text = selectedBETool.Quantity.ToString();
     HPLowInput.Text    = selectedBETool.HPLow.ToString();
     HPHighInput.Text   = selectedBETool.HPHigh.ToString();
     SPLowInput.Text    = selectedBETool.SPLow.ToString();
     SPHighInput.Text   = selectedBETool.SPHigh.ToString();
     ActiveState1Input.SelectedIndex   = StateData.FindIndex(selectedBETool.ActiveState1);
     ActiveState2Input.SelectedIndex   = StateData.FindIndex(selectedBETool.ActiveState2);
     InactiveState1Input.SelectedIndex = StateData.FindIndex(selectedBETool.InactiveState1);
     InactiveState2Input.SelectedIndex = StateData.FindIndex(selectedBETool.InactiveState2);
     AllyConditionInput.SelectedIndex  = selectedBETool.AllyCondition;
     FoeConditionInput.SelectedIndex   = selectedBETool.FoeCondition;
     UserConditionInput.SelectedIndex  = selectedBETool.UserCondition;
     if (selectedBETool.TargetElementRate == null)
     {
         return;
     }
     string[] elementRate    = selectedBETool.TargetElementRate.Split('_');
     string[] stateRates     = selectedBETool.TargetStateRates.Split('_');
     string[] statConditions = selectedBETool.TargetStatConditions.Split('_');
     ElementRateInput.SelectedIndex = ElementData.FindIndex(int.Parse(elementRate[0]));
     Gate1Input.SelectedIndex       = int.Parse(elementRate[1]);
     Value1Input.SelectedIndex      = int.Parse(elementRate[2]);
     State1Input.SelectedIndex      = StateData.FindIndex(int.Parse(stateRates[0]));
     Gate2Input.SelectedIndex       = int.Parse(stateRates[1]);
     Value2Input.SelectedIndex      = int.Parse(stateRates[2]);
     State2Input.SelectedIndex      = StateData.FindIndex(int.Parse(stateRates[3]));
     Gate3Input.SelectedIndex       = int.Parse(stateRates[4]);
     Value3Input.SelectedIndex      = int.Parse(stateRates[5]);
     Stat1Input.SelectedIndex       = int.Parse(statConditions[0]);
     Gate4Input.SelectedIndex       = int.Parse(statConditions[1]);
     Value4Input.SelectedIndex      = int.Parse(statConditions[2]);
     Stat2Input.SelectedIndex       = int.Parse(statConditions[3]);
     Gate5Input.SelectedIndex       = int.Parse(statConditions[4]);
     Value5Input.SelectedIndex      = int.Parse(statConditions[5]);
     ToolElementInput.SelectedIndex = ElementData.FindIndex(selectedBETool.TargetToolElement);
 }
 protected override void OnRead(SQLiteDataReader reader)
 {
     EnemyInput.SelectedIndex         = EnemyData.FindIndex(reader["EnemyID"]);
     LevelInput.Text                  = reader["Level"].ToString();
     GridPositionZInput.SelectedIndex = int.Parse(reader["GridPositionZ"].ToString());
     GridPositionXInput.SelectedIndex = int.Parse(reader["GridPositionX"].ToString());
     HPMultiplierInput.Text           = reader["HPMultiplier"].ToString();
     EnemySkills.Read();
     EnemyWeapons.Read();
     EnemyItems.Read();
     PassiveSkill1Input.SelectedIndex = PassiveSkillData.FindIndex(reader["PassiveSkill1"]);
     PassiveSkill2Input.SelectedIndex = PassiveSkillData.FindIndex(reader["PassiveSkill2"]);
 }
Exemple #9
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     ScaledStats.Read(reader);
     EnemyClassInput.SelectedIndex = EnemyClassData.FindIndex(reader["EnemyClass"]);
     ElementRates.Read();
     StateRates.Read();
     WidthInput.SelectedIndex    = int.Parse(reader["Width"].ToString());
     HeightInput.SelectedIndex   = int.Parse(reader["Height"].ToString());
     BossTypeInput.SelectedIndex = int.Parse(reader["BossType"].ToString());
     FlyingInput.IsChecked       = reader["Flying"].ToString() == "True" ? true : false;
     ExpInput.Text  = reader["Exp"].ToString();
     GoldInput.Text = reader["Gold"].ToString();
 }
Exemple #10
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     ScaledStats.Read(reader);
     Skills.Read();
     UpgradedClass1Input.SelectedIndex    = UpgradedClass1Data.FindIndex(reader["UpgradedClass1"]);
     UpgradedClass2Input.SelectedIndex    = UpgradedClass2Data.FindIndex(reader["UpgradedClass2"]);
     UsableWeaponType1Input.SelectedIndex = UsableWeaponType1Data.FindIndex(reader["UsableWeaponType1"]);
     UsableWeaponType2Input.SelectedIndex = UsableWeaponType2Data.FindIndex(reader["UsableWeaponType2"]);
     PassiveSkill1Input.SelectedIndex     = PassiveSkill1Data.FindIndex(reader["PassiveSkill1"]);
     PassiveSkill2Input.SelectedIndex     = PassiveSkill2Data.FindIndex(reader["PassiveSkill2"]);
     PSkillLvlRequired1Input.Text         = reader["PSkillLvlRequired1"].ToString();
     PSkillLvlRequired2Input.Text         = reader["PSkillLvlRequired2"].ToString();
 }
Exemple #11
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     HPRegenInput.Text                    = reader["HPRegen"].ToString();
     SPRegenInput.Text                    = reader["SPRegen"].ToString();
     SPConsumeRateInput.Text              = reader["SPConsumeRate"].ToString();
     ComboDifficultyInput.Text            = reader["ComboDifficulty"].ToString();
     CounterInput.Text                    = reader["Counter"].ToString();
     ReflectInput.Text                    = reader["Reflect"].ToString();
     DisabledToolType1Input.SelectedIndex = DisabledToolType1Data.FindIndex(reader["DisabledToolType1"]);
     DisabledToolType2Input.SelectedIndex = DisabledToolType2Data.FindIndex(reader["DisabledToolType2"]);
     ExtraTurnsInput.Text                 = reader["ExtraTurns"].ToString();
     TurnEnd1Input.Text                   = reader["TurnEnd1"].ToString();
     TurnEnd2Input.Text                   = reader["TurnEnd2"].ToString();
     TurnSequenceInput.SelectedIndex      = int.Parse(reader["TurnSequence"].ToString());
     RemoveByHitInput.Text                = reader["RemoveByHit"].ToString();
 }
 protected override void OnRead(SQLiteDataReader reader)
 {
     TypeInput.SelectedIndex            = TypeData.FindIndex(reader["Type"]);
     FormulaInput.SelectedIndex         = FormulaData.FindIndex(reader["Formula"]);
     HPModInput.SelectedIndex           = int.Parse(reader["HPModType"].ToString());
     SPModInput.SelectedIndex           = int.Parse(reader["SPModType"].ToString());
     HPAmountInput.Text                 = reader["HPAmount"].ToString();
     HPPercentInput.Text                = reader["HPPercent"].ToString();
     SPPercentInput.Text                = reader["SPPercent"].ToString();
     HPRecoilInput.Text                 = reader["HPRecoil"].ToString();
     ClassExclusive1Input.SelectedIndex = ClassExclusive1Data.FindIndex(reader["ClassExclusive1"]);
     ClassExclusive2Input.SelectedIndex = ClassExclusive2Data.FindIndex(reader["ClassExclusive2"]);
     ElementInput.SelectedIndex         = ElementData.FindIndex(reader["Element"]);
     PowerInput.Text           = reader["Power"].ToString();
     AccuracyInput.Text        = reader["Accuracy"].ToString();
     CriticalRateInput.Text    = reader["CriticalRate"].ToString();
     PriorityInput.Text        = reader["Priority"].ToString();
     ScopeInput.SelectedIndex  = int.Parse(reader["Scope"].ToString());
     ConsecutiveActsInput.Text = reader["ConsecutiveActs"].ToString();
     RandomActsInput.Text      = reader["RandomActs"].ToString();
 }
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     PassiveEffectAttributes.Read(reader);
     PassiveEffectRates.Read(reader);
     StatMods.Read(reader);
     HPMinInput.Text                   = reader["HPMin"].ToString();
     HPMaxInput.Text                   = reader["HPMax"].ToString();
     SPMinInput.Text                   = reader["SPMin"].ToString();
     SPMaxInput.Text                   = reader["SPMax"].ToString();
     AnyStateInput.IsChecked           = reader["AnyState"].ToString() == "True" ? true : false;
     NoStateInput.IsChecked            = reader["NoState"].ToString() == "True" ? true : false;
     StateActive1Input.SelectedIndex   = StateActive1Data.FindIndex(reader["StateActive1"]);
     StateActive2Input.SelectedIndex   = StateActive2Data.FindIndex(reader["StateActive2"]);
     StateInactive1Input.SelectedIndex = StateInactive1Data.FindIndex(reader["StateInactive1"]);
     StateInactive2Input.SelectedIndex = StateInactive2Data.FindIndex(reader["StateInactive2"]);
     ExpGainRateInput.Text             = reader["ExpGainRate"].ToString();
     GoldGainRateInput.Text            = reader["GoldGainRate"].ToString();
     AllyConditionInput.SelectedIndex  = int.Parse(reader["AllyCondition"].ToString());
     FoeConditionInput.SelectedIndex   = int.Parse(reader["FoeCondition"].ToString());
     UserConditionInput.SelectedIndex  = int.Parse(reader["UserCondition"].ToString());
 }