/// <summary>
        /// Assigns a new spell to be cast.
        /// For player entity, this will display "press button to fire spell" message.
        /// </summary>
        /// <param name="spell"></param>
        public void SetReadySpell(FakeSpell spell)
        {
            readySpell = spell;

            if (isPlayerEntity)
            {
                DaggerfallUI.AddHUDText(HardStrings.pressButtonToFireSpell);
            }
        }
        public void CastReadySpell()
        {
            if (readySpell != null)
            {
                // TODO: Emit spell into world
                Debug.Log("Cast spell.");

                lastSpell  = readySpell;
                readySpell = null;
            }
        }
        private void clipboard_button_Click(object sender, EventArgs e)
        {
            main_spell.Flags         = flags_listbox.CheckedItems.Cast <string>().ToList();
            main_spell.ValidTargets  = valid_targets_listbox.CheckedItems.Cast <string>().ToList();
            main_spell.AffectedBps   = effected_body_part_listbox.CheckedItems.Cast <string>().ToList();
            main_spell.EffectTargets = effect_filter_listbox.CheckedItems.Cast <string>().ToList();

            if (additionalSpellGrid.Rows.Count > 0)
            {
                main_spell.ExtraEffects = new List <FakeSpell> {
                };
            }
            foreach (DataGridViewRow row in additionalSpellGrid.Rows)
            {
                FakeSpell spell = new FakeSpell
                {
                    Id       = (string)row.Cells[0].Value,
                    MaxLevel = (int)row.Cells[1].Value,
                    Self     = (bool)row.Cells[2].Value
                };
                main_spell.ExtraEffects.Add(spell);
            }

            if (spellsLearnedGrid.Rows.Count > 0)
            {
                main_spell.LearnSpells = new Dictionary <string, int> {
                };
            }
            foreach (DataGridViewRow row in spellsLearnedGrid.Rows)
            {
                main_spell.LearnSpells.Add((string)row.Cells[0].Value, (int)row.Cells[1].Value);
            }


            IgnoreEmptyEnumerablesResolver contractResolver = new IgnoreEmptyEnumerablesResolver
            {
                NamingStrategy = new SnakeCaseNamingStrategy()
            };

            Clipboard.SetText(JsonConvert.SerializeObject(
                                  main_spell,
                                  Formatting.Indented,
                                  new JsonSerializerSettings
            {
                DefaultValueHandling = DefaultValueHandling.Ignore,
                ContractResolver     = contractResolver
            }
                                  ));;
        }
 public void AbortReadySpell()
 {
     readySpell = null;
 }