diff --git a/lib/world/obj/1.obj b/lib/world/obj/1.obj index 7557120..2e0ae89 100644 --- a/lib/world/obj/1.obj +++ b/lib/world/obj/1.obj @@ -246,4 +246,12 @@ A long piece of bones with a sharpened edge has been left here.~ 5 0 0 0 0 an 0 0 0 0 0 0 0 1 6 11 0 3 50 0 0 0 +#131 +backpack pack hide~ +a hide backpack~ +A backpack made of thick hide is lying here.~ +~ +15 0 0 0 0 ad 0 0 0 0 0 0 0 +75 0 0 0 +5 50 0 0 0 $~ diff --git a/src/act.item.c b/src/act.item.c index a3cca73..28663c9 100644 --- a/src/act.item.c +++ b/src/act.item.c @@ -1127,6 +1127,9 @@ static void wear_message(struct char_data *ch, struct obj_data *obj, int where) {"$n wears $p around $s neck.", "You wear $p around your neck."}, + {"$n straps $p around $s back.", + "You wear $p on your back."}, + {"$n wears $p on $s body.", "You wear $p on your body."}, @@ -1180,11 +1183,11 @@ static void perform_wear(struct char_data *ch, struct obj_data *obj, int where) */ int wear_bitvectors[] = { - ITEM_WEAR_TAKE, ITEM_WEAR_FINGER, ITEM_WEAR_FINGER, ITEM_WEAR_NECK, - ITEM_WEAR_NECK, ITEM_WEAR_BODY, ITEM_WEAR_HEAD, ITEM_WEAR_LEGS, - ITEM_WEAR_FEET, ITEM_WEAR_HANDS, ITEM_WEAR_ARMS, ITEM_WEAR_SHIELD, - ITEM_WEAR_ABOUT, ITEM_WEAR_WAIST, ITEM_WEAR_WRIST, ITEM_WEAR_WRIST, - ITEM_WEAR_WIELD, ITEM_WEAR_TAKE + ITEM_WEAR_TAKE, ITEM_WEAR_FINGER, ITEM_WEAR_FINGER, ITEM_WEAR_NECK, + ITEM_WEAR_NECK, ITEM_WEAR_BACK, ITEM_WEAR_BODY, ITEM_WEAR_HEAD, + ITEM_WEAR_LEGS, ITEM_WEAR_FEET, ITEM_WEAR_HANDS, ITEM_WEAR_ARMS, + ITEM_WEAR_SHIELD, ITEM_WEAR_ABOUT, ITEM_WEAR_WAIST, ITEM_WEAR_WRIST, + ITEM_WEAR_WRIST, ITEM_WEAR_WIELD, ITEM_WEAR_TAKE }; const char *already_wearing[] = { @@ -1193,6 +1196,7 @@ static void perform_wear(struct char_data *ch, struct obj_data *obj, int where) "You're already wearing something on both of your ring fingers.\r\n", "YOU SHOULD NEVER SEE THIS MESSAGE. PLEASE REPORT.\r\n", "You can't wear anything else around your neck.\r\n", + "You can't wear any more on your back.\r\n", "You're already wearing something on your body.\r\n", "You're already wearing something on your head.\r\n", "You're already wearing something on your legs.\r\n", @@ -1242,6 +1246,7 @@ int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg) "!RESERVED!", "neck", "!RESERVED!", + "back", "body", "head", "legs", @@ -1261,6 +1266,7 @@ int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg) if (!arg || !*arg) { if (CAN_WEAR(obj, ITEM_WEAR_FINGER)) where = WEAR_FINGER_R; if (CAN_WEAR(obj, ITEM_WEAR_NECK)) where = WEAR_NECK_1; + if (CAN_WEAR(obj, ITEM_WEAR_BACK)) where = WEAR_BACK; if (CAN_WEAR(obj, ITEM_WEAR_BODY)) where = WEAR_BODY; if (CAN_WEAR(obj, ITEM_WEAR_HEAD)) where = WEAR_HEAD; if (CAN_WEAR(obj, ITEM_WEAR_LEGS)) where = WEAR_LEGS; diff --git a/src/act.wizard.c b/src/act.wizard.c index 8159ce3..894b050 100644 --- a/src/act.wizard.c +++ b/src/act.wizard.c @@ -3978,6 +3978,7 @@ static struct zcheck_armor { } zarmor[] = { {ITEM_WEAR_FINGER, 10, "Ring"}, {ITEM_WEAR_NECK, 10, "Necklace"}, + {ITEM_WEAR_BACK, 10, "Backpack"}, {ITEM_WEAR_BODY, 10, "Body armor"}, {ITEM_WEAR_HEAD, 10, "Head gear"}, {ITEM_WEAR_LEGS, 10, "Legwear"}, diff --git a/src/constants.c b/src/constants.c index fa1e42c..073aad1 100644 --- a/src/constants.c +++ b/src/constants.c @@ -333,6 +333,7 @@ const char *wear_where[] = { " ", " ", " ", + " ", " ", " ", " ", @@ -357,6 +358,7 @@ const char *equipment_types[] = { "Worn on left finger", "First worn around Neck", "Second worn around Neck", + "Worn on back", "Worn on body", "Worn on head", "Worn on legs", @@ -411,6 +413,7 @@ const char *wear_bits[] = { "TAKE", "FINGER", "NECK", + "BACK", "BODY", "HEAD", "LEGS", diff --git a/src/dg_scripts.c b/src/dg_scripts.c index 88a4b6d..1e98efc 100644 --- a/src/dg_scripts.c +++ b/src/dg_scripts.c @@ -240,6 +240,7 @@ int find_eq_pos_script(char *arg) {"waist", WEAR_WAIST}, {"rwrist", WEAR_WRIST_R}, {"lwrist", WEAR_WRIST_L}, + {"back", WEAR_BACK}, {"none", -1} }; @@ -268,6 +269,7 @@ int can_wear_on_pos(struct obj_data *obj, int pos) case WEAR_FINGER_L: return CAN_WEAR(obj, ITEM_WEAR_FINGER); case WEAR_NECK_1: case WEAR_NECK_2: return CAN_WEAR(obj, ITEM_WEAR_NECK); + case WEAR_BACK: return CAN_WEAR(obj, ITEM_WEAR_BACK); case WEAR_BODY: return CAN_WEAR(obj, ITEM_WEAR_BODY); case WEAR_HEAD: return CAN_WEAR(obj, ITEM_WEAR_HEAD); case WEAR_LEGS: return CAN_WEAR(obj, ITEM_WEAR_LEGS); diff --git a/src/objsave.c b/src/objsave.c index 1e0b690..7dd19f5 100644 --- a/src/objsave.c +++ b/src/objsave.c @@ -160,6 +160,10 @@ static void auto_equip(struct char_data *ch, struct obj_data *obj, int location) if (!CAN_WEAR(obj, ITEM_WEAR_NECK)) location = LOC_INVENTORY; break; + case WEAR_BACK: + if (!CAN_WEAR(obj, ITEM_WEAR_BACK)) + location = LOC_INVENTORY; + break; case WEAR_BODY: if (!CAN_WEAR(obj, ITEM_WEAR_BODY)) location = LOC_INVENTORY; diff --git a/src/structs.h b/src/structs.h index 3e0953f..9c276fe 100644 --- a/src/structs.h +++ b/src/structs.h @@ -346,26 +346,27 @@ which control the valid places you can wear a piece of equipment. For example, there are two neck positions on the player, and items only get the generic neck type. */ -#define WEAR_LIGHT 0 /**< Equipment Location Light */ -#define WEAR_FINGER_R 1 /**< Equipment Location Right Finger */ -#define WEAR_FINGER_L 2 /**< Equipment Location Left Finger */ -#define WEAR_NECK_1 3 /**< Equipment Location Neck #1 */ -#define WEAR_NECK_2 4 /**< Equipment Location Neck #2 */ -#define WEAR_BODY 5 /**< Equipment Location Body */ -#define WEAR_HEAD 6 /**< Equipment Location Head */ -#define WEAR_LEGS 7 /**< Equipment Location Legs */ -#define WEAR_FEET 8 /**< Equipment Location Feet */ -#define WEAR_HANDS 9 /**< Equipment Location Hands */ -#define WEAR_ARMS 10 /**< Equipment Location Arms */ -#define WEAR_SHIELD 11 /**< Equipment Location Shield */ -#define WEAR_ABOUT 12 /**< Equipment Location about body (like a cape)*/ -#define WEAR_WAIST 13 /**< Equipment Location Waist */ -#define WEAR_WRIST_R 14 /**< Equipment Location Right Wrist */ -#define WEAR_WRIST_L 15 /**< Equipment Location Left Wrist */ -#define WEAR_WIELD 16 /**< Equipment Location Weapon */ -#define WEAR_HOLD 17 /**< Equipment Location held in offhand */ +#define WEAR_LIGHT 0 /**< Equipment Location Light */ +#define WEAR_FINGER_R 1 /**< Equipment Location Right Finger */ +#define WEAR_FINGER_L 2 /**< Equipment Location Left Finger */ +#define WEAR_NECK_1 3 /**< Equipment Location Neck #1 */ +#define WEAR_NECK_2 4 /**< Equipment Location Neck #2 */ +#define WEAR_BACK 5 /**< Equipment Location back */ +#define WEAR_BODY 6 /**< Equipment Location Body */ +#define WEAR_HEAD 7 /**< Equipment Location Head */ +#define WEAR_LEGS 8 /**< Equipment Location Legs */ +#define WEAR_FEET 9 /**< Equipment Location Feet */ +#define WEAR_HANDS 10 /**< Equipment Location Hands */ +#define WEAR_ARMS 11 /**< Equipment Location Arms */ +#define WEAR_SHIELD 12 /**< Equipment Location Shield */ +#define WEAR_ABOUT 13 /**< Equipment Location about body (like a cape or cloak)*/ +#define WEAR_WAIST 14 /**< Equipment Location Waist */ +#define WEAR_WRIST_R 15 /**< Equipment Location Right Wrist */ +#define WEAR_WRIST_L 16 /**< Equipment Location Left Wrist */ +#define WEAR_WIELD 17 /**< Equipment Location Weapon */ +#define WEAR_HOLD 18 /**< Equipment Location held in offhand */ /** Total number of available equipment lcoations */ -#define NUM_WEARS 18 +#define NUM_WEARS 19 /* object-related defines */ /* Item types: used by obj_data.obj_flags.type_flag */ @@ -396,23 +397,24 @@ #define NUM_ITEM_TYPES 24 /* Take/Wear flags: used by obj_data.obj_flags.wear_flags */ -#define ITEM_WEAR_TAKE 0 /**< Item can be taken */ -#define ITEM_WEAR_FINGER 1 /**< Item can be worn on finger */ -#define ITEM_WEAR_NECK 2 /**< Item can be worn around neck */ -#define ITEM_WEAR_BODY 3 /**< Item can be worn on body */ -#define ITEM_WEAR_HEAD 4 /**< Item can be worn on head */ -#define ITEM_WEAR_LEGS 5 /**< Item can be worn on legs */ -#define ITEM_WEAR_FEET 6 /**< Item can be worn on feet */ -#define ITEM_WEAR_HANDS 7 /**< Item can be worn on hands */ -#define ITEM_WEAR_ARMS 8 /**< Item can be worn on arms */ -#define ITEM_WEAR_SHIELD 9 /**< Item can be used as a shield */ -#define ITEM_WEAR_ABOUT 10 /**< Item can be worn about body */ -#define ITEM_WEAR_WAIST 11 /**< Item can be worn around waist */ -#define ITEM_WEAR_WRIST 12 /**< Item can be worn on wrist */ -#define ITEM_WEAR_WIELD 13 /**< Item can be wielded */ -#define ITEM_WEAR_HOLD 14 /**< Item can be held */ +#define ITEM_WEAR_TAKE 0 /**< Item can be taken */ +#define ITEM_WEAR_FINGER 1 /**< Item can be worn on finger */ +#define ITEM_WEAR_NECK 2 /**< Item can be worn around neck */ +#define ITEM_WEAR_BACK 3 /**< Item can be worn on back */ +#define ITEM_WEAR_BODY 4 /**< Item can be worn on body */ +#define ITEM_WEAR_HEAD 5 /**< Item can be worn on head */ +#define ITEM_WEAR_LEGS 6 /**< Item can be worn on legs */ +#define ITEM_WEAR_FEET 7 /**< Item can be worn on feet */ +#define ITEM_WEAR_HANDS 8 /**< Item can be worn on hands */ +#define ITEM_WEAR_ARMS 9 /**< Item can be worn on arms */ +#define ITEM_WEAR_SHIELD 10 /**< Item can be used as a shield */ +#define ITEM_WEAR_ABOUT 11 /**< Item can be worn about body */ +#define ITEM_WEAR_WAIST 12 /**< Item can be worn around waist */ +#define ITEM_WEAR_WRIST 13 /**< Item can be worn on wrist */ +#define ITEM_WEAR_WIELD 14 /**< Item can be wielded */ +#define ITEM_WEAR_HOLD 15 /**< Item can be held */ /** Total number of item wears */ -#define NUM_ITEM_WEARS 15 +#define NUM_ITEM_WEARS 16 /* Extra object flags: used by obj_data.obj_flags.extra_flags */ #define ITEM_GLOW 0 /**< Item is glowing */