(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
MJWFTUS66PTCNEYXEJA3CUJFXNWXIKDD6H3V24PW7HK64NSVOFSAC
I4HQEB6RVIPJD3EQCNADMQJVGYAIIHTBGFVMPXHDNLYYG5JVIK4AC
7Q4H6B62UZACQOUDHCHPMPBYEBXM5GVQINIHVHM4KLRENSH6VGTAC
CGYTZT5QWIEGYKUOLOK7MFXSLJKLYRZONER5ZCDZO5XYWSLG475QC
D27U7RT2C77NEUBP6JCSQJ2DRCJVHOXUO2PFZ45VFYMEVMKI4TSAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
XHNJ2W4AQHIF32P2ENIMMDLWAIFWP442KJIZC6RKS4HBJNZIHHBAC
UZ6N6HOUPGVSPC5NQROEEDWMEGJA5XUWUY2AKH5QG65AZ25PVXDAC
SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
LOJYD6QZRNLNDDZJKVBMKQIBPTKSRN2ETCYGNVV47M7L3QLUJUJAC
WHY6LRRJ5T2NSBE3IUCR4X3TOAH7TTK5NPUPUIFT7TPNJ6J4HBDAC
QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC
W7KGGF2VUXLD6YH55EPIRQ5SF5VKVKT33P6RNKCFCVQ4QXOLQE7AC
R22TTMI6WXWULC7ODKFF3QCB7MOTETQQ6IR4BUCUPOCQKQNCTT5AC
MG6LLF3XYCOEBQRX7TJ4MUTKM3IROYWUMZGCMYVW4TGDG36CJMJQC
NLQNXH3SVJ52CWXEV35FSSZP32VHC4QFGN3HINF4KO5GZHZMOBKQC
ACKNLTFL2RI3PMRWLNRVLRWGQAMLRFKNGNS5LED6NFE5GVGFIHFAC
HIRKGUMNJPWKSVTR6TVBPD3MWNA63CEHCLCIPWEMGDFHVB3NPLDQC
ESWIM76FGJL4QFLSHU6AC4D74PT7OPLQ7ZCJYWLZS5UCBAJDXYHAC
Q4YYTFXYZUDBYWT37U354CJOAQMAAIWM5W72TAEGMEUKZIUZBMGAC
QZERCVTY5BISIKSDH6WUXGZPIBAF4KUCGSZEEGMGBCORNUXT4HXAC
ouch( (you.your_level * 2) + random2avg(29, 2)
- random2(1 + player_AC()), 0, KILLED_BY_TRAP, " blade" );
int damage = (you.your_level * 2) + random2avg(29, 2)
- random2(1 + player_AC());
ouch( damage, 0, KILLED_BY_TRAP, " blade" );
bleed_onto_floor(you.x_pos, you.y_pos, -1, damage, true);
// checks whether the player or a monster is capable of bleeding
static bool victim_can_bleed(int montype)
{
if (montype == -1) // player
{
if (you.is_undead && (you.species != SP_VAMPIRE
|| you.hunger_state >= HS_FULL))
{
return (false);
}
int tran = you.attribute[ATTR_TRANSFORMATION];
if (tran == TRAN_STATUE || tran == TRAN_ICE_BEAST
|| tran == TRAN_AIR || tran == TRAN_LICH
|| tran == TRAN_SPIDER) // monster spiders don't bleed either
{
return (false);
}
return (true);
}
// now check monsters
return (mons_class_flag(montype, M_COLD_BLOOD)
|| mons_class_flag(montype, M_WARM_BLOOD));
}
static bool allow_bleeding_on_square(int x, int y)
{
// no bleeding onto sanctuary ground, please
// also not necessary if already covered in blood
if (env.map[x][y].property != FPROP_NONE)
return (false);
// no spattering into lava or water
if (grd[x][y] >= DNGN_LAVA && grd[x][y] < DNGN_FLOOR)
return (false);
// the good gods like to keep their altars pristine
if (is_good_god(grid_altar_god(grd[x][y])))
return (false);
return (true);
}
static void maybe_bloodify_square(int x, int y, int amount, bool spatter = false)
{
if (amount < 1)
return;
if (!spatter && !allow_bleeding_on_square(x,y))
return;
if (amount > random2(20))
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
"might bleed now; square: (%d, %d); amount = %d",
x, y, amount);
#endif
if (allow_bleeding_on_square(x,y))
env.map[x][y].property = FPROP_BLOODY;
if (spatter)
{
// smaller chance of spattering surrounding squares
for (int i=-1;i<=1;i++)
for (int j=-1;j<=1;j++)
{
if (i == 0 && j == 0) // current square
continue;
// spattering onto walls etc. less likely
if (grd[x+i][y+j] < DNGN_MINMOVE && one_chance_in(3))
continue;
maybe_bloodify_square(x+i, y+j, amount/10);
}
}
}
}
// currently flavour only: colour ground (and possibly adjacent squares) red
// "damage" depends on damage taken (or hitpoints, if damage higher),
// or, for sacrifices, on the number of chunks possible to get out of a corpse
void bleed_onto_floor(int x, int y, int montype, int damage, bool spatter)
{
if (!victim_can_bleed(montype))
return;
maybe_bloodify_square(x, y, damage, spatter);
}
// clean bloody floor
if (is_bloodcovered(cx,cy))
env.map[cx][cy].property = FPROP_NONE;
// chance of cleaning adjacent squares
for (int k=-1; k<=1; k++)
{
for (int l=-1; l<=1; l++)
if (is_bloodcovered(cx+k,cy+l)
&& one_chance_in(5))
{
env.map[cx+k][cy+l].property = FPROP_NONE;
}
}