package th; /* quite a lot of the things in the game can't be described by stats alone * with ease, and need code to go along with it. * * So that monsters can use items, a constant need to be defined when * you subclass this. * First is usage - make it one of DO_NOT_USE, USE. * A monster will use items that are flagged 'USE'. * * At this stage, there are no provisions for monster-used items being able * to ask questions. The item should check to see if it is being used by * the player (user == g.player) and ask in that case, doing something * appropreate (zapping an enemy, whatever) otherwise. * */ public class Special { public boolean monUse (Mon user) { return false;//(user.smart? true : false); } // Called when an item is dropped; return true to allow the item // to be dropped and false to prevent it. public boolean drop (Itm self, Mon dropper, Node location) { return true; } // return true to allow, false to prohibit. public boolean get (Itm self, Mon getter, Node location) { return true; } // use function public boolean use (Itm self, Mon user, Node location) { return false; } // when eating... return true to allow it to be eaten (removed from // inventory and disappeared), false otherwise. public boolean eat (Itm self, Mon eater, Node location) { return true; } public boolean wield (Itm self, Mon wielder, Node location) { return true; } // Called when this is used as a weapon. public void used_as_weapon(Itm self, Mon wielder, Node location, Mon target, boolean hit) { return; } public boolean wear (Itm self, Mon wearer, Node location) { return true; } public boolean unwear (Itm self, Mon unwearer, Node location) { return true; } // Use this constructor to set params when a new item is made. // You can use this to set whatever parameters the item has. // (Uses, etc - see the textbook example.) public Special () { return; } }