Remove app_type bonuses in favor of ability mod bonus

This commit is contained in:
kinther 2025-10-03 14:51:34 -07:00
parent 3cabd51dc5
commit 19682f5b58
11 changed files with 18 additions and 252 deletions

View file

@ -1713,8 +1713,8 @@ ACMD(do_wield)
else {
if (!CAN_WEAR(obj, ITEM_WEAR_WIELD))
send_to_char(ch, "You can't wield that.\r\n");
else if (GET_OBJ_WEIGHT(obj) > str_app[STRENGTH_APPLY_INDEX(ch)].wield_w)
send_to_char(ch, "It's too heavy for you to use.\r\n");
else if (GET_OBJ_WEIGHT(obj) > CAN_WIELD_W(ch))
send_to_char(ch, "It's too heavy for you to use.\r\n");
else if (GET_LEVEL(ch) < GET_OBJ_LEVEL(obj))
send_to_char(ch, "You are not experienced enough to use that.\r\n");
else

View file

@ -596,7 +596,7 @@ static int ok_pick(struct char_data *ch, obj_vnum keynum, int pickproof, int scm
return (1);
percent = rand_number(1, 101);
skill_lvl = GET_SKILL(ch, SKILL_PICK_LOCK) + dex_app_skill[GET_DEX(ch)].p_locks;
skill_lvl = GET_SKILL(ch, SKILL_PICK_LOCK) + GET_ABILITY_MOD(GET_DEX(ch));
if (keynum == NOTHING) {
send_to_char(ch, "Odd - you can't seem to find a keyhole.\r\n");

View file

@ -429,7 +429,7 @@ ACMD(do_steal)
}
/* 101% is a complete failure */
percent = rand_number(1, 101) - dex_app_skill[GET_DEX(ch)].p_pocket;
percent = rand_number(1, 101) - GET_ABILITY_MOD(GET_DEX(ch));
if (GET_POS(vict) < POS_SLEEPING)
percent = -1; /* ALWAYS SUCCESS, unless heavy object. */

View file

@ -1199,8 +1199,8 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
send_to_char(ch, "Played: [%dh %dm], Age: [%d], per[%d]/NSTL[%d]",
k->player.time.played / 3600, (k->player.time.played % 3600) / 60,
age(k)->year, int_app[GET_INT(k)].learn,
wis_app[GET_WIS(k)].bonus);
age(k)->year, GET_ABILITY_MOD(GET_INT(k)),
GET_ABILITY_MOD(GET_WIS(k)));
/* Display OLC zone for immorts. */
if (GET_LEVEL(k) >= LVL_BUILDER) {
if (GET_OLC_ZONE(k)==AEDIT_PERMISSION)
@ -1239,7 +1239,7 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
CCYEL(ch, C_NRM), GET_PAGE_LENGTH(k), CCCYN(ch, C_NRM), CCNRM(ch, C_NRM));
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_AC(k), GET_ABILITY_MOD(GET_DEX(k)), 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));

View file

@ -978,7 +978,7 @@ void advance_level(struct char_data *ch)
{
int add_hp, add_mana = 0, add_move = 0, i;
add_hp = con_app[GET_CON(ch)].hitp;
add_hp = GET_ABILITY_MOD(GET_CON(ch));
switch (GET_CLASS(ch)) {

View file

@ -639,198 +639,6 @@ const char *fullness[] =
""
};
/** Strength attribute affects.
* The fields are hit mod, damage mod, weight carried mod, and weight wielded
* mod. */
cpp_extern const struct str_app_type str_app[] = {
{-5, -4, 0, 0}, /* str = 0 */
{-5, -4, 3, 1}, /* str = 1 */
{-3, -2, 3, 2},
{-3, -1, 10, 3},
{-2, -1, 25, 4},
{-2, -1, 55, 5}, /* str = 5 */
{-1, 0, 80, 6},
{-1, 0, 90, 7},
{0, 0, 100, 8},
{0, 0, 100, 9},
{0, 0, 115, 10}, /* str = 10 */
{0, 0, 115, 11},
{0, 0, 140, 12},
{0, 0, 140, 13},
{0, 0, 170, 14},
{0, 0, 170, 15}, /* str = 15 */
{0, 1, 195, 16},
{1, 1, 220, 18},
{1, 2, 255, 20}, /* str = 18 */
{3, 7, 640, 40},
{3, 8, 700, 40}, /* str = 20 */
{4, 9, 810, 40},
{4, 10, 970, 40},
{5, 11, 1130, 40},
{6, 12, 1440, 40},
{7, 14, 1750, 40}, /* str = 25 */
{1, 3, 280, 22}, /* str = 18/0 - 18-50 */
{2, 3, 305, 24}, /* str = 18/51 - 18-75 */
{2, 4, 330, 26}, /* str = 18/76 - 18-90 */
{2, 5, 380, 28}, /* str = 18/91 - 18-99 */
{3, 6, 480, 30} /* str = 18/100 */
};
/** Dexterity skill modifiers for thieves.
* The fields are for pick pockets, pick locks, find traps, sneak and hide. */
cpp_extern const struct dex_skill_type dex_app_skill[] = {
{-99, -99, -90, -99, -60}, /* dex = 0 */
{-90, -90, -60, -90, -50}, /* dex = 1 */
{-80, -80, -40, -80, -45},
{-70, -70, -30, -70, -40},
{-60, -60, -30, -60, -35},
{-50, -50, -20, -50, -30}, /* dex = 5 */
{-40, -40, -20, -40, -25},
{-30, -30, -15, -30, -20},
{-20, -20, -15, -20, -15},
{-15, -10, -10, -20, -10},
{-10, -5, -10, -15, -5}, /* dex = 10 */
{-5, 0, -5, -10, 0},
{0, 0, 0, -5, 0},
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0},
{0, 0, 0, 0, 0}, /* dex = 15 */
{0, 5, 0, 0, 0},
{5, 10, 0, 5, 5},
{10, 15, 5, 10, 10}, /* dex = 18 */
{15, 20, 10, 15, 15},
{15, 20, 10, 15, 15}, /* dex = 20 */
{20, 25, 10, 15, 20},
{20, 25, 15, 20, 20},
{25, 25, 15, 20, 20},
{25, 30, 15, 25, 25},
{25, 30, 15, 25, 25} /* dex = 25 */
};
/** Dexterity attribute affects.
* The fields are reaction, missile attacks, and defensive (armor class). */
cpp_extern const struct dex_app_type dex_app[] = {
{-7, -7, 6}, /* dex = 0 */
{-6, -6, 5}, /* dex = 1 */
{-4, -4, 5},
{-3, -3, 4},
{-2, -2, 3},
{-1, -1, 2}, /* dex = 5 */
{0, 0, 1},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0}, /* dex = 10 */
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, -1}, /* dex = 15 */
{1, 1, -2},
{2, 2, -3},
{2, 2, -4}, /* dex = 18 */
{3, 3, -4},
{3, 3, -4}, /* dex = 20 */
{4, 4, -5},
{4, 4, -5},
{4, 4, -5},
{5, 5, -6},
{5, 5, -6} /* dex = 25 */
};
/** Constitution attribute affects.
* The field referenced is for hitpoint bonus. */
cpp_extern const struct con_app_type con_app[] = {
{-4}, /* con = 0 */
{-3}, /* con = 1 */
{-2},
{-2},
{-1},
{-1}, /* con = 5 */
{-1},
{0},
{0},
{0},
{0}, /* con = 10 */
{0},
{0},
{0},
{0},
{1}, /* con = 15 */
{2},
{2},
{3}, /* con = 18 */
{3},
{4}, /* con = 20 */
{5},
{5},
{5},
{6},
{6} /* con = 25 */
};
/** Intelligence attribute affects.
* The field shows how much practicing affects a skill/spell. */
cpp_extern const struct int_app_type int_app[] = {
{3}, /* int = 0 */
{5}, /* int = 1 */
{7},
{8},
{9},
{10}, /* int = 5 */
{11},
{12},
{13},
{15},
{17}, /* int = 10 */
{19},
{22},
{25},
{30},
{35}, /* int = 15 */
{40},
{45},
{50}, /* int = 18 */
{53},
{55}, /* int = 20 */
{56},
{57},
{58},
{59},
{60} /* int = 25 */
};
/** Wisdom attribute affects.
* The field represents how many extra practice points are gained per level. */
cpp_extern const struct wis_app_type wis_app[] = {
{0}, /* wis = 0 */
{0}, /* wis = 1 */
{0},
{0},
{0},
{0}, /* wis = 5 */
{0},
{0},
{0},
{0},
{0}, /* wis = 10 */
{0},
{2},
{2},
{3},
{3}, /* wis = 15 */
{3},
{4},
{5}, /* wis = 18 */
{6},
{6}, /* wis = 20 */
{6},
{6},
{7},
{7},
{7} /* wis = 25 */
};
/** Define a set of opposite directions from the cardinal directions. */
int rev_dir[] =
{

View file

@ -39,12 +39,6 @@ extern const char *color_liquid[];
extern const char *fullness[];
extern const char *weekdays[];
extern const char *month_name[];
extern const struct str_app_type str_app[];
extern const struct dex_skill_type dex_app_skill[];
extern const struct dex_app_type dex_app[];
extern const struct con_app_type con_app[];
extern const struct int_app_type int_app[];
extern const struct wis_app_type wis_app[];
extern int rev_dir[];
extern int movement_loss[];
extern int drink_aff[][3];

View file

@ -155,7 +155,7 @@ int compute_armor_class(struct char_data *ch)
int armorclass = GET_AC(ch);
if (AWAKE(ch))
armorclass += dex_app[GET_DEX(ch)].defensive * 10;
armorclass += GET_ABILITY_MOD(GET_DEX(ch)) * 10;
return (MAX(-100, armorclass)); /* -100 is lowest */
}

View file

@ -255,7 +255,7 @@ void gain_skill(struct char_data *ch, char *skill, bool success)
return;
/* Wisdom bonus from wis_app[] (constants.c). Higher = better learning & shorter cooldown. */
wisb = wis_app[GET_WIS(ch)].bonus;
wisb = GET_ABILITY_MOD(GET_WIS(ch));
if (success) {
/* Learning from success is harder: 1..100, threshold scales with WIS */

View file

@ -1209,46 +1209,6 @@ struct dex_skill_type
sh_int hide; /**< Alters the success of hiding out of sight */
};
/** Describes the bonuses applied for a specific value of a character's
* strength attribute. */
struct dex_app_type
{
sh_int reaction; /**< Historically affects reaction savings throws. */
sh_int miss_att; /**< Historically affects missile attacks */
sh_int defensive; /**< Alters character's inherent armor class */
};
/** Describes the bonuses applied for a specific value of a character's
* strength attribute. */
struct str_app_type
{
sh_int tohit; /**< To Hit (THAC0) Bonus/Penalty */
sh_int todam; /**< Damage Bonus/Penalty */
sh_int carry_w; /**< Maximum weight that can be carrried */
sh_int wield_w; /**< Maximum weight that can be wielded */
};
/** Describes the bonuses applied for a specific value of a character's
* wisdom attribute. */
struct wis_app_type
{
byte bonus; /**< how many practices player gains per lev, unused now */
};
/** Describes the bonuses applied for a specific value of a character's
* intelligence attribute. */
struct int_app_type
{
byte learn; /**< how many % a player learns a spell/skill */
};
/** Describes the bonuses applied for a specific value of a
* character's constitution attribute. */
struct con_app_type
{
sh_int hitp; /**< Added to a character's new MAXHP at each new level. */
};
/** Stores, and used to deliver, the current weather information
* in the mud world. */
struct weather_data

View file

@ -687,10 +687,14 @@ do \
(GET_ADD(ch) <= 99) ? 29 : 30 ) ) ) \
)
/** Return how much weight ch can carry. */
#define CAN_CARRY_W(ch) (str_app[STRENGTH_APPLY_INDEX(ch)].carry_w)
/** Return how many items ch can carry. */
#define CAN_CARRY_N(ch) (5 + (GET_DEX(ch) >> 1) + (GET_LEVEL(ch) >> 1))
/** Return how much weight ch can carry (5e rule: Str × 15 lb). */
#define CAN_CARRY_W(ch) (GET_STR(ch) * 15)
/** Return how many items ch can carry (5e has no item count, so base it on Strength too).
* Here we use Str × 2 as a simple abstraction to replace the old level/dex scaling.
*/
#define CAN_CARRY_N(ch) (GET_STR(ch) * 2)
/** Max weapon weight a character can wield (5e-like rule of thumb: Str × 1.5 lb). */
#define CAN_WIELD_W(ch) (GET_STR(ch) * 1.5)
/** Return whether or not ch is awake. */
#define AWAKE(ch) (GET_POS(ch) > POS_SLEEPING)
/** Defines if ch can see in general in the dark. */