Esempio n. 1
0
        private void OnCreateButton(object sender, EventArgs e)
        {
            if (statsBox.SelectedIndex == -1)
            {
                MessageBox.Show("Choose a stat from the list.");
            }
            else if (statValueBox.Text.ElementAt(0) == '(')
            {
                MessageBox.Show("Enter a positive or negative amount for the effect.");
            }
            else
            {
                Stats.Effect effect = new Stats.Effect();
                effect.name = (string)statsBox.SelectedItem;
                int value;
                int.TryParse(statValueBox.Text, out value);
                effect.value = value;

                string effectPrefix;
                if (effect.value < 0)
                {
                    effectPrefix = "Damage";
                }
                else
                {
                    effectPrefix = "Fortify";
                }



                effect.name = effectPrefix + " " + effect.name;

                knownEffects.Add(effect);
                //effectsBox.Items.Add(newEffectName);
            }
        }
Esempio n. 2
0
 void Add(Stats.Effect effect)
 {
 }