From: <gi...@cr...> - 2011-10-31 16:30:16
|
via 56a7a78f025c31dfbc1a9a01b43bb5a57ce4b513 (commit) from 8a4c72d12298cd201d7271770ce673d9d198234e (commit) ----------------------------------------------------------------------- commit 56a7a78f025c31dfbc1a9a01b43bb5a57ce4b513 Author: Robert Burnham <bur...@gm...> Date: Mon Oct 31 01:55:55 2011 -0500 Unify to-hit messages, temporarily add in debug messages ----------------------------------------------------------------------- Summary of changes: crawl-ref/source/contrib/sdl | 2 +- crawl-ref/source/melee_attack.cc | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/crawl-ref/source/contrib/sdl b/crawl-ref/source/contrib/sdl index 822a498..5877613 160000 --- a/crawl-ref/source/contrib/sdl +++ b/crawl-ref/source/contrib/sdl @@ -1 +1 @@ -Subproject commit 822a49888f4a4060594e272640faac462953ce1e +Subproject commit 58776138f260489281abd18096d415bc3df2b1a6 diff --git a/crawl-ref/source/melee_attack.cc b/crawl-ref/source/melee_attack.cc index 16a63c2..4b90897 100644 --- a/crawl-ref/source/melee_attack.cc +++ b/crawl-ref/source/melee_attack.cc @@ -381,6 +381,7 @@ bool melee_attack::handle_phase_hit() // Apply attack delay you.time_taken = calc_attack_delay(); // Check for stab (and set stab_attempt and stab_bonus) + dprf("MONSTER NAME: %s", defender->name(DESC_THE).c_str()); player_stab_check(); // TODO: Remove this (placed here so I can get rid of player_attack) @@ -453,9 +454,11 @@ bool melee_attack::handle_phase_hit() // This does more than just calculate the damage, it also sets up // messages, etc. damage_done = calc_damage(); + dprf("MONSTER NAME: %s", defender->name(DESC_THE).c_str()); if (damage_done > 0) { + // TODO Unify or remove (some output is already handled above) if (attacker->atype() == ACT_PLAYER) player_announce_hit(); else @@ -474,16 +477,16 @@ bool melee_attack::handle_phase_hit() } else { - // TODO: Unify these - if (attacker->atype() == ACT_PLAYER) - { - no_damage_message = make_stringf("%s %s %s.", - attacker->name(DESC_THE).c_str(), - attack_verb.c_str(), - defender->name(DESC_THE).c_str()); - } - else - mons_announce_dud_hit(); + attack_verb = attacker->atype() == ACT_PLAYER + ? attack_verb + : attacker->conj_verb(mons_attack_verb()); + + // TODO: Clean this up if possible, checking atype for do / does is ugly + mprf("%s %s %s but %s no damage.", + attacker->name(DESC_THE).c_str(), + attack_verb.c_str(), + defender->name(DESC_THE).c_str(), + attacker->atype() == ACT_PLAYER ? "do" : "does"); } // TODO: Remove this, placed here so we can do away with player_attack @@ -770,6 +773,7 @@ bool melee_attack::attack() // Check for a stab (helpless or petrifying) if (to_hit >= ev && ev_helpless > ev) { + dprf("MONSTER NAME: %s", defender->name(DESC_THE).c_str()); defender->props["helpless"] = true; ev_margin = 1; @@ -2832,6 +2836,7 @@ attack_flavour melee_attack::random_chaos_attack_flavour() bool melee_attack::apply_damage_brand() { bool brand_was_known = false; + int brand; if (weapon) { @@ -2848,7 +2853,6 @@ bool melee_attack::apply_damage_brand() special_damage = 0; obvious_effect = false; - int brand; if (damage_brand == SPWPN_CHAOS) brand = random_chaos_brand(); else -- Dungeon Crawl Stone Soup |