2 CHARACTER(vampire
, humanoid
)
5 virtual truth
SpecialBiteEffect (character
*, v2
, int, int, truth
, truth Critical
, int DoneDamage
);
12 truth
vampire::SpecialBiteEffect (character
*Victim
, v2 HitPos
, int BodyPartIndex
, int Direction
, truth BlockedByArmour
, truth Critical
, int DoneDamage
) {
14 if (!BlockedByArmour && Victim->IsWarmBlooded() && (!(RAND()%2) || Critical) && !Victim->AllowSpoil()) {
15 if (Victim->IsHumanoid()) Victim->BeginTemporaryState(VAMPIRISM, 1500+RAND_N(2000)); // Randomly instigate vampirism
16 if (Victim->IsPlayer() || IsPlayer() || Victim->CanBeSeenByPlayer() || CanBeSeenByPlayer()) {
17 ADD_MESSAGE("%s drains some precious lifeblood from %s!", CHAR_DESCRIPTION(DEFINITE), Victim->CHAR_DESCRIPTION(DEFINITE));
19 return Victim->ReceiveBodyPartDamage(this, 10 + (RAND() % 11), DRAIN, BodyPartIndex, Direction);
23 if (!BlockedByArmour
&& Victim
->IsWarmBlooded() && (!(RAND()%2) || Critical
) && !Victim
->AllowSpoil()) {
25 ADD_MESSAGE("You drain some precious lifeblood from %s!", Victim
->CHAR_DESCRIPTION(DEFINITE
));
26 } else if (Victim
->IsPlayer() || Victim
->CanBeSeenByPlayer() || CanBeSeenByPlayer()) {
27 ADD_MESSAGE("%s drains some precious lifeblood from %s!", CHAR_DESCRIPTION(DEFINITE
), Victim
->CHAR_DESCRIPTION(DEFINITE
));
30 if (Victim
->IsHumanoid() && !Victim
->StateIsActivated(VAMPIRISM
) && !Victim
->StateIsActivated(LYCANTHROPY
) && !Victim
->StateIsActivated(DISEASE_IMMUNITY
)) {
31 Victim
->BeginTemporaryState(VAMPIRISM
, 5000 + RAND_N(2500));
34 // HP recieved is about half the damage done; against werewolves this is full
35 int DrainDamage
= (DoneDamage
>>1)+1;
36 if (Victim
->StateIsActivated(LYCANTHROPY
)) DrainDamage
= DoneDamage
+1;
38 if (IsPlayer()) game::DoEvilDeed(10);
40 return Victim
->ReceiveBodyPartDamage(this, DrainDamage
, DRAIN
, BodyPartIndex
, Direction
);