actor MagnetMissileBoss : BaseMM8BDMWep_CBM
{
dropitem "MagnetMissileWepCDropped"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Weapon.SlotNumber 1
Obituary "$OB_MAGNETMISSILE"
Inventory.Pickupmessage "Power up! YOU GOT SOME POWER!!!"
weapon.ammotype "PullAmmo"
weapon.ammotype2 "PullCharge"
+WEAPON.Alt_AMMO_OPTIONAL
States
{
Spawn:
C_03 B 1
loop
Ready:
MAGB A 0 ACS_ExecuteAlways(998,0,761)
goto Ready1
Ready1:
MAGB A 0 A_TakeInventory("WeaponFired",999)
MAGB A 0 //A_GunFlash
MAGB A 0 A_JumpIfInventory("PullAmmo",3,"Ready2")
MAGB A 4 A_WeaponReady(WRF_NOFIRE)
MAGB A 0 A_GiveInventory("PullAmmo",1)
Goto Ready1+2
Ready2:
MAGB A 4 A_WeaponReady
MAGB A 0 A_GiveInventory("PullAmmo",1)
loop
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("IsBot",1,"BotFire")
MAGB B 0 A_JumpIfInventory("PullAmmo",3,1)
goto NoAmmo

MAGB A 0 A_GiveInventory("EndPull",1)
MAGB A 0 A_TakeInventory("PullCharge",999)
MAGB A 0 A_GiveInventory("WeaponFired",1)
MAGB A 0 //A_GunFlash

MAGB A 0 A_TakeInventory("MagnetmanFlag1",9)
MAGB A 2 A_TakeInventory("MagnetmanFlag2",9)
MAGB A 0 A_TakeInventory("PullAmmo",4)
MAGB A 0 A_PlaySoundEx("weapon/magnetmissile","Weapon")
MAGB A 1 OffSet(-14,22)A_GiveInventory("MagnetmanMain_CI",1)
MAGB A 0 A_GunFlash
goto Hold
Hold:
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)
MAGB A 0 A_Refire(1)
goto FireEnd
MAGB A 0 A_JumpIfInventory("MagnetmanFlag2",1,"FireEndX")
MAGB A 1 OffSet(-28,12)A_GiveInventory("PullAmmo",1)
MAGB A 0 A_Refire
goto FireEnd
FireEndX:
MAGB A 0 A_ClearRefire
FireEnd:
MAGB B 3 OffSet(-20,16)A_GiveInventory("MagnetmanFlag1",1)
MAGB B 3 OffSet(-12,20)A_WeaponReady(7)
MAGB A 3 OffSet(-6,24)A_WeaponReady(7)
MAGB A 3 OffSet(-2,28)A_WeaponReady(7)
Goto Ready1

NoAmmo:
MAGB B 0
Goto Ready1


Flash://For the bot?
TNT1 A 0 A_JumpIfInventory("WeaponFired",1,"NoFlash")
goto Reload
Reload:
TNT1 A 5
TNT1 A 0 A_JumpIfInventory("IsDead",1,"NoFlash")
TNT1 A 0 A_GiveInventory("PullAmmo",2)
loop

AltFire:
MAGB G 0 ACS_ExecuteAlways(C_SPEEDJUMP_ACS,0,100,100)
MAGB G 0 A_TakeInventory("EndPull",999)
MAGB G 0 SetPlayerProperty(0,1,0)
MAGB G 0 A_PlaySoundEx("weapon/magPush","auto")
MAGB G 3 Offset(1,33)A_GiveInventory("PullCharge",2)
MAGB H 0 A_GiveInventory("PullAmmo",1)
MAGB H 3 Offset(1,33)A_GiveInventory("PullCharge",2)
AltRefire:
MAGB H 0 A_JumpIfInventory("PullCharge",40,"AltFire10")
MAGB H 0 A_Refire
MAGB A 0 A_JumpIfInventory("PullCharge",36,"AltFire9")
MAGB A 0 A_JumpIfInventory("PullCharge",32,"AltFire8")
MAGB A 0 A_JumpIfInventory("PullCharge",28,"AltFire7")
MAGB A 0 A_JumpIfInventory("PullCharge",24,"AltFire6")
MAGB A 0 A_JumpIfInventory("PullCharge",20,"AltFire5")
MAGB A 0 A_JumpIfInventory("PullCharge",16,"AltFire4")
MAGB A 0 A_JumpIfInventory("PullCharge",12,"AltFire3")
MAGB A 0 A_JumpIfInventory("PullCharge",8,"AltFire2")
MAGB A 0 A_JumpIfInventory("PullCharge",4,"AltFire1")
MAGB A 0 A_FireCustomMissile("MagPush0",0,0,8,0)
goto EndPull
AltFire10:
MAGB A 0 A_FireCustomMissile("MagPush10")
goto EndPull
AltFire9:
MAGB A 0 A_FireCustomMissile("MagPush9")
goto EndPull
AltFire8:
MAGB A 0 A_FireCustomMissile("MagPush8")
goto EndPull
AltFire7:
MAGB A 0 A_FireCustomMissile("MagPush7")
goto EndPull
AltFire6:
MAGB A 0 A_FireCustomMissile("MagPush6")
goto EndPull
AltFire5:
MAGB A 0 A_FireCustomMissile("MagPush5")
goto EndPull
AltFire4:
MAGB A 0 A_FireCustomMissile("MagPush4")
goto EndPull
AltFire3:
MAGB A 0 A_FireCustomMissile("MagPush3")
goto EndPull
AltFire2:
MAGB A 0 A_FireCustomMissile("MagPush2")
goto EndPull
AltFire1:
MAGB A 0 A_FireCustomMissile("MagPush1")
goto EndPull
EndPull:
MAGB A 0 A_PlaySoundEx("weapon/magPush2","auto")
MAGB A 0 A_SpawnItemEx("MagpushFX",0,0,0,momx,momy,momz,0,8,0)
MAGB A 0 A_ClearRefire
MAGB A 4 OffSet(-18,14)A_GiveInventory("EndPull",999)
MAGB A 0 ACS_ExecuteAlways(C_SPEEDJUMP_ACS,0,100,120)
MAGB A 4 OffSet(-9,27)SetPlayerProperty(0,0,0)
MAGB A 0 A_TakeInventory("PullCharge",999)
Goto Ready1+2

BotFire:
MAGB A 0 A_JumpIfCloser(200,"AltCheck")
MAGB A 0 A_JumpIfNoAmmo("Run")
MAGB A 0 A_GiveInventory("BotRetreatFlag",1)
MAGB A 0 A_GiveInventory("EndPull",1)
MAGB A 0 A_TakeInventory("PullCharge",999)
MAGB A 0 A_GiveInventory("WeaponFired",1)
MAGB A 0 A_GunFlash
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)
TNT1 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+2
AltCheck:
MAGB A 0 A_JumpIfInventory("PullAmmo",18,"AltFire")
MAGB A 0 A_TakeInventory("EndPull",999)
MAGB A 0 SetPlayerProperty(0,1,0)
MAGB A 0 A_PlaySoundEx("weapon/magPush","auto")
MAGB GH 3 A_GiveInventory("PullCharge",2)
goto AltCheck
}
}


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

actor A3AmmoBlah : PullAmmo{}

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

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

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

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 47
scale 2.5

States
{
Spawn:
MAGB T 2 A_SeekerMissile(2,10,3,88,10)
MAGB T 0 A_CountDown
loop
Death:
TMFX BCDE 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
{
var int user_P;
//var int user_Z;
Translation "192:192=4:4","198:198=41:41","250:250=4:4","249:249=205:205"
PROJECTILE
damagetype "MagnetMissile"
Obituary "$OB_MAGNETMISSILE"
+DONTSEEKINVISIBLE//
+SEEKERMISSILE
+SCREENSEEKER
+LOOKALLAROUND
Radius 8
Height 8
scale 3.0//2.5
damage (9+user_P)
speed 36//30
reactiontime 10
States
{
Spawn:
MAGB T 0 A_JumpIf(ACS_ExecuteWithResult(C_CHECK_TARGET_OOC)==0,"SpawnX")
MAGB TTTTT 1 A_JumpIfInTargetInventory("MagnetmanFlag1",1,"Home")
MAGB T 0 A_SetUserVar("user_P",user_P+1)
loop
HomeFlag:
MAGB T 0 A_ChangeFlag("SCREENSEEKER",0)
goto Home+1
Home:
MAGB T 0 A_JumpIf(user_P>=6,"HomeFlag")
MAGB T 0
MAGB T 0 A_GiveInventory("MagnetmanFlag2",1)
MAGB T 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_NULL)
MAGB T 0 A_PlaySoundEx("S3_K/Beep","Weapon")
MAGB TTTTT 0 A_SeekerMissile(user_P+1,user_P*2+2,3,256,3)
MAGB U 1 //A_SetUserVar("user_Z",z)
MAGB U 0 A_JumpIfInventory("IsInGame",1,"Spawn1",AAPTR_TRACER)
goto SpawnX
SpawnX:
MAGB U 2
loop
Spawn1:
MAGB U 0 A_JumpIf(user_P>=16,"Spawn3")
MAGB U 0 A_JumpIfInventory("HeHasMyPowerPower",1,"SpawnP",AAPTR_TRACER)
goto Spawn2
Spawn2:
MAGB UUUUUUUUUU 2 A_SeekerMissile(user_P+1,user_P*2+8,3,50,3)
goto SpawnX
SpawnP:
MAGB UUUUUUUUUU 2 A_SeekerMissile(user_P*2+1,user_P*4+8,3,50,3)
goto SpawnX
Spawn3://Peace out
MAGB UU 1 A_SeekerMissile(90,90,3,50,3)
MAGB U 0 A_CountDown
loop
Death:
TNT1 A 0 A_JumpIfInventory("MagnetmanFlag2",1,"Death2")
TNT1 A 0 A_GiveToTarget("MagnetmanFlag2",1)
TMFX BCDE 2
stop
Death2:
ZMFX BCDE 2
stop
}
}

actor MagMissileClassB : MagMissileClass{Translation "192:192=205:205","198:198=74:74","250:250=196:196","249:249=75:75","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 80
}

actor MagPush1 : BasicExplosion
{
damagetype "MagPush"
Obituary "$OB_MAGNETPUSH"
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(11,210,0)
stop
}
}

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

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

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

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

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

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

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

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

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

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


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

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
}
}

