--- deliantra/server/common/item.C 2006/09/10 16:00:23 1.4 +++ deliantra/server/common/item.C 2006/12/30 21:07:46 1.16 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_item_c = - * "$Id: item.C,v 1.4 2006/09/10 16:00:23 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The authors can be reached via e-mail at crossfire-devel@real-time.com + The authors can be reached via e-mail at */ #include @@ -54,31 +48,18 @@ * "This item goes %s\n", with the use/nonuse values filling in the %s */ Body_Locations body_locations[NUM_BODY_LOCATIONS] = { - {"body_range", "in your range slot", "in a human's range slot"} - , - {"body_arm", "on your arm", "on a human's arm"} - , - {"body_torso", "on your body", "on a human's torso"} - , - {"body_head", "on your head", "on a human's head"} - , - {"body_neck", "around your neck", "around a humans neck"} - , - {"body_skill", "in your skill slot", "in a human's skill slot"} - , - {"body_finger", "on your finger", "on a human's finger"} - , - {"body_shoulder", "around your shoulders", "around a human's shoulders"} - , - {"body_foot", "on your feet", "on a human's feet"} - , - {"body_hand", "on your hands", "on a human's hands"} - , - {"body_wrist", "around your wrists", "around a human's wrist"} - , - {"body_waist", "around your waist", "around a human's waist"} - , - + {"body_range", "in your range slot", "in a human's range slot"}, + {"body_arm", "on your arm", "on a human's arm"}, + {"body_torso", "on your body", "on a human's torso"}, + {"body_head", "on your head", "on a human's head"}, + {"body_neck", "around your neck", "around a humans neck"}, + {"body_skill", "in your skill slot", "in a human's skill slot"}, + {"body_finger", "on your finger", "on a human's finger"} , + {"body_shoulder", "around your shoulders", "around a human's shoulders"}, + {"body_foot", "on your feet", "on a human's feet"}, + {"body_hand", "on your hands", "on a human's hands"}, + {"body_wrist", "around your wrists", "around a human's wrist"}, + {"body_waist", "around your waist", "around a human's waist"}, /*{"body_dragon_torso", "your body", "a dragon's body"} */ }; @@ -120,7 +101,6 @@ {POISON, "poison", "poisons", SK_ALCHEMY, 0}, {BOOK, "book", "books", SK_LITERACY, 0}, {CLOCK, "clock", "clocks", 0, 0}, - {LIGHTNING, "lightning", "lightning", 0, 0}, {ARROW, "arrow", "arrows", SK_BOWYER, 0}, {BOW, "bow", "bows", SK_BOWYER, 0}, {WEAPON, "weapon", "weapons", SK_SMITHERY, 0}, @@ -150,7 +130,6 @@ {TELEPORTER, "teleporter", "teleporters", 0, 0}, {CREATOR, "creator", "creators", 0, 0}, {SKILL, "skill", "skills", 0, 0}, - {EXPERIENCE, "experience", "experience", 0, 0}, {EARTHWALL, "earthwall", "earthwalls", 0, 0}, {GOLEM, "golem", "golems", 0, 0}, {THROWN_OBJ, "projectile", "projectiles", 0, 0}, @@ -180,17 +159,11 @@ {INORGANIC, "inorganic", "inorganics", SK_ALCHEMY, 0}, {SKILL_TOOL, "skill tool", "skill tools", 0, 0}, {LIGHTER, "lighter", "lighters", 0, 0}, - {TRAP_PART, "trap part", "trap parts", 0, 0}, - {WALL, "wall", "walls", 0, 0}, - {LIGHT_SOURCE, "light source", "light sources", 0, 0}, + {BUILDABLE_WALL, "buildable wall", "buildable walls", 0, 0}, {MISC_OBJECT, "bric-a-brac", "bric-a-brac", 0, 0}, - {MONSTER, "monster", "monsters", 0, 0}, - {SPAWN_GENERATOR, "monster generator", "monster generators", 0, 0}, {LAMP, "lamp", "lamps", 0, 0}, {DUPLICATOR, "duplicator", "duplicators", 0, 0}, - {TOOL, "tool", "tools", 0, 0}, {SPELLBOOK, "spellbook", "spellbooks", SK_LITERACY, 0}, - {BUILDFAC, "building facility", "building facilities", 0, 0}, {CLOAK, "cloak", "cloaks", SK_SMITHERY, 0}, {SPINNER, "spinner", "spinners", 0, 0}, {GATE, "gate", "gates", 0, 0}, @@ -207,8 +180,6 @@ {BRACERS, "bracers", "bracers", SK_SMITHERY, 0}, {POISONING, "poisoning", "poisonings", 0, 0}, {SAVEBED, "savebed", "savebeds", 0, 0}, - {POISONCLOUD, "poison cloud", "poison clouds", 0, 0}, - {FIREHOLES, "fireholes", "fireholes", 0, 0}, {WAND, "wand", "wands", SK_THAUMATURGY, 0}, {SCROLL, "scroll", "scrolls", SK_LITERACY, 0}, {DIRECTOR, "director", "directors", 0, 0}, @@ -599,6 +570,7 @@ if (op->name == NULL) return "(null)"; + if (!op->nrof && !op->weight && !op->title && !is_magical (op)) return op->name; /* To speed things up (or make things slower?) */ @@ -688,7 +660,7 @@ use_buf %= 5; #ifdef NEW_MATERIAL_CODE - if ((IS_ARMOR (op) || IS_WEAPON (op)) && op->materialname) + if ((op->is_armor () || op->is_weapon ()) && op->materialname) { mt = name_to_material (op->materialname); if (mt) @@ -795,11 +767,11 @@ if (!op->nrof && !op->weight && !op->title && !is_magical (op)) return op->name; /* To speed things up (or make things slower?) */ - if ((IS_ARMOR (op) || IS_WEAPON (op)) && op->materialname) + if ((op->is_armor () || op->is_weapon ()) && op->materialname) mt = name_to_material (op->materialname); #ifdef NEW_MATERIAL_CODE - if ((IS_ARMOR (op) || IS_WEAPON (op)) && op->materialname && mt && + if ((op->is_armor () || op->is_weapon ()) && op->materialname && mt && op->arch->clone.materialname != mt->name && !(op->material & M_SPECIAL)) { strcpy (buf, mt->description); @@ -897,7 +869,7 @@ * very good. Any player with a speed greater than .67 will * fall into the 'lightning fast movement' category. */ - if (FABS (op->speed) > MIN_ACTIVE_SPEED) + if (op->has_active_speed ()) { switch ((int) ((FABS (op->speed)) * 15)) { @@ -1522,11 +1494,9 @@ return 0; } - /* * Supposed to fix face-values as well here, but later. */ - void identify (object *op) { @@ -1558,7 +1528,7 @@ update_object (op, UP_OBJ_FACE); else { - pl = is_player_inv (op->env); + pl = op->in_player (); if (pl) /* A lot of the values can change from an update - might as well send * it all. @@ -1566,3 +1536,4 @@ esrv_send_item (pl, op); } } +