diff -ur -x '*.o' Sil/src/cmd1.c Sil-mod/src/cmd1.c --- Sil/src/cmd1.c 2013-01-03 12:00:55.000000000 +0100 +++ Sil-mod/src/cmd1.c 2013-03-26 00:17:15.997426953 +0100 @@ -3067,7 +3067,7 @@ * Find the attr/char pair to use for a visual hit effect * */ -static u16b hit_pict(int net_dam, int dam_type) +static u16b hit_pict(int net_dam, int dam_type, bool is_fatal) { int base; @@ -3083,48 +3083,55 @@ /* Basic hit color */ - if (net_dam == 0) + if (is_fatal) { - // only stunning overrides the default for zero damage hits - if (dam_type == GF_SOUND) - { - k = TERM_UMBER; - } - else - { - k = TERM_L_WHITE; - } - } - else if (net_dam < 10) - { - if (dam_type == GF_POIS) - { - k = TERM_GREEN; - } - else if (dam_type == GF_SOUND) - { - k = TERM_UMBER; - } - else - { - k = TERM_L_RED; - } + k = TERM_VIOLET; } else { - if (dam_type == GF_POIS) - { - k = TERM_L_GREEN; - } - else if (dam_type == GF_SOUND) - { - k = TERM_L_UMBER; - } - else - { - k = TERM_RED; - } - } + if (net_dam == 0) + { + // only stunning overrides the default for zero damage hits + if (dam_type == GF_SOUND) + { + k = TERM_UMBER; + } + else + { + k = TERM_L_WHITE; + } + } + else if (net_dam < 10) + { + if (dam_type == GF_POIS) + { + k = TERM_GREEN; + } + else if (dam_type == GF_SOUND) + { + k = TERM_UMBER; + } + else + { + k = TERM_L_RED; + } + } + else + { + if (dam_type == GF_POIS) + { + k = TERM_L_GREEN; + } + else if (dam_type == GF_SOUND) + { + k = TERM_L_UMBER; + } + else + { + k = TERM_RED; + } + } + } /* Obtain attr/char */ a = misc_to_attr[base+k]; @@ -3159,7 +3166,7 @@ return (PICT(a,c)); } -void display_hit(int y, int x, int net_dam, int dam_type) +void display_hit(int y, int x, int net_dam, int dam_type, bool is_fatal) { u16b p; @@ -3170,7 +3177,7 @@ if (!display_hits) return; /* Obtain the hit pict */ - p = hit_pict(net_dam, dam_type); + p = hit_pict(net_dam, dam_type, is_fatal); /* Extract attr/char */ a = PICT_A(p); @@ -3384,6 +3391,7 @@ bool charge = FALSE; bool rapid_attack = FALSE; bool off_hand_blow = FALSE; + bool has_died = FALSE; u32b f1, f2, f3; // the weapon's flags @@ -3637,14 +3645,17 @@ knock_back = TRUE; } + /* Damage, check for death */ + has_died = mon_take_hit(cave_m_idx[y][x], net_dam, NULL, -1); + // use different colours depending on whether knock back triggered if (knock_back) { - display_hit(y, x, net_dam, GF_SOUND); + display_hit(y, x, net_dam, GF_SOUND, has_died); } else { - display_hit(y, x, net_dam, GF_HURT); + display_hit(y, x, net_dam, GF_HURT, has_died); } @@ -3655,8 +3666,7 @@ noticed_flag = FALSE; } - /* Damage, check for death */ - if (mon_take_hit(cave_m_idx[y][x], net_dam, NULL, -1)) + if (has_died) { // heal with a vampiric weapon if (f1 & (TR1_VAMPIRIC)) Only in Sil-mod/src: cmd1.c~ diff -ur -x '*.o' Sil/src/cmd2.c Sil-mod/src/cmd2.c --- Sil/src/cmd2.c 2013-01-01 18:11:06.000000000 +0100 +++ Sil-mod/src/cmd2.c 2013-03-26 00:18:45.687435526 +0100 @@ -3221,6 +3221,7 @@ u32b noticed_bow_flag = 0L; // and the arrow/bow will be identified. bool noticed_radiance = FALSE; + bool has_died = FALSE; bool pierce = FALSE; bool targets_remaining = FALSE; @@ -3646,11 +3647,15 @@ /* No negative damage */ if (net_dam < 0) net_dam = 0; - update_combat_rolls2(total_dd, total_ds, dam, r_ptr->pd, r_ptr->ps, prt, prt_percent, GF_HURT, FALSE); - display_hit(y, x, net_dam, GF_HURT); + update_combat_rolls2(total_dd, total_ds, dam, r_ptr->pd, r_ptr->ps, prt, prt_percent, GF_HURT, FALSE); + + /* Hit the monster, check for death */ + has_died = mon_take_hit(cave_m_idx[y][x], net_dam, note_dies, -1); + + display_hit(y, x, net_dam, GF_HURT, has_died); /* Hit the monster, check for death */ - if (mon_take_hit(cave_m_idx[y][x], net_dam, note_dies, -1)) + if (has_died) { // gain wrath if singing song of slaying if (singing(SNG_SLAYING)) @@ -4440,7 +4445,6 @@ if (net_dam < 0) net_dam = 0; update_combat_rolls2(i_ptr->dd + total_bonus_dice, total_ds, dam, r_ptr->pd, r_ptr->ps, prt, prt_percent, GF_HURT, FALSE); - display_hit(y, x, net_dam, GF_HURT); /* Hit the monster, unless a potion effect has already been done */ if (!potion_effect) @@ -4453,6 +4457,7 @@ add_wrath(); } } + display_hit(y, x, net_dam, GF_HURT, is_dead); /* Still alive */ if (!is_dead) diff -ur -x '*.o' Sil/src/externs.h Sil-mod/src/externs.h --- Sil/src/externs.h 2013-01-01 18:50:28.000000000 +0100 +++ Sil-mod/src/externs.h 2013-03-26 00:16:06.202955620 +0100 @@ -345,7 +345,7 @@ extern void do_cmd_pickup_from_pile(void); extern void py_pickup(int pickup); extern void hit_trap(int y, int x); -extern void display_hit(int y, int x, int net_dam, int dam_type); +extern void display_hit(int y, int x, int net_dam, int dam_type, bool is_fatal); extern int concentration_bonus(int y, int x); extern int focused_attack_bonus(void); extern int master_hunter_bonus(monster_type *m_ptr); diff -ur -x '*.o' Sil/src/melee1.c Sil-mod/src/melee1.c --- Sil/src/melee1.c 2013-01-03 13:35:37.000000000 +0100 +++ Sil-mod/src/melee1.c 2013-03-26 00:12:17.859824247 +0100 @@ -1517,7 +1517,7 @@ update_combat_rolls2(dd + crit_bonus_dice + elem_bonus_dice, ds, dam, -1, -1, prt, prt_percent, dam_type, TRUE); - display_hit(p_ptr->py, p_ptr->px, net_dam, dam_type); + display_hit(p_ptr->py, p_ptr->px, net_dam, dam_type, p_ptr->is_dead); /* Handle character death */ if (p_ptr->is_dead && (l_ptr->deaths < MAX_SHORT)) diff -ur -x '*.o' Sil/src/spells1.c Sil-mod/src/spells1.c --- Sil/src/spells1.c 2013-01-01 14:02:23.000000000 +0100 +++ Sil-mod/src/spells1.c 2013-03-26 00:14:28.609061673 +0100 @@ -3246,7 +3246,7 @@ } update_combat_rolls2(total_dd, total_ds, dam, -1, -1, prt, 100, GF_HURT, FALSE); - display_hit(p_ptr->py, p_ptr->px, net_dam, GF_HURT); + display_hit(p_ptr->py, p_ptr->px, net_dam, GF_HURT, p_ptr->is_dead); if (net_dam) { @@ -3311,7 +3311,7 @@ } update_combat_rolls2(total_dd, total_ds, dam, -1, -1, prt, 100, GF_HURT, FALSE); - display_hit(p_ptr->py, p_ptr->px, net_dam, GF_HURT); + display_hit(p_ptr->py, p_ptr->px, net_dam, GF_HURT, p_ptr->is_dead); if (net_dam) {