Skip to content

Commit

Permalink
Avoid explicit TMD_OPP_* references
Browse files Browse the repository at this point in the history
That's in the spirit of Angband's angband/angband@2afd564 : only require changes to list-player-timed.h and player_timed.txt to add a new temporary resistance for an existing element.  Of course, would still need to change objects, artifacts, activations, or spells to use the new temporary resistance.
  • Loading branch information
backwardsEric committed Feb 27, 2024
1 parent 4956241 commit 8701926
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/player-calcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2525,20 +2525,9 @@ void calc_bonuses(struct player *p, struct player_state *state, bool known_only,
if (p->timed[TMD_TERROR]) {
state->speed += 10;
}
if (p->timed[TMD_OPP_ACID]) {
apply_resist(&state->el_info[ELEM_ACID].res_level, RES_BOOST_NORMAL);
}
if (p->timed[TMD_OPP_ELEC]) {
apply_resist(&state->el_info[ELEM_ELEC].res_level, RES_BOOST_NORMAL);
}
if (p->timed[TMD_OPP_FIRE]) {
apply_resist(&state->el_info[ELEM_FIRE].res_level, RES_BOOST_NORMAL);
}
if (p->timed[TMD_OPP_COLD]) {
apply_resist(&state->el_info[ELEM_COLD].res_level, RES_BOOST_NORMAL);
}
if (p->timed[TMD_OPP_POIS]) {
apply_resist(&state->el_info[ELEM_POIS].res_level, RES_BOOST_NORMAL);
for (i = 0; i < TMD_MAX; ++i) {
if (!p->timed[i] || timed_effects[i].temp_resist == -1) continue;
apply_resist(&state->el_info[timed_effects[i].temp_resist].res_level, RES_BOOST_NORMAL);
}
if (p->timed[TMD_CONFUSED]) {
adjust_skill_scale(&state->skills[SKILL_DEVICE], -1, 4, 0);
Expand Down

0 comments on commit 8701926

Please sign in to comment.