actor MagnetMissileBoss : BaseMM8BDMWep_CBM
{
tag "$TAGC_3B"
dropitem "MagnetMissileWepCDropped"
Weapon.AmmoUse 4
Weapon.AmmoGive 0
Obituary "$OB_MAGNETMISSILE"
Inventory.Pickupmessage "Power up! YOU GOT SOME POWER!!!"
weapon.ammotype "MagnetMissileClassAmmo"
weapon.ammotype2 "PullCharge"
//inventory.icon "MagIcon1"
+WEAPON.Alt_AMMO_OPTIONAL
+WEAPON.NOAUTOAIM
States
{
Spawn:
C_03 B 1
loop
Ready:
MAGB A 0 ACS_ExecuteAlways(998,0,DYE_MAGNETMAN)
MAGB A 0 A_GunFlash
goto Ready1
Delay:
MAGB A 10 A_WeaponReady(WRF_ALLOWRELOAD)
goto Ready1
Ready1:
MAGB A 0 A_JumpIfInventory("MagnetMissileClassAmmo",12,"Ready2")
MAGB A 3 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWRELOAD)
MAGB A 0 A_GiveInventory("MagnetMissileClassAmmo",1)
MAGB A 0 A_GiveInventory("PullCharge",3)
loop
Ready2:
MAGB A 3 A_WeaponReady(WRF_ALLOWRELOAD)
MAGB A 0 A_GiveInventory("MagnetMissileClassAmmo",1)
MAGB A 0 A_GiveInventory("PullCharge",3)
goto Ready1

Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
MAGB A 1 A_Lower
Loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
MAGB A 1 A_Raise
Loop

Fire:
MAGB A 0 A_JumpIfInventory("MagnetMissileClassAmmo",4,"Continued")
goto NoAmmo
Continued:
MAGB A 1 OffSet(-12,20)
MAGB A 1 OffSet(-24,12)
MAGB A 1 OffSet(-36,4)
ContinueLoop:
MAGB A 0 A_PlaySoundEx("weapon/magnetmissile","Weapon")
MAGB B 1 Offset(-30,8)A_GiveInventory("MagnetmanMain_CI",1)
MAGB C 1 Offset(-20,18)
MAGB A 1 Offset(-10,28)A_GiveInventory("AtomicFireAmmo",1)
MAGB A 1 Offset(-6,32)
MAGB A 1 Offset(0,38)
MAGB A 1 Offset(4,42)A_JumpIfInventory("AtomicFireAmmo",3,"FireEnd2")
MAGB A 0 A_Refire("ContinueLoopRedo")

FireEnd: 
MAGB A 0 A_TakeInventory("AtomicFireAmmo",99)
MAGB A 1 Offset(8,42)
MAGB A 1 Offset(12,43)
MAGB A 1 Offset(14,44)
MAGB A 1 Offset(16,44)
MAGB A 1 Offset(14,42)
MAGB A 1 OffSet(12,40)
MAGB A 1 OffSet(4,34)
MAGB A 1 OffSet(-6,30)
MAGB A 16 A_WeaponReady(WRF_NOFIRE)
goto Delay
FireEnd2: //third shot, therefore arm goes farther
MAGB A 0 A_TakeInventory("AtomicFireAmmo",99)
MAGB A 1 Offset(8,48)
MAGB A 1 Offset(14,52)
MAGB A 1 Offset(18,56)
MAGB A 1 Offset(20,58)
MAGB A 1 OffSet(16,48)
MAGB A 1 OffSet(12,42)
MAGB A 1 OffSet(4,36)
MAGB A 1 OffSet(-6,32)
MAGB A 16 A_WeaponReady(WRF_NOFIRE)
Goto Delay
ContinueLoopRedo:
MAGB A 1 Offset(4,40)
MAGB A 1 Offset(0,36)
MAGB A 1 Offset(-6,30)
MAGB A 1 Offset(-20,16)
MAGB A 1 Offset(-30,6)
goto ContinueLoop

NoAmmo:
MAGB A 10
MAGB A 0 A_TakeInventory("AtomicFireAmmo",99)
MAGB A 0 A_GiveInventory("MagnetMissileClassAmmo",1)
MAGB A 0 A_GiveInventory("PullCharge",1)
goto Ready1

AltFire:
MAGB C 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,10,1)
MAGB C 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_Speed,40,100)//40% speed
MAGB C 0 //SetPlayerProperty(0,1,0)
MAGB C 0 A_GiveInventory("LadderDisable",1)
MAGB C 0 A_GiveInventory("VivifyDelay4",1)
MAGB H 0 A_PlaySoundEx("weapon/magnetmine","Body")
MAGB ADEF 2
MAGB C 0 A_JumpIfInventory("PullCharge",1,1)
goto AltEndPull
TNT1 A 0
Altfire2:
MAGB C 0 A_JumpIfInventory("PullCharge",1,1)
goto AltEndPull
MAGB F 0 A_PlaySoundEx("weapon/magPush","Body")
MAGB F 0 A_GiveInventory("VivifyDelay4",1)
MAGB F 3 Offset(1,35)A_TakeInventory("PullCharge",8)
MAGB F 0 A_GiveInventory("PullChargePower",8)
MAGB F 0 A_Refire("Altfire3")
goto AltEndPull
Altfire3:
MAGB F 0 A_JumpIfInventory("PullCharge",1,1)
goto AltEndPull
MAGB F 0 A_GiveInventory("VivifyDelay4",1)
MAGB F 3 Offset(1,60)A_TakeInventory("PullCharge",8)
MAGB F 0 A_GiveInventory("PullChargePower",8)
MAGB F 0 A_Refire("Altfire2")
goto AltEndPull
AltEndPull:
MAGB A 0 A_PlaySoundEx("weapon/magPush2","auto")
MAGB A 0 A_FireCustomMissile("MagPush1")
MAGB G 2 A_ChangeVelocity(Cos(pitch)*(ACS_NamedExecuteWithResult("MagnetCounter")*5/4), 0, -sin(pitch)*ACS_NamedExecuteWithResult("MagnetCounter"),1)
MAGB A 0 A_TakeInventory("PullChargePower",999)
MAGB A 0 A_SpawnItemEx("MagpushFX",0,0,0,momx,momy,momz,0,8,0)
MAGB A 0 A_ClearRefire
MAGB A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_JumpZ,12,1)
MAGB A 0 ACS_ExecuteAlways(CORE_ACS_191,0,APROP_Speed,1,1)
MAGB A 0 A_GiveInventory("LadderEnable",1)
MAGB A 0 A_GiveInventory("VivifyDelay5",1)
MAGB HHGGFED 1
MAGB A 0 //SetPlayerProperty(0,0,0)
MAGB A 2 OffSet(-9,27)
MAGB A 2 OffSet(-9,27)
Goto Ready1

Reload:
MAGB A 0 A_JumpIfInventory("CutterFlag",1,"AltDetonate")
MAGB A 0 A_JumpIfInventory("MagFlyDelay",1,"NoAmmo")
MAGN A 0 A_JumpIfInventory("MagFlyDelayFast",1,"NoAmmo")
MAGB A 0 A_JumpIfInventory("MagFlyIsOut",1,"NoAmmo")
MAGB A 0 A_GiveInventory("CutterFlag",1)
MAGB H 0 A_PlaySoundEx("weapon/woolshot","Weapon")
MAGB I 1
TNT1 A 0 A_GiveInventory("MagnetmanAlt_CI",1)
MAGB JKLM 1
TNT1 A 6
MAGB A 1 Offset(0,56)
MAGB A 1 Offset(0,48)
MAGB A 1 Offset(0,40)
MAGB A 1 
MAGB A 5 
Goto Ready1

AltDetonate:
MAGB A 0 A_TakeInventory("CutterFlag",1)
MAGB H 0 A_PlaySoundEx("misc/astroplatformdisappear","Body")
MAGB A 1 OffSet(-14,22)
TNT1 A 0 A_GiveInventory("WeaponCharge",1)
MAGB A 1 OffSet(-28,12)
MAGB P 3 OffSet(-20,16)
MAGB P 3 OffSet(-12,20)
MAGB A 3 OffSet(-6,24)
MAGB A 3 OffSet(-2,28)
TNT1 A 0 A_TakeInventory("WeaponCharge",999)
Goto Ready1

BotFire:
MAGB A 0 A_JumpIfCloser(200,"AltCheck")
MAGB A 0 A_GiveInventory("BotRetreatFlag",1)
MAGB A 4 OffSet(-9,27)
MAGB A 0 A_PlaySoundEx("weapon/magnetmissile","Weapon")
MAGB A 0 A_GiveInventory("MagnetmanMainX_CI",1)
MAGB A 4 OffSet(-18,14)
MAGB A 4 OffSet(-9,27)
MAGB A 12 A_WeaponReady(14)
MAGB A 0 A_TakeInventory("BotRetreatFlag",999)
Goto Ready1
Run:
MAGB A 0 A_GiveInventory("BotRetreatFlag",1)
MAGB A 1
MAGB A 0 A_TakeInventory("BotRetreatFlag",999)
Goto Ready1
AltCheck:
MAGB A 1
goto Altfire

Flash:
TNT1 A 1 A_TakeInventory("MagFlyDelay",1)
TNT1 A 0 A_TakeInventory("MagFlyDelayFast",1)
loop
}
}

/*actor MagnetReloadItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "MAGNETSI"
scale 2.0
inventory.pickupmessage "Hey, hey, step aside, Crash Man. It's time for Magnet Man to finish this job with his Magnet Missiles."
+INVBAR
states
{
Spawn:
MAGB X 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("MReload",1,"No")
TNT1 A 0 A_JumpIfInventory("MagnetMissileClassAmmo",5,"No")
TNT1 A 0 A_PlaySoundEx("weapon/BoobeamBeep","SoundSlot6")
TNT1 A 0 A_GiveInventory("MReload",1)
fail
No:
TNT1 A 0
fail
}
}

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

actor PullCharge : Ammo
{
inventory.amount 1
inventory.maxamount 112
+INVENTORY.IGNORESKILL
}

actor PullChargePower : Ammo
{
inventory.amount 1
inventory.maxamount 112
+INVENTORY.IGNORESKILL
}

actor MagnetMissileClassAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 48
+INVENTORY.IGNORESKILL
}

actor MagFlyDelay : Ammo
{
inventory.amount 1
inventory.maxamount 105
+INVENTORY.IGNORESKILL
}

actor MagFlyDelayFast : Ammo
{
inventory.amount 1
inventory.maxamount 50
+INVENTORY.IGNORESKILL
}

actor MagFlyIsOut : OnceC{}
actor BarriersOut : OnceC{}

actor MagnetmanFlag1 : OnceC{}
actor MagnetmanFlag2 : OnceC{}

actor MagFlyTrollmiteFlag : Powerup
{
Powerup.Duration 3
}

actor MagMissileClassX
{
Translation "192:192=4:4", "198:198=41:41"
PROJECTILE
damagetype "MagnetMissile"
Obituary "$OB_MAGNETMISSILE"
+DONTSEEKINVISIBLE//
+SEEKERMISSILE
+SCREENSEEKER
ReactionTime 85
damage (15)
Radius 8
Height 5
speed 44
scale 2.5

States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
SpawnLOOP:
MAGB T 2 A_SeekerMissile(2,10,3,88,10)
MAGB T 0 A_CountDown
loop
Death:
TMFX ABCD 2
stop
}
}

actor MagMissileClassXB : MagMissileClassX{translation "192:192=205:205", "198:198=74:74"}
actor MagMissileClassXR : MagMissileClassX{translation "192:192=171:171", "198:198=41:41"}
actor MagMissileClassXO : MagMissileClassX{translation "192:192=104:104", "198:198=128:128"}
actor MagMissileClassXP : MagMissileClassX{translation "192:192=229:229", "198:198=232:232"}

actor MagMissileClass
{
Translation "192:192=4:4","198:198=41:41","250:250=4:4","249:249=205:205"
PROJECTILE
var int user_p;
Radius 12
Height 12
scale 2.5
damagetype "MagnetMissile"
Obituary "$OB_MAGNETMISSILE"
damage (12-user_p)
speed 50
+SEEKERMISSILE
-EXTREMEDEATH
+SCREENSEEKER
//+HEXENBOUNCE
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteAlways("BULL_Tidifier", 0)
MAGG FGFGFG 2 A_SpawnItemEx("MagMissileClassFX",random(-8,8),0,Random(-8,8),random(-2,2),0,random(-2,2),random(0,359),9)
TNT1 A 0 A_ScaleVelocity(0.02)//hehehehehe
MAGB T 2 A_PlaySoundEx("S3_K/Beep","Weapon")
MAGG F 2
MAGB T 2
MAGG G 2
MAGB T 2
MAGB A 0 A_SetUserVar("user_p",3)
MAGG AAAAA 0 A_SeekerMissile (90, 90, SMF_LOOK|SMF_PRECISE|SMF_CURSPEED, 256, 5)
TERS A 0 A_ScaleVelocity(25.00)
TERS A 0 A_PlaySoundEx("weapon/magnettrack","Body",1)
SpawnLoop:
MAGB T 3
loop
Death:
WMFX ABCD 2
stop
}
}


actor MagMissileClassB : MagMissileClass{Translation "192:192=205:205","198:198=74:74","250:250=196:196","249:249=199:199","195:195=74:74"}
actor MagMissileClassR : MagMissileClass{Translation "192:192=171:171","198:198=41:41","250:250=170:170","249:249=43:43","195:195=41:41"}
actor MagMissileClassO : MagMissileClass{Translation "192:192=104:104","198:198=128:128","250:250=138:138","249:249=131:131","195:195=128:128"}
actor MagMissileClassP : MagMissileClass{Translation "192:192=229:229","198:198=232:232","250:250=214:214","249:249=223:223","195:195=232:232"}

//actor HeHasMyPowerPower : Powerup{Powerup.Duration 90}

actor MagflyMagnetX : BasicHelper
{
height 64
scale 2.5
//+FLOATBOB
renderstyle normal
reactiontime 210
Translation "192:192=4:4","198:198=41:41"
//+SHOOTABLE
//+NOTAUTOAIMED
//+NODAMAGE
//+NODAMAGETHRUST
//+NOGRAVITY
//+NOBLOOD
//+QUICKTORETALIATE
//+INVULNERABLE
//+FORCEXYBILLBOARD
//+CANTSEEK
//Health 9999
//Mass 99999
Radius 32
Speed 0
//painchance 256
damagefactor "Normal", 0.0
damagefactor "ThunderClaw", 1.0
damagefactor "ThunderClawPegHelp", 1.0
damagefactor "ThunderClawHit", 1.0
States
{
Spawn:
NAPA E 0 A_PlaySoundEx("weapon/magnetbeep", "Body")
SpawnLOOP:
MAG3 A 0 A_Stop
MAG3 A 0 ACS_NamedExecuteAlways("Trill_MagnetJumpBooster",0,128)
MAG3 AA 0 A_SpawnItemEx("MagParticleSpawnerX",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 A 1 A_Countdown
MAG3 A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"BRRRRRRRRRR")
MAG3 A 0 A_JumpIfInTargetInventory("MagFlyTrollmiteFlag",1,"Death")
MAG3 A 0 ACS_NamedExecuteAlways("Trill_MagnetJumpBooster",0,128)
MAG3 AA 0 A_SpawnItemEx("MagParticleSpawnerX",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 A 1 A_Countdown
MAG3 A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"BRRRRRRRRRR")
MAG3 A 0 A_JumpIfInTargetInventory("MagFlyTrollmiteFlag",1,"Death")
MAG3 A 0 ACS_NamedExecuteAlways("Trill_MagnetJumpBooster",0,128)
MAG3 AA 0 A_SpawnItemEx("MagParticleSpawnerX",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 A 1 A_Countdown
MAG3 A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"BRRRRRRRRRR")
MAG3 A 0 A_JumpIfInTargetInventory("MagFlyTrollmiteFlag",1,"Death")
MAG3 A 0 ACS_NamedExecuteAlways("Trill_MagnetJumpBooster",0,128)
MAG3 AA 0 A_SpawnItemEx("MagParticleSpawnerX",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 B 1 A_Countdown
MAG3 A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"BRRRRRRRRRR")
MAG3 A 0 A_JumpIfInTargetInventory("MagFlyTrollmiteFlag",1,"Death")
MAG3 A 0 ACS_NamedExecuteAlways("Trill_MagnetJumpBooster",0,128)
MAG3 AA 0 A_SpawnItemEx("MagParticleSpawnerX",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 B 1 A_Countdown
MAG3 A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"BRRRRRRRRRR")
MAG3 A 0 A_JumpIfInTargetInventory("MagFlyTrollmiteFlag",1,"Death")
MAG3 A 0 ACS_NamedExecuteAlways("Trill_MagnetJumpBooster",0,128)
MAG3 AA 0 A_SpawnItemEx("MagParticleSpawnerX",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 B 1 A_Countdown
MAG3 A 0 A_JumpIfInTargetInventory("WeaponCharge",1,"BRRRRRRRRRR")
MAG3 A 0 A_JumpIfInTargetInventory("MagFlyTrollmiteFlag",1,"Death")
loop
Death:
MAGB A 0 A_TakeFromTarget("MagFlyTrollmiteFlag",1)
MAGB A 0 A_TakeFromTarget("CutterFlag",999)
NAPA E 0 A_PlaySoundEx("misc/mm3explosion", "Body")
MAGB A 0 A_GiveToTarget("MagFlyDelayFast",50)
MAGB A 0 A_TakeFromTarget("MagFlyIsOut",999)
MAGB A 0 A_ChangeFlag("FLOATBOB",FALSE)
MXP2 ABCDEFGHIJKLMNOPQRST 1
stop
BRRRRRRRRRR:
MAG3 A 0 A_SpawnItemEX("MagflyMagnetMad",0,0,0,0,0,0,0,1)
stop
Pain.ThunderClawHit:
Pain.ThunderClaw:
Pain.ThunderClawPegHelp:
THOO A 0 A_ChangeFlag(SHOOTABLE, false)
TNT1 A 1 ACS_ExecuteAlways(248, 0, 70)
//TNT1 A 1 A_TakeFromTarget("YoGeekyAmmo",75)
THOO A 0 A_ClearTarget
THOO A 0 A_ChangeFlag(SHOOTABLE, true)
Goto SpawnLOOP
}
}

actor MagflyMagnetXB : MagflyMagnetX{Translation "192:192=4:4","198:198=74:74","250:250=196:196","249:249=199:199","195:195=74:74"}
actor MagflyMagnetXR : MagflyMagnetX{Translation "192:192=4:4","198:198=41:41","250:250=170:170","249:249=43:43","195:195=41:41"}
actor MagflyMagnetXO : MagflyMagnetX{Translation "192:192=4:4","198:198=128:128","250:250=138:138","249:249=131:131","195:195=128:128"}
actor MagflyMagnetXP : MagflyMagnetX{Translation "192:192=4:4","198:198=232:232","250:250=214:214","249:249=223:223","195:195=232:232"}

actor MagflyMagnetMad
{
PROJECTILE
Translation "192:192=4:4","198:198=41:41"
speed 0
+THRUACTORS
damage (0)
scale 2.5
reactiontime 35
states
{
Spawn:
TNT1 AA 0
TNT1 A 0 A_SpawnItemEx("MagFlyExploderFinal",0,0,-10,0,0,0,0,552)//HAHA 69 DAMAGE LMAOOOOOOOOOOOOOOOOOOOOOO
MAG3 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MagMissileClassFX2Start", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AAAAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MagMissileClassFX3Start", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
SpawnLOOP:
MAG3 A 2 A_PlaySoundEx("weapon/magnetminefly","Weapon")
MAG3 B 0 A_Quake(3,2,0,180)
MAG3 B 0 A_Quake(1,2,0,360)
MAG3 B 0 A_CountDown
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX2", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX3", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AAAA 0 A_SpawnItemEx("MagParticleSpawnerX2",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
//MAG3 A 0 A_SpawnItemEx("MagFlyExploder",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 B 2 //A_PlaySoundEx("Weapon/MagFlyMad","Weapon")
MAG3 B 0 A_Quake(3,2,0,180)
MAG3 B 0 A_Quake(1,2,0,360)
MAG3 B 0 A_CountDown
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX2", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX3", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AAAA 0 A_SpawnItemEx("MagParticleSpawnerX2",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
TNT1 A 0 A_SpawnItemEx("MagFlyExploder",0,0,-10,0,0,0,0,552)
MAG3 A 2
MAG3 B 0 A_Quake(3,2,0,180)
MAG3 B 0 A_Quake(1,2,0,360)
MAG3 B 0 A_CountDown
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX2", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX3", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AAAA 0 A_SpawnItemEx("MagParticleSpawnerX2",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
//MAG3 A 0 A_SpawnItemEx("MagFlyExploder",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
MAG3 B 2 //A_PlaySoundEx("Weapon/MagFlyMad","Weapon")
MAG3 B 0 A_Quake(3,2,0,180)
MAG3 B 0 A_Quake(1,2,0,360)
MAG3 B 0 A_CountDown
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX2", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AA 0 A_SpawnItemEx("MagMissileClassFX3", random(0, 128), 0, Random(0, 8), 0, 0, random(-80, -100), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
MAG3 AAAA 0 A_SpawnItemEx("MagParticleSpawnerX2",0,0,-(z-floorz),0,0,0,0,SXF_TRANSFERTRANSLATION)
TNT1 A 0 A_SpawnItemEx("MagFlyExploder",0,0,-10,0,0,0,0,552)
loop
Death:
MAGB A 0 A_TakeFromTarget("CutterFlag",999)
MAGB A 0 A_TakeFromTarget("WeaponCharge",999)
NAPA E 0 A_PlaySoundEx("misc/mm3explosion", "Weapon")
MAG3 A 0 A_TakeFromTarget("MagFlyIsOut",999)
MAGB A 0 A_GiveToTarget("MagFlyDelay",105)
MXP4 ABCDEFHIJKLMNOPQUS 1
stop
}
}

actor MagflyMagnetMadB : MagflyMagnetMad{Translation "192:192=4:4","198:198=74:74","250:250=196:196","249:249=199:199","195:195=74:74"}
actor MagflyMagnetMadR : MagflyMagnetMad{Translation "192:192=4:4","198:198=41:41","250:250=170:170","249:249=43:43","195:195=41:41"}
actor MagflyMagnetMadO : MagflyMagnetMad{Translation "192:192=4:4","198:198=128:128","250:250=138:138","249:249=131:131","195:195=128:128"}
actor MagflyMagnetMadP : MagflyMagnetMad{Translation "192:192=4:4","198:198=232:232","250:250=214:214","249:249=223:223","195:195=232:232"}

actor MagFlyExploder
{
PROJECTILE
Species "ThunderWoolBoss"
damagetype "MagnetM_MagFly"
Obituary "$OB_MAGNETMANFLY"
+THRUACTORS
+THRUSPECIES
+THRUGHOST
renderstyle none
+DONTBLAST
+DONTREFLECT
damage (0)
Radius 8
Height 8
speed 45
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("MagFlyExploder",0,0,-10,0,0,0,0,552)
FRWV X 1 A_Explode(2,128,0,0,128)
TNT1 A 0 A_Stop
stop
}
}

actor MagFlyExploderFinal : MagFlyExploder
{
damagetype "MagnetM_MagFlySlam"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("MagFlyExploderFinal",0,0,-10,0,0,0,0,552)
FRWV X 1 A_Explode(1,128,0,0,128)
TNT1 A 0 A_Stop
stop
}
}

actor MagnetM_MagFlyProtection : PowerProtection
{
Powerup.Duration 2
DamageFactor "MagnetM_MagFly", 0.0
//DamageFactor "MagnetM_MagFlySlam", 0.0
}

actor MagnetM_MagFlySlamProtection : PowerProtection
{
Powerup.Duration 2
DamageFactor "MagnetM_MagFlySlam", 0.0
}

actor MagnetJumpBoost : PowerHighJump
{
powerup.duration 17
}

actor MagFlyDeleteItem : CustomInventory
{
inventory.amount 1
inventory.maxamount 1
inventory.icon "MagIcon1"
scale 2.0
Tag "$TAGC_3B2"
inventory.pickupmessage "Hey, hey, step aside, Crash Man. It's time for Magnet Man to finish this job with his Mag Flies."
+INVBAR
states
{
Spawn:
MAGB X 1
loop
Use:
TNT1 A 0 A_PlaySoundEx("weapon/BoobeamBeep","SoundSlot6")
//TNT1 A 0 A_JumpIfInventory("ClashFlagT",1,"No")
TNT1 A 0 A_GiveInventory("MagFlyTrollmiteFlag",1)
fail
No:
TNT1 A 0
fail
}
}

actor MagParticleSpawnerX
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
-SOLID
+FLOORHUGGER
scale 2.5
height 0
radius 0
States
{
Spawn:
TNT1 A 0
TNT1 AA 0 A_SpawnItemEx("MagMissileClassFX", random(0, 128), 0, Random(0, 8), momx, momy, random(6, 15), random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
stop
}
}

actor MagParticleSpawnerX2
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
+FORCEXYBILLBOARD
-SOLID
+FLOORHUGGER
scale 2.5
height 0
radius 0
States
{
Spawn:
TNT1 A 0
TNT1 AA 0 A_SpawnItemEx("MagMissileClassFX", random(0, 128), 0, Random(0, 8), momx, momy, 0, random(0,359), SXF_ABSOLUTEMOMENTUM|SXF_TRANSFERTRANSLATION)
TNT1 A 0 A_PlaySoundEx("Weapon/MagFlyMad","Weapon")
stop
}
}

actor PullChargeFX_Helper : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("MagMissileClassFX",random(2,12),0,random(48,56),0,0,frandom(1,2),random(1,16)*20,1)
TNT1 A 1
stop
}
}

actor MagMissileClassFX : BasicClientSide
{
-NOINTERACTION
-THRUACTORS
alpha 0.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump(256,1,3)
X_0C E 10
X_0C E 1 A_Fadeout(0.1)
wait
X_0C F 10
X_0C F 1 A_Fadeout(0.1)
wait
Death:
TNT1 A 0
stop
}
}

actor MagMissileClassFX2 : MagMissileClassFX
{
States
{
Spawn:
TNT1 A 0
X_0C EEEEEEEEEE 1 A_FadeIn(0.2)
X_0C E 1 A_CheckFloor("Death")
wait
}
}

actor MagMissileClassFX3 : MagMissileClassFX
{
States
{
Spawn:
TNT1 A 0
X_0C FFFFFFFFFF 1 A_FadeIn(0.2)
X_0C F 1 A_CheckFloor("Death")
wait
}
}

actor MagMissileClassFX2Start : MagMissileClassFX2
{
renderstyle add
scale 5.0
}

actor MagMissileClassFX3Start : MagMissileClassFX3
{
renderstyle add
scale 5.0
}

actor MagPush1 : BasicExplosion
{
var int user_P;
damagetype "MagnetM_Push"
Obituary "$OB_MAGNETPUSH"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_SetUserVar("user_P",CallACS("cbm_countinv_acs",31,2))
TNT1 A 4 A_Explode(6+(user_P*0.125),128+(user_P*1.75),0,0,16+(user_P*0.875))
TNT1 A 2
stop
}
}

actor MagPushFX
{
-SOLID
+NOGRAVITY
+DONTSPLASH
+NONETID
Radius 2
Height 2
scale 2.5
States
{
Spawn:
TNT1 AA 0
MAGB ONO 2 //ONO! it's back!
stop
}
}

actor MagflyMagnetSpawnerBloke : ThunderWool
{
Translation "192:192=4:4","198:198=41:41"
+THRUACTORS
-BOUNCEONCEILINGS
-FORCEXYBILLBOARD
+CANBOUNCEWATER
Height 64
States
{
Spawn:
MAG3 A 0
MAG3 A 0 A_GiveToTarget("MagFlyIsOut",999)
MAG3 AAAA 3 ThrustThingZ(0,9,0,1)
MAG3 E 0 ThrustThingZ(0,9,0,1)
MAG3 AAAAAAAAA 1
Death:
MAG3 A 0 A_SpawnItemEX("MagflyMagnetX",0,0,0,0,0,0,0,SXF_TRANSFERTRANSLATION)
stop
}
}

actor MagflyMagnetSpawnerBlokeB : MagflyMagnetSpawnerBloke{Translation "192:192=4:4","198:198=74:74","250:250=196:196","249:249=199:199","195:195=74:74"}
actor MagflyMagnetSpawnerBlokeR : MagflyMagnetSpawnerBloke{Translation "192:192=4:4","198:198=41:41","250:250=170:170","249:249=43:43","195:195=41:41"}
actor MagflyMagnetSpawnerBlokeO : MagflyMagnetSpawnerBloke{Translation "192:192=4:4","198:198=128:128","250:250=138:138","249:249=131:131","195:195=128:128"}
actor MagflyMagnetSpawnerBlokeP : MagflyMagnetSpawnerBloke{Translation "192:192=4:4","198:198=232:232","250:250=214:214","249:249=223:223","195:195=232:232"}

actor MagnetmanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagMissileClass",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagMissileClassB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagMissileClassR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagMissileClassO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagMissileClassP",0,1,8,0)
goto Done
}
}


actor MagnetmanMainX_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagMissileClassX",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagMissileClassXB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagMissileClassXR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagMissileClassXO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagMissileClassXP",0,1,8,0)
goto Done
}
}

actor MagnetmanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("MagflyMagnetSpawnerBloke",0,1,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("MagflyMagnetSpawnerBlokeB",0,1,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("MagflyMagnetSpawnerBlokeR",0,1,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("MagflyMagnetSpawnerBlokeO",0,1,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("MagflyMagnetSpawnerBlokeP",0,1,8,0)
goto Done
}
}