1% drop.pl
    2% May 18, 1996
    3% John Eikenberry
    4% Dec 13, 2035
    5% Douglas Miles
    6%
    7/* * module * 
    8% This file defines the basic drop predicate
    9% 
   10*/
   11% :-swi_module(user). 
   12:-swi_module(modDrop, []).   13
   14:- include(prologmud(mud_header)).   15
   16% :- register_module_type (mtCommand).
   17
   18% orderedBy(tDropAble,tNearestReachableItem).
   19
   20baseKB:action_info(actDrop(isOneOf([tDropAble,tNearestReachableItem,tObj,ftID])),"Drop an item").
   21
   22baseKB:agent_call_command(Agent,actDrop(Obj)):- once(actDrop(Agent,Obj)).
   23
   24% Drop something
   25actDrop(Agent,Obj) :-
   26	mudPossess(Agent,Obj),
   27        mudAtLoc(Agent,LOC),
   28        clr(mudPossess(Agent,Obj)),
   29        must(\+((mudPossess(Agent,Obj)))),
   30        ain(mudAtLoc(Obj,LOC)),
   31	must(call_update_charge(Agent,actDrop)),!.
   32
   33%Nothing to drop
   34actDrop(Agent,_) :-
   35	call_update_charge(Agent,actDrop),
   36	(add_cmdfailure(Agent,actDrop)).
   37
   38% Record keeping
   39update_charge(Agent,actDrop) :- ain(mudEnergy(Agent, + -1)).
   40
   41baseKB:agent_text_command(Agent,["drop",X],Agent,actDrop(parseForFn(tDroppable,X))).
   42
   43%:-must_det(show_call(get_agent_text_command(agent1,[drop,item1],_R,_CMD))).
   44
   45:- include(prologmud(mud_footer)).