Mercurial > hg > early-roguelike
diff urogue/fight.c @ 304:e52a8a7ad4c5
Fix many compiler warnings.
There should only be two changes in behavior:
arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly
applied to characters who are not monks instead of monks who are not
empty-handed.
urogue/fight.c: fixed an interaction with the "debug" macro that could
cause the wrong message to be displayed.
author | John "Elwin" Edwards |
---|---|
date | Wed, 14 Apr 2021 18:55:33 -0400 |
parents | 317166b49d8a |
children |
line wrap: on
line diff
--- a/urogue/fight.c Sat Mar 20 22:36:52 2021 -0400 +++ b/urogue/fight.c Wed Apr 14 18:55:33 2021 -0400 @@ -245,9 +245,8 @@ if (is_wearing(R_HEALTH) || player.t_ctype == C_PALADIN || - (player.t_ctype == C_NINJA && pstats.s_lvl - > 6) || - thrown && rnd(50) > 0 || + (player.t_ctype == C_NINJA && pstats.s_lvl > 6) || + (thrown && rnd(50) > 0) || rnd(20) > 0) { msg("The dust makes it hard to breath."); @@ -331,7 +330,9 @@ } if (itm == NULL) + { debug("Can't find crystalline armor being worn."); + } else { msg("Your armor shatters from the shriek."); @@ -554,7 +555,9 @@ } if (item == NULL) + { debug("Can't find crystalline armor being worn."); + } else { msg("Your armor is shattered by the blow."); @@ -1034,20 +1037,20 @@ msg("You feel nimble fingers reach into you pack."); } - if ((obj != cur_armor && - obj != cur_weapon && - obj != cur_ring[LEFT_1] && - obj != cur_ring[LEFT_2] && - obj != cur_ring[LEFT_3] && - obj != cur_ring[LEFT_4] && - obj != cur_ring[LEFT_5] && - obj != cur_ring[RIGHT_1] && - obj != cur_ring[RIGHT_2] && - obj != cur_ring[RIGHT_3] && - obj != cur_ring[RIGHT_4] && - obj != cur_ring[RIGHT_5] && - !(obj->o_flags & ISPROT) && - is_magic(obj) + if (((obj != cur_armor && + obj != cur_weapon && + obj != cur_ring[LEFT_1] && + obj != cur_ring[LEFT_2] && + obj != cur_ring[LEFT_3] && + obj != cur_ring[LEFT_4] && + obj != cur_ring[LEFT_5] && + obj != cur_ring[RIGHT_1] && + obj != cur_ring[RIGHT_2] && + obj != cur_ring[RIGHT_3] && + obj != cur_ring[RIGHT_4] && + obj != cur_ring[RIGHT_5] && + !(obj->o_flags & ISPROT) && + is_magic(obj)) || level > 45) && get_worth(obj) > worth) { @@ -2099,9 +2102,9 @@ /* Try to summon if less than 1/3 max hit points */ if (on(*mons, CANSUMMON) && - (force == FORCE || - (mons->t_stats.s_hpt < mons->maxstats.s_hpt / 3) && - (rnd(40 * 10) < (mons->t_stats.s_lvl * mons->t_stats.s_intel)))) + (force == FORCE || + ((mons->t_stats.s_hpt < mons->maxstats.s_hpt / 3) && + (rnd(40 * 10) < (mons->t_stats.s_lvl * mons->t_stats.s_intel))))) { turn_off(*mons, CANSUMMON); msg("The %s summons its attendants!", mname);