protected override void OnClone(SQLiteConnection conn)
 {
     Base.Clone(conn);
     PassiveEffectAttributes.Clone(conn);
     PassiveEffectRates.Clone(conn);
     StatMods.Clone(conn);
 }
 public WoodenWarHammer() : base(ItemIds.WoodenWarHammer, "Wooden war hammer")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(4f, TypeName, ModTypes.Flat, StatTypes.Str));
     StatMods.Add(AssingStatmod.Create(-2f, TypeName, ModTypes.Flat, StatTypes.Dex));
     Slots.Add(EquipSlot.LeftHand);
 }
Esempio n. 3
0
 public WoodenStick() : base(ItemIds.WoodenStick, "Wooden stick")
 {
     desc = "Stick for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(2f, TypeName, ModTypes.Flat, StatTypes.Str));
     Slots.Add(EquipSlot.LeftHand);
     Slots.Add(EquipSlot.RightHand);
 }
Esempio n. 4
0
 public SpikedClub() : base(ItemIds.SpikedClub, "Spiked club")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(3, TypeName, ModTypes.Flat, StatTypes.Str));
     Slots.Add(EquipSlot.LeftHand);
     Slots.Add(EquipSlot.RightHand);
 }
Esempio n. 5
0
 public ArmourTemplate() : base(ItemIds.WoodenStick, "ArmourTemplate")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(2, TypeName, ModTypes.Flat, StatTypes.Charm));
     HealthMods.Add(new HealthMod(2, ModTypes.Flat, TypeName, HealthTypes.Health));
     Slots.Add(EquipSlot.LeftHand);
 }
        public WeaponTemplate() : base(ItemIds.WoodenStick, "WeaponTemplate")
        {
            desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
            AssingStatmod assingMod1 = new AssingStatmod(new StatMod(2, typeof(WeaponTemplate).Name, ModTypes.Flat), StatTypes.Charm);

            StatMods.Add(assingMod1);
            Slots.Add(EquipSlot.LeftHand);
        }
Esempio n. 7
0
 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");
 }
Esempio n. 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, MaxStack, StepsToRemove, ContactSpreadRate, Stun, Petrify, KO",
               "@BaseObjectID, @PassiveEffectID, @StatModifiers, @MaxStack, @StepsToRemove, @ContactSpreadRate, @Stun, @Petrify, @KO");
 }
Esempio n. 9
0
    protected override float CalcValue()
    {
        float flat = BaseValue + StatMods.FindAll(sm => sm.ModType == ModTypes.Flat).Sum(m => m.Value)
                     + TempMods.FindAll(sm => sm.ModType == ModTypes.Flat).Sum(m => m.Value);
        float precent = 1f + StatMods.FindAll(sm => sm.ModType == ModTypes.Precent).Sum(m => m.Value)
                        + TempMods.FindAll(sm => sm.ModType == ModTypes.Precent).Sum(m => m.Value);

        return(flat * precent);
    }
Esempio n. 10
0
 public Hood() : base(ItemIds.Hood, "Hood")
 {
     desc = "template for items, desc itself is where you say what the item does. This item happens to do nothing.";
     StatMods.Add(AssingStatmod.Create(-1, TypeName, ModTypes.Flat, StatTypes.Charm));
     StatMods.Add(AssingStatmod.Create(1, TypeName, ModTypes.Flat, StatTypes.End));
     HealthMods.Add(new HealthMod(5, ModTypes.Flat, TypeName, HealthTypes.Health));
     HealthMods.Add(new HealthMod(5, ModTypes.Flat, TypeName, HealthTypes.WillPower));
     Slots.Add(EquipSlot.Head);
 }
Esempio n. 11
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);
        }
Esempio n. 12
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");
 }
Esempio n. 13
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");
 }
Esempio n. 14
0
 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;
 }
Esempio n. 15
0
 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;;
 }
Esempio n. 16
0
        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);
        }
Esempio n. 17
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;
 }
Esempio n. 18
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());
 }