コード例 #1
0
 protected override void OnClone(SQLiteConnection conn)
 {
     Base.Clone(conn);
     PassiveEffectAttributes.Clone(conn);
     PassiveEffectRates.Clone(conn);
     StatMods.Clone(conn);
 }
コード例 #2
0
ファイル: State.xaml.cs プロジェクト: rafapena/SideBattleRPG
 protected override void OnUpdate(SQLiteConnection conn)
 {
     Base.Update(conn);
     PassiveEffectAttributes.Update(conn);
     PassiveEffectRates.Update(conn);
     StatMods.Update(conn);
     SQLUpdate(conn, "MaxStack = @MaxStack, StepsToRemove = @StepsToRemove, ContactSpreadRate = @ContactSpreadRate, Stun = @Stun, Petrify = @Petrify, KO = @KO");
 }
コード例 #3
0
ファイル: State.xaml.cs プロジェクト: rafapena/SideBattleRPG
 protected override void OnCreate(SQLiteConnection conn)
 {
     Base.Create(conn);
     PassiveEffectAttributes.Create(conn);
     PassiveEffectRates.Create(conn);
     StatMods.Create(conn);
     SQLCreate(conn, "BaseObjectID, PassiveEffectID, StatModifiers, MaxStack, StepsToRemove, ContactSpreadRate, Stun, Petrify, KO",
               "@BaseObjectID, @PassiveEffectID, @StatModifiers, @MaxStack, @StepsToRemove, @ContactSpreadRate, @Stun, @Petrify, @KO");
 }
コード例 #4
0
 protected override void OnUpdate(SQLiteConnection conn)
 {
     Base.Update(conn);
     PassiveEffectAttributes.Update(conn);
     PassiveEffectRates.Update(conn);
     SQLUpdate(conn, "BaseObjectID=@BaseObjectID, PassiveEffectID=@PassiveEffectID, " +
               "MapForeground=@MapForeground, MapBackground=@MapBackground, BattleForeground=@BattleForeground, BattleBackground=@BattleBackground, " +
               "Accuracy=@Accuracy, Evasion=@Evasion, CriticalRate=@CriticalRate, CritEvadeRate=@CritEvadeRate");
 }
コード例 #5
0
 protected override void OnCreate(SQLiteConnection conn)
 {
     Base.Create(conn);
     PassiveEffectAttributes.Create(conn);
     PassiveEffectRates.Create(conn);
     SQLCreate(conn, "BaseObjectID, PassiveEffectID, MapForeground, MapBackground, BattleForeground, BattleBackground, " +
               "Accuracy, Evasion, CriticalRate, CritEvadeRate",
               "@BaseObjectID, @PassiveEffectID, @MapForeground, @MapBackground, @BattleForeground, @BattleBackground, " +
               "@Accuracy, @Evasion, @CriticalRate, @CritEvadeRate");
 }
コード例 #6
0
        public override string ValidateInputs()
        {
            string err = Base.ValidateInputs();

            err += PassiveEffectAttributes.ValidateInputs();
            err += PassiveEffectRates.ValidateInputs();
            err += StatMods.ValidateInputs(0, 1000);
            if (!Utils.PosInt(HPMinInput.Text, 100))
            {
                err += "HP Min % must be an integer between 0 and 100\n";
            }
            if (!Utils.PosInt(HPMaxInput.Text, 100))
            {
                err += "HP Max % must be an integer between 0 and 100\n";
            }
            if (!Utils.PosInt(SPMinInput.Text, 100))
            {
                err += "SP Min % must be an integer between 0 and 100\n";
            }
            if (!Utils.PosInt(SPMaxInput.Text, 100))
            {
                err += "SP Max % must be an integer between 0 and 100\n";
            }
            bool identical = false;
            int  s1        = StateActive1Input.SelectedIndex;
            int  s2        = StateActive2Input.SelectedIndex;
            int  s3        = StateInactive1Input.SelectedIndex;
            int  s4        = StateInactive2Input.SelectedIndex;

            if (s1 != 0 && (s1 == s2 || s1 == s3 || s1 == s4))
            {
                identical = true;
            }
            if (s2 != 0 && (s2 == s3 || s2 == s4))
            {
                identical = true;
            }
            if (s3 != 0 && (s3 == s4))
            {
                identical = true;
            }
            if (identical)
            {
                err += "All State Active/Inactive inputs must be unique from each other\n";
            }
            if (!Utils.PosInt(ExpGainRateInput.Text))
            {
                err += "EXP Gain % must be a positive integer\n";
            }
            if (!Utils.PosInt(GoldGainRateInput.Text))
            {
                err += "Gold Gain % must be a positive integer\n";
            }
            return(err);
        }
コード例 #7
0
 protected override void OnUpdate(SQLiteConnection conn)
 {
     Base.Update(conn);
     PassiveEffectAttributes.Update(conn);
     PassiveEffectRates.Update(conn);
     StatMods.Update(conn);
     SQLUpdate(conn, "BaseObjectID=@BaseObjectID, PassiveEffectID=@PassiveEffectID, StatModifiers=@StatModifiers, HPMin=@HPMin, HPMax=@HPMax, " +
               "SPMin=@SPMin, SPMax=@SPMax, AnyState=@AnyState, NoState=@NoState, StateActive1=@StateActive1, StateActive2=@StateActive2, " +
               "StateInactive1=@StateInactive1, StateInactive2=@StateInactive2, ExpGainRate=@ExpGainRate, GoldGainRate=@GoldGainRate, " +
               "AllyCondition=@AllyCondition, FoeCondition=@FoeCondition, UserCondition=@UserCondition");
 }
コード例 #8
0
 protected override void OnCreate(SQLiteConnection conn)
 {
     Base.Create(conn);
     PassiveEffectAttributes.Create(conn);
     PassiveEffectRates.Create(conn);
     StatMods.Create(conn);
     SQLCreate(conn, "BaseObjectID, PassiveEffectID, StatModifiers, HPMin, HPMax, SPMin, SPMax, AnyState, NoState, " +
               "StateActive1, StateActive2, StateInactive1, StateInactive2, ExpGainRate, GoldGainRate, AllyCondition, FoeCondition, UserCondition",
               "@BaseObjectID, @PassiveEffectID, @StatModifiers, @HPMin, @HPMax, @SPMin, @SPMax, @AnyState, @NoState, " +
               "@StateActive1, @StateActive2, @StateInactive1, @StateInactive2, @ExpGainRate, @GoldGainRate, @AllyCondition, @FoeCondition, @UserCondition");
 }
コード例 #9
0
ファイル: State.xaml.cs プロジェクト: rafapena/SideBattleRPG
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     PassiveEffectAttributes.Read(reader);
     PassiveEffectRates.Read(reader);
     StatMods.Read(reader);
     MaxStackInput.Text          = reader["MaxStack"].ToString();
     StepsToRemoveInput.Text     = reader["StepsToRemove"].ToString();
     ContactSpreadRateInput.Text = reader["ContactSpreadRate"].ToString();
     StunInput.IsChecked         = reader["Stun"].ToString() == "True" ? true : false;;
     PetrifyInput.IsChecked      = reader["Petrify"].ToString() == "True" ? true : false;;
     KOInput.IsChecked           = reader["KO"].ToString() == "True" ? true : false;;
 }
コード例 #10
0
ファイル: State.xaml.cs プロジェクト: rafapena/SideBattleRPG
 protected override void OnInitializeNew()
 {
     Base.InitializeNew();
     PassiveEffectAttributes.InitializeNew();
     PassiveEffectRates.InitializeNew();
     StatMods.InitializeNew(100, "StatModifiers");
     MaxStackInput.Text          = "1";
     StepsToRemoveInput.Text     = "0";
     ContactSpreadRateInput.Text = "0";
     StunInput.IsChecked         = false;
     PetrifyInput.IsChecked      = false;
     KOInput.IsChecked           = false;
 }
コード例 #11
0
 protected override void OnInitializeNew()
 {
     Base.InitializeNew();
     PassiveEffectAttributes.InitializeNew();
     PassiveEffectRates.InitializeNew();
     MapForegroundInput.Source    = null;
     MapBackgroundInput.Source    = null;
     BattleForegroundInput.Source = null;
     BattleBackgroundInput.Source = null;
     AccuracyInput.Text           = "100";
     EvasionInput.Text            = "100";
     CriticalRateInput.Text       = "100";
     CritEvadeRateInput.Text      = "100";
 }
コード例 #12
0
 protected override void OnRead(SQLiteDataReader reader)
 {
     Base.Read(reader);
     PassiveEffectAttributes.Read(reader);
     PassiveEffectRates.Read(reader);
     MapForegroundInput.Source    = ImageManager.BytesToImage(ImageManager.BlobToBytes(reader, 1));
     MapBackgroundInput.Source    = ImageManager.BytesToImage(ImageManager.BlobToBytes(reader, 2));
     BattleForegroundInput.Source = ImageManager.BytesToImage(ImageManager.BlobToBytes(reader, 3));
     BattleBackgroundInput.Source = ImageManager.BytesToImage(ImageManager.BlobToBytes(reader, 4));
     AccuracyInput.Text           = reader["Accuracy"].ToString();
     EvasionInput.Text            = reader["Evasion"].ToString();
     CriticalRateInput.Text       = reader["CriticalRate"].ToString();
     CritEvadeRateInput.Text      = reader["CritEvadeRate"].ToString();
 }
コード例 #13
0
ファイル: State.xaml.cs プロジェクト: rafapena/SideBattleRPG
        public override string ValidateInputs()
        {
            string err = Base.ValidateInputs();

            err += PassiveEffectAttributes.ValidateInputs();
            err += PassiveEffectRates.ValidateInputs();
            err += StatMods.ValidateInputs(0, 1000);
            if (!Utils.PosInt(MaxStackInput.Text))
            {
                err += "Max Stack must be a positive integer\n";
            }
            if (!Utils.PosInt(StepsToRemoveInput.Text))
            {
                err += "Steps to Remove must be a positive integer\n";
            }
            if (!Utils.PosInt(ContactSpreadRateInput.Text, 100))
            {
                err += "Contact Spread % must be an integer between 0 and 100\n";
            }
            return(err);
        }
コード例 #14
0
 protected override void OnInitializeNew()
 {
     Base.InitializeNew();
     PassiveEffectAttributes.InitializeNew();
     PassiveEffectRates.InitializeNew();
     StatMods.InitializeNew(100, "StatModifiers");
     HPMinInput.Text                   = "0";
     HPMaxInput.Text                   = "100";
     SPMinInput.Text                   = "0";
     SPMaxInput.Text                   = "100";
     AnyStateInput.IsChecked           = false;
     NoStateInput.IsChecked            = false;
     StateActive1Input.SelectedIndex   = 0;
     StateActive2Input.SelectedIndex   = 0;
     StateInactive1Input.SelectedIndex = 0;
     StateInactive2Input.SelectedIndex = 0;
     ExpGainRateInput.Text             = "100";
     GoldGainRateInput.Text            = "100";
     AllyConditionInput.SelectedIndex  = 0;
     FoeConditionInput.SelectedIndex   = 0;
     UserConditionInput.SelectedIndex  = 2;
 }
コード例 #15
0
 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());
 }
コード例 #16
0
        public override string ValidateInputs()
        {
            string err = Base.ValidateInputs();

            err += PassiveEffectAttributes.ValidateInputs();
            err += PassiveEffectRates.ValidateInputs();
            if (!Utils.PosInt(AccuracyInput.Text, 1000))
            {
                err += "Accuracy must be an integer between 0 to 1000\n";
            }
            if (!Utils.PosInt(EvasionInput.Text, 1000))
            {
                err += "Evasion must be an integer between 0 to 1000\n";
            }
            if (!Utils.PosInt(CriticalRateInput.Text, 1000))
            {
                err += "Critical Rate must be an integer between 0 and 1000\n";
            }
            if (!Utils.PosInt(CritEvadeRateInput.Text, 1000))
            {
                err += "Crit Evade Rate must be an integer between 0 and 1000\n";
            }
            return(err);
        }
コード例 #17
0
 protected override void OnDelete(SQLiteConnection conn)
 {
     Base.Delete(conn);
     PassiveEffectAttributes.Delete(conn);
     PassiveEffectRates.Delete(conn);
 }