- Added unlimited fountains and containers (Thanks Adam Scriven).

- Removed object types MISSILE and FIRE WEAPON.
--Rumble
This commit is contained in:
Rumble 2007-03-30 12:55:33 +00:00
parent 7f65248b2a
commit 140fcc2be1
16 changed files with 234 additions and 298 deletions

View file

@ -5,7 +5,9 @@ The Builder Academy
builderacademy.net 9091 builderacademy.net 9091
tbaMUD 3.52 tbaMUD 3.52
[Mar 27 2007] - Rumble [Mar 30 2007] - Rumble
Added unlimited fountains and containers (Thanks Adam Scriven).
Removed object types MISSILE and FIRE WEAPON.
Removed the do_oasis function and called the Xedit commands directly (thanks Rhade). Removed the do_oasis function and called the Xedit commands directly (thanks Rhade).
[Mar 25 2007] - Rumble [Mar 25 2007] - Rumble
Updated idle timer to keep track of imms too (thanks Jamdog). Updated idle timer to keep track of imms too (thanks Jamdog).
@ -13,7 +15,7 @@ tbaMUD 3.52
Removed special procedures that were replaced with trigedit. Removed special procedures that were replaced with trigedit.
Updated README.WIN, README.MSVC8, and README.CYGWIN. Updated README.WIN, README.MSVC8, and README.CYGWIN.
[Mar 20 2007] - Rumble [Mar 20 2007] - Rumble
Added object type CHAIR (thanks Dark). Added object type FURNITURE (thanks Dark).
Added ZZZ directories to plrfiles and plrvars (thanks Zizazat). Added ZZZ directories to plrfiles and plrvars (thanks Zizazat).
Added 00 files to plrfiles directories (thanks Khorlane). Added 00 files to plrfiles directories (thanks Khorlane).
Added mail check at reconnect and when coming back from AFK. Added mail check at reconnect and when coming back from AFK.

View file

@ -78,11 +78,9 @@ chair~
a squishy armchair~ a squishy armchair~
A large squishy armchair sits in front of the fireplace.~ A large squishy armchair sits in front of the fireplace.~
~ ~
24 0 a 0 6 0 a 0
1 0 0 0 2 0 0 0
1 1 0 0 1 1 0 0
T 1209
T 1286
E E
chair armchair squishy~ chair armchair squishy~
This chair has large red leather cushions, on the seat and back. Strange This chair has large red leather cushions, on the seat and back. Strange
@ -104,7 +102,7 @@ a spring well~
A mountain spring bubbles up fresh water here.~ A mountain spring bubbles up fresh water here.~
~ ~
23 0 0 0 23 0 0 0
500 500 15 0 -1 0 0 0
0 0 0 0 0 0 0 0
E E
spring fountain water~ spring fountain water~
@ -294,14 +292,14 @@ A piece of fireworks is planted in a champagne bottle.~
0 0 0 0 0 0 0 0
T 1297 T 1297
E E
firework new year piece~
This large rocket is about to go up! Strange colours will fill the sky!
~
E
bottle champagne~ bottle champagne~
The bottle is filled partially with water so it doesn't tilt over. Someone The bottle is filled partially with water so it doesn't tilt over. Someone
has obviously drunk the champagne first. has obviously drunk the champagne first.
~ ~
E
firework new year piece~
This large rocket is about to go up! Strange colours will fill the sky!
~
#1299 #1299
christmas tree~ christmas tree~
a christmas tree~ a christmas tree~

View file

@ -110,7 +110,7 @@ A rather dubious looking piece of meat is on the ground here.~
~ ~
19 0 a 0 19 0 a 0
14 0 0 0 14 0 0 0
5 24 10 0 500 24 10 0
E E
meat chunk~ meat chunk~
It isn't so much that the meat looks poisoned or anything, but that you just It isn't so much that the meat looks poisoned or anything, but that you just
@ -135,13 +135,13 @@ A small sword lies here.~
0 1 6 11 0 1 6 11
3 60 10 0 3 60 10 0
E E
inscription~
It says: 'May this sword be a good companion. '
~
E
sword small~ sword small~
The small sword seems to have an inscription of some sort. The small sword seems to have an inscription of some sort.
~ ~
E
inscription~
It says: 'May this sword be a good companion. '
~
#3022 #3022
sword long~ sword long~
a long sword~ a long sword~
@ -535,13 +535,13 @@ A large, sociable bulletin board is mounted on a wall here.~
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
E E
social bulletin~
Use 'look board' to read the board.
~
E
board~ board~
If you can read this, the board is not working. If you can read this, the board is not working.
~ ~
E
social bulletin~
Use 'look board' to read the board.
~
#3097 #3097
boards frozen bulletin gen_boards~ boards frozen bulletin gen_boards~
a frozen bulletin board~ a frozen bulletin board~
@ -551,13 +551,13 @@ A large bulletin board is here, carved from a block of ice.~
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
E E
freeze bulletin~
Use 'look board' to read the board.
~
E
board~ board~
If you can read this, the board is not working. If you can read this, the board is not working.
~ ~
E
freeze bulletin~
Use 'look board' to read the board.
~
#3098 #3098
boards holy bulletin gen_boards~ boards holy bulletin gen_boards~
a holy bulletin board~ a holy bulletin board~
@ -567,13 +567,13 @@ A large bulletin board is mounted on a wall here. It glows with a faint aura.~
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
E E
holy bulletin~
Use 'look board' to read the board.
~
E
board~ board~
If you can read this, the board is not working. If you can read this, the board is not working.
~ ~
E
holy bulletin~
Use 'look board' to read the board.
~
#3099 #3099
boards bulletin gen_boards~ boards bulletin gen_boards~
a bulletin board~ a bulletin board~
@ -583,11 +583,11 @@ A large bulletin board is mounted on a wall here.~
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
E E
bulletin~
Use 'look board' to read the board.
~
E
board~ board~
If you can read this, the board is not working. If you can read this, the board is not working.
~ ~
E
bulletin~
Use 'look board' to read the board.
~
$~ $~

View file

@ -308,7 +308,7 @@ void look_at_char(struct char_data *i, struct char_data *ch)
void list_one_char(struct char_data *i, struct char_data *ch) void list_one_char(struct char_data *i, struct char_data *ch)
{ {
struct obj_data *chair; struct obj_data *furniture;
const char *positions[] = { const char *positions[] = {
" is lying here, dead.", " is lying here, dead.",
" is lying here, mortally wounded.", " is lying here, mortally wounded.",
@ -366,10 +366,10 @@ void list_one_char(struct char_data *i, struct char_data *ch)
if (!SITTING(i)) if (!SITTING(i))
send_to_char(ch, "%s", positions[(int) GET_POS(i)]); send_to_char(ch, "%s", positions[(int) GET_POS(i)]);
else { else {
chair = SITTING(i); furniture = SITTING(i);
send_to_char(ch, " is %s upon %s.", ((GET_POS(i) == POS_SITTING) ? send_to_char(ch, " is %s upon %s.", ((GET_POS(i) == POS_SLEEPING) ?
"sitting" : "resting"), (CAN_SEE_OBJ(ch, chair) ? "sleeping" : "sitting"), (CAN_SEE_OBJ(ch, furniture) ?
chair->short_description : "something")); furniture->short_description : "something"));
} }
} else { } else {
if (FIGHTING(i)) { if (FIGHTING(i)) {
@ -564,9 +564,15 @@ void look_in_obj(struct char_data *ch, char *arg)
if (GET_OBJ_VAL(obj, 1) <= 0) if (GET_OBJ_VAL(obj, 1) <= 0)
send_to_char(ch, "It is empty.\r\n"); send_to_char(ch, "It is empty.\r\n");
else { else {
if (GET_OBJ_VAL(obj,0) <= 0 || GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0)) { if (GET_OBJ_VAL(obj, 0) < 0)
send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */ {
} else { char buf2[MAX_STRING_LENGTH];
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
send_to_char(ch, "It's full of a %s liquid.\r\n", buf2);
}
else if (GET_OBJ_VAL(obj,1)>GET_OBJ_VAL(obj,0))
send_to_char(ch, "Its contents seem somewhat murky.\r\n"); /* BUG */
else {
char buf2[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH];
amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0); amt = (GET_OBJ_VAL(obj, 1) * 3) / GET_OBJ_VAL(obj, 0);
sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2)); sprinttype(GET_OBJ_VAL(obj, 2), color_liquid, buf2, sizeof(buf2));
@ -822,8 +828,8 @@ ACMD(do_score)
if (!SITTING(ch)) if (!SITTING(ch))
send_to_char(ch, "You are sitting.\r\n"); send_to_char(ch, "You are sitting.\r\n");
else { else {
struct obj_data *chair = SITTING(ch); struct obj_data *furniture = SITTING(ch);
send_to_char(ch, "You are sitting upon %s.\r\n", chair->short_description); send_to_char(ch, "You are sitting upon %s.\r\n", furniture->short_description);
} }
break; break;
case POS_FIGHTING: case POS_FIGHTING:

View file

@ -10,7 +10,6 @@
#include "conf.h" #include "conf.h"
#include "sysdep.h" #include "sysdep.h"
#include "structs.h" #include "structs.h"
#include "utils.h" #include "utils.h"
#include "comm.h" #include "comm.h"
@ -54,9 +53,7 @@ ACMD(do_wear);
ACMD(do_wield); ACMD(do_wield);
ACMD(do_grab); ACMD(do_grab);
void perform_put(struct char_data *ch, struct obj_data *obj, struct obj_data *cont)
void perform_put(struct char_data *ch, struct obj_data *obj,
struct obj_data *cont)
{ {
if (!drop_otrigger(obj, ch)) if (!drop_otrigger(obj, ch))
@ -65,7 +62,8 @@ void perform_put(struct char_data *ch, struct obj_data *obj,
if (!obj) /* object might be extracted by drop_otrigger */ if (!obj) /* object might be extracted by drop_otrigger */
return; return;
if (GET_OBJ_WEIGHT(cont) + GET_OBJ_WEIGHT(obj) > GET_OBJ_VAL(cont, 0)) if ((GET_OBJ_VAL(cont, 0) > 0) &&
(GET_OBJ_WEIGHT(cont) + GET_OBJ_WEIGHT(obj) > GET_OBJ_VAL(cont, 0)))
act("$p won't fit in $P.", FALSE, ch, obj, cont, TO_CHAR); act("$p won't fit in $P.", FALSE, ch, obj, cont, TO_CHAR);
else if (OBJ_FLAGGED(obj, ITEM_NODROP) && IN_ROOM(cont) != NOWHERE) else if (OBJ_FLAGGED(obj, ITEM_NODROP) && IN_ROOM(cont) != NOWHERE)
act("You can't get $p out of your hand.", FALSE, ch, obj, NULL, TO_CHAR); act("You can't get $p out of your hand.", FALSE, ch, obj, NULL, TO_CHAR);
@ -85,17 +83,12 @@ void perform_put(struct char_data *ch, struct obj_data *obj,
} }
} }
/* The following put modes are supported:
/* The following put modes are supported by the code below: 1) put <object> <container>
2) put all.<object> <container>
1) put <object> <container> 3) put all <container>
2) put all.<object> <container> The <container> must be in inventory or on ground. All objects to be put
3) put all <container> into container must be in inventory. */
<container> must be in inventory or on ground.
all objects to be put into container must be in inventory.
*/
ACMD(do_put) ACMD(do_put)
{ {
char arg1[MAX_INPUT_LENGTH]; char arg1[MAX_INPUT_LENGTH];
@ -169,8 +162,6 @@ ACMD(do_put)
} }
} }
int can_take_obj(struct char_data *ch, struct obj_data *obj) int can_take_obj(struct char_data *ch, struct obj_data *obj)
{ {
if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) { if (IS_CARRYING_N(ch) >= CAN_CARRY_N(ch)) {
@ -186,7 +177,6 @@ int can_take_obj(struct char_data *ch, struct obj_data *obj)
return (1); return (1);
} }
void get_check_money(struct char_data *ch, struct obj_data *obj) void get_check_money(struct char_data *ch, struct obj_data *obj)
{ {
int value = GET_OBJ_VAL(obj, 0); int value = GET_OBJ_VAL(obj, 0);
@ -204,7 +194,6 @@ void get_check_money(struct char_data *ch, struct obj_data *obj)
send_to_char(ch, "There were %d coins.\r\n", value); send_to_char(ch, "There were %d coins.\r\n", value);
} }
void perform_get_from_container(struct char_data *ch, struct obj_data *obj, void perform_get_from_container(struct char_data *ch, struct obj_data *obj,
struct obj_data *cont, int mode) struct obj_data *cont, int mode)
{ {
@ -221,7 +210,6 @@ void perform_get_from_container(struct char_data *ch, struct obj_data *obj,
} }
} }
void get_from_container(struct char_data *ch, struct obj_data *cont, void get_from_container(struct char_data *ch, struct obj_data *cont,
char *arg, int mode, int howmany) char *arg, int mode, int howmany)
{ {
@ -272,7 +260,6 @@ void get_from_container(struct char_data *ch, struct obj_data *cont,
} }
} }
int perform_get_from_room(struct char_data *ch, struct obj_data *obj) int perform_get_from_room(struct char_data *ch, struct obj_data *obj)
{ {
if (can_take_obj(ch, obj) && get_otrigger(obj, ch)) { if (can_take_obj(ch, obj) && get_otrigger(obj, ch)) {
@ -286,7 +273,6 @@ int perform_get_from_room(struct char_data *ch, struct obj_data *obj)
return (0); return (0);
} }
void get_from_room(struct char_data *ch, char *arg, int howmany) void get_from_room(struct char_data *ch, char *arg, int howmany)
{ {
struct obj_data *obj, *next_obj; struct obj_data *obj, *next_obj;
@ -327,8 +313,6 @@ void get_from_room(struct char_data *ch, char *arg, int howmany)
} }
} }
ACMD(do_get) ACMD(do_get)
{ {
char arg1[MAX_INPUT_LENGTH]; char arg1[MAX_INPUT_LENGTH];
@ -351,8 +335,8 @@ ACMD(do_get)
int amount = 1; int amount = 1;
if (is_number(arg1)) { if (is_number(arg1)) {
amount = atoi(arg1); amount = atoi(arg1);
strcpy(arg1, arg2); /* strcpy: OK (sizeof: arg1 == arg2) */ strcpy(arg1, arg2); /* strcpy: OK (sizeof: arg1 == arg2) */
strcpy(arg2, arg3); /* strcpy: OK (sizeof: arg2 == arg3) */ strcpy(arg2, arg3); /* strcpy: OK (sizeof: arg2 == arg3) */
} }
cont_dotmode = find_all_dots(arg2); cont_dotmode = find_all_dots(arg2);
if (cont_dotmode == FIND_INDIV) { if (cont_dotmode == FIND_INDIV) {
@ -400,9 +384,7 @@ ACMD(do_get)
} }
} }
void perform_drop_gold(struct char_data *ch, int amount, byte mode, room_rnum RDR)
void perform_drop_gold(struct char_data *ch, int amount,
byte mode, room_rnum RDR)
{ {
struct obj_data *obj; struct obj_data *obj;
@ -412,7 +394,7 @@ void perform_drop_gold(struct char_data *ch, int amount,
send_to_char(ch, "You don't have that many coins!\r\n"); send_to_char(ch, "You don't have that many coins!\r\n");
else { else {
if (mode != SCMD_JUNK) { if (mode != SCMD_JUNK) {
WAIT_STATE(ch, PULSE_VIOLENCE); /* to prevent coin-bombing */ WAIT_STATE(ch, PULSE_VIOLENCE); /* to prevent coin-bombing */
obj = create_money(amount); obj = create_money(amount);
if (mode == SCMD_DONATE) { if (mode == SCMD_DONATE) {
send_to_char(ch, "You throw some gold into the air where it disappears in a puff of smoke!\r\n"); send_to_char(ch, "You throw some gold into the air where it disappears in a puff of smoke!\r\n");
@ -446,10 +428,8 @@ void perform_drop_gold(struct char_data *ch, int amount,
} }
} }
#define VANISH(mode) ((mode == SCMD_DONATE || mode == SCMD_JUNK) ? \ #define VANISH(mode) ((mode == SCMD_DONATE || mode == SCMD_JUNK) ? \
" It vanishes in a puff of smoke!" : "") " It vanishes in a puff of smoke!" : "")
int perform_drop(struct char_data *ch, struct obj_data *obj, int perform_drop(struct char_data *ch, struct obj_data *obj,
byte mode, const char *sname, room_rnum RDR) byte mode, const char *sname, room_rnum RDR)
{ {
@ -493,18 +473,14 @@ int perform_drop(struct char_data *ch, struct obj_data *obj,
return (value); return (value);
default: default:
log("SYSERR: Incorrect argument %d passed to perform_drop.", mode); log("SYSERR: Incorrect argument %d passed to perform_drop.", mode);
/* SYSERR_DESC: /* SYSERR_DESC: This error comes from perform_drop() and is output when
* This error comes from perform_drop() and is output when perform_drop() * perform_drop() is called with an illegal 'mode' argument. */
* is called with an illegal 'mode' argument.
*/
break; break;
} }
return (0); return (0);
} }
ACMD(do_drop) ACMD(do_drop)
{ {
char arg[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH];
@ -618,7 +594,6 @@ ACMD(do_drop)
} }
} }
void perform_give(struct char_data *ch, struct char_data *vict, void perform_give(struct char_data *ch, struct char_data *vict,
struct obj_data *obj) struct obj_data *obj)
{ {
@ -664,7 +639,6 @@ struct char_data *give_find_vict(struct char_data *ch, char *arg)
return (NULL); return (NULL);
} }
void perform_give_gold(struct char_data *ch, struct char_data *vict, void perform_give_gold(struct char_data *ch, struct char_data *vict,
int amount) int amount)
{ {
@ -693,7 +667,6 @@ void perform_give_gold(struct char_data *ch, struct char_data *vict,
bribe_mtrigger(vict, ch, amount); bribe_mtrigger(vict, ch, amount);
} }
ACMD(do_give) ACMD(do_give)
{ {
char arg[MAX_STRING_LENGTH]; char arg[MAX_STRING_LENGTH];
@ -713,7 +686,7 @@ ACMD(do_give)
if ((vict = give_find_vict(ch, arg)) != NULL) if ((vict = give_find_vict(ch, arg)) != NULL)
perform_give_gold(ch, vict, amount); perform_give_gold(ch, vict, amount);
return; return;
} else if (!*arg) /* Give multiple code. */ } else if (!*arg) /* Give multiple code. */
send_to_char(ch, "What do you want to give %d of?\r\n", amount); send_to_char(ch, "What do you want to give %d of?\r\n", amount);
else if (!(vict = give_find_vict(ch, argument))) else if (!(vict = give_find_vict(ch, argument)))
return; return;
@ -756,8 +729,6 @@ ACMD(do_give)
} }
} }
void weight_change_object(struct obj_data *obj, int weight) void weight_change_object(struct obj_data *obj, int weight)
{ {
struct obj_data *tmp_obj; struct obj_data *tmp_obj;
@ -775,15 +746,12 @@ void weight_change_object(struct obj_data *obj, int weight)
obj_to_obj(obj, tmp_obj); obj_to_obj(obj, tmp_obj);
} else { } else {
log("SYSERR: Unknown attempt to subtract weight from an object."); log("SYSERR: Unknown attempt to subtract weight from an object.");
/* SYSERR_DESC: /* SYSERR_DESC: weight_change_object() outputs this error when weight is
* weight_change_object() outputs this error when weight is attempted to * attempted to be removed from an object that is not carried or in
* be removed from an object that is not carried or in another object. * another object. */
*/
} }
} }
void name_from_drinkcon(struct obj_data *obj) void name_from_drinkcon(struct obj_data *obj)
{ {
char *new_name, *cur_name, *next; char *new_name, *cur_name, *next;
@ -796,11 +764,9 @@ void name_from_drinkcon(struct obj_data *obj)
liqname = drinknames[GET_OBJ_VAL(obj, 2)]; liqname = drinknames[GET_OBJ_VAL(obj, 2)];
if (!isname(liqname, obj->name)) { if (!isname(liqname, obj->name)) {
log("SYSERR: Can't remove liquid '%s' from '%s' (%d) item.", liqname, obj->name, obj->item_number); log("SYSERR: Can't remove liquid '%s' from '%s' (%d) item.", liqname, obj->name, obj->item_number);
/* SYSERR_DESC: /* SYSERR_DESC: From name_from_drinkcon(), this error comes about if the
* From name_from_drinkcon(), this error comes about if the object * object noted (by keywords and item vnum) does not contain the liquid
* noted (by keywords and item vnum) does not contain the liquid string * string being searched for. */
* being searched for.
*/
return; return;
} }
@ -820,8 +786,8 @@ void name_from_drinkcon(struct obj_data *obj)
continue; continue;
if (*new_name) if (*new_name)
strcat(new_name, " "); /* strcat: OK (size precalculated) */ strcat(new_name, " "); /* strcat: OK (size precalculated) */
strncat(new_name, cur_name, cpylen); /* strncat: OK (size precalculated) */ strncat(new_name, cur_name, cpylen); /* strncat: OK (size precalculated) */
} }
if (GET_OBJ_RNUM(obj) == NOTHING || obj->name != obj_proto[GET_OBJ_RNUM(obj)].name) if (GET_OBJ_RNUM(obj) == NOTHING || obj->name != obj_proto[GET_OBJ_RNUM(obj)].name)
@ -829,8 +795,6 @@ void name_from_drinkcon(struct obj_data *obj)
obj->name = new_name; obj->name = new_name;
} }
void name_to_drinkcon(struct obj_data *obj, int type) void name_to_drinkcon(struct obj_data *obj, int type)
{ {
char *new_name; char *new_name;
@ -839,7 +803,7 @@ void name_to_drinkcon(struct obj_data *obj, int type)
return; return;
CREATE(new_name, char, strlen(obj->name) + strlen(drinknames[type]) + 2); CREATE(new_name, char, strlen(obj->name) + strlen(drinknames[type]) + 2);
sprintf(new_name, "%s %s", obj->name, drinknames[type]); /* sprintf: OK */ sprintf(new_name, "%s %s", obj->name, drinknames[type]); /* sprintf: OK */
if (GET_OBJ_RNUM(obj) == NOTHING || obj->name != obj_proto[GET_OBJ_RNUM(obj)].name) if (GET_OBJ_RNUM(obj) == NOTHING || obj->name != obj_proto[GET_OBJ_RNUM(obj)].name)
free(obj->name); free(obj->name);
@ -847,8 +811,6 @@ void name_to_drinkcon(struct obj_data *obj, int type)
obj->name = new_name; obj->name = new_name;
} }
ACMD(do_drink) ACMD(do_drink)
{ {
char arg[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH];
@ -859,7 +821,7 @@ ACMD(do_drink)
one_argument(argument, arg); one_argument(argument, arg);
if (IS_NPC(ch)) /* Cannot use GET_COND() on mobs. */ if (IS_NPC(ch)) /* Cannot use GET_COND() on mobs. */
return; return;
if (!*arg) { if (!*arg) {
@ -921,11 +883,12 @@ ACMD(do_drink)
amount = MIN(amount, GET_OBJ_VAL(temp, 1)); amount = MIN(amount, GET_OBJ_VAL(temp, 1));
/* You can't subtract more than the object weighs */ /* You can't subtract more than the object weighs, unless its unlimited. */
weight = MIN(amount, GET_OBJ_WEIGHT(temp)); if (GET_OBJ_VAL(temp, 0) > 0) {
weight = MIN(amount, GET_OBJ_WEIGHT(temp));
weight_change_object(temp, -weight); /* Subtract amount */ weight_change_object(temp, -weight); /* Subtract amount */
}
gain_condition(ch, DRUNK, drink_aff[GET_OBJ_VAL(temp, 2)][DRUNK] * amount / 4); gain_condition(ch, DRUNK, drink_aff[GET_OBJ_VAL(temp, 2)][DRUNK] * amount / 4);
gain_condition(ch, HUNGER, drink_aff[GET_OBJ_VAL(temp, 2)][HUNGER] * amount / 4); gain_condition(ch, HUNGER, drink_aff[GET_OBJ_VAL(temp, 2)][HUNGER] * amount / 4);
gain_condition(ch, THIRST, drink_aff[GET_OBJ_VAL(temp, 2)][THIRST] * amount / 4); gain_condition(ch, THIRST, drink_aff[GET_OBJ_VAL(temp, 2)][THIRST] * amount / 4);
@ -939,7 +902,7 @@ ACMD(do_drink)
if (GET_COND(ch, HUNGER) > 20) if (GET_COND(ch, HUNGER) > 20)
send_to_char(ch, "You are full.\r\n"); send_to_char(ch, "You are full.\r\n");
if (GET_OBJ_VAL(temp, 3)) { /* The crap was poisoned ! */ if (GET_OBJ_VAL(temp, 3)) { /* The crap was poisoned ! */
send_to_char(ch, "Oops, it tasted rather strange!\r\n"); send_to_char(ch, "Oops, it tasted rather strange!\r\n");
act("$n chokes and utters some strange sounds.", TRUE, ch, 0, 0, TO_ROOM); act("$n chokes and utters some strange sounds.", TRUE, ch, 0, 0, TO_ROOM);
@ -950,18 +913,18 @@ ACMD(do_drink)
af.bitvector = AFF_POISON; af.bitvector = AFF_POISON;
affect_join(ch, &af, FALSE, FALSE, FALSE, FALSE); affect_join(ch, &af, FALSE, FALSE, FALSE, FALSE);
} }
/* empty the container, and no longer poison. */ /* Empty the container (unless unlimited), and no longer poison. */
GET_OBJ_VAL(temp, 1) -= amount; if (GET_OBJ_VAL(temp, 0) > 0) {
if (!GET_OBJ_VAL(temp, 1)) { /* The last bit */ GET_OBJ_VAL(temp, 1) -= amount;
name_from_drinkcon(temp); if (!GET_OBJ_VAL(temp, 1)) { /* The last bit */
GET_OBJ_VAL(temp, 2) = 0; name_from_drinkcon(temp);
GET_OBJ_VAL(temp, 3) = 0; GET_OBJ_VAL(temp, 2) = 0;
GET_OBJ_VAL(temp, 3) = 0;
}
} }
return; return;
} }
ACMD(do_eat) ACMD(do_eat)
{ {
char arg[MAX_INPUT_LENGTH]; char arg[MAX_INPUT_LENGTH];
@ -971,7 +934,7 @@ ACMD(do_eat)
one_argument(argument, arg); one_argument(argument, arg);
if (IS_NPC(ch)) /* Cannot use GET_COND() on mobs. */ if (IS_NPC(ch)) /* Cannot use GET_COND() on mobs. */
return; return;
if (!*arg) { if (!*arg) {
@ -991,12 +954,12 @@ ACMD(do_eat)
send_to_char(ch, "You can't eat THAT!\r\n"); send_to_char(ch, "You can't eat THAT!\r\n");
return; return;
} }
if (GET_COND(ch, HUNGER) > 20) {/* Stomach full */ if (GET_COND(ch, HUNGER) > 20) { /* Stomach full */
send_to_char(ch, "You are too full to eat more!\r\n"); send_to_char(ch, "You are too full to eat more!\r\n");
return; return;
} }
if (!consume_otrigger(food, ch, OCMD_EAT)) /* check trigger */ if (!consume_otrigger(food, ch, OCMD_EAT)) /* check trigger */
return; return;
if (subcmd == SCMD_EAT) { if (subcmd == SCMD_EAT) {
@ -1036,17 +999,16 @@ ACMD(do_eat)
} }
} }
ACMD(do_pour) ACMD(do_pour)
{ {
char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH]; char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
struct obj_data *from_obj = NULL, *to_obj = NULL; struct obj_data *from_obj = NULL, *to_obj = NULL;
int amount; int amount = 0;
two_arguments(argument, arg1, arg2); two_arguments(argument, arg1, arg2);
if (subcmd == SCMD_POUR) { if (subcmd == SCMD_POUR) {
if (!*arg1) { /* No arguments */ if (!*arg1) { /* No arguments */
send_to_char(ch, "From what do you want to pour?\r\n"); send_to_char(ch, "From what do you want to pour?\r\n");
return; return;
} }
@ -1060,7 +1022,7 @@ ACMD(do_pour)
} }
} }
if (subcmd == SCMD_FILL) { if (subcmd == SCMD_FILL) {
if (!*arg1) { /* no arguments */ if (!*arg1) { /* no arguments */
send_to_char(ch, "What do you want to fill? And what are you filling it from?\r\n"); send_to_char(ch, "What do you want to fill? And what are you filling it from?\r\n");
return; return;
} }
@ -1072,7 +1034,7 @@ ACMD(do_pour)
act("You can't fill $p!", FALSE, ch, to_obj, 0, TO_CHAR); act("You can't fill $p!", FALSE, ch, to_obj, 0, TO_CHAR);
return; return;
} }
if (!*arg2) { /* no 2nd argument */ if (!*arg2) { /* no 2nd argument */
act("What do you want to fill $p from?", FALSE, ch, to_obj, 0, TO_CHAR); act("What do you want to fill $p from?", FALSE, ch, to_obj, 0, TO_CHAR);
return; return;
} }
@ -1089,21 +1051,25 @@ ACMD(do_pour)
act("The $p is empty.", FALSE, ch, from_obj, 0, TO_CHAR); act("The $p is empty.", FALSE, ch, from_obj, 0, TO_CHAR);
return; return;
} }
if (subcmd == SCMD_POUR) { /* pour */ if (subcmd == SCMD_POUR) { /* pour */
if (!*arg2) { if (!*arg2) {
send_to_char(ch, "Where do you want it? Out or in what?\r\n"); send_to_char(ch, "Where do you want it? Out or in what?\r\n");
return; return;
} }
if (!str_cmp(arg2, "out")) { if (!str_cmp(arg2, "out")) {
act("$n empties $p.", TRUE, ch, from_obj, 0, TO_ROOM); if (GET_OBJ_VAL(from_obj, 0) > 0) {
act("You empty $p.", FALSE, ch, from_obj, 0, TO_CHAR); act("$n empties $p.", TRUE, ch, from_obj, 0, TO_ROOM);
act("You empty $p.", FALSE, ch, from_obj, 0, TO_CHAR);
weight_change_object(from_obj, -GET_OBJ_VAL(from_obj, 1)); /* Empty */ weight_change_object(from_obj, -GET_OBJ_VAL(from_obj, 1)); /* Empty */
name_from_drinkcon(from_obj); name_from_drinkcon(from_obj);
GET_OBJ_VAL(from_obj, 1) = 0; GET_OBJ_VAL(from_obj, 1) = 0;
GET_OBJ_VAL(from_obj, 2) = 0; GET_OBJ_VAL(from_obj, 2) = 0;
GET_OBJ_VAL(from_obj, 3) = 0; GET_OBJ_VAL(from_obj, 3) = 0;
}
else
send_to_char(ch, "You can't possibly pour that container out!\r\n");
return; return;
} }
@ -1121,8 +1087,8 @@ ACMD(do_pour)
send_to_char(ch, "A most unproductive effort.\r\n"); send_to_char(ch, "A most unproductive effort.\r\n");
return; return;
} }
if ((GET_OBJ_VAL(to_obj, 1) != 0) && if ((GET_OBJ_VAL(to_obj, 0) < 0) ||
(GET_OBJ_VAL(to_obj, 2) != GET_OBJ_VAL(from_obj, 2))) { (!(GET_OBJ_VAL(to_obj, 1) < GET_OBJ_VAL(to_obj, 0)))) {
send_to_char(ch, "There is already another liquid in it!\r\n"); send_to_char(ch, "There is already another liquid in it!\r\n");
return; return;
} }
@ -1145,26 +1111,32 @@ ACMD(do_pour)
GET_OBJ_VAL(to_obj, 2) = GET_OBJ_VAL(from_obj, 2); GET_OBJ_VAL(to_obj, 2) = GET_OBJ_VAL(from_obj, 2);
/* Then how much to pour */ /* Then how much to pour */
GET_OBJ_VAL(from_obj, 1) -= (amount = if (GET_OBJ_VAL(from_obj, 0) > 0) {
(GET_OBJ_VAL(to_obj, 0) - GET_OBJ_VAL(to_obj, 1))); GET_OBJ_VAL(from_obj, 1) -= (amount =
(GET_OBJ_VAL(to_obj, 0) - GET_OBJ_VAL(to_obj, 1)));
GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0); GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0);
if (GET_OBJ_VAL(from_obj, 1) < 0) { /* There was too little */ if (GET_OBJ_VAL(from_obj, 1) < 0) { /* There was too little */
GET_OBJ_VAL(to_obj, 1) += GET_OBJ_VAL(from_obj, 1); GET_OBJ_VAL(to_obj, 1) += GET_OBJ_VAL(from_obj, 1);
amount += GET_OBJ_VAL(from_obj, 1); amount += GET_OBJ_VAL(from_obj, 1);
name_from_drinkcon(from_obj); name_from_drinkcon(from_obj);
GET_OBJ_VAL(from_obj, 1) = 0; GET_OBJ_VAL(from_obj, 1) = 0;
GET_OBJ_VAL(from_obj, 2) = 0; GET_OBJ_VAL(from_obj, 2) = 0;
GET_OBJ_VAL(from_obj, 3) = 0; GET_OBJ_VAL(from_obj, 3) = 0;
}
} }
/* Then the poison boogie */ else
GET_OBJ_VAL(to_obj, 3) = GET_OBJ_VAL(to_obj, 1) = GET_OBJ_VAL(to_obj, 0);
(GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3));
/* And the weight boogie */ /* Poisoned? */
weight_change_object(from_obj, -amount); GET_OBJ_VAL(to_obj, 3) = (GET_OBJ_VAL(to_obj, 3) || GET_OBJ_VAL(from_obj, 3))
weight_change_object(to_obj, amount); /* Add weight */ ;
/* Weight change, except for unlimited. */
if (GET_OBJ_VAL(from_obj, 0) > 0) {
weight_change_object(from_obj, -amount);
}
weight_change_object(to_obj, amount); /* Add weight */
} }
void wear_message(struct char_data *ch, struct obj_data *obj, int where) void wear_message(struct char_data *ch, struct obj_data *obj, int where)

View file

@ -529,8 +529,8 @@ ACMD(do_stand)
case POS_SITTING: case POS_SITTING:
send_to_char(ch, "You stand up.\r\n"); send_to_char(ch, "You stand up.\r\n");
act("$n clambers to $s feet.", TRUE, ch, 0, 0, TO_ROOM); act("$n clambers to $s feet.", TRUE, ch, 0, 0, TO_ROOM);
/* Were they sitting in a chair? */ /* Were they sitting in something? */
char_from_chair(ch); char_from_furniture(ch);
/* Will be sitting after a successful bash and may still be fighting. */ /* Will be sitting after a successful bash and may still be fighting. */
GET_POS(ch) = FIGHTING(ch) ? POS_FIGHTING : POS_STANDING; GET_POS(ch) = FIGHTING(ch) ? POS_FIGHTING : POS_STANDING;
break; break;
@ -538,8 +538,8 @@ ACMD(do_stand)
send_to_char(ch, "You stop resting, and stand up.\r\n"); send_to_char(ch, "You stop resting, and stand up.\r\n");
act("$n stops resting, and clambers on $s feet.", TRUE, ch, 0, 0, TO_ROOM); act("$n stops resting, and clambers on $s feet.", TRUE, ch, 0, 0, TO_ROOM);
GET_POS(ch) = POS_STANDING; GET_POS(ch) = POS_STANDING;
/* Were they sitting in the chair */ /* Were they sitting in something. */
char_from_chair(ch); char_from_furniture(ch);
break; break;
case POS_SLEEPING: case POS_SLEEPING:
send_to_char(ch, "You have to wake up first!\r\n"); send_to_char(ch, "You have to wake up first!\r\n");
@ -559,7 +559,7 @@ ACMD(do_stand)
ACMD(do_sit) ACMD(do_sit)
{ {
char arg[MAX_STRING_LENGTH]; char arg[MAX_STRING_LENGTH];
struct obj_data *chair; struct obj_data *furniture;
struct char_data *tempch; struct char_data *tempch;
int found; int found;
@ -567,7 +567,7 @@ ACMD(do_sit)
if (!*arg) if (!*arg)
found = 0; found = 0;
if (!(chair = get_obj_in_list_vis(ch, arg, NULL, world[ch->in_room].contents))) if (!(furniture = get_obj_in_list_vis(ch, arg, NULL, world[ch->in_room].contents)))
found = 0; found = 0;
else else
found = 1; found = 1;
@ -579,30 +579,30 @@ ACMD(do_sit)
act("$n sits down.", FALSE, ch, 0, 0, TO_ROOM); act("$n sits down.", FALSE, ch, 0, 0, TO_ROOM);
GET_POS(ch) = POS_SITTING; GET_POS(ch) = POS_SITTING;
} else { } else {
if (GET_OBJ_TYPE(chair) != ITEM_CHAIR) { if (GET_OBJ_TYPE(furniture) != ITEM_FURNITURE) {
send_to_char(ch, "You can't sit on that!\r\n"); send_to_char(ch, "You can't sit on that!\r\n");
return; return;
} else if (GET_OBJ_VAL(chair, 1) > GET_OBJ_VAL(chair, 0)) { } else if (GET_OBJ_VAL(furniture, 1) > GET_OBJ_VAL(furniture, 0)) {
/* val 1 is current number in chair, 0 is max in chair */ /* Val 1 is current number sitting, 0 is max in sitting. */
act("$p looks like it's all full.", TRUE, ch, chair, 0, TO_CHAR); act("$p looks like it's all full.", TRUE, ch, furniture, 0, TO_CHAR);
log("SYSERR: chair %d holding too many people.", GET_OBJ_VNUM(chair)); log("SYSERR: Furniture %d holding too many people.", GET_OBJ_VNUM(furniture));
return; return;
} else if (GET_OBJ_VAL(chair, 1) == GET_OBJ_VAL(chair, 0)) { } else if (GET_OBJ_VAL(furniture, 1) == GET_OBJ_VAL(furniture, 0)) {
act("There is no where left to sit upon $p.", TRUE, ch, chair, 0, TO_CHAR); act("There is no where left to sit upon $p.", TRUE, ch, furniture, 0, TO_CHAR);
return; return;
} else { } else {
if (OBJ_SAT_IN_BY(chair) == NULL) if (OBJ_SAT_IN_BY(furniture) == NULL)
OBJ_SAT_IN_BY(chair) = ch; OBJ_SAT_IN_BY(furniture) = ch;
for (tempch = OBJ_SAT_IN_BY(chair); tempch != ch ; tempch = NEXT_SITTING(tempch)) { for (tempch = OBJ_SAT_IN_BY(furniture); tempch != ch ; tempch = NEXT_SITTING(tempch)) {
if (NEXT_SITTING(tempch)) if (NEXT_SITTING(tempch))
continue; continue;
NEXT_SITTING(tempch) = ch; NEXT_SITTING(tempch) = ch;
} }
act("You sit down upon $p.", TRUE, ch, chair, 0, TO_CHAR); act("You sit down upon $p.", TRUE, ch, furniture, 0, TO_CHAR);
act("$n sits down upon $p.", TRUE, ch, chair, 0, TO_ROOM); act("$n sits down upon $p.", TRUE, ch, furniture, 0, TO_ROOM);
SITTING(ch) = chair; SITTING(ch) = furniture;
NEXT_SITTING(ch) = NULL; NEXT_SITTING(ch) = NULL;
GET_OBJ_VAL(chair, 1) += 1; GET_OBJ_VAL(furniture, 1) += 1;
GET_POS(ch) = POS_SITTING; GET_POS(ch) = POS_SITTING;
} }
} }
@ -719,8 +719,8 @@ ACMD(do_wake)
else { else {
send_to_char(ch, "You awaken, and sit up.\r\n"); send_to_char(ch, "You awaken, and sit up.\r\n");
act("$n awakens.", TRUE, ch, 0, 0, TO_ROOM); act("$n awakens.", TRUE, ch, 0, 0, TO_ROOM);
/* Were they asleep in a chair? */ /* Were they asleep while sitting? */
char_from_chair(ch); char_from_furniture(ch);
GET_POS(ch) = POS_SITTING; GET_POS(ch) = POS_SITTING;
} }
} }

View file

@ -744,8 +744,8 @@ void do_stat_object(struct char_data *ch, struct obj_data *j)
case ITEM_MONEY: case ITEM_MONEY:
send_to_char(ch, "Coins: %d\r\n", GET_OBJ_VAL(j, 0)); send_to_char(ch, "Coins: %d\r\n", GET_OBJ_VAL(j, 0));
break; break;
case ITEM_CHAIR: case ITEM_FURNITURE:
send_to_char(ch, "Can hold: [%d] Num. of People in Chair: [%d]\r\n", GET_OBJ_VAL(j, 0), GET_OBJ_VAL(j, 1)); send_to_char(ch, "Can hold: [%d] Num. of People in: [%d]\r\n", GET_OBJ_VAL(j, 0), GET_OBJ_VAL(j, 1));
send_to_char(ch, "Holding : "); send_to_char(ch, "Holding : ");
for (tempch = OBJ_SAT_IN_BY(j); tempch; tempch = NEXT_SITTING(tempch)) for (tempch = OBJ_SAT_IN_BY(j); tempch; tempch = NEXT_SITTING(tempch))
send_to_char(ch, "%s ", GET_NAME(tempch)); send_to_char(ch, "%s ", GET_NAME(tempch));

View file

@ -301,8 +301,8 @@ const char *item_types[] = {
"WAND", "WAND",
"STAFF", "STAFF",
"WEAPON", "WEAPON",
"FIRE WEAPON", "FURNITURE",
"MISSILE", "UNDEFINED",
"TREASURE", "TREASURE",
"ARMOR", "ARMOR",
"POTION", "POTION",
@ -319,7 +319,6 @@ const char *item_types[] = {
"PEN", "PEN",
"BOAT", "BOAT",
"FOUNTAIN", "FOUNTAIN",
"CHAIR",
"\n" "\n"
}; };

View file

@ -2667,7 +2667,7 @@ void reset_char(struct char_data *ch)
ch->next_fighting = NULL; ch->next_fighting = NULL;
ch->next_in_room = NULL; ch->next_in_room = NULL;
FIGHTING(ch) = NULL; FIGHTING(ch) = NULL;
char_from_chair(ch); char_from_furniture(ch);
ch->char_specials.position = POS_STANDING; ch->char_specials.position = POS_STANDING;
ch->mob_specials.default_pos = POS_STANDING; ch->mob_specials.default_pos = POS_STANDING;
ch->char_specials.carry_weight = 0; ch->char_specials.carry_weight = 0;
@ -2922,7 +2922,8 @@ int check_object(struct obj_data *obj)
} }
/* Fall through. */ /* Fall through. */
case ITEM_FOUNTAIN: case ITEM_FOUNTAIN:
if (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0) && (error = TRUE)) if ((GET_OBJ_VAL(obj,0) > 0) && (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0)
&& (error = TRUE)))
log("SYSERR: Object #%d (%s) contains (%d) more than maximum (%d).", log("SYSERR: Object #%d (%s) contains (%d) more than maximum (%d).",
GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VNUM(obj), obj->short_description,
GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 0)); GET_OBJ_VAL(obj, 1), GET_OBJ_VAL(obj, 0));
@ -2957,7 +2958,7 @@ int check_object(struct obj_data *obj)
} while (onealias && *onealias); } while (onealias && *onealias);
} }
break; break;
case ITEM_CHAIR: case ITEM_FURNITURE:
if (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0) && (error = TRUE)) if (GET_OBJ_VAL(obj, 1) > GET_OBJ_VAL(obj, 0) && (error = TRUE))
log("SYSERR: Object #%d (%s) contains (%d) more than maximum (%d).", log("SYSERR: Object #%d (%s) contains (%d) more than maximum (%d).",
GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VAL(obj, 1), GET_OBJ_VNUM(obj), obj->short_description, GET_OBJ_VAL(obj, 1),

View file

@ -306,8 +306,8 @@ int valid_dg_target(struct char_data *ch, int bitvector)
void script_damage(struct char_data *vict, int dam) void script_damage(struct char_data *vict, int dam)
{ {
if (GET_LEVEL(vict)>=LVL_IMMORT && (dam > 0)) { if (GET_LEVEL(vict)>=LVL_IMMORT && (dam > 0)) {
send_to_char(vict, "Being the cool immortal you are, you sidestep a trap,\r\n" send_to_char(vict, "Being the cool immortal you are, you sidestep a trap, "
"obviously placed to kill you.\r\n"); "obviously placed to kill you.\r\n");
return; return;
} }
@ -320,7 +320,7 @@ void script_damage(struct char_data *vict, int dam)
if (GET_POS(vict) == POS_DEAD) { if (GET_POS(vict) == POS_DEAD) {
if (!IS_NPC(vict)) if (!IS_NPC(vict))
mudlog( BRF, 0, TRUE, "%s killed by script at %s", mudlog( BRF, 0, TRUE, "%s killed by script at %s",
GET_NAME(vict), world[vict->in_room].name); GET_NAME(vict), world[vict->in_room].name);
die(vict, NULL); die(vict, NULL);
} }
} }

View file

@ -10,7 +10,6 @@
#include "conf.h" #include "conf.h"
#include "sysdep.h" #include "sysdep.h"
#include "structs.h" #include "structs.h"
#include "utils.h" #include "utils.h"
#include "comm.h" #include "comm.h"
@ -51,7 +50,7 @@ char *fname(const char *namelist)
} }
/* Stock isname(). Leave this here even if you put in a newer * /* Stock isname(). Leave this here even if you put in a newer *
* isname(). Used for OasisOLC. */ * isname(). Used for OasisOLC. */
int is_name(const char *str, const char *namelist) int is_name(const char *str, const char *namelist)
{ {
const char *curname, *curstr; const char *curname, *curstr;
@ -107,8 +106,6 @@ int isname(const char *str, const char *namelist)
return 0; return 0;
} }
void affect_modify(struct char_data *ch, byte loc, sbyte mod, void affect_modify(struct char_data *ch, byte loc, sbyte mod,
bitvector_t bitv, bool add) bitvector_t bitv, bool add)
{ {
@ -146,14 +143,11 @@ void affect_modify(struct char_data *ch, byte loc, sbyte mod,
/* ??? GET_CLASS(ch) += mod; */ /* ??? GET_CLASS(ch) += mod; */
break; break;
/* /* My personal thoughts on these two would be to set the person to the value
* My personal thoughts on these two would be to set the person to the * of the apply. That way you won't have to worry about people making +1
* value of the apply. That way you won't have to worry about people * level things to be imp (you restrict anything that gives immortal level of
* making +1 level things to be imp (you restrict anything that gives * course). It also makes more sense to set someone to a class rather than
* immortal level of course). It also makes more sense to set someone * adding to the class number. -gg */
* to a class rather than adding to the class number. -gg
*/
case APPLY_LEVEL: case APPLY_LEVEL:
/* ??? GET_LEVEL(ch) += mod; */ /* ??? GET_LEVEL(ch) += mod; */
break; break;
@ -227,10 +221,8 @@ void affect_modify(struct char_data *ch, byte loc, sbyte mod,
} /* switch */ } /* switch */
} }
/* This updates a character by subtracting everything he is affected by
* restoring original abilities, and then affecting all again. */
/* This updates a character by subtracting everything he is affected by */
/* restoring original abilities, and then affecting all again */
void affect_total(struct char_data *ch) void affect_total(struct char_data *ch)
{ {
struct affected_type *af; struct affected_type *af;
@ -258,12 +250,10 @@ void affect_total(struct char_data *ch)
GET_OBJ_AFFECT(GET_EQ(ch, i)), TRUE); GET_OBJ_AFFECT(GET_EQ(ch, i)), TRUE);
} }
for (af = ch->affected; af; af = af->next) for (af = ch->affected; af; af = af->next)
affect_modify(ch, af->location, af->modifier, af->bitvector, TRUE); affect_modify(ch, af->location, af->modifier, af->bitvector, TRUE);
/* Make certain values are between 0..25, not < 0 and not > 25! */ /* Make certain values are between 0..25, not < 0 and not > 25! */
i = (IS_NPC(ch) || GET_LEVEL(ch) >= LVL_GRGOD) ? 25 : 18; i = (IS_NPC(ch) || GET_LEVEL(ch) >= LVL_GRGOD) ? 25 : 18;
GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), i)); GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), i));
@ -284,10 +274,8 @@ void affect_total(struct char_data *ch)
} }
} }
/* Insert an affect_type in a char_data structure. Automatically sets
* apropriate bits and apply's */
/* Insert an affect_type in a char_data structure
Automatically sets apropriate bits and apply's */
void affect_to_char(struct char_data *ch, struct affected_type *af) void affect_to_char(struct char_data *ch, struct affected_type *af)
{ {
struct affected_type *affected_alloc; struct affected_type *affected_alloc;
@ -302,13 +290,9 @@ void affect_to_char(struct char_data *ch, struct affected_type *af)
affect_total(ch); affect_total(ch);
} }
/* Remove an affected_type structure from a char (called when duration reaches
* zero). Pointer *af must never be NIL! Frees mem and calls
/* * affect_location_apply */
* Remove an affected_type structure from a char (called when duration
* reaches zero). Pointer *af must never be NIL! Frees mem and calls
* affect_location_apply
*/
void affect_remove(struct char_data *ch, struct affected_type *af) void affect_remove(struct char_data *ch, struct affected_type *af)
{ {
struct affected_type *temp; struct affected_type *temp;
@ -324,8 +308,6 @@ void affect_remove(struct char_data *ch, struct affected_type *af)
affect_total(ch); affect_total(ch);
} }
/* Call affect_remove with every spell of spelltype "skill" */ /* Call affect_remove with every spell of spelltype "skill" */
void affect_from_char(struct char_data *ch, int type) void affect_from_char(struct char_data *ch, int type)
{ {
@ -338,12 +320,8 @@ void affect_from_char(struct char_data *ch, int type)
} }
} }
/* Return TRUE if a char is affected by a spell (SPELL_XXX), FALSE indicates
* not affected. */
/*
* Return TRUE if a char is affected by a spell (SPELL_XXX),
* FALSE indicates not affected.
*/
bool affected_by_spell(struct char_data *ch, int type) bool affected_by_spell(struct char_data *ch, int type)
{ {
struct affected_type *hjp; struct affected_type *hjp;
@ -355,8 +333,6 @@ bool affected_by_spell(struct char_data *ch, int type)
return (FALSE); return (FALSE);
} }
void affect_join(struct char_data *ch, struct affected_type *af, void affect_join(struct char_data *ch, struct affected_type *af,
bool add_dur, bool avg_dur, bool add_mod, bool avg_mod) bool add_dur, bool avg_dur, bool add_mod, bool avg_mod)
{ {
@ -386,7 +362,6 @@ void affect_join(struct char_data *ch, struct affected_type *af,
affect_to_char(ch, af); affect_to_char(ch, af);
} }
/* move a player out of a room */ /* move a player out of a room */
void char_from_room(struct char_data *ch) void char_from_room(struct char_data *ch)
{ {
@ -410,7 +385,6 @@ void char_from_room(struct char_data *ch)
ch->next_in_room = NULL; ch->next_in_room = NULL;
} }
/* place a character in a room */ /* place a character in a room */
void char_to_room(struct char_data *ch, room_rnum room) void char_to_room(struct char_data *ch, room_rnum room)
{ {
@ -435,8 +409,7 @@ void char_to_room(struct char_data *ch, room_rnum room)
} }
} }
/* Give an object to a char. */
/* give an object to a char */
void obj_to_char(struct obj_data *object, struct char_data *ch) void obj_to_char(struct obj_data *object, struct char_data *ch)
{ {
if (object && ch) { if (object && ch) {
@ -454,7 +427,6 @@ void obj_to_char(struct obj_data *object, struct char_data *ch)
log("SYSERR: NULL obj (%p) or char (%p) passed to obj_to_char.", object, ch); log("SYSERR: NULL obj (%p) or char (%p) passed to obj_to_char.", object, ch);
} }
/* take an object from a char */ /* take an object from a char */
void obj_from_char(struct obj_data *object) void obj_from_char(struct obj_data *object)
{ {
@ -476,8 +448,6 @@ void obj_from_char(struct obj_data *object)
object->next_content = NULL; object->next_content = NULL;
} }
/* Return the effect of a piece of armor in position eq_pos */ /* Return the effect of a piece of armor in position eq_pos */
int apply_ac(struct char_data *ch, int eq_pos) int apply_ac(struct char_data *ch, int eq_pos)
{ {
@ -573,8 +543,6 @@ void equip_char(struct char_data *ch, struct obj_data *obj, int pos)
affect_total(ch); affect_total(ch);
} }
struct obj_data *unequip_char(struct char_data *ch, int pos) struct obj_data *unequip_char(struct char_data *ch, int pos)
{ {
int j; int j;
@ -611,7 +579,6 @@ struct obj_data *unequip_char(struct char_data *ch, int pos)
return (obj); return (obj);
} }
int get_number(char **name) int get_number(char **name)
{ {
int i; int i;
@ -634,8 +601,6 @@ int get_number(char **name)
return (1); return (1);
} }
/* Search a given list for an object number, and return a ptr to that obj */ /* Search a given list for an object number, and return a ptr to that obj */
struct obj_data *get_obj_in_list_num(int num, struct obj_data *list) struct obj_data *get_obj_in_list_num(int num, struct obj_data *list)
{ {
@ -648,8 +613,6 @@ struct obj_data *get_obj_in_list_num(int num, struct obj_data *list)
return (NULL); return (NULL);
} }
/* search the entire world for an object number, and return a pointer */ /* search the entire world for an object number, and return a pointer */
struct obj_data *get_obj_num(obj_rnum nr) struct obj_data *get_obj_num(obj_rnum nr)
{ {
@ -662,8 +625,6 @@ struct obj_data *get_obj_num(obj_rnum nr)
return (NULL); return (NULL);
} }
/* search a room for a char, and return a pointer if found.. */ /* search a room for a char, and return a pointer if found.. */
struct char_data *get_char_room(char *name, int *number, room_rnum room) struct char_data *get_char_room(char *name, int *number, room_rnum room)
{ {
@ -686,8 +647,6 @@ struct char_data *get_char_room(char *name, int *number, room_rnum room)
return (NULL); return (NULL);
} }
/* search all over the world for a char num, and return a pointer if found */ /* search all over the world for a char num, and return a pointer if found */
struct char_data *get_char_num(mob_rnum nr) struct char_data *get_char_num(mob_rnum nr)
{ {
@ -700,8 +659,6 @@ struct char_data *get_char_num(mob_rnum nr)
return (NULL); return (NULL);
} }
/* put an object in a room */ /* put an object in a room */
void obj_to_room(struct obj_data *object, room_rnum room) void obj_to_room(struct obj_data *object, room_rnum room)
{ {
@ -718,7 +675,6 @@ void obj_to_room(struct obj_data *object, room_rnum room)
} }
} }
/* Take an object from a room */ /* Take an object from a room */
void obj_from_room(struct obj_data *object) void obj_from_room(struct obj_data *object)
{ {
@ -738,7 +694,6 @@ void obj_from_room(struct obj_data *object)
object->next_content = NULL; object->next_content = NULL;
} }
/* put an object in an object (quaint) */ /* put an object in an object (quaint) */
void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to) void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to)
{ {
@ -753,17 +708,20 @@ void obj_to_obj(struct obj_data *obj, struct obj_data *obj_to)
obj->next_content = obj_to->contains; obj->next_content = obj_to->contains;
obj_to->contains = obj; obj_to->contains = obj;
obj->in_obj = obj_to; obj->in_obj = obj_to;
tmp_obj = obj->in_obj;
for (tmp_obj = obj->in_obj; tmp_obj->in_obj; tmp_obj = tmp_obj->in_obj) /* Add weight to container, unless unlimited. */
if (GET_OBJ_VAL(obj->in_obj, 0) > 0) {
for (tmp_obj = obj->in_obj; tmp_obj->in_obj; tmp_obj = tmp_obj->in_obj)
GET_OBJ_WEIGHT(tmp_obj) += GET_OBJ_WEIGHT(obj);
/* top level object. Subtract weight from inventory if necessary. */
GET_OBJ_WEIGHT(tmp_obj) += GET_OBJ_WEIGHT(obj); GET_OBJ_WEIGHT(tmp_obj) += GET_OBJ_WEIGHT(obj);
if (tmp_obj->carried_by)
/* top level object. Subtract weight from inventory if necessary. */ IS_CARRYING_W(tmp_obj->carried_by) += GET_OBJ_WEIGHT(obj);
GET_OBJ_WEIGHT(tmp_obj) += GET_OBJ_WEIGHT(obj); }
if (tmp_obj->carried_by)
IS_CARRYING_W(tmp_obj->carried_by) += GET_OBJ_WEIGHT(obj);
} }
/* remove an object from an object */ /* remove an object from an object */
void obj_from_obj(struct obj_data *obj) void obj_from_obj(struct obj_data *obj)
{ {
@ -774,22 +732,23 @@ void obj_from_obj(struct obj_data *obj)
return; return;
} }
obj_from = obj->in_obj; obj_from = obj->in_obj;
temp = obj->in_obj;
REMOVE_FROM_LIST(obj, obj_from->contains, next_content); REMOVE_FROM_LIST(obj, obj_from->contains, next_content);
/* Subtract weight from containers container */ /* Subtract weight from containers container unless unlimited. */
for (temp = obj->in_obj; temp->in_obj; temp = temp->in_obj) if (GET_OBJ_VAL(obj->in_obj, 0) > 0) {
for (temp = obj->in_obj; temp->in_obj; temp = temp->in_obj)
GET_OBJ_WEIGHT(temp) -= GET_OBJ_WEIGHT(obj);
/* Subtract weight from char that carries the object */
GET_OBJ_WEIGHT(temp) -= GET_OBJ_WEIGHT(obj); GET_OBJ_WEIGHT(temp) -= GET_OBJ_WEIGHT(obj);
if (temp->carried_by)
/* Subtract weight from char that carries the object */ IS_CARRYING_W(temp->carried_by) -= GET_OBJ_WEIGHT(obj);
GET_OBJ_WEIGHT(temp) -= GET_OBJ_WEIGHT(obj); }
if (temp->carried_by)
IS_CARRYING_W(temp->carried_by) -= GET_OBJ_WEIGHT(obj);
obj->in_obj = NULL; obj->in_obj = NULL;
obj->next_content = NULL; obj->next_content = NULL;
} }
/* Set all carried_by to point to new owner */ /* Set all carried_by to point to new owner */
void object_list_new_owner(struct obj_data *list, struct char_data *ch) void object_list_new_owner(struct obj_data *list, struct char_data *ch)
{ {
@ -982,7 +941,6 @@ void extract_char_final(struct char_data *ch)
free_char(ch); free_char(ch);
} }
/* Why do we do this? Because trying to iterate over the character list with /* Why do we do this? Because trying to iterate over the character list with
* 'ch = ch->next' does bad things if the current character happens to die. The * 'ch = ch->next' does bad things if the current character happens to die. The
* trivial workaround of 'vict = next_vict' doesn't work if the _next_ person * trivial workaround of 'vict = next_vict' doesn't work if the _next_ person
@ -991,7 +949,7 @@ void extract_char_final(struct char_data *ch)
* really confused otherwise. */ * really confused otherwise. */
void extract_char(struct char_data *ch) void extract_char(struct char_data *ch)
{ {
char_from_chair(ch); char_from_furniture(ch);
if (IS_NPC(ch)) if (IS_NPC(ch))
SET_BIT(MOB_FLAGS(ch), MOB_NOTDEADYET); SET_BIT(MOB_FLAGS(ch), MOB_NOTDEADYET);

View file

@ -24,7 +24,7 @@
#define NUM_AFF_FLAGS 22 #define NUM_AFF_FLAGS 22
#define NUM_ATTACK_TYPES 15 #define NUM_ATTACK_TYPES 15
#define NUM_ITEM_TYPES 25 #define NUM_ITEM_TYPES 24
#define NUM_ITEM_FLAGS 17 #define NUM_ITEM_FLAGS 17
#define NUM_ITEM_WEARS 15 #define NUM_ITEM_WEARS 15
#define NUM_APPLIES 25 #define NUM_APPLIES 25
@ -36,8 +36,8 @@
#define NUM_SHOP_FLAGS 3 #define NUM_SHOP_FLAGS 3
#define NUM_TRADERS 7 #define NUM_TRADERS 7
#define MAX_PEOPLE_IN_CHAIR 10 /* The maximum number of people you want #define MAX_PEOPLE 10 /* Max # of people you want to sit in furniture. */
to sit in a chair at the same time. */
/* Limit information. */ /* Limit information. */
#define MAX_ROOM_NAME 75 #define MAX_ROOM_NAME 75
#define MAX_MOB_NAME 50 #define MAX_MOB_NAME 50

View file

@ -443,11 +443,11 @@ void oedit_disp_val1_menu(struct descriptor_data *d)
write_to_output(d, "Apply to AC : "); write_to_output(d, "Apply to AC : ");
break; break;
case ITEM_CONTAINER: case ITEM_CONTAINER:
write_to_output(d, "Max weight to contain : "); write_to_output(d, "Max weight to contain (-1 for unlimited) : ");
break; break;
case ITEM_DRINKCON: case ITEM_DRINKCON:
case ITEM_FOUNTAIN: case ITEM_FOUNTAIN:
write_to_output(d, "Max drink units : "); write_to_output(d, "Max drink units (-1 for unlimited) : ");
break; break;
case ITEM_FOOD: case ITEM_FOOD:
write_to_output(d, "Hours to fill stomach : "); write_to_output(d, "Hours to fill stomach : ");
@ -457,8 +457,8 @@ void oedit_disp_val1_menu(struct descriptor_data *d)
break; break;
case ITEM_NOTE: case ITEM_NOTE:
break; break;
case ITEM_CHAIR: case ITEM_FURNITURE:
write_to_output(d, "Number of people the chair can hold : "); write_to_output(d, "Number of people it can hold : ");
break; break;
default: default:
oedit_disp_menu(d); oedit_disp_menu(d);
@ -946,8 +946,8 @@ void oedit_parse(struct descriptor_data *d, char *arg)
case OEDIT_VALUE_1: case OEDIT_VALUE_1:
number = atoi(arg); number = atoi(arg);
switch (GET_OBJ_TYPE(OLC_OBJ(d))) { switch (GET_OBJ_TYPE(OLC_OBJ(d))) {
case ITEM_CHAIR: case ITEM_FURNITURE:
if (number < 0 || number > MAX_PEOPLE_IN_CHAIR) if (number < 0 || number > MAX_PEOPLE)
oedit_disp_val1_menu(d); oedit_disp_val1_menu(d);
else { else {
GET_OBJ_VAL(OLC_OBJ(d), 0) = number; GET_OBJ_VAL(OLC_OBJ(d), 0) = number;
@ -958,7 +958,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
GET_OBJ_VAL(OLC_OBJ(d), 0) = MIN(MAX(atoi(arg), -50), 50); GET_OBJ_VAL(OLC_OBJ(d), 0) = MIN(MAX(atoi(arg), -50), 50);
break; break;
case ITEM_CONTAINER: case ITEM_CONTAINER:
GET_OBJ_VAL(OLC_OBJ(d), 0) = LIMIT(atoi(arg), 0, MAX_CONTAINER_SIZE); GET_OBJ_VAL(OLC_OBJ(d), 0) = LIMIT(atoi(arg), -1, MAX_CONTAINER_SIZE);
break; break;
default: default:
GET_OBJ_VAL(OLC_OBJ(d), 0) = atoi(arg); GET_OBJ_VAL(OLC_OBJ(d), 0) = atoi(arg);

View file

@ -294,8 +294,8 @@
#define ITEM_WAND 3 /* Item is a wand */ #define ITEM_WAND 3 /* Item is a wand */
#define ITEM_STAFF 4 /* Item is a staff */ #define ITEM_STAFF 4 /* Item is a staff */
#define ITEM_WEAPON 5 /* Item is a weapon */ #define ITEM_WEAPON 5 /* Item is a weapon */
#define ITEM_FIREWEAPON 6 /* Unimplemented */ #define ITEM_FURNITURE 6 /* Sittable Furniture */
#define ITEM_MISSILE 7 /* Unimplemented */ #define ITEM_UNDEFINED 7 /* Unimplemented */
#define ITEM_TREASURE 8 /* Item is a treasure, not gold */ #define ITEM_TREASURE 8 /* Item is a treasure, not gold */
#define ITEM_ARMOR 9 /* Item is armor */ #define ITEM_ARMOR 9 /* Item is armor */
#define ITEM_POTION 10 /* Item is a potion */ #define ITEM_POTION 10 /* Item is a potion */
@ -312,7 +312,6 @@
#define ITEM_PEN 21 /* Item is a pen */ #define ITEM_PEN 21 /* Item is a pen */
#define ITEM_BOAT 22 /* Item is a boat */ #define ITEM_BOAT 22 /* Item is a boat */
#define ITEM_FOUNTAIN 23 /* Item is a fountain */ #define ITEM_FOUNTAIN 23 /* Item is a fountain */
#define ITEM_CHAIR 24 /* Item is a chair */
/* Take/Wear flags: used by obj_data.obj_flags.wear_flags */ /* Take/Wear flags: used by obj_data.obj_flags.wear_flags */
#define ITEM_WEAR_TAKE (1 << 0) /* Item can be taken */ #define ITEM_WEAR_TAKE (1 << 0) /* Item can be taken */
@ -747,8 +746,8 @@ struct char_special_data_saved {
struct char_special_data { struct char_special_data {
struct char_data *fighting; /* Opponent */ struct char_data *fighting; /* Opponent */
struct char_data *hunting; /* Char hunted by this char */ struct char_data *hunting; /* Char hunted by this char */
struct obj_data *chair; /* Object the char is sitting in */ struct obj_data *furniture; /* Object the char is sitting in */
struct char_data *next_in_chair; /* The next person in the chair */ struct char_data *next_in_furniture; /* The next person sitting */
byte position; /* Standing, fighting, sleeping, etc. */ byte position; /* Standing, fighting, sleeping, etc. */

View file

@ -611,6 +611,7 @@ int count_color_chars(char *string)
} }
return num; return num;
} }
/* Rules (unless overridden by ROOM_DARK): Inside and City rooms are always /* Rules (unless overridden by ROOM_DARK): Inside and City rooms are always
* lit. Outside rooms are dark at sunset and night. */ * lit. Outside rooms are dark at sunset and night. */
int room_is_dark(room_rnum room) int room_is_dark(room_rnum room)
@ -663,24 +664,24 @@ int levenshtein_distance(char *s1, char *s2)
return k; return k;
} }
void char_from_chair(struct char_data *ch) void char_from_furniture(struct char_data *ch)
{ {
struct obj_data *chair; struct obj_data *furniture;
struct char_data *tempch; struct char_data *tempch;
int i, found = 0; int i, found = 0;
if (!SITTING(ch)) if (!SITTING(ch))
return; return;
if (!(chair = SITTING(ch))){ if (!(furniture = SITTING(ch))){
log("SYSERR: ACK, no chair for char in char from chair"); log("SYSERR: No furniture for char in char_from_furniture.");
SITTING(ch) = NULL; SITTING(ch) = NULL;
NEXT_SITTING(ch) = NULL; NEXT_SITTING(ch) = NULL;
return; return;
} }
if (!(tempch = OBJ_SAT_IN_BY(chair))){ if (!(tempch = OBJ_SAT_IN_BY(furniture))){
log("SYSERR: Char from chair, but no chair!"); log("SYSERR: Char from furniture, but no furniture!");
SITTING(ch) = NULL; SITTING(ch) = NULL;
NEXT_SITTING(ch) = NULL; NEXT_SITTING(ch) = NULL;
return; return;
@ -688,28 +689,28 @@ void char_from_chair(struct char_data *ch)
if (tempch == ch){ if (tempch == ch){
if (!NEXT_SITTING(ch)) if (!NEXT_SITTING(ch))
OBJ_SAT_IN_BY(chair) = NULL; OBJ_SAT_IN_BY(furniture) = NULL;
else else
OBJ_SAT_IN_BY(chair) = NEXT_SITTING(ch); OBJ_SAT_IN_BY(furniture) = NEXT_SITTING(ch);
GET_OBJ_VAL(chair, 1) -= 1; GET_OBJ_VAL(furniture, 1) -= 1;
SITTING(ch) = NULL; SITTING(ch) = NULL;
NEXT_SITTING(ch) = NULL; NEXT_SITTING(ch) = NULL;
return; return;
} }
for (i = 0; i < GET_OBJ_VAL(chair, 1) && found == 0; i++){ for (i = 0; i < GET_OBJ_VAL(furniture, 1) && found == 0; i++){
if (NEXT_SITTING(tempch) == ch){ if (NEXT_SITTING(tempch) != ch){
NEXT_SITTING(tempch) = NEXT_SITTING(ch); NEXT_SITTING(tempch) = NEXT_SITTING(ch);
found++; found++;
} }
} }
if (found) if (found)
log("SYSERR: Char flagged as sitting, but not in chair"); log("SYSERR: Char flagged as sitting, but not in furniture.");
else else
GET_OBJ_VAL(chair, 1) -= 1; GET_OBJ_VAL(furniture, 1) -= 1;
SITTING(ch) = NULL; SITTING(ch) = NULL;
NEXT_SITTING(ch) = NULL; NEXT_SITTING(ch) = NULL;
return; return;
} }

View file

@ -91,9 +91,9 @@ void gain_condition(struct char_data *ch, int condition, int value);
void point_update(void); void point_update(void);
void update_pos(struct char_data *victim); void update_pos(struct char_data *victim);
void char_from_chair(struct char_data *ch); void char_from_furniture(struct char_data *ch);
#define SITTING(ch) ((ch)->char_specials.chair) #define SITTING(ch) ((ch)->char_specials.furniture)
#define NEXT_SITTING(ch) ((ch)->char_specials.next_in_chair) #define NEXT_SITTING(ch) ((ch)->char_specials.next_in_furniture)
#define OBJ_SAT_IN_BY(obj) ((obj)->sitting_here) #define OBJ_SAT_IN_BY(obj) ((obj)->sitting_here)
/* various constants */ /* various constants */