comparison 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
comparison
equal deleted inserted replaced
303:e06ebc407615 304:e52a8a7ad4c5
243 msg("The %s explodes in a cloud of dust.", 243 msg("The %s explodes in a cloud of dust.",
244 monsters[tp->t_index].m_name); 244 monsters[tp->t_index].m_name);
245 245
246 if (is_wearing(R_HEALTH) || 246 if (is_wearing(R_HEALTH) ||
247 player.t_ctype == C_PALADIN || 247 player.t_ctype == C_PALADIN ||
248 (player.t_ctype == C_NINJA && pstats.s_lvl 248 (player.t_ctype == C_NINJA && pstats.s_lvl > 6) ||
249 > 6) || 249 (thrown && rnd(50) > 0) ||
250 thrown && rnd(50) > 0 ||
251 rnd(20) > 0) 250 rnd(20) > 0)
252 { 251 {
253 msg("The dust makes it hard to breath."); 252 msg("The dust makes it hard to breath.");
254 } 253 }
255 else 254 else
329 if (obj == cur_armor) 328 if (obj == cur_armor)
330 break; 329 break;
331 } 330 }
332 331
333 if (itm == NULL) 332 if (itm == NULL)
333 {
334 debug("Can't find crystalline armor being worn."); 334 debug("Can't find crystalline armor being worn.");
335 }
335 else 336 else
336 { 337 {
337 msg("Your armor shatters from the shriek."); 338 msg("Your armor shatters from the shriek.");
338 cur_armor = NULL; 339 cur_armor = NULL;
339 del_pack(itm); 340 del_pack(itm);
552 if (obj == cur_armor) 553 if (obj == cur_armor)
553 break; 554 break;
554 } 555 }
555 556
556 if (item == NULL) 557 if (item == NULL)
558 {
557 debug("Can't find crystalline armor being worn."); 559 debug("Can't find crystalline armor being worn.");
560 }
558 else 561 else
559 { 562 {
560 msg("Your armor is shattered by the blow."); 563 msg("Your armor is shattered by the blow.");
561 cur_armor = NULL; 564 cur_armor = NULL;
562 del_pack(item); 565 del_pack(item);
1032 obj->o_flags |= ISCURSED; 1035 obj->o_flags |= ISCURSED;
1033 1036
1034 msg("You feel nimble fingers reach into you pack."); 1037 msg("You feel nimble fingers reach into you pack.");
1035 } 1038 }
1036 1039
1037 if ((obj != cur_armor && 1040 if (((obj != cur_armor &&
1038 obj != cur_weapon && 1041 obj != cur_weapon &&
1039 obj != cur_ring[LEFT_1] && 1042 obj != cur_ring[LEFT_1] &&
1040 obj != cur_ring[LEFT_2] && 1043 obj != cur_ring[LEFT_2] &&
1041 obj != cur_ring[LEFT_3] && 1044 obj != cur_ring[LEFT_3] &&
1042 obj != cur_ring[LEFT_4] && 1045 obj != cur_ring[LEFT_4] &&
1043 obj != cur_ring[LEFT_5] && 1046 obj != cur_ring[LEFT_5] &&
1044 obj != cur_ring[RIGHT_1] && 1047 obj != cur_ring[RIGHT_1] &&
1045 obj != cur_ring[RIGHT_2] && 1048 obj != cur_ring[RIGHT_2] &&
1046 obj != cur_ring[RIGHT_3] && 1049 obj != cur_ring[RIGHT_3] &&
1047 obj != cur_ring[RIGHT_4] && 1050 obj != cur_ring[RIGHT_4] &&
1048 obj != cur_ring[RIGHT_5] && 1051 obj != cur_ring[RIGHT_5] &&
1049 !(obj->o_flags & ISPROT) && 1052 !(obj->o_flags & ISPROT) &&
1050 is_magic(obj) 1053 is_magic(obj))
1051 || level > 45) 1054 || level > 45)
1052 && get_worth(obj) > worth) 1055 && get_worth(obj) > worth)
1053 { 1056 {
1054 stealit = list; 1057 stealit = list;
1055 worth = get_worth(obj); 1058 worth = get_worth(obj);
2097 char *mname = monsters[mons->t_index].m_name; 2100 char *mname = monsters[mons->t_index].m_name;
2098 2101
2099 /* Try to summon if less than 1/3 max hit points */ 2102 /* Try to summon if less than 1/3 max hit points */
2100 2103
2101 if (on(*mons, CANSUMMON) && 2104 if (on(*mons, CANSUMMON) &&
2102 (force == FORCE || 2105 (force == FORCE ||
2103 (mons->t_stats.s_hpt < mons->maxstats.s_hpt / 3) && 2106 ((mons->t_stats.s_hpt < mons->maxstats.s_hpt / 3) &&
2104 (rnd(40 * 10) < (mons->t_stats.s_lvl * mons->t_stats.s_intel)))) 2107 (rnd(40 * 10) < (mons->t_stats.s_lvl * mons->t_stats.s_intel)))))
2105 { 2108 {
2106 turn_off(*mons, CANSUMMON); 2109 turn_off(*mons, CANSUMMON);
2107 msg("The %s summons its attendants!", mname); 2110 msg("The %s summons its attendants!", mname);
2108 helpname = monsters[mons->t_index].m_typesum; 2111 helpname = monsters[mons->t_index].m_typesum;
2109 2112