@Override
	public void affectCharState(MOB mob, CharState state)
	{
		super.affectCharState(mob,state);
		if(mob.baseCharStats().getCurrentClass().ID().equals(ID()))
		{
			Ability A=null;
			for(int a=0;a<mob.numAbilities();a++)
			{
				A=mob.fetchAbility(a);
				if((A!=null)
				&&((A.classificationCode()&Ability.ALL_ACODES)==Ability.ACODE_SPELL)
				&&(!CMLib.ableMapper().getDefaultGain(ID(),false,A.ID())))
				{
					final int[] cost=A.usageCost(mob,true);
					final int manaCost=cost[Ability.USAGEINDEX_MANA];
					if(manaCost>0)
					{
						if(state.getMana()<manaCost)
						{
							mob.delAbility(A);
							a--;
						}
						else
							state.setMana(state.getMana()-manaCost);
					}
				}
			}
			if(mob.curState().getMana()>state.getMana())
				mob.curState().setMana(state.getMana());
		}
	}