typos
[k8-i-v-a-n.git] / src / game / humans / humanoid_vampire.cpp
blobee0f439e45e37e0bd056fdaede8059b1cd4fc3b6
1 #ifdef HEADER_PHASE
2 CHARACTER(vampire, humanoid)
4 public:
5 virtual truth SpecialBiteEffect (character*, v2, int, int, truth, truth Critical, int DoneDamage);
6 };
9 #else
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);
21 return false;
23 if (!BlockedByArmour && Victim->IsWarmBlooded() && (!(RAND()%2) || Critical) && !Victim->AllowSpoil()) {
24 if (IsPlayer()) {
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);
43 return false;
46 #endif