From 447bc8ac9d8557be01da02c40349e4301f42c089 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 9 Jan 2008 14:15:43 +0000 Subject: Add gore and splatter to Crawl - in the form of Jarmo's (strongly modified, I admit) blood patch. Whenever the player or a monster capable of bleeding suffers damage (currently only in melee) or when you dissect a corpse there's a chance (depending on damage/corpse weight) that the square will turn bloody and be coloured red, with a much lower chance of additionally spattering some of the surrounding squares. These chances are probably still a bit too high for later values of possible damage dealt. Also, ranged and some of the magic attacks (earth-based, mostly) should also be able to send blood flying. :p For now, this is flavour only, but it shouldn't be too difficult to introduce relations to Necromancy or evil gods. Also consider dragons to be warm-blooded, like dinosaurs. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3230 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 48dd950bff..09fa35a48f 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -605,6 +605,15 @@ bool melee_attack::player_attack() // always upset monster regardless of damage behaviour_event(def, ME_WHACK, MHITYOU); + if (damage_done > 0) + { + int blood = damage_done; + if (blood > defender->stat_hp()) + blood = defender->stat_hp(); + + bleed_onto_floor(where.x, where.y, defender->id(), blood, true); + } + player_hurt_monster(); if (damage_done > 0 || !defender_visible) @@ -2139,11 +2148,17 @@ bool melee_attack::chop_hydra_head( int dam, if (def->number < 1) { if (defender_visible) + { mprf( "%s %s %s's last head off!", atk_name(DESC_CAP_THE).c_str(), attacker->conj_verb(verb).c_str(), def_name(DESC_NOCAP_THE).c_str() ); + } + coord_def pos = defender->pos(); + bleed_onto_floor(pos.x, pos.y, defender->id(), + def->hit_points, true); + defender->hurt(attacker, def->hit_points); } else @@ -3520,10 +3535,22 @@ void melee_attack::mons_perform_attack_rounds() mons_announce_hit(attk); check_defender_train_armour(); + int type = -1; // player + if (defender->atype() == ACT_MONSTER) + type = defender->id(); + + int damage = damage_done; + if (damage > defender->stat_hp()) + damage = defender->stat_hp(); + + bleed_onto_floor(pos.x, pos.y, type, damage, true); + if (decapitate_hydra(damage_done, attacker->damage_type(attack_number))) + { continue; - + } + special_damage = 0; special_damage_message.clear(); -- cgit v1.2.3-54-g00ecf