12:-swi_module(modDrop, []). 13
14:- include(prologmud(mud_header)). 15
17
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
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
34actDrop(Agent,_) :-
35 call_update_charge(Agent,actDrop),
36 (add_cmdfailure(Agent,actDrop)).
37
39update_charge(Agent,actDrop) :- ain(mudEnergy(Agent, + -1)).
40
41baseKB:agent_text_command(Agent,["drop",X],Agent,actDrop(parseForFn(tDroppable,X))).
42
44
45:- include(prologmud(mud_footer)).