gzdoom/wadsrc/static/zscript/hexen/magelightning.txt
Christoph Oelckers 7b5a589635 - scriptified Hexen's Frost shards.
- scriptified all SpecialMissileHit methods.
2016-11-27 21:41:04 +01:00

238 lines
4.2 KiB
Text

// 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";
}
action native void A_LightningReady();
action native void A_MLightningAttack(class<Actor> floor = "LightningFloor", class<Actor> ceiling = "LightningCeiling");
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 --------------------------------------------------------
class Lightning : Actor
{
Default
{
MissileType "LightningZap";
AttackSound "MageLightningZap";
ActiveSound "MageLightningContinuous";
Obituary "$OB_MPMWEAPLIGHTNING";
}
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
}
}
class LightningCeiling : Lightning
{
Default
{
Health 144;
Speed 25;
Radius 16;
Height 40;
Damage 8;
Projectile;
+CEILINGHUGGER
RenderStyle "Add";
}
native void A_LightningZap();
native void A_LightningClip();
native void A_LightningRemove();
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";
}
native void A_LastZap();
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 ------------------------------------------------------------
class LightningZap : Actor
{
Default
{
Radius 15;
Height 35;
Damage 2;
Projectile;
-ACTIVATEIMPACT
-ACTIVATEPCROSS
RenderStyle "Add";
Obituary "$OB_MPMWEAPLIGHTNING";
}
native void A_ZapMimic();
States
{
Spawn:
MLFX IJKLM 2 Bright A_ZapMimic;
Loop;
Death:
MLFX NOPQRSTU 2 Bright;
Stop;
}
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;
}
}