1% This file defines the agents action of drinking. 
    2% Very simple... but kept separate to maintain modularity
    3%
    4% This uses the worth/2 predicate from take.pl
    5% Will (theoretically) only be used in conjuction with take action
    6%
    7% It will destroy something, even if it is not food... talk about a garbage disposal. 
    8% :-swi_module(user). 
    9% :-swi_module(modDrink, []).
   10
   11:- include(prologmud(mud_header)).   12
   13% :- register_module_type (mtCommand).
   14
   15action_info(actDrink(tDrinkAble),"Drink a Drinkable Item").
   16
   17% Drink something held
   18% Check to make sure it's in the agents possession... 
   19% if it is, process it's worth, then destroy it
   20agent_call_command(Agent,actDrink(Obj)) :-
   21	mudPossess(Agent,Obj),
   22	do_act_affect(Agent,actDrink,Obj),
   23	clr(mudPossess(Agent,Obj)),
   24        destroy_instance(Obj),
   25	call_update_charge(Agent,actDrink).
   26
   27update_charge(Agent,actDrink) :- ain(mudEnergy(Agent,+ -1)).
   28
   29:- include(prologmud(mud_footer)).