actor MagnetMissileBoss : MegaBuster 20038
{
Weapon.AmmoUse 3
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "%o was magnetized by %k's Magnet Missile."
Inventory.Pickupmessage "Power up! Magnet Missile!"
weapon.ammotype "PullAmmo"
weapon.ammotype2 "PullCharge"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
+WEAPON.Alt_AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
MAGB B 0 ACS_ExecuteAlways(998,0,77)
CRAA A 0 A_TakeInventory("WeaponFired", 999)
CRAA A 0 A_GunFlash
MAGB B 0 A_JumpIfInventory("PullAmmo",3,"Ready2")
MAGB B 1 A_WeaponReady(WRF_NOFIRE|WRF_NOSWITCH)
Goto Ready+3
Ready2:
MAGB B 1 A_WeaponReady(WRF_NOSWITCH)
loop
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MAGB C 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MAGB C 1 A_Raise
Loop
Fire:
TNT1 A 0 A_JumpIfInventory("IsBotFlag",1,"BotFire")
MAGB B 0 A_JumpIfNoAmmo("NoAmmo")
MAGB B 0 A_GiveInventory("EndPull",1)
MAGB B 0 A_TakeInventory("PullCharge",999)
MAGB B 0 A_GiveInventory("WeaponFired",1)
CRAA A 0 A_GunFlash
MAGB A 4
MAGB B 0 A_PlaySoundEx("weapon/magnetmissile","Weapon")
MAGB B 0 A_FireCustomMissile("MagnetMissile2",0,1,8,0)
MAGB CA 4
MAGB B 12
MAGB B 0 A_Refire
Goto Ready+1
NoAmmo:
/*MAGB B 0 A_GiveInventory("EndPull",1)
MAGB B 0 A_TakeInventory("PullCharge",999)
MAGB C 0 SetPlayerProperty(0,0,0)*/
//MAGB C 1 ACS_Execute(979,0)
MAGB B 0
Goto Ready+1
/*Altfire:
MAGB B 0 A_JumpIfNoAmmo("NoAmmo")
MAGB B 0 A_GiveInventory("PullCharge",1)
MAGB B 0 A_TakeInventory("EndPull",999)
MAGB C 0 SetPlayerProperty(0,1,0)
MAGB B 0 A_PlaySoundEx("weapon/magPush","auto")
MAGB C 1 A_FireCustomMissile("MagPush2",0,1,8,0)
MAGB C 1
MAGB C 4
MAGB B 0 A_Refire
MAGB B 0 A_GiveInventory("EndPull",999)
MAGB B 0 A_TakeInventory("PullCharge",999)
MAGB C 0 SetPlayerProperty(0,0,0)
Goto Ready+1*/
AltFire:
MAGB B 0 A_TakeInventory("EndPull",999)
MAGB C 0 SetPlayerProperty(0,1,0)
//MAGB B 0 A_JumpIfInventory("MagArmsFlag",1,"AltFirePose2")
MAGB B 0 A_PlaySoundEx("weapon/magPush","auto")
//MAGB G 0 A_GiveInventory("MagArmsFlag",1)
MAGB G 3 A_GiveInventory("PullCharge",1)
//goto AltRefire
//AltFirePose2:
//MAGB G 0 A_TakeInventory("MagArmsFlag",999)
MAGB H 3 A_GiveInventory("PullCharge",1)
AltRefire:
MAGB B 0 A_JumpIfInventory("PullCharge",40,"AltFire10")
MAGB B 0 A_Refire
MAGB B 0 A_JumpIfInventory("PullCharge",36,"AltFire9")
MAGB B 0 A_JumpIfInventory("PullCharge",32,"AltFire8")
MAGB B 0 A_JumpIfInventory("PullCharge",28,"AltFire7")
MAGB B 0 A_JumpIfInventory("PullCharge",24,"AltFire6")
MAGB B 0 A_JumpIfInventory("PullCharge",20,"AltFire5")
MAGB B 0 A_JumpIfInventory("PullCharge",16,"AltFire4")
MAGB B 0 A_JumpIfInventory("PullCharge",12,"AltFire3")
MAGB B 0 A_JumpIfInventory("PullCharge",8,"AltFire2")
MAGB B 0 A_JumpIfInventory("PullCharge",4,"AltFire1")
MAGB C 0 A_FireCustomMissile("MagPush0",0,0,8,0)
goto EndPull
AltFire10:
MAGB C 0 A_FireCustomMissile("MagPush10",0,0,8,0)
goto EndPull
AltFire9:
MAGB C 0 A_FireCustomMissile("MagPush9",0,0,8,0)
goto EndPull
AltFire8:
MAGB C 0 A_FireCustomMissile("MagPush8",0,0,8,0)
goto EndPull
AltFire7:
MAGB C 0 A_FireCustomMissile("MagPush7",0,0,8,0)
goto EndPull
AltFire6:
MAGB C 0 A_FireCustomMissile("MagPush6",0,0,8,0)
goto EndPull
AltFire5:
MAGB C 0 A_FireCustomMissile("MagPush5",0,0,8,0)
goto EndPull
AltFire4:
MAGB C 0 A_FireCustomMissile("MagPush4",0,0,8,0)
goto EndPull
AltFire3:
MAGB C 0 A_FireCustomMissile("MagPush3",0,0,8,0)
goto EndPull
AltFire2:
MAGB C 0 A_FireCustomMissile("MagPush2",0,0,8,0)
goto EndPull
AltFire1:
MAGB C 0 A_FireCustomMissile("MagPush1",0,0,8,0)
goto EndPull
EndPull:
MAGB B 0 A_PlaySoundEx("weapon/magPush2","auto")
STAA B 0 A_SpawnItemEx("MagpushFX", 0, 0, 0, momx, momy, momz, 0, SXF_ABSOLUTEMOMENTUM, 0)
MAGB C 4 A_GiveInventory("EndPull",999)
MAGB B 4 SetPlayerProperty(0,0,0)
MAGB C 0 A_TakeInventory("PullCharge",999)
Goto Ready+3

Flash:
TNT1 A 0 A_JumpIfInventory("WeaponFired", 1, "NoFlash")
goto Reload
Reload:
TNT1 A 5
CRAA A 0 A_GiveInventory ("PullAmmo", 1)
loop
NoFlash:
TNT1 A 0
stop

BotFire:
MAGB B 0 A_JumpIfCloser(200, "AltCheck")
MAGB B 0 A_JumpIfNoAmmo("Run")
TNT1 A 0 A_GiveInventory("BotRetreatFlag",1)
MAGB B 0 A_GiveInventory("EndPull",1)
MAGB B 0 A_TakeInventory("PullCharge",999)
MAGB B 0 A_GiveInventory("WeaponFired",1)
CRAA A 0 A_GunFlash
MAGB A 4
MAGB B 0 A_PlaySoundEx("weapon/magnetmissile","Weapon")
MAGB B 0 A_FireCustomMissile("MagnetMissile2",0,1,8,0)
MAGB CA 4
MAGB B 12
TNT1 A 0 A_TakeInventory("BotRetreatFlag",999)
//MAGB B 0 A_Refire
Goto Ready+1
Run:
TNT1 A 0 A_GiveInventory("BotRetreatFlag",1)
MAGB B 1
TNT1 A 0 A_TakeInventory("BotRetreatFlag",999)
Goto Ready+3
AltCheck:
MAGB B 0 A_JumpIfInventory("PullAmmo",18,"AltFire")
MAGB B 0 A_TakeInventory("EndPull",999)
MAGB C 0 SetPlayerProperty(0,1,0)
MAGB B 0 A_PlaySoundEx("weapon/magPush","auto")
MAGB GH 3 A_GiveInventory("PullCharge",1)
goto AltCheck
}
}


actor MagnetMissile2 : MagnetMissile
{
Translation "87:87=4:4"
damage (15)
states
{
Death:
MMFX B 0 A_SpawnItemEX("MagnetMissile2FX")
stop
}
}

actor MagnetMissile2FX
{
+NOINTERACTION
-SOLID
+DONTBLAST
+NOGRAVITY
+DONTSPLASH
+CLIENTSIDEONLY
scale 2.5
states
{
Spawn:
MMFX BCDE 2
stop
}
}

actor Magnetpull 
{
Projectile 
Radius 120
Height 5
scale 2.5
damagetype "Magnet"
Obituary "%o was magnetized by %k's Magnetic Shockwave."
damage (2)
+RIPPER
speed 0

States
{
Spawn:
MGNE A 0 //A_CustomBulletAttack(255,0,255,100,"MagnetPuff",3000,false)
MGNE AB 4
stop
}
}

actor Magpush
{
  height 7
  radius 7
  PROJECTILE
  +DONTBLAST
  +RIPPER
  +PAINLESS
  +NONETID
  +CLIENTSIDEONLY
  damage 0
  states
  {
  Spawn:
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  TNT1 A 1 A_RadiusThrust (60000, 7, 0)
  stop
  }
}

actor MagPush1
{
height 1
radius 1
PROJECTILE
+DONTBLAST
-SOLID
+NOGRAVITY
damagetype "MagPush"
Obituary "%o was magnetized by %k's Magnetic Shockwave."
damage 0
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(11, 210, 0)
TNT1 A 0 //A_RadiusThrust (600000, 1200, 0)
TNT1 A 1
stop
}
}

actor MagPush0 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(10, 200, 0)
TNT1 A 1
stop
}
}

actor MagPush2 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(12, 220, 0)
TNT1 A 1
stop
}
}

actor MagPush3 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(13, 230, 0)
TNT1 A 1
stop
}
}

actor MagPush4 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(14, 240, 0)
TNT1 A 1
stop
}
}

actor MagPush5 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(15, 250, 0)
TNT1 A 1
stop
}
}

actor MagPush6 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(16, 260, 0)
TNT1 A 1
stop
}
}

actor MagPush7 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(17, 270, 0)
TNT1 A 1
stop
}
}

actor MagPush8 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(18, 280, 0)
TNT1 A 1
stop
}
}

actor MagPush9 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(19, 290, 0)
TNT1 A 1
stop
}
}

actor MagPush10 : MagPush1
{
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(20, 300, 0)
TNT1 A 1
stop
}
}

actor PullAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
}

actor PullCharge : Ammo
{
inventory.amount 1
inventory.maxamount 40
}

actor EndPull : Inventory
{
inventory.amount 1
inventory.maxamount 1
}
/*
actor MagArmsFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}
*/

actor MagPushFX
{
scale 2.5
- SOLID
+NOGRAVITY
+DONTSPLASH
+NONETID
States
{
Spawn:
MAGB JIJ 2
stop
}
}