Remove hitroll/damroll

This commit is contained in:
kinther 2025-09-30 07:00:54 -07:00
parent 874422ac0b
commit cb59bf0315
35 changed files with 133 additions and 3636 deletions

View file

@ -47,6 +47,7 @@ $%.o: %.c
clean:
rm -f *.o depend
rm -f ./tests/*.o depend
# Dependencies for the object files (automagically generated with
# gcc -MM)

View file

@ -1238,9 +1238,8 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
CCCYN(ch, C_NRM), CCYEL(ch, C_NRM), GET_SCREEN_WIDTH(k), CCNRM(ch, C_NRM),
CCYEL(ch, C_NRM), GET_PAGE_LENGTH(k), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM));
send_to_char(ch, "AC: [%d%+d/10], Hitroll: [%2d], Damroll: [%2d], Saving throws: [%d/%d/%d/%d/%d]\r\n",
GET_AC(k), dex_app[GET_DEX(k)].defensive, k->points.hitroll,
k->points.damroll, GET_SAVE(k, 0), GET_SAVE(k, 1), GET_SAVE(k, 2),
send_to_char(ch, "AC: [%d%+d/10], Saving throws: [%d/%d/%d/%d/%d]\r\n",
GET_AC(k), dex_app[GET_DEX(k)].defensive, GET_SAVE(k, 0), GET_SAVE(k, 1), GET_SAVE(k, 2),
GET_SAVE(k, 3), GET_SAVE(k, 4));
sprinttype(GET_POS(k), position_types, buf, sizeof(buf));
@ -3228,7 +3227,6 @@ static struct set_struct {
{ "class", LVL_BUILDER, BOTH, MISC },
{ "color", LVL_GOD, PC, BINARY },
{ "con", LVL_BUILDER, BOTH, NUMBER },
{ "damroll", LVL_BUILDER, BOTH, NUMBER }, /* 10 */
{ "deleted", LVL_IMPL, PC, BINARY },
{ "dex", LVL_BUILDER, BOTH, NUMBER },
{ "drunk", LVL_BUILDER, BOTH, MISC },
@ -3237,7 +3235,6 @@ static struct set_struct {
{ "gold", LVL_BUILDER, BOTH, NUMBER },
{ "height", LVL_BUILDER, BOTH, NUMBER },
{ "hitpoints", LVL_BUILDER, BOTH, NUMBER },
{ "hitroll", LVL_BUILDER, BOTH, NUMBER },
{ "hunger", LVL_BUILDER, BOTH, MISC }, /* 20 */
{ "int", LVL_BUILDER, BOTH, NUMBER },
{ "invis", LVL_GOD, PC, NUMBER },
@ -3374,14 +3371,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.con = value;
affect_total(vict);
break;
case 10: /* damroll */
vict->points.damroll = RANGE(-20, 20);
affect_total(vict);
break;
case 11: /* delete */
case 10: /* delete */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_DELETED);
break;
case 12: /* dex */
case 11: /* dex */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3389,7 +3382,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.dex = value;
affect_total(vict);
break;
case 13: /* drunk */
case 12: /* drunk */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, DRUNK) = -1;
send_to_char(ch, "%s's drunkenness is now off.\r\n", GET_NAME(vict));
@ -3403,32 +3396,28 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 14: /* exp */
case 13: /* exp */
vict->points.exp = RANGE(0, 50000000);
break;
case 15: /* frozen */
case 14: /* frozen */
if (ch == vict && on) {
send_to_char(ch, "Better not -- could be a long winter!\r\n");
return (0);
}
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_FROZEN);
break;
case 16: /* gold */
case 15: /* gold */
GET_GOLD(vict) = RANGE(0, 100000000);
break;
case 17: /* height */
case 16: /* height */
GET_HEIGHT(vict) = value;
affect_total(vict);
break;
case 18: /* hit */
case 17: /* hit */
vict->points.hit = RANGE(-9, vict->points.max_hit);
affect_total(vict);
break;
case 19: /* hitroll */
vict->points.hitroll = RANGE(-20, 20);
affect_total(vict);
break;
case 20: /* hunger */
case 18: /* hunger */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, HUNGER) = -1;
send_to_char(ch, "%s's hunger is now off.\r\n", GET_NAME(vict));
@ -3442,7 +3431,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 21: /* int */
case 19: /* int */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3450,20 +3439,20 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.intel = value;
affect_total(vict);
break;
case 22: /* invis */
case 20: /* invis */
if (GET_LEVEL(ch) < LVL_IMPL && ch != vict) {
send_to_char(ch, "You aren't godly enough for that!\r\n");
return (0);
}
GET_INVIS_LEV(vict) = RANGE(0, GET_LEVEL(vict));
break;
case 23: /* invistart */
case 21: /* invistart */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_INVSTART);
break;
case 24: /* killer */
case 22: /* killer */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_KILLER);
break;
case 25: /* level */
case 23: /* level */
if ((!IS_NPC(vict) && value > GET_LEVEL(ch)) || value > LVL_IMPL) {
send_to_char(ch, "You can't do that.\r\n");
return (0);
@ -3471,7 +3460,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
RANGE(1, LVL_IMPL);
vict->player.level = value;
break;
case 26: /* loadroom */
case 24: /* loadroom */
if (!str_cmp(val_arg, "off")) {
REMOVE_BIT_AR(PLR_FLAGS(vict), PLR_LOADROOM);
} else if (is_number(val_arg)) {
@ -3489,27 +3478,27 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 27: /* mana */
case 25: /* mana */
vict->points.mana = RANGE(0, vict->points.max_mana);
affect_total(vict);
break;
case 28: /* maxhit */
case 26: /* maxhit */
vict->points.max_hit = RANGE(1, 5000);
affect_total(vict);
break;
case 29: /* maxmana */
case 27: /* maxmana */
vict->points.max_mana = RANGE(1, 5000);
affect_total(vict);
break;
case 30: /* maxmove */
case 28: /* maxmove */
vict->points.max_move = RANGE(1, 5000);
affect_total(vict);
break;
case 31: /* move */
case 29: /* move */
vict->points.move = RANGE(0, vict->points.max_move);
affect_total(vict);
break;
case 32: /* name */
case 30: /* name */
if (ch != vict && GET_LEVEL(ch) < LVL_IMPL) {
send_to_char(ch, "Only Imps can change the name of other players.\r\n");
return (0);
@ -3519,24 +3508,24 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 33: /* nodelete */
case 31: /* nodelete */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NODELETE);
break;
case 34: /* nohassle */
case 32: /* nohassle */
if (GET_LEVEL(ch) < LVL_GOD && ch != vict) {
send_to_char(ch, "You aren't godly enough for that!\r\n");
return (0);
}
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_NOHASSLE);
break;
case 35: /* nosummon */
case 33: /* nosummon */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SUMMONABLE);
send_to_char(ch, "Nosummon %s for %s.\r\n", ONOFF(!on), GET_NAME(vict));
break;
case 36: /* nowiz */
case 34: /* nowiz */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_NOWIZLIST);
break;
case 37: /* olc */
case 35: /* olc */
if (is_abbrev(val_arg, "socials") || is_abbrev(val_arg, "actions") || is_abbrev(val_arg, "aedit"))
GET_OLC_ZONE(vict) = AEDIT_PERMISSION;
else if (is_abbrev(val_arg, "hedit") || is_abbrev(val_arg, "help"))
@ -3551,7 +3540,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
} else
GET_OLC_ZONE(vict) = atoi(val_arg);
break;
case 38: /* password */
case 36: /* password */
if (GET_LEVEL(vict) >= LVL_GRGOD) {
send_to_char(ch, "You cannot change that.\r\n");
return (0);
@ -3560,7 +3549,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
*(GET_PASSWD(vict) + MAX_PWD_LENGTH) = '\0';
send_to_char(ch, "Password changed to '%s'.\r\n", val_arg);
break;
case 39: /* poofin */
case 37: /* poofin */
if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
skip_spaces(&val_arg);
parse_at(val_arg);
@ -3574,7 +3563,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
POOFIN(vict) = strdup(val_arg);
}
break;
case 40: /* poofout */
case 38: /* poofout */
if ((vict == ch) || (GET_LEVEL(ch) == LVL_IMPL)) {
skip_spaces(&val_arg);
parse_at(val_arg);
@ -3588,10 +3577,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
POOFOUT(vict) = strdup(val_arg);
}
break;
case 41: /* quest */
case 39: /* quest */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_QUEST);
break;
case 42: /* room */
case 40: /* room */
if ((rnum = real_room(value)) == NOWHERE) {
send_to_char(ch, "No room exists with that number.\r\n");
return (0);
@ -3600,23 +3589,23 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
char_from_room(vict);
char_to_room(vict, rnum);
break;
case 43: /* screenwidth */
case 41: /* screenwidth */
GET_SCREEN_WIDTH(vict) = RANGE(40, 200);
break;
case 44: /* sex */
case 42: /* sex */
if ((i = search_block(val_arg, genders, FALSE)) < 0) {
send_to_char(ch, "Must be 'male', 'female', or 'neutral'.\r\n");
return (0);
}
GET_SEX(vict) = i;
break;
case 45: /* showvnums */
case 43: /* showvnums */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SHOWVNUMS);
break;
case 46: /* siteok */
case 44: /* siteok */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_SITEOK);
break;
case 47: /* skills/spells */
case 45: /* skills/spells */
{
char local_buf[MAX_INPUT_LENGTH], *value_arg, *name_end;
char skill_name[MAX_INPUT_LENGTH];
@ -3701,7 +3690,7 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
}
break;
case 48: /* str */
case 46: /* str */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3710,16 +3699,16 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.str_add = 0;
affect_total(vict);
break;
case 49: /* stradd */
case 47: /* stradd */
vict->real_abils.str_add = RANGE(0, 100);
if (value > 0)
vict->real_abils.str = 18;
affect_total(vict);
break;
case 50: /* thief */
case 48: /* thief */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_THIEF);
break;
case 51: /* thirst */
case 49: /* thirst */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, THIRST) = -1;
send_to_char(ch, "%s's thirst is now off.\r\n", GET_NAME(vict));
@ -3733,17 +3722,17 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 52: /* title */
case 50: /* title */
set_title(vict, val_arg);
send_to_char(ch, "%s's title is now: %s\r\n", GET_NAME(vict), GET_TITLE(vict));
break;
case 53: /* variable */
case 51: /* variable */
return perform_set_dg_var(ch, vict, val_arg);
case 54: /* weight */
case 52: /* weight */
GET_WEIGHT(vict) = value;
affect_total(vict);
break;
case 55: /* wis */
case 53: /* wis */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3751,10 +3740,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.wis = value;
affect_total(vict);
break;
case 56: /* questpoints */
case 54: /* questpoints */
GET_QUESTPOINTS(vict) = RANGE(0, 100000000);
break;
case 57: /* questhistory */
case 55: /* questhistory */
qvnum = atoi(val_arg);
if (real_quest(qvnum) == NOTHING) {
send_to_char(ch, "That quest doesn't exist.\r\n");
@ -3956,9 +3945,6 @@ ACMD(do_links)
/* Zone Checker Code below */
/*mob limits*/
#define MAX_DAMROLL_ALLOWED MAX(GET_LEVEL(mob)/5, 1)
#define MAX_HITROLL_ALLOWED MAX(GET_LEVEL(mob)/3, 1)
#define MAX_MOB_GOLD_ALLOWED GET_LEVEL(mob)*3000
#define MAX_EXP_ALLOWED GET_LEVEL(mob)*GET_LEVEL(mob) * 120
#define MAX_LEVEL_ALLOWED LVL_IMPL
#define GET_OBJ_AVG_DAM(obj) (((GET_OBJ_VAL(obj, 2) + 1) / 2.0) * GET_OBJ_VAL(obj, 1))
@ -4021,8 +4007,6 @@ static struct zcheck_affs {
{APPLY_GOLD, 0, 0, "gold"},
{APPLY_EXP, 0, 0, "experience"},
{APPLY_AC, -10, 10, "magical AC"},
{APPLY_HITROLL, 0, -99, "hitroll"}, /* Handled seperately below */
{APPLY_DAMROLL, 0, -99, "damroll"}, /* Handled seperately below */
{APPLY_SAVING_PARA, -2, 2, "saving throw (paralysis)"},
{APPLY_SAVING_ROD, -2, 2, "saving throw (rod)"},
{APPLY_SAVING_PETRI,-2, 2, "saving throw (death)"},
@ -4030,10 +4014,6 @@ static struct zcheck_affs {
{APPLY_SAVING_SPELL,-2, 2, "saving throw (spell)"}
};
/* These are ABS() values. */
#define MAX_APPLY_HITROLL_TOTAL 5
#define MAX_APPLY_DAMROLL_TOTAL 5
/*room limits*/
/* Off limit zones are any zones a player should NOT be able to walk to (ex. Limbo) */
static const int offlimit_zones[] = {0,12,13,14,-1}; /*what zones can no room connect to (virtual num) */
@ -4047,7 +4027,7 @@ ACMD (do_zcheck)
struct char_data *mob = NULL;
room_vnum exroom=0;
int ac=0;
int affs=0, tohit, todam, value;
int affs=0, value;
int i = 0, j = 0, k = 0, l = 0, m = 0, found = 0; /* found is used as a 'send now' flag*/
char buf[MAX_STRING_LENGTH];
float avg_dam;
@ -4099,18 +4079,8 @@ ACMD (do_zcheck)
"- Is level %d (limit: 1-%d)\r\n",
GET_LEVEL(mob), MAX_LEVEL_ALLOWED);
if (GET_DAMROLL(mob)>MAX_DAMROLL_ALLOWED && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Damroll of %d is too high (limit: %d)\r\n",
GET_DAMROLL(mob), MAX_DAMROLL_ALLOWED);
if (GET_HITROLL(mob)>MAX_HITROLL_ALLOWED && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Hitroll of %d is too high (limit: %d)\r\n",
GET_HITROLL(mob), MAX_HITROLL_ALLOWED);
/* avg. dam including damroll per round of combat */
avg_dam = (((mob->mob_specials.damsizedice / 2.0) * mob->mob_specials.damnodice)+GET_DAMROLL(mob));
/* avg. dam per round of combat */
avg_dam = (((mob->mob_specials.damsizedice / 2.0)));
if (avg_dam>MAX_MOB_DAM_ALLOWED && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- average damage of %4.1f is too high (limit: %d)\r\n",
@ -4127,12 +4097,6 @@ ACMD (do_zcheck)
len += snprintf(buf + len, sizeof(buf) - len,
"- Both aggresive and agressive to align.\r\n");
if ((GET_GOLD(mob) > MAX_MOB_GOLD_ALLOWED) && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Set to %d Gold (limit : %d).\r\n",
GET_GOLD(mob),
MAX_MOB_GOLD_ALLOWED);
if (GET_EXP(mob)>MAX_EXP_ALLOWED && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- Has %d experience (limit: %d)\r\n",
@ -4265,22 +4229,6 @@ ACMD (do_zcheck)
zaffs[(int)obj->affected[j].location].min_aff,
zaffs[(int)obj->affected[j].location].max_aff);
/* special handling of +hit and +dam because of +hit_n_dam */
for (todam=0, tohit=0, j=0;j<MAX_OBJ_AFFECT;j++) {
if (obj->affected[j].location == APPLY_HITROLL)
tohit += obj->affected[j].modifier;
if (obj->affected[j].location == APPLY_DAMROLL)
todam += obj->affected[j].modifier;
}
if (abs(todam) > MAX_APPLY_DAMROLL_TOTAL && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- total damroll %d out of range (limit +/-%d.\r\n",
todam, MAX_APPLY_DAMROLL_TOTAL);
if (abs(tohit) > MAX_APPLY_HITROLL_TOTAL && (found=1))
len += snprintf(buf + len, sizeof(buf) - len,
"- total hitroll %d out of range (limit +/-%d).\r\n",
tohit, MAX_APPLY_HITROLL_TOTAL);
for (ext2 = NULL, ext = obj->ex_description; ext; ext = ext->next)
if (strncmp(ext->description, " ", 3))

View file

@ -509,8 +509,6 @@ const char *apply_types[] = {
"GOLD",
"EXP",
"ARMOR",
"HITROLL",
"DAMROLL",
"SAVING_PARA",
"SAVING_ROD",
"SAVING_PETRI",

View file

@ -1552,44 +1552,26 @@ static void parse_simple_mob(FILE *mob_f, int i, int nr)
exit(1);
}
if (sscanf(line, " %d %d %d %dd%d+%d %dd%d+%d ",
t, t + 1, t + 2, t + 3, t + 4, t + 5, t + 6, t + 7, t + 8) != 9) {
if (sscanf(line, " %d %dd%d+%d %dd%d ",
t, t + 1, t + 2, t + 3, t + 4, t + 5) != 6) {
log("SYSERR: Format error in mob #%d, first line after S flag\n"
"...expecting line of form '# # # #d#+# #d#+#'", nr);
"...expecting line of form '# #d#+# #d#'", nr);
exit(1);
}
GET_LEVEL(mob_proto + i) = t[0];
GET_HITROLL(mob_proto + i) = 20 - t[1];
GET_AC(mob_proto + i) = 10 * t[2];
/* max hit = 0 is a flag that H, M, V is xdy+z */
GET_MAX_HIT(mob_proto + i) = 0;
GET_HIT(mob_proto + i) = t[3];
GET_MANA(mob_proto + i) = t[4];
GET_MOVE(mob_proto + i) = t[5];
GET_HIT(mob_proto + i) = t[1];
GET_MANA(mob_proto + i) = t[2];
GET_MOVE(mob_proto + i) = t[3];
GET_MAX_MANA(mob_proto + i) = 10;
GET_MAX_MOVE(mob_proto + i) = 50;
mob_proto[i].mob_specials.damnodice = t[6];
mob_proto[i].mob_specials.damsizedice = t[7];
GET_DAMROLL(mob_proto + i) = t[8];
if (!get_line(mob_f, line)) {
log("SYSERR: Format error in mob #%d, second line after S flag\n"
"...expecting line of form '# #', but file ended!", nr);
exit(1);
}
if (sscanf(line, " %d %d ", t, t + 1) != 2) {
log("SYSERR: Format error in mob #%d, second line after S flag\n"
"...expecting line of form '# #'", nr);
exit(1);
}
GET_GOLD(mob_proto + i) = t[0];
GET_EXP(mob_proto + i) = t[1];
mob_proto[i].mob_specials.damnodice = t[4];
mob_proto[i].mob_specials.damsizedice = t[5];
if (!get_line(mob_f, line)) {
log("SYSERR: Format error in last line of mob #%d\n"
@ -3610,6 +3592,7 @@ void clear_char(struct char_data *ch)
GET_POS(ch) = POS_STANDING;
ch->mob_specials.default_pos = POS_STANDING;
ch->events = NULL;
ch->points.prof_mod = 0;
GET_AC(ch) = 100; /* Basic Armor */
if (ch->points.max_mana < 100)

View file

@ -654,13 +654,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
}
break;
case 'd':
if (!str_cmp(field, "damroll")) {
if (subfield && *subfield) {
int addition = atoi(subfield);
GET_DAMROLL(c) = MAX(1, GET_DAMROLL(c) + addition);
}
snprintf(str, slen, "%d", GET_DAMROLL(c));
} else if (!str_cmp(field, "dex")) {
if (!str_cmp(field, "dex")) {
if (subfield && *subfield) {
int addition = atoi(subfield);
int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;
@ -760,13 +754,6 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
}
snprintf(str, slen, "%d", GET_HIT(c));
}
else if (!str_cmp(field, "hitroll")) {
if (subfield && *subfield) {
int addition = atoi(subfield);
GET_HITROLL(c) = MAX(1, GET_HITROLL(c) + addition);
}
snprintf(str, slen, "%d", GET_HITROLL(c));
}
else if (!str_cmp(field, "hunger")) {
if (subfield && *subfield) {
int addition = atoi(subfield);

View file

@ -384,19 +384,16 @@ int write_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
fprintf(fd, "%s", convert_from_tabs(buf));
fprintf(fd, "%d %d %d %d %d %d %d %d %d E\n"
"%d %d %d %dd%d+%d %dd%d+%d\n",
"%d %dd%d+%d %dd%d\n",
MOB_FLAGS(mob)[0], MOB_FLAGS(mob)[1],
MOB_FLAGS(mob)[2], MOB_FLAGS(mob)[3],
AFF_FLAGS(mob)[0], AFF_FLAGS(mob)[1],
AFF_FLAGS(mob)[2], AFF_FLAGS(mob)[3],
GET_ALIGNMENT(mob),
GET_LEVEL(mob), 20 - GET_HITROLL(mob), GET_AC(mob) / 10, GET_HIT(mob),
GET_MANA(mob), GET_MOVE(mob), GET_NDD(mob), GET_SDD(mob),
GET_DAMROLL(mob));
GET_LEVEL(mob), GET_HIT(mob),
GET_MANA(mob), GET_MOVE(mob), GET_NDD(mob), GET_SDD(mob));
fprintf(fd, "%d %d\n"
"%d %d %d\n",
GET_GOLD(mob), GET_EXP(mob),
fprintf(fd, "%d %d %d\n",
GET_POS(mob), GET_DEFAULT_POS(mob), GET_SEX(mob)
);

View file

@ -613,19 +613,16 @@ static int export_mobile_record(mob_vnum mvnum, struct char_data *mob, FILE *fd)
);
fprintf(fd, "%d %d %d %d %d %d %d %d %d E\n"
"%d %d %d %dd%d+%d %dd%d+%d\n",
"%d %dd%d+%d %dd%d\n",
MOB_FLAGS(mob)[0], MOB_FLAGS(mob)[1],
MOB_FLAGS(mob)[2], MOB_FLAGS(mob)[3],
AFF_FLAGS(mob)[0], AFF_FLAGS(mob)[1],
AFF_FLAGS(mob)[2], AFF_FLAGS(mob)[3],
GET_ALIGNMENT(mob),
GET_LEVEL(mob), 20 - GET_HITROLL(mob), GET_AC(mob) / 10, GET_HIT(mob),
GET_MANA(mob), GET_MOVE(mob), GET_NDD(mob), GET_SDD(mob),
GET_DAMROLL(mob));
GET_LEVEL(mob), GET_HIT(mob),
GET_MANA(mob), GET_MOVE(mob), GET_NDD(mob), GET_SDD(mob));
fprintf(fd, "%d %d\n"
"%d %d %d\n",
GET_GOLD(mob), GET_EXP(mob),
fprintf(fd, "%d %d %d\n",
GET_POS(mob), GET_DEFAULT_POS(mob), GET_SEX(mob)
);

View file

@ -171,12 +171,8 @@ static void aff_apply_modify(struct char_data *ch, byte loc, sbyte mod, char *ms
GET_AC(ch) += mod;
break;
case APPLY_HITROLL:
GET_HITROLL(ch) += mod;
break;
case APPLY_DAMROLL:
GET_DAMROLL(ch) += mod;
case APPLY_PROFICIENCY:
GET_PROF_MOD(ch) += mod;
break;
case APPLY_SAVING_PARA:
@ -233,27 +229,37 @@ void affect_total(struct char_data *ch)
struct affected_type *af;
int i, j;
/* First, remove all object-based modifiers. */
for (i = 0; i < NUM_WEARS; i++) {
if (GET_EQ(ch, i))
for (j = 0; j < MAX_OBJ_AFFECT; j++)
affect_modify_ar(ch, GET_EQ(ch, i)->affected[j].location,
GET_EQ(ch, i)->affected[j].modifier,
GET_OBJ_AFFECT(GET_EQ(ch, i)), FALSE);
affect_modify_ar(ch,
GET_EQ(ch, i)->affected[j].location,
GET_EQ(ch, i)->affected[j].modifier,
GET_OBJ_AFFECT(GET_EQ(ch, i)), FALSE);
}
/* Then remove all spell/affect modifiers. */
for (af = ch->affected; af; af = af->next)
affect_modify_ar(ch, af->location, af->modifier, af->bitvector, FALSE);
/* Reset derived abilities to real abilities. */
ch->aff_abils = ch->real_abils;
/* Reset transient modifiers that are re-applied below. */
GET_PROF_MOD(ch) = 0; /* Proficiency delta (from APPLY_PROFICIENCY) */
/* Re-apply object-based modifiers. */
for (i = 0; i < NUM_WEARS; i++) {
if (GET_EQ(ch, i))
for (j = 0; j < MAX_OBJ_AFFECT; j++)
affect_modify_ar(ch, GET_EQ(ch, i)->affected[j].location,
GET_EQ(ch, i)->affected[j].modifier,
GET_OBJ_AFFECT(GET_EQ(ch, i)), TRUE);
affect_modify_ar(ch,
GET_EQ(ch, i)->affected[j].location,
GET_EQ(ch, i)->affected[j].modifier,
GET_OBJ_AFFECT(GET_EQ(ch, i)), TRUE);
}
/* Re-apply spell/affect modifiers. */
for (af = ch->affected; af; af = af->next)
affect_modify_ar(ch, af->location, af->modifier, af->bitvector, TRUE);

View file

@ -339,7 +339,7 @@ void mag_affects(int level, struct char_data *ch, struct char_data *victim,
break;
case SPELL_BLESS:
af[0].location = APPLY_HITROLL;
af[0].location = GET_SPELL_ABILITY_MOD(ch);
af[0].modifier = 2;
af[0].duration = 6;
@ -357,7 +357,7 @@ void mag_affects(int level, struct char_data *ch, struct char_data *victim,
return;
}
af[0].location = APPLY_HITROLL;
af[0].location = GET_SPELL_ABILITY_MOD(ch);
af[0].modifier = -4;
af[0].duration = 2;
SET_BIT_AR(af[0].bitvector, AFF_BLIND);
@ -377,12 +377,12 @@ void mag_affects(int level, struct char_data *ch, struct char_data *victim,
return;
}
af[0].location = APPLY_HITROLL;
af[0].location = GET_SPELL_ABILITY_MOD(ch);
af[0].duration = 1 + (GET_LEVEL(ch) / 2);
af[0].modifier = -1;
SET_BIT_AR(af[0].bitvector, AFF_CURSE);
af[1].location = APPLY_DAMROLL;
af[1].location = GET_SPELL_ABILITY_MOD(ch);
af[1].duration = 1 + (GET_LEVEL(ch) / 2);
af[1].modifier = -1;
SET_BIT_AR(af[1].bitvector, AFF_CURSE);

View file

@ -479,26 +479,13 @@ static void medit_disp_stats_menu(struct descriptor_data *d)
"Hit Points (xdy+z): Bare Hand Damage (xdy+z): \r\n"
"(%s3%s) HP NumDice: %s[%s%5d%s]%s (%s6%s) BHD NumDice: %s[%s%5d%s]%s\r\n"
"(%s4%s) HP SizeDice: %s[%s%5d%s]%s (%s7%s) BHD SizeDice: %s[%s%5d%s]%s\r\n"
"(%s5%s) HP Addition: %s[%s%5d%s]%s (%s8%s) DamRoll: %s[%s%5d%s]%s\r\n"
"%-*s(range %s%d%s to %s%d%s)\r\n\r\n"
"(%sA%s) Armor Class: %s[%s%4d%s]%s (%sD%s) Hitroll: %s[%s%5d%s]%s\r\n"
"(%sB%s) Exp Points: %s[%s%10d%s]%s (%sE%s) Alignment: %s[%s%5d%s]%s\r\n"
"(%sC%s) Gold: %s[%s%10d%s]%s\r\n\r\n",
"(%s5%s) HP Addition: %s[%s%5d%s]%s (%s8%s) Alignment: %s[%s%5d%s]%s\r\n\r\n",
cyn, yel, OLC_NUM(d), cyn, nrm,
cyn, nrm, cyn, yel, GET_LEVEL(mob), cyn, nrm,
cyn, nrm, cyn, nrm,
cyn, nrm, cyn, yel, GET_HIT(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_NDD(mob), cyn, nrm,
cyn, nrm, cyn, yel, GET_MANA(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_SDD(mob), cyn, nrm,
cyn, nrm, cyn, yel, GET_MOVE(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_DAMROLL(mob), cyn, nrm,
count_color_chars(buf)+28, buf,
yel, GET_NDD(mob) + GET_DAMROLL(mob), nrm,
yel, (GET_NDD(mob) * GET_SDD(mob)) + GET_DAMROLL(mob), nrm,
cyn, nrm, cyn, yel, GET_AC(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_HITROLL(mob), cyn, nrm,
cyn, nrm, cyn, yel, GET_EXP(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_ALIGNMENT(mob), cyn, nrm,
cyn, nrm, cyn, yel, GET_GOLD(mob), cyn, nrm
cyn, nrm, cyn, yel, GET_MOVE(mob), cyn, nrm, cyn, nrm, cyn, yel, GET_ALIGNMENT(mob), cyn, nrm
);
if (CONFIG_MEDIT_ADVANCED) {
@ -701,31 +688,6 @@ void medit_parse(struct descriptor_data *d, char *arg)
i++;
break;
case '8':
OLC_MODE(d) = MEDIT_DAMROLL;
i++;
break;
case 'a':
case 'A':
OLC_MODE(d) = MEDIT_AC;
i++;
break;
case 'b':
case 'B':
OLC_MODE(d) = MEDIT_EXP;
i++;
break;
case 'c':
case 'C':
OLC_MODE(d) = MEDIT_GOLD;
i++;
break;
case 'd':
case 'D':
OLC_MODE(d) = MEDIT_HITROLL;
i++;
break;
case 'e':
case 'E':
OLC_MODE(d) = MEDIT_ALIGNMENT;
i++;
break;
@ -914,18 +876,6 @@ void medit_parse(struct descriptor_data *d, char *arg)
GET_SEX(OLC_MOB(d)) = LIMIT(i - 1, 0, NUM_GENDERS - 1);
break;
case MEDIT_HITROLL:
GET_HITROLL(OLC_MOB(d)) = LIMIT(i, 0, 50);
OLC_VAL(d) = TRUE;
medit_disp_stats_menu(d);
return;
case MEDIT_DAMROLL:
GET_DAMROLL(OLC_MOB(d)) = LIMIT(i, 0, 50);
OLC_VAL(d) = TRUE;
medit_disp_stats_menu(d);
return;
case MEDIT_NDD:
GET_NDD(OLC_MOB(d)) = LIMIT(i, 0, 30);
OLC_VAL(d) = TRUE;
@ -956,24 +906,6 @@ void medit_parse(struct descriptor_data *d, char *arg)
medit_disp_stats_menu(d);
return;
case MEDIT_AC:
GET_AC(OLC_MOB(d)) = LIMIT(i, -200, 200);
OLC_VAL(d) = TRUE;
medit_disp_stats_menu(d);
return;
case MEDIT_EXP:
GET_EXP(OLC_MOB(d)) = LIMIT(i, 0, MAX_MOB_EXP);
OLC_VAL(d) = TRUE;
medit_disp_stats_menu(d);
return;
case MEDIT_GOLD:
GET_GOLD(OLC_MOB(d)) = LIMIT(i, 0, MAX_MOB_GOLD);
OLC_VAL(d) = TRUE;
medit_disp_stats_menu(d);
return;
case MEDIT_STR:
GET_STR(OLC_MOB(d)) = LIMIT(i, 11, 25);
OLC_VAL(d) = TRUE;
@ -1127,12 +1059,6 @@ void medit_autoroll_stats(struct descriptor_data *d)
GET_NDD(OLC_MOB(d)) = MAX(1, mob_lev/6); /* number damage dice 1-5 */
GET_SDD(OLC_MOB(d)) = MAX(2, mob_lev/6); /* size of damage dice 2-5 */
GET_DAMROLL(OLC_MOB(d)) = mob_lev/6; /* damroll (dam bonus) 0-5 */
GET_HITROLL(OLC_MOB(d)) = mob_lev/3; /* hitroll 0-10 */
GET_EXP(OLC_MOB(d)) = (mob_lev*mob_lev*100);
GET_GOLD(OLC_MOB(d)) = (mob_lev*10);
GET_AC(OLC_MOB(d)) = (100-(mob_lev*6)); /* AC 94 to -80 */
/* 'Advanced' stats are only rolled if advanced options are enabled */
if (CONFIG_MEDIT_ADVANCED) {

View file

@ -265,34 +265,29 @@ extern const char *nrm, *grn, *cyn, *yel;
/* Numerical responses. */
#define MEDIT_NUMERICAL_RESPONSE 10
#define MEDIT_SEX 11
#define MEDIT_HITROLL 12
#define MEDIT_DAMROLL 13
#define MEDIT_NDD 14
#define MEDIT_SDD 15
#define MEDIT_NUM_HP_DICE 16
#define MEDIT_SIZE_HP_DICE 17
#define MEDIT_ADD_HP 18
#define MEDIT_AC 19
#define MEDIT_EXP 20
#define MEDIT_GOLD 21
#define MEDIT_POS 22
#define MEDIT_DEFAULT_POS 23
#define MEDIT_ATTACK 24
#define MEDIT_LEVEL 25
#define MEDIT_ALIGNMENT 26
#define MEDIT_DELETE 27
#define MEDIT_COPY 28
#define MEDIT_STR 29
#define MEDIT_INT 30
#define MEDIT_WIS 31
#define MEDIT_DEX 32
#define MEDIT_CON 33
#define MEDIT_CHA 34
#define MEDIT_PARA 35
#define MEDIT_ROD 36
#define MEDIT_PETRI 37
#define MEDIT_BREATH 38
#define MEDIT_SPELL 39
#define MEDIT_NDD 12
#define MEDIT_SDD 13
#define MEDIT_NUM_HP_DICE 14
#define MEDIT_SIZE_HP_DICE 15
#define MEDIT_ADD_HP 16
#define MEDIT_POS 17
#define MEDIT_DEFAULT_POS 18
#define MEDIT_ATTACK 19
#define MEDIT_LEVEL 20
#define MEDIT_ALIGNMENT 21
#define MEDIT_DELETE 22
#define MEDIT_COPY 23
#define MEDIT_STR 24
#define MEDIT_INT 25
#define MEDIT_WIS 26
#define MEDIT_DEX 27
#define MEDIT_CON 28
#define MEDIT_CHA 29
#define MEDIT_PARA 30
#define MEDIT_ROD 31
#define MEDIT_PETRI 32
#define MEDIT_BREATH 33
#define MEDIT_SPELL 34
/* Submodes of SEDIT connectedness. */
#define SEDIT_MAIN_MENU 0

View file

@ -33,8 +33,6 @@
#define PFDEF_GOLD 0
#define PFDEF_BANK 0
#define PFDEF_EXP 0
#define PFDEF_HITROLL 0
#define PFDEF_DAMROLL 0
#define PFDEF_AC 0
#define PFDEF_STR 0
#define PFDEF_STRADD 0

View file

@ -268,8 +268,6 @@ int load_char(const char *name, struct char_data *ch)
GET_GOLD(ch) = PFDEF_GOLD;
GET_BANK_GOLD(ch) = PFDEF_BANK;
GET_EXP(ch) = PFDEF_EXP;
GET_HITROLL(ch) = PFDEF_HITROLL;
GET_DAMROLL(ch) = PFDEF_DAMROLL;
GET_AC(ch) = PFDEF_AC;
ch->real_abils.str = PFDEF_STR;
ch->real_abils.str_add = PFDEF_STRADD;
@ -348,7 +346,6 @@ int load_char(const char *name, struct char_data *ch)
if (!strcmp(tag, "Desc")) ch->player.description = fread_string(fl, buf2);
else if (!strcmp(tag, "Dex ")) ch->real_abils.dex = atoi(line);
else if (!strcmp(tag, "Drnk")) GET_COND(ch, DRUNK) = atoi(line);
else if (!strcmp(tag, "Drol")) GET_DAMROLL(ch) = atoi(line);
break;
case 'E':
@ -371,7 +368,6 @@ int load_char(const char *name, struct char_data *ch)
free(GET_HOST(ch));
GET_HOST(ch) = strdup(line);
}
else if (!strcmp(tag, "Hrol")) GET_HITROLL(ch) = atoi(line);
else if (!strcmp(tag, "Hung")) GET_COND(ch, HUNGER) = atoi(line);
break;
@ -651,8 +647,6 @@ void save_char(struct char_data * ch)
if (GET_GOLD(ch) != PFDEF_GOLD) fprintf(fl, "Gold: %d\n", GET_GOLD(ch));
if (GET_BANK_GOLD(ch) != PFDEF_BANK) fprintf(fl, "Bank: %d\n", GET_BANK_GOLD(ch));
if (GET_EXP(ch) != PFDEF_EXP) fprintf(fl, "Exp : %d\n", GET_EXP(ch));
if (GET_HITROLL(ch) != PFDEF_HITROLL) fprintf(fl, "Hrol: %d\n", GET_HITROLL(ch));
if (GET_DAMROLL(ch) != PFDEF_DAMROLL) fprintf(fl, "Drol: %d\n", GET_DAMROLL(ch));
if (GET_OLC_ZONE(ch) != PFDEF_OLC) fprintf(fl, "Olc : %d\n", GET_OLC_ZONE(ch));
if (GET_PAGE_LENGTH(ch) != PFDEF_PAGELENGTH) fprintf(fl, "Page: %d\n", GET_PAGE_LENGTH(ch));
if (GET_SCREEN_WIDTH(ch) != PFDEF_SCREENWIDTH) fprintf(fl, "ScrW: %d\n", GET_SCREEN_WIDTH(ch));

View file

@ -149,8 +149,6 @@ static variable_name_t VariableNameTable[eMSDP_MAX+1] =
{ eMSDP_MONEY, "MONEY", NUMBER_READ_ONLY },
{ eMSDP_MOVEMENT, "MOVEMENT", NUMBER_READ_ONLY },
{ eMSDP_MOVEMENT_MAX, "MOVEMENT_MAX", NUMBER_READ_ONLY },
{ eMSDP_HITROLL, "HITROLL", NUMBER_READ_ONLY },
{ eMSDP_DAMROLL, "DAMROLL", NUMBER_READ_ONLY },
{ eMSDP_AC, "AC", NUMBER_READ_ONLY },
{ eMSDP_STR, "STR", NUMBER_READ_ONLY },
{ eMSDP_INT, "INT", NUMBER_READ_ONLY },

View file

@ -113,8 +113,6 @@ typedef enum
eMSDP_MONEY,
eMSDP_MOVEMENT,
eMSDP_MOVEMENT_MAX,
eMSDP_HITROLL,
eMSDP_DAMROLL,
eMSDP_AC,
eMSDP_STR,
eMSDP_INT,

View file

@ -372,7 +372,7 @@ ASPELL(spell_identify)
age(victim)->day, age(victim)->hours);
send_to_char(ch, "Height %d cm, Weight %d pounds\r\n", GET_HEIGHT(victim), GET_WEIGHT(victim));
send_to_char(ch, "Level: %d, Hits: %d, Mana: %d\r\n", GET_LEVEL(victim), GET_HIT(victim), GET_MANA(victim));
send_to_char(ch, "AC: %d, Hitroll: %d, Damroll: %d\r\n", compute_armor_class(victim), GET_HITROLL(victim), GET_DAMROLL(victim));
send_to_char(ch, "AC: %d\r\n", compute_armor_class(victim));
send_to_char(ch, "Str: %d/%d, Int: %d, Wis: %d, Dex: %d, Con: %d, Cha: %d\r\n",
GET_STR(victim), GET_ADD(victim), GET_INT(victim),
GET_WIS(victim), GET_DEX(victim), GET_CON(victim), GET_CHA(victim));
@ -399,10 +399,10 @@ ASPELL(spell_enchant_weapon)
SET_BIT_AR(GET_OBJ_EXTRA(obj), ITEM_MAGIC);
obj->affected[0].location = APPLY_HITROLL;
obj->affected[0].location = APPLY_PROFICIENCY;
obj->affected[0].modifier = 1 + (level >= 18);
obj->affected[1].location = APPLY_DAMROLL;
obj->affected[1].location = APPLY_PROFICIENCY;
obj->affected[1].modifier = 1 + (level >= 20);
if (IS_GOOD(ch)) {

View file

@ -463,15 +463,14 @@
#define APPLY_GOLD 15 /**< Reserved */
#define APPLY_EXP 16 /**< Reserved */
#define APPLY_AC 17 /**< Apply to Armor Class */
#define APPLY_HITROLL 18 /**< Apply to hitroll */
#define APPLY_DAMROLL 19 /**< Apply to damage roll */
#define APPLY_SAVING_PARA 20 /**< Apply to save throw: paralysis */
#define APPLY_SAVING_ROD 21 /**< Apply to save throw: rods */
#define APPLY_SAVING_PETRI 22 /**< Apply to save throw: petrif */
#define APPLY_SAVING_BREATH 23 /**< Apply to save throw: breath */
#define APPLY_SAVING_SPELL 24 /**< Apply to save throw: spells */
#define APPLY_PROFICIENCY 18 /**< Apply to Proficiency Bonus */
#define APPLY_SAVING_PARA 19 /**< Apply to save throw: paralysis */
#define APPLY_SAVING_ROD 20 /**< Apply to save throw: rods */
#define APPLY_SAVING_PETRI 21 /**< Apply to save throw: petrif */
#define APPLY_SAVING_BREATH 22 /**< Apply to save throw: breath */
#define APPLY_SAVING_SPELL 23 /**< Apply to save throw: spells */
/** Total number of applies */
#define NUM_APPLIES 25
#define NUM_APPLIES 24
/* Equals the total number of SAVING_* defines in spells.h */
#define NUM_OF_SAVING_THROWS 5
@ -917,12 +916,11 @@ struct char_point_data
* Dungeons and Dragons method of dealing with character defense, or
* Armor class. */
sh_int armor;
sh_int prof_mod; /**< Equipment/affect delta to proficiency bonus */
int gold; /**< Current gold carried on character */
int bank_gold; /**< Gold the char has in a bank account */
int exp; /**< The experience points, or value, of the character. */
sbyte hitroll; /**< Any bonus or penalty to the hit roll */
sbyte damroll; /**< Any bonus or penalty to the damage roll */
};
/** char_special_data_saved: specials which both a PC and an NPC have in

View file

@ -49,8 +49,6 @@ struct char_point_data_plrtoascii {
int bank_gold; /* Gold the char has in a bank account */
int exp; /* The experience of the player */
sbyte hitroll; /* Any bonus or penalty to the hit roll */
sbyte damroll; /* Any bonus or penalty to the damage roll */
};
@ -303,10 +301,6 @@ void convert(char *filename)
fprintf(outfile, "Bank: %d\n", cpd->bank_gold);
if (cpd->exp != PFDEF_EXP)
fprintf(outfile, "Exp : %d\n", cpd->exp);
if (cpd->hitroll != PFDEF_HITROLL)
fprintf(outfile, "Hrol: %d\n", cpd->hitroll);
if (cpd->damroll != PFDEF_DAMROLL)
fprintf(outfile, "Drol: %d\n", cpd->damroll);
/* affected_type */
fprintf(outfile, "Affs:\n");

View file

@ -550,6 +550,8 @@ do \
#define GET_EXP(ch) ((ch)->points.exp)
/** Armor class of ch. */
#define GET_AC(ch) ((ch)->points.armor)
/** Proficiency bonus of ch. */
#define GET_PROF_MOD(ch) ((ch)->points.prof_mod)
/** Current hit points (health) of ch. */
#define GET_HIT(ch) ((ch)->points.hit)
/** Maximum hit points of ch. */
@ -566,10 +568,6 @@ do \
#define GET_GOLD(ch) ((ch)->points.gold)
/** Gold in bank of ch. */
#define GET_BANK_GOLD(ch) ((ch)->points.bank_gold)
/** Current to-hit roll modifier for ch. */
#define GET_HITROLL(ch) ((ch)->points.hitroll)
/** Current damage roll modifier for ch. */
#define GET_DAMROLL(ch) ((ch)->points.damroll)
/** Current position (standing, sitting) of ch. */
#define GET_POS(ch) ((ch)->char_specials.position)