2016-10-14 18:08:41 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// 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";
|
2018-06-24 10:31:55 +00:00
|
|
|
Tag "$FN_MANCU";
|
2016-10-14 18:08:41 +00:00
|
|
|
}
|
|
|
|
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
|
2017-06-01 14:41:52 +00:00
|
|
|
+ZDOOMTRANS
|
2016-10-14 18:08:41 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-10-27 15:47:46 +00:00
|
|
|
//===========================================================================
|
|
|
|
//
|
|
|
|
// Code (must be attached to Actor)
|
|
|
|
//
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
extend class Actor
|
|
|
|
{
|
|
|
|
const FATSPREAD = 90./8;
|
|
|
|
|
|
|
|
void A_FatRaise()
|
|
|
|
{
|
|
|
|
A_FaceTarget();
|
2020-01-04 13:15:32 +00:00
|
|
|
A_StartSound("fatso/raiseguns", CHAN_WEAPON);
|
2016-10-27 15:47:46 +00:00
|
|
|
}
|
|
|
|
|
2016-10-30 13:00:11 +00:00
|
|
|
//
|
|
|
|
// Mancubus attack,
|
|
|
|
// firing three missiles in three different directions?
|
|
|
|
// Doesn't look like it.
|
|
|
|
//
|
|
|
|
|
2016-10-27 15:47:46 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-30 13:00:11 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// killough 9/98: a mushroom explosion effect, sorta :)
|
|
|
|
// Original idea: Linguica
|
|
|
|
//
|
|
|
|
|
2016-11-21 12:04:27 +00:00
|
|
|
void A_Mushroom(class<Actor> spawntype = "FatShot", int numspawns = 0, int flags = 0, double vrange = 4.0, double hrange = 0.5)
|
2016-10-30 13:00:11 +00:00
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
if (numspawns == 0)
|
|
|
|
{
|
|
|
|
numspawns = GetMissileDamage(0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
A_Explode(128, 128, (flags & MSF_DontHurt) ? 0 : XF_HURTSOURCE);
|
|
|
|
|
|
|
|
// Now launch mushroom cloud
|
|
|
|
Actor aimtarget = Spawn("Mapspot", pos, NO_REPLACE); // We need something to aim at.
|
2016-12-31 14:40:16 +00:00
|
|
|
if (aimtarget == null) return;
|
2016-10-30 13:00:11 +00:00
|
|
|
Actor owner = (flags & MSF_DontHurt) ? target : self;
|
|
|
|
aimtarget.Height = Height;
|
|
|
|
|
2018-11-26 16:15:40 +00:00
|
|
|
bool shootmode = ((flags & MSF_Classic) || // Flag explicitly set, or no flags and compat options
|
2019-02-09 08:17:57 +00:00
|
|
|
(flags == 0 && CurState.bDehacked && (Level.compatflags & COMPATF_MUSHROOM)));
|
2016-10-30 13:00:11 +00:00
|
|
|
|
|
|
|
for (i = -numspawns; i <= numspawns; i += 8)
|
|
|
|
{
|
|
|
|
for (j = -numspawns; j <= numspawns; j += 8)
|
|
|
|
{
|
|
|
|
Actor mo;
|
|
|
|
aimtarget.SetXYZ(pos + (i, j, (i, j).Length() * vrange)); // Aim up fairly high
|
|
|
|
if (shootmode)
|
|
|
|
{ // Use old function for MBF compatibility
|
|
|
|
mo = OldSpawnMissile(aimtarget, spawntype, owner);
|
|
|
|
}
|
|
|
|
else // Use normal function
|
|
|
|
{
|
|
|
|
mo = SpawnMissile(aimtarget, spawntype, owner);
|
|
|
|
}
|
|
|
|
if (mo)
|
|
|
|
{ // Slow it down a bit
|
|
|
|
mo.Vel *= hrange;
|
|
|
|
mo.bNoGravity = false; // Make debris fall under gravity
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
aimtarget.Destroy();
|
|
|
|
}
|
|
|
|
|
2016-10-27 15:47:46 +00:00
|
|
|
}
|
|
|
|
|