Resolved bug #89: Identical defines in codebase.

- GET_OBJ_PERM has been removed in favor of GET_OBJ_AFFECT.

Implemented idea #55: Mail stamp cost.
- Postmaster no longer mentions stamp price for immortals.
This commit is contained in:
wyld-sw 2015-08-05 12:48:22 -04:00
parent b0cb9aa549
commit 1e8dd801e3
7 changed files with 30 additions and 32 deletions

View file

@ -1886,10 +1886,10 @@ char *parse_object(FILE *obj_f, int nr)
GET_OBJ_WEAR(obj_proto + i)[1] = 0;
GET_OBJ_WEAR(obj_proto + i)[2] = 0;
GET_OBJ_WEAR(obj_proto + i)[3] = 0;
GET_OBJ_PERM(obj_proto + i)[0] = asciiflag_conv_aff(f3);
GET_OBJ_PERM(obj_proto + i)[1] = 0;
GET_OBJ_PERM(obj_proto + i)[2] = 0;
GET_OBJ_PERM(obj_proto + i)[3] = 0;
GET_OBJ_AFFECT(obj_proto + i)[0] = asciiflag_conv_aff(f3);
GET_OBJ_AFFECT(obj_proto + i)[1] = 0;
GET_OBJ_AFFECT(obj_proto + i)[2] = 0;
GET_OBJ_AFFECT(obj_proto + i)[3] = 0;
if(bitsavetodisk) {
add_to_save_list(zone_table[real_zone_by_thing(nr)].number, 1);
@ -1907,10 +1907,10 @@ char *parse_object(FILE *obj_f, int nr)
GET_OBJ_WEAR(obj_proto + i)[1] = asciiflag_conv(f6);
GET_OBJ_WEAR(obj_proto + i)[2] = asciiflag_conv(f7);
GET_OBJ_WEAR(obj_proto + i)[3] = asciiflag_conv(f8);
GET_OBJ_PERM(obj_proto + i)[0] = asciiflag_conv(f9);
GET_OBJ_PERM(obj_proto + i)[1] = asciiflag_conv(f10);
GET_OBJ_PERM(obj_proto + i)[2] = asciiflag_conv(f11);
GET_OBJ_PERM(obj_proto + i)[3] = asciiflag_conv(f12);
GET_OBJ_AFFECT(obj_proto + i)[0] = asciiflag_conv(f9);
GET_OBJ_AFFECT(obj_proto + i)[1] = asciiflag_conv(f10);
GET_OBJ_AFFECT(obj_proto + i)[2] = asciiflag_conv(f11);
GET_OBJ_AFFECT(obj_proto + i)[3] = asciiflag_conv(f12);
} else {
log("SYSERR: Format error in first numeric line (expecting 13 args, got %d), %s", retval, buf2);

View file

@ -233,10 +233,10 @@ int save_objects(zone_rnum zone_num)
sprintascii(wbuf2, GET_OBJ_WEAR(obj)[1]);
sprintascii(wbuf3, GET_OBJ_WEAR(obj)[2]);
sprintascii(wbuf4, GET_OBJ_WEAR(obj)[3]);
sprintascii(pbuf1, GET_OBJ_PERM(obj)[0]);
sprintascii(pbuf2, GET_OBJ_PERM(obj)[1]);
sprintascii(pbuf3, GET_OBJ_PERM(obj)[2]);
sprintascii(pbuf4, GET_OBJ_PERM(obj)[3]);
sprintascii(pbuf1, GET_OBJ_AFFECT(obj)[0]);
sprintascii(pbuf2, GET_OBJ_AFFECT(obj)[1]);
sprintascii(pbuf3, GET_OBJ_AFFECT(obj)[2]);
sprintascii(pbuf4, GET_OBJ_AFFECT(obj)[3]);
fprintf(fp, "%d %s %s %s %s %s %s %s %s %s %s %s %s\n"
"%d %d %d %d\n"

View file

@ -787,10 +787,10 @@ static int export_save_objects(zone_rnum zrnum)
sprintascii(wbuf2, GET_OBJ_WEAR(obj)[1]);
sprintascii(wbuf3, GET_OBJ_WEAR(obj)[2]);
sprintascii(wbuf4, GET_OBJ_WEAR(obj)[3]);
sprintascii(pbuf1, GET_OBJ_PERM(obj)[0]);
sprintascii(pbuf2, GET_OBJ_PERM(obj)[1]);
sprintascii(pbuf3, GET_OBJ_PERM(obj)[2]);
sprintascii(pbuf4, GET_OBJ_PERM(obj)[3]);
sprintascii(pbuf1, GET_OBJ_AFFECT(obj)[0]);
sprintascii(pbuf2, GET_OBJ_AFFECT(obj)[1]);
sprintascii(pbuf3, GET_OBJ_AFFECT(obj)[2]);
sprintascii(pbuf4, GET_OBJ_AFFECT(obj)[3]);
fprintf(obj_file,
"%d %s %s %s %s %s %s %s %s %s %s %s %s\n",

View file

@ -301,14 +301,14 @@ static void postmaster_send_mail(struct char_data *ch, struct char_data *mailman
return;
}
act("$n starts to write some mail.", TRUE, ch, 0, 0, TO_ROOM);
snprintf(buf, sizeof(buf), "$n tells you, 'I'll take %d coins for the stamp.'\r\n"
"$n tells you, 'Write your message. (/s saves /h for help).'",
STAMP_PRICE);
act(buf, FALSE, mailman, 0, ch, TO_VICT);
if (GET_LEVEL(ch) < LVL_IMMORT)
if (GET_LEVEL(ch) < LVL_IMMORT) {
snprintf(buf, sizeof(buf), "$n tells you, 'I'll take %d coins for the stamp.'", STAMP_PRICE);
act(buf, FALSE, mailman, 0, ch, TO_VICT);
decrease_gold(ch, STAMP_PRICE);
}
act("$n tells you, 'Write your message. (/s saves /h for help).'", FALSE, mailman, 0, ch, TO_VICT);
SET_BIT_AR(PLR_FLAGS(ch), PLR_MAILING); /* string_write() sets writing. */

View file

@ -116,7 +116,7 @@ int objsave_save_obj_record(struct obj_data *obj, FILE *fp, int locate)
if (TEST_OBJN(cost_per_day))
fprintf(fp, "Rent: %d\n", GET_OBJ_RENT(obj));
if (TEST_OBJN(bitvector))
fprintf(fp, "Perm: %d %d %d %d\n", GET_OBJ_PERM(obj)[0], GET_OBJ_PERM(obj)[1], GET_OBJ_PERM(obj)[2], GET_OBJ_PERM(obj)[3]);
fprintf(fp, "Perm: %d %d %d %d\n", GET_OBJ_AFFECT(obj)[0], GET_OBJ_AFFECT(obj)[1], GET_OBJ_AFFECT(obj)[2], GET_OBJ_AFFECT(obj)[3]);
if (TEST_OBJN(wear_flags))
fprintf(fp, "Wear: %d %d %d %d\n", GET_OBJ_WEAR(obj)[0], GET_OBJ_WEAR(obj)[1], GET_OBJ_WEAR(obj)[2], GET_OBJ_WEAR(obj)[3]);
@ -1131,10 +1131,10 @@ obj_save_data *objsave_parse_objects(FILE *fl)
case 'P':
if (!strcmp(tag, "Perm")) {
sscanf(line, "%s %s %s %s", f1, f2, f3, f4);
GET_OBJ_PERM(temp)[0] = asciiflag_conv(f1);
GET_OBJ_PERM(temp)[1] = asciiflag_conv(f2);
GET_OBJ_PERM(temp)[2] = asciiflag_conv(f3);
GET_OBJ_PERM(temp)[3] = asciiflag_conv(f4);
GET_OBJ_AFFECT(temp)[0] = asciiflag_conv(f1);
GET_OBJ_AFFECT(temp)[1] = asciiflag_conv(f2);
GET_OBJ_AFFECT(temp)[2] = asciiflag_conv(f3);
GET_OBJ_AFFECT(temp)[3] = asciiflag_conv(f4);
}
break;
case 'R':

View file

@ -587,7 +587,7 @@ static void oedit_disp_perm_menu(struct descriptor_data *d)
for (counter = 1; counter < NUM_AFF_FLAGS; counter++) {
write_to_output(d, "%s%2d%s) %-20.20s %s", grn, counter, nrm, affected_bits[counter], !(++columns % 2) ? "\r\n" : "");
}
sprintbitarray(GET_OBJ_PERM(OLC_OBJ(d)), affected_bits, EF_ARRAY_MAX, bits);
sprintbitarray(GET_OBJ_AFFECT(OLC_OBJ(d)), affected_bits, EF_ARRAY_MAX, bits);
write_to_output(d, "\r\nObject permanent flags: %s%s%s\r\n"
"Enter object perm flag (0 to quit) : ", cyn, bits, nrm);
}
@ -645,7 +645,7 @@ static void oedit_disp_menu(struct descriptor_data *d)
);
/* Send first half then build second half of menu. */
sprintbitarray(GET_OBJ_WEAR(OLC_OBJ(d)), wear_bits, EF_ARRAY_MAX, buf1);
sprintbitarray(GET_OBJ_PERM(OLC_OBJ(d)), affected_bits, EF_ARRAY_MAX, buf2);
sprintbitarray(GET_OBJ_AFFECT(OLC_OBJ(d)), affected_bits, EF_ARRAY_MAX, buf2);
write_to_output(d,
"%s7%s) Wear flags : %s%s\r\n"
@ -935,7 +935,7 @@ void oedit_parse(struct descriptor_data *d, char *arg)
if (number > 0 && number <= NUM_AFF_FLAGS) {
/* Setting AFF_CHARM on objects like this is dangerous. */
if (number != AFF_CHARM) {
TOGGLE_BIT_AR(GET_OBJ_PERM(OLC_OBJ(d)), number);
TOGGLE_BIT_AR(GET_OBJ_AFFECT(OLC_OBJ(d)), number);
}
}
oedit_disp_perm_menu(d);

View file

@ -697,8 +697,6 @@ do \
/** Level of obj. */
#define GET_OBJ_LEVEL(obj) ((obj)->obj_flags.level)
/** Permanent affects on obj. */
#define GET_OBJ_PERM(obj) ((obj)->obj_flags.bitvector)
/** Type of obj. */
#define GET_OBJ_TYPE(obj) ((obj)->obj_flags.type_flag)
/** Cost of obj. */