2016-10-14 18:08:41 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Pain Elemental
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
class PainElemental : Actor
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
Health 400;
|
|
|
|
Radius 31;
|
|
|
|
Height 56;
|
|
|
|
Mass 400;
|
|
|
|
Speed 8;
|
|
|
|
PainChance 128;
|
|
|
|
Monster;
|
|
|
|
+FLOAT
|
|
|
|
+NOGRAVITY
|
|
|
|
SeeSound "pain/sight";
|
|
|
|
PainSound "pain/pain";
|
|
|
|
DeathSound "pain/death";
|
|
|
|
ActiveSound "pain/active";
|
|
|
|
}
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
PAIN A 10 A_Look;
|
|
|
|
Loop;
|
|
|
|
See:
|
|
|
|
PAIN AABBCC 3 A_Chase;
|
|
|
|
Loop;
|
|
|
|
Missile:
|
|
|
|
PAIN D 5 A_FaceTarget;
|
|
|
|
PAIN E 5 A_FaceTarget;
|
|
|
|
PAIN F 5 BRIGHT A_FaceTarget;
|
|
|
|
PAIN F 0 BRIGHT A_PainAttack;
|
|
|
|
Goto See;
|
|
|
|
Pain:
|
|
|
|
PAIN G 6;
|
|
|
|
PAIN G 6 A_Pain;
|
|
|
|
Goto See;
|
|
|
|
Death:
|
|
|
|
PAIN H 8 BRIGHT;
|
|
|
|
PAIN I 8 BRIGHT A_Scream;
|
|
|
|
PAIN JK 8 BRIGHT;
|
|
|
|
PAIN L 8 BRIGHT A_PainDie;
|
|
|
|
PAIN M 8 BRIGHT;
|
|
|
|
Stop;
|
|
|
|
Raise:
|
|
|
|
PAIN MLKJIH 8;
|
|
|
|
Goto See;
|
|
|
|
}
|
|
|
|
}
|
2016-10-27 22:32:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Code (must be attached to Actor)
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
extend class Actor
|
|
|
|
{
|
2016-11-21 12:04:27 +00:00
|
|
|
native void A_PainShootSkull(Class<Actor> spawntype, double angle, int flags = 0, int limit = -1);
|
2016-10-27 22:32:52 +00:00
|
|
|
|
2016-11-21 12:04:27 +00:00
|
|
|
void A_PainAttack(class<Actor> spawntype = "LostSoul", double addangle = 0, int flags = 0, int limit = -1)
|
2016-10-27 22:32:52 +00:00
|
|
|
{
|
|
|
|
if (target)
|
|
|
|
{
|
|
|
|
A_FaceTarget();
|
|
|
|
A_PainShootSkull(spawntype, angle + addangle, flags, limit);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void A_DualPainAttack(class<Actor> spawntype = "LostSoul")
|
|
|
|
{
|
|
|
|
if (target)
|
|
|
|
{
|
|
|
|
A_FaceTarget();
|
|
|
|
A_PainShootSkull(spawntype, angle + 45);
|
|
|
|
A_PainShootSkull(spawntype, angle - 45);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void A_PainDie(class<Actor> spawntype = "LostSoul")
|
|
|
|
{
|
|
|
|
if (target && IsFriend(target))
|
|
|
|
{ // And I thought you were my friend!
|
|
|
|
bFriendly = false;
|
|
|
|
}
|
|
|
|
A_NoBlocking();
|
|
|
|
A_PainShootSkull(spawntype, angle + 90);
|
|
|
|
A_PainShootSkull(spawntype, angle + 180);
|
|
|
|
A_PainShootSkull(spawntype, angle + 270);
|
|
|
|
}
|
|
|
|
}
|