finished adding content from CLIVAN; not tested yet
[k8-i-v-a-n.git] / src / game / nonhumans / canine_firefox.cpp
blobfbb99372ff7bff2e5be045bc290ce8138c011672
1 #ifdef HEADER_PHASE
2 CHARACTER(firefox, canine)
4 protected:
5 virtual truth SpecialBiteEffect (character *, v2, int, int, truth);
6 virtual int GetSpecialBodyPartFlags (int) const;
7 };
10 #else
13 int firefox::GetSpecialBodyPartFlags (int) const { return ST_FLAMES; }
16 truth firefox::SpecialBiteEffect (character * Enemy, v2 HitPos, int BodyPartIndex, int Direction, truth BlockedByArmour) {
17 if (Enemy->IsEnabled() && (RAND()&1)) {
18 if (Enemy->CanBeSeenByPlayer() && IsPlayer()) {
19 ADD_MESSAGE("Your bite burns %s.", Enemy->CHAR_DESCRIPTION(DEFINITE));
20 } else if (Enemy->IsPlayer() || Enemy->CanBeSeenByPlayer() || CanBeSeenByPlayer()) {
21 ADD_MESSAGE("The bite of %s burns %s.", CHAR_DESCRIPTION(DEFINITE), Enemy->CHAR_DESCRIPTION(DEFINITE));
23 Enemy->ReceiveBodyPartDamage(this, 2+(RAND()&3), FIRE, BodyPartIndex, Direction);
24 Enemy->CheckDeath(CONST_S("killed by the firey bite of ") + GetName(INDEFINITE), this);
25 return true;
27 return false;
32 truth firefox::Bite (character *Enemy, v2 HitPos, int BodyPartIndex, int Direction, truth BlockedByArmour) {
33 truth BaseSuccess = nonhumanoid::Bite(Enemy, HitPos, BodyPartIndex, Direction, BlockedByArmour);
35 if (Enemy->IsEnabled() && (RAND()&1)) {
36 if (Enemy->CanBeSeenByPlayer() && IsPlayer()) {
37 ADD_MESSAGE("Your bite burns %s.", Enemy->CHAR_DESCRIPTION(DEFINITE));
38 } else if (Enemy->IsPlayer() || Enemy->CanBeSeenByPlayer() || CanBeSeenByPlayer()) {
39 ADD_MESSAGE("The bite of %s burns %s.", CHAR_DESCRIPTION(DEFINITE), Enemy->CHAR_DESCRIPTION(DEFINITE));
41 return Enemy->ReceiveBodyPartDamage(this, 2 + (RAND() & 3), FIRE, BodyPartIndex, Direction) || BaseSuccess;
43 return BaseSuccess;
48 #endif