mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-17 09:41:21 +00:00
c7347608a4
- swapped parameters of two-parameter VelToAngle method, so that internal and script version are in line. - fixed parameter asserts to handle NULL pointers properly.
167 lines
2.9 KiB
Text
167 lines
2.9 KiB
Text
//===========================================================================
|
|
//
|
|
// Mancubus
|
|
//
|
|
//===========================================================================
|
|
class Fatso : Actor
|
|
{
|
|
Default
|
|
{
|
|
Health 600;
|
|
Radius 48;
|
|
Height 64;
|
|
Mass 1000;
|
|
Speed 8;
|
|
PainChance 80;
|
|
Monster;
|
|
+FLOORCLIP
|
|
+BOSSDEATH
|
|
SeeSound "fatso/sight";
|
|
PainSound "fatso/pain";
|
|
DeathSound "fatso/death";
|
|
ActiveSound "fatso/active";
|
|
Obituary "$OB_FATSO";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
FATT AB 15 A_Look;
|
|
Loop;
|
|
See:
|
|
FATT AABBCCDDEEFF 4 A_Chase;
|
|
Loop;
|
|
Missile:
|
|
FATT G 20 A_FatRaise;
|
|
FATT H 10 BRIGHT A_FatAttack1;
|
|
FATT IG 5 A_FaceTarget;
|
|
FATT H 10 BRIGHT A_FatAttack2;
|
|
FATT IG 5 A_FaceTarget;
|
|
FATT H 10 BRIGHT A_FatAttack3;
|
|
FATT IG 5 A_FaceTarget;
|
|
Goto See;
|
|
Pain:
|
|
FATT J 3;
|
|
FATT J 3 A_Pain;
|
|
Goto See;
|
|
Death:
|
|
FATT K 6;
|
|
FATT L 6 A_Scream;
|
|
FATT M 6 A_NoBlocking;
|
|
FATT NOPQRS 6;
|
|
FATT T -1 A_BossDeath;
|
|
Stop;
|
|
Raise:
|
|
FATT R 5;
|
|
FATT QPONMLK 5;
|
|
Goto See;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
//
|
|
// Mancubus fireball
|
|
//
|
|
//===========================================================================
|
|
class FatShot : Actor
|
|
{
|
|
Default
|
|
{
|
|
Radius 6;
|
|
Height 8;
|
|
Speed 20;
|
|
Damage 8;
|
|
Projectile;
|
|
+RANDOMIZE
|
|
RenderStyle "Add";
|
|
Alpha 1;
|
|
SeeSound "fatso/attack";
|
|
DeathSound "fatso/shotx";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
MANF AB 4 BRIGHT;
|
|
Loop;
|
|
Death:
|
|
MISL B 8 BRIGHT;
|
|
MISL C 6 BRIGHT;
|
|
MISL D 4 BRIGHT;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
|
|
//===========================================================================
|
|
//
|
|
// Code (must be attached to Actor)
|
|
//
|
|
//===========================================================================
|
|
|
|
extend class Actor
|
|
{
|
|
const FATSPREAD = 90./8;
|
|
|
|
|
|
void A_FatRaise()
|
|
{
|
|
A_FaceTarget();
|
|
A_PlaySound("fatso/raiseguns", CHAN_WEAPON);
|
|
}
|
|
|
|
void A_FatAttack1(class<Actor> spawntype = "FatShot")
|
|
{
|
|
if (target)
|
|
{
|
|
A_FaceTarget ();
|
|
// Change direction to ...
|
|
Angle += FATSPREAD;
|
|
SpawnMissile (target, spawntype);
|
|
Actor missile = SpawnMissile (target, spawntype);
|
|
if (missile)
|
|
{
|
|
missile.Angle += FATSPREAD;
|
|
missile.VelFromAngle();
|
|
}
|
|
}
|
|
}
|
|
|
|
void A_FatAttack2(class<Actor> spawntype = "FatShot")
|
|
{
|
|
if (target)
|
|
{
|
|
A_FaceTarget ();
|
|
// Now here choose opposite deviation.
|
|
Angle -= FATSPREAD;
|
|
SpawnMissile (target, spawntype);
|
|
Actor missile = SpawnMissile (target, spawntype);
|
|
if (missile)
|
|
{
|
|
missile.Angle -= FATSPREAD;
|
|
missile.VelFromAngle();
|
|
}
|
|
}
|
|
}
|
|
|
|
void A_FatAttack3(class<Actor> spawntype = "FatShot")
|
|
{
|
|
if (target)
|
|
{
|
|
A_FaceTarget ();
|
|
Actor missile = SpawnMissile (target, spawntype);
|
|
if (missile)
|
|
{
|
|
missile.Angle -= FATSPREAD/2;
|
|
missile.VelFromAngle();
|
|
}
|
|
missile = SpawnMissile (target, spawntype);
|
|
if (missile)
|
|
{
|
|
missile.Angle += FATSPREAD/2;
|
|
missile.VelFromAngle();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|