2016-10-18 16:11:13 +00:00
|
|
|
|
|
|
|
// The Mage's Lightning Arc of Death ----------------------------------------
|
|
|
|
|
|
|
|
class MWeapLightning : MageWeapon
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+NOGRAVITY
|
|
|
|
Weapon.SelectionOrder 1100;
|
|
|
|
Weapon.AmmoUse1 5;
|
|
|
|
Weapon.AmmoGive1 25;
|
|
|
|
Weapon.KickBack 0;
|
|
|
|
Weapon.YAdjust 20;
|
|
|
|
Weapon.AmmoType1 "Mana2";
|
|
|
|
Inventory.PickupMessage "$TXT_WEAPON_M3";
|
|
|
|
Tag "$TAG_MWEAPLIGHTNING";
|
|
|
|
}
|
|
|
|
|
2016-11-13 13:20:30 +00:00
|
|
|
action native void A_LightningReady();
|
|
|
|
action native void A_MLightningAttack(class<Actor> floor = "LightningFloor", class<Actor> ceiling = "LightningCeiling");
|
2016-10-18 16:11:13 +00:00
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
WMLG ABCDEFGH 4 Bright;
|
|
|
|
Loop;
|
|
|
|
Select:
|
|
|
|
MLNG A 1 Bright A_Raise;
|
|
|
|
Loop;
|
|
|
|
Deselect:
|
|
|
|
MLNG A 1 Bright A_Lower;
|
|
|
|
Loop;
|
|
|
|
Ready:
|
|
|
|
MLNG AAAAA 1 Bright A_WeaponReady;
|
|
|
|
MLNG A 1 Bright A_LightningReady;
|
|
|
|
MLNG BBBBBB 1 Bright A_WeaponReady;
|
|
|
|
MLNG CCCCC 1 Bright A_WeaponReady;
|
|
|
|
MLNG C 1 Bright A_LightningReady;
|
|
|
|
MLNG BBBBBB 1 Bright A_WeaponReady;
|
|
|
|
Loop;
|
|
|
|
Fire:
|
|
|
|
MLNG DE 3 Bright;
|
|
|
|
MLNG F 4 Bright A_MLightningAttack;
|
|
|
|
MLNG G 4 Bright;
|
|
|
|
MLNG HI 3 Bright;
|
|
|
|
MLNG I 6 Bright Offset (0, 199);
|
|
|
|
MLNG C 2 Bright Offset (0, 55);
|
|
|
|
MLNG B 2 Bright Offset (0, 50);
|
|
|
|
MLNG B 2 Bright Offset (0, 45);
|
|
|
|
MLNG B 2 Bright Offset (0, 40);
|
|
|
|
Goto Ready;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ceiling Lightning --------------------------------------------------------
|
|
|
|
|
2016-11-27 20:41:04 +00:00
|
|
|
class Lightning : Actor
|
2016-10-18 16:11:13 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
MissileType "LightningZap";
|
|
|
|
AttackSound "MageLightningZap";
|
|
|
|
ActiveSound "MageLightningContinuous";
|
|
|
|
Obituary "$OB_MPMWEAPLIGHTNING";
|
|
|
|
}
|
2016-11-27 20:41:04 +00:00
|
|
|
|
|
|
|
override int SpecialMissileHit (Actor thing)
|
|
|
|
{
|
|
|
|
if (thing.bShootable && thing != target)
|
|
|
|
{
|
|
|
|
if (thing.Mass < LARGE_MASS)
|
|
|
|
{
|
|
|
|
thing.Vel.X += Vel.X / 16;
|
|
|
|
thing.Vel.Y += Vel.Y / 16;
|
|
|
|
}
|
|
|
|
if ((!thing.player && !thing.bBoss) || !(level.time&1))
|
|
|
|
{
|
|
|
|
thing.DamageMobj(self, target, 3, 'Electric');
|
|
|
|
A_PlaySound(self.AttackSound, CHAN_WEAPON, 1, true);
|
|
|
|
if (thing.bIsMonster && random[LightningHit]() < 64)
|
|
|
|
{
|
|
|
|
thing.Howl ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
health--;
|
|
|
|
if (health <= 0 || thing.health <= 0)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (bFloorHugger)
|
|
|
|
{
|
|
|
|
if (lastenemy && ! lastenemy.tracer)
|
|
|
|
{
|
|
|
|
lastenemy.tracer = thing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!tracer)
|
|
|
|
{
|
|
|
|
tracer = thing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1; // lightning zaps through all sprites
|
|
|
|
}
|
|
|
|
|
2016-10-18 16:11:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class LightningCeiling : Lightning
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
Health 144;
|
|
|
|
Speed 25;
|
|
|
|
Radius 16;
|
|
|
|
Height 40;
|
|
|
|
Damage 8;
|
|
|
|
Projectile;
|
|
|
|
+CEILINGHUGGER
|
|
|
|
RenderStyle "Add";
|
|
|
|
}
|
|
|
|
|
2016-10-22 15:49:08 +00:00
|
|
|
native void A_LightningZap();
|
|
|
|
native void A_LightningClip();
|
|
|
|
native void A_LightningRemove();
|
2016-10-18 16:11:13 +00:00
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
MLFX A 2 Bright A_LightningZap;
|
|
|
|
MLFX BCD 2 Bright A_LightningClip;
|
|
|
|
Loop;
|
|
|
|
Death:
|
|
|
|
MLF2 A 2 Bright A_LightningRemove;
|
|
|
|
MLF2 BCDEKLM 3 Bright;
|
|
|
|
ACLO E 35;
|
|
|
|
MLF2 NO 3 Bright;
|
|
|
|
MLF2 P 4 Bright;
|
|
|
|
MLF2 QP 3 Bright;
|
|
|
|
MLF2 Q 4 Bright;
|
|
|
|
MLF2 P 3 Bright;
|
|
|
|
MLF2 O 3 Bright;
|
|
|
|
MLF2 P 3 Bright;
|
|
|
|
MLF2 P 1 Bright A_HideThing;
|
|
|
|
ACLO E 1050;
|
|
|
|
Stop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Floor Lightning ----------------------------------------------------------
|
|
|
|
|
|
|
|
class LightningFloor : LightningCeiling
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
-CEILINGHUGGER
|
|
|
|
+FLOORHUGGER
|
|
|
|
RenderStyle "Add";
|
|
|
|
}
|
|
|
|
|
2016-10-22 15:49:08 +00:00
|
|
|
native void A_LastZap();
|
2016-10-18 16:11:13 +00:00
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
MLFX E 2 Bright A_LightningZap;
|
|
|
|
MLFX FGH 2 Bright A_LightningClip;
|
|
|
|
Loop;
|
|
|
|
Death:
|
|
|
|
MLF2 F 2 Bright A_LightningRemove;
|
|
|
|
MLF2 GHIJKLM 3 Bright;
|
|
|
|
ACLO E 20;
|
|
|
|
MLF2 NO 3 Bright;
|
|
|
|
MLF2 P 4 Bright;
|
|
|
|
MLF2 QP 3 Bright;
|
|
|
|
MLF2 Q 4 Bright A_LastZap;
|
|
|
|
MLF2 POP 3 Bright;
|
|
|
|
MLF2 P 1 Bright A_HideThing;
|
|
|
|
Goto Super::Death + 19;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Lightning Zap ------------------------------------------------------------
|
|
|
|
|
2016-11-27 20:41:04 +00:00
|
|
|
class LightningZap : Actor
|
2016-10-18 16:11:13 +00:00
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
Radius 15;
|
|
|
|
Height 35;
|
|
|
|
Damage 2;
|
|
|
|
Projectile;
|
|
|
|
-ACTIVATEIMPACT
|
|
|
|
-ACTIVATEPCROSS
|
|
|
|
RenderStyle "Add";
|
|
|
|
Obituary "$OB_MPMWEAPLIGHTNING";
|
|
|
|
}
|
|
|
|
|
2016-10-22 15:49:08 +00:00
|
|
|
native void A_ZapMimic();
|
2016-10-18 16:11:13 +00:00
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
MLFX IJKLM 2 Bright A_ZapMimic;
|
|
|
|
Loop;
|
|
|
|
Death:
|
|
|
|
MLFX NOPQRSTU 2 Bright;
|
|
|
|
Stop;
|
|
|
|
}
|
2016-11-27 20:41:04 +00:00
|
|
|
|
|
|
|
override int SpecialMissileHit (Actor thing)
|
|
|
|
{
|
|
|
|
Actor lmo;
|
|
|
|
|
|
|
|
if (thing.bShootable && thing != target)
|
|
|
|
{
|
|
|
|
lmo = lastenemy;
|
|
|
|
if (lmo)
|
|
|
|
{
|
|
|
|
if (lmo.bFloorHugger)
|
|
|
|
{
|
|
|
|
if (lmo.lastenemy && !lmo.lastenemy.tracer)
|
|
|
|
{
|
|
|
|
lmo.lastenemy.tracer = thing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!lmo.tracer)
|
|
|
|
{
|
|
|
|
lmo.tracer = thing;
|
|
|
|
}
|
|
|
|
if (!(level.time&3))
|
|
|
|
{
|
|
|
|
lmo.health--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2016-10-18 16:11:13 +00:00
|
|
|
}
|