Mercurial > hg > early-roguelike
comparison rogue4/sticks.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 | 1b73a8641b37 |
children |
comparison
equal
deleted
inserted
replaced
303:e06ebc407615 | 304:e52a8a7ad4c5 |
---|---|
157 { | 157 { |
158 rm = rnd_room(); | 158 rm = rnd_room(); |
159 rnd_pos(&rooms[rm], &tp->t_pos); | 159 rnd_pos(&rooms[rm], &tp->t_pos); |
160 } until (winat(tp->t_pos.y, tp->t_pos.x) == FLOOR); | 160 } until (winat(tp->t_pos.y, tp->t_pos.x) == FLOOR); |
161 tp->t_room = roomin(&tp->t_pos); | 161 tp->t_room = roomin(&tp->t_pos); |
162 tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x); | 162 tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x) & |
163 A_CHARTEXT; | |
163 if (see_monst(tp)) | 164 if (see_monst(tp)) |
164 mvaddch(tp->t_pos.y, tp->t_pos.x, tp->t_disguise); | 165 mvaddch(tp->t_pos.y, tp->t_pos.x, tp->t_disguise); |
165 else if (on(player, SEEMONST)) | 166 else if (on(player, SEEMONST)) |
166 { | 167 { |
167 standout(); | 168 standout(); |
173 { | 174 { |
174 tp->t_pos.y = hero.y + delta.y; | 175 tp->t_pos.y = hero.y + delta.y; |
175 tp->t_pos.x = hero.x + delta.x; | 176 tp->t_pos.x = hero.x + delta.x; |
176 | 177 |
177 if (tp->t_pos.y != y || tp->t_pos.x != x) | 178 if (tp->t_pos.y != y || tp->t_pos.x != x) |
178 tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x); | 179 tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x) & |
180 A_CHARTEXT; | |
179 } | 181 } |
180 moat(y, x) = NULL; | 182 moat(y, x) = NULL; |
181 moat(tp->t_pos.y, tp->t_pos.x) = tp; | 183 moat(tp->t_pos.y, tp->t_pos.x) = tp; |
182 if (tp->t_type == 'F') | 184 if (tp->t_type == 'F') |
183 player.t_flags &= ~ISHELD; | 185 player.t_flags &= ~ISHELD; |
421 hit_hero = FALSE; | 423 hit_hero = FALSE; |
422 changed = !changed; | 424 changed = !changed; |
423 if (!save(VS_MAGIC)) | 425 if (!save(VS_MAGIC)) |
424 { | 426 { |
425 if ((pstats.s_hpt -= roll(6, 6)) <= 0) | 427 if ((pstats.s_hpt -= roll(6, 6)) <= 0) |
428 { | |
426 if (start == &hero) | 429 if (start == &hero) |
427 death('b'); | 430 death('b'); |
428 else | 431 else |
429 death(moat(start->y, start->x)->t_type); | 432 death(moat(start->y, start->x)->t_type); |
433 } | |
430 used = TRUE; | 434 used = TRUE; |
431 if (terse) | 435 if (terse) |
432 msg("the %s hits", name); | 436 msg("the %s hits", name); |
433 else | 437 else |
434 msg("you are hit by the %s", name); | 438 msg("you are hit by the %s", name); |