Example #1
0
        private void AddSpellToDataTable(DataTable data, RPGSpell s)
        {
            #region Build Row Data
            string realm = Enum.GetName(typeof(SpellRealm), s.Realm);
            string range = Enum.GetName(typeof(RPGEffect.EffectRange), s.Effect.Range);

            bool   bIsBuff = s.Effect.EffectIsABuff;
            string isBuff  = "Attack";
            string effect  = s.GetShortEffectDescription();
            string pwr     = "" + s.Effect.MinPower + " - " + s.Effect.MaxPower;
            string cost    = s.Cost.ToString();

            string duration = s.Effect.GetDurationAsString();
            if (s.Effect.DurationEffectType == RPGEffect.DurationType.Permanent)
            {
                duration = "Once";
            }

            #endregion

            #region Assign vars to new row
            DataRow newRow = data.NewRow();
            newRow["Realm"]    = realm;
            newRow["type"]     = isBuff;
            newRow["Range"]    = range;
            newRow["Effect"]   = effect;
            newRow["Power"]    = pwr;
            newRow["Cost"]     = cost;
            newRow["Duration"] = duration;
            #endregion

            data.Rows.Add(newRow);
        }
Example #2
0
 public void loadSpell(RPGSpell spell)
 {
     if (spell != null)
     {
         ButtonText = spell.GetShortEffectDescription();
         this.BText = new SolidBrush(spell.SpellColor);
         this.Refresh();
     }
     else
     {
         ClearSpell();
     }
 }