public override void RunAction()
 {
     spellbook.Memorize(spell);
     foreach (var slot in spellbook.GetMemorizedSpells(spell.SpellLevel))
     {
         if (slot.Spell == spell)
         {
             slot.Available = true;
         }
     }
     FastStudy.RemoveMasterAbls(base.Target.Unit.Descriptor);
     base.Target.Unit.Descriptor.Buffs.RemoveFact(FastStudy.flagBuff);
 }
        public override void Apply(AbilityExecutionContext context, TargetWrapper target)
        {
            UnitDescriptor unit       = context.MaybeOwner.Descriptor;
            AbilityData    spell      = context.Ability.ParamSpellSlot.Spell;
            Spellbook      spellbook  = context.Ability.ParamSpellbook;
            int            spellLevel = context.Ability.ParamSpellLevel.Value;

            if (spellLevel < 1 || spellLevel > spellbook.MaxSpellLevel)
            {
                return;
            }
            foreach (var slot in spellbook.GetMemorizedSpells(spellLevel))
            {
                if (slot.Spell == spell)
                {
                    spellbook.ForgetMemorized(slot);
                }
            }
            unit.AddBuff(flagBuff, unit.Unit);
            UnityModManager.Logger.Log("Rua1?");
            FastStudy.RefreshSubAbls(spellbook, spellLevel);
            UnityModManager.Logger.Log("Rua1?>");
            FastStudy.AddMasterAbls(unit);
        }