2 CHARACTER(ennerbeast
, humanoid
)
5 virtual truth
Hit(character
*, v2
, int, int = 0);
6 virtual truth
MustBeRemovedFromBone() const;
8 virtual bodypart
* MakeBodyPart(int) const;
9 virtual void GetAICommand();
10 virtual truth
AttackIsBlockable(int) const { return false; }
18 truth
ennerbeast::Hit(character
* Enemy
, v2
, int, int)
20 if(CheckIfTooScaredToHit(Enemy
))
24 ADD_MESSAGE("%s yells: UGH UGHAaaa!", CHAR_DESCRIPTION(DEFINITE
));
26 ADD_MESSAGE("%s yells: Uga Ugar Ugade Ugat!", CHAR_DESCRIPTION(DEFINITE
));
29 femath::CalculateEnvironmentRectangle(Rect
, GetLevel()->GetBorder(), GetPos(), 30);
31 for(int x
= Rect
.X1
; x
<= Rect
.X2
; ++x
)
32 for(int y
= Rect
.Y1
; y
<= Rect
.Y2
; ++y
)
34 int ScreamStrength
= int(70 / (hypot(GetPos().X
- x
, GetPos().Y
- y
) + 1));
38 character
* Char
= GetNearSquare(x
, y
)->GetCharacter();
40 if(Char
&& Char
!= this)
42 msgsystem::EnterBigMessageMode();
45 ADD_MESSAGE("You are hit by the horrible waves of high sound.");
46 else if(Char
->CanBeSeenByPlayer())
47 ADD_MESSAGE("%s is hit by the horrible waves of high sound.", Char
->CHAR_NAME(DEFINITE
));
49 Char
->ReceiveDamage(this, ScreamStrength
, SOUND
, ALL
, YOURSELF
, true);
50 Char
->CheckDeath(CONST_S("killed @bkp scream"), this);
51 msgsystem::LeaveBigMessageMode();
53 if (Char
->IsPlayer() && Char
->HasOmmelBlood() && CanBeSeenByPlayer()) {
54 if (Char
->CurdleOmmelBlood()) ADD_MESSAGE("Your vial of Ommel Blood vibrates and it contents curdles with the scream of the Enner Beast.");
58 GetNearLSquare(x
, y
)->GetStack()->ReceiveDamage(this, ScreamStrength
, SOUND
);
63 EditAP(-1000000 / GetCWeaponSkill(BITE
)->GetBonus());
64 EditStamina(-1000, false);
70 void ennerbeast::GetAICommand()
72 SeekLeader(GetLeader());
74 if(StateIsActivated(PANIC
) || !(RAND() % 3))
75 Hit(0, ZERO_V2
, YOURSELF
);
77 if(CheckForEnemies(false, false, true))
80 if(FollowLeader(GetLeader()))
91 truth
ennerbeast::MustBeRemovedFromBone() const
93 return !IsEnabled() || GetTeam()->GetID() != MONSTER_TEAM
|| GetDungeon()->GetIndex() != ELPURI_CAVE
|| GetLevel()->GetIndex() != ENNER_BEAST_LEVEL
;
98 bodypart
* ennerbeast::MakeBodyPart(int I
) const
101 return ennerhead::Spawn(0, NO_MATERIALS
);
103 return humanoid::MakeBodyPart(I
);