actor ProtoBusterC : ProtoBuster
{
dropitem "PowerUpgradeGiverDropped"
States
{
Spawn:
C_00 A 1
loop
Ready:
PROC J 0 A_JumpIfInventory("Once",1,"Ready2")
PROC J 0 ACS_ExecuteAlways(981,0,0)
PROC J 0 A_GiveInventory("Once",1)
Goto Ready2

Ready2:
PROC J 0 ACS_ExecuteAlways(998,0,700)
PROC J 0 A_TakeInventory("WeaponCharge",999)
PROC J 0 A_TakeInventory("StopShield",1)
PROC J 0 A_GunFlash
PROC LKJ 1 A_WeaponReady
Goto Ready2+6

Deselect:
BASB B 0 //A_TakeInventory("Once",1)
PROC LK 0 A_TakeInventory("ProtoSlide",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
PROC J 1 A_Lower
Loop

Fire:
PROC D 0 A_JumpIfInventory("StopShield",1,"FireX")
PROC D 0 A_GiveInventory("StopShield",1)
PROC D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
PROC D 0 A_GiveInventory("ProtomanMain_CI",1)
PROC KLD 1 A_TakeInventory("WeaponCharge",999)
PROC EF 3
PROC D 2
PROC D 0 A_Refire("HoldS")
goto FireXL
FireXL:
PROC DDDDDDDDDDDDD 1 A_WeaponReady
goto Ready2+2
FireX:
PROC D 0 A_GiveInventory("StopShield",1)
PROC D 0 A_PlaySoundEx("weapon/mbuster","Weapon")
PROC D 0 A_GiveInventory("ProtomanMain_CI",1)
PROC EF 3
PROC D 2 A_TakeInventory("WeaponCharge",999)
PROC D 0 A_Refire("HoldS")
goto FireXL
Fire2X:
PROC D 0 ACS_ExecuteAlways(991,0,700)
PROC D 0 A_TakeInventory("WeaponCharge",999)
PROC D 0 A_GiveInventory("StopShield",1)
PROC F 0 A_PlaySoundEx("weapon/pshot","Weapon")
PROC F 3 A_GiveInventory("ProtomanMain2_CI",1)
PROC EDD 3
PROC D 0 A_Refire("HoldS")
goto Ready2+1
Fire3X:
PROC D 0 ACS_ExecuteAlways(991,0,700)
PROC D 0 A_TakeInventory("WeaponCharge",999)
PROC D 0 A_GiveInventory("StopShield",1)
PROC D 0 A_PlaySoundEx("weapon/pshot","Weapon")
PROC F 3 A_GiveInventory("ProtomanMain3_CI",1)
PROC ED 3
PROC D 8
PROC D 0 A_Refire("HoldS")
goto Ready2+1
HoldS:
PROC D 0 A_GiveInventory("StopShield",1)
PROC D 0 A_JumpIfInventory("WeaponCharge",24,"ChargeX2")
PROC D 0 A_JumpIfInventory("WeaponCharge",10,"ChargeX")
PROC D 1 A_GiveInventory("WeaponCharge",1)
PROC D 0 A_Refire("HoldS")
Goto FireX
ChargeX:
PROC D 0 A_JumpIfInventory("WeaponCharge",24,"ChargeX2")
PROC D 0 A_JumpIfInventory("WeaponCharge",11,"ChargeX1")
PROC D 0 A_PlaySoundEx("weapon/pcharge","Weapon")
PROC D 1
PROC D 0 A_Refire(1)
Goto Fire2X
PROC D 1
PROC D 0 A_Refire("ChargeX1")
Goto Fire2X
ChargeX1:
PROC D 0 A_JumpIfInventory("WeaponCharge",24,"ChargeX2")
PROC D 1 ACS_ExecuteAlways(998,0,63,5)
PROC D 0 A_Refire(1)
Goto Fire2X
PROC R 1 ACS_ExecuteAlways(998,0,700,1)
PROC R 0 A_GiveInventory("WeaponCharge",1)
PROC R 0 A_Refire(1)
Goto Fire2X
PROC R 1
PROC R 0 A_Refire(1)
Goto Fire2X
PROC R 1 A_GiveInventory("WeaponCharge",1)
PROC R 0 A_Refire("ChargeX1")
Goto Fire2X
ChargeX2:
PROC S 0 A_GiveInventory("StopShield",1)
PROC S 0 A_JumpIfInventory("ProtomanUpgradeFlag",1,"Charge2SS")
PROC S 1 ACS_ExecuteAlways(998,0,64,6)
PROC S 0 A_Refire(1)
Goto Fire3X
PROC R 1 ACS_ExecuteAlways(998,0,700,7)
PROC R 0 A_JumpIfInventory("IsBot", 1, "BotFireX")
PROC R 0 A_Refire("ChargeX2")
Goto Fire3X
Charge2SS:
PROC S 0 A_GiveInventory("ProtoStrikeReady",1)
goto Charge2S
Charge2S:
PROC S 0 A_GiveInventory("StopShield",1)
PROC S 0 ACS_ExecuteAlways(998,0,64,6)
PROC S 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
PROC R 0 ACS_ExecuteAlways(998,0,700,7)
PROC R 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSWITCH)
PROC D 0 //A_GunFlash
PROC D 0 A_JumpIfInventory("IsBot",1,"ProtoStrike")
PROC D 0 A_Refire("Charge2S")
PROC D 0 A_TakeInventory("ProtoStrikeReady",1)
Goto Fire3X
BotFireX:
PROC D 0 A_Jump(16, "Fire3X")
PROC D 0 A_Refire("ChargeX2")
Goto Fire3X

ProtoStrike:
PROC F 0 ACS_ExecuteAlways(991,0,700)
PROC F 0 A_ClearReFire
PROC F 0 A_TakeInventory("ProtoStrikeReady",1)
PROC F 0 A_TakeInventory("WeaponCharge",999)
PROC F 0 A_GiveInventory("StopShield",1)
PROC F 0 A_PlaySoundEx("weapon/pshot","Weapon")
PROC F 6 A_GiveInventory("ProtomanAlt_CI",1)
PROC ED 3
PROC D 4 A_ClearRefire
PROC D 5
goto Ready2+1

Altfire:
PROC I 0 A_JumpIfInventory("ProtoStrikeReady",1,"ProtoStrike")
PROC J 0 A_JumpIf(z-floorz==0,"SlideSlide") //A_JumpIf(momz==0, "SlideSlide")
Goto Ready2+2
SlideSlide:
PROC D 0 A_GiveInventory("ProtoSlide",1)
PROC D 0 A_PlaySoundEx("weapon/chargekick","Weapon")
PROC D 0 SetPlayerProperty(0,1,0)
PROC D 0 ACS_ExecuteAlways(648,0,5)
PROC D 0 A_JumpIfInventory("StopShield",1,5)
PROC D 0 A_GiveInventory("StopShield",1)
PROC L 2 A_GiveInventory("CopySlidePickup",1)
PROC K 2
PROC K 0 A_Jump(256,2)
PROC D 4 A_GiveInventory("CopySlidePickup",1)
PSLI A 8 //SetPlayerProperty(0,0,0)
PSLI B 5 SetPlayerProperty(0,0,0)
PROC L 10 ACS_ExecuteAlways(648,0,3)
PROC K 0 A_TakeInventory("ProtoSlide",1)
PROC K 0 A_TakeInventory("WeaponCharge",999)
PROC K 0 A_TakeInventory("StopShield",1)
PROC K 0 A_GunFlash
PROC KKK 1 A_WeaponReady
Goto Ready2+6

NoFlash:
TNT1 A 0
stop
}
}


actor ProtoStrikeReady : OnceC{}


actor ProtoShotC : ProtoShot
{
Translation "195:195=248:248"
-SKYEXPLODE
-DONTREFLECT
Speed 26
Damage (16)
radius 5
height 5
States
{
Spawn:
TNT1 A 2
BUST U 2
BUST U 0 A_ChangeFlag("THRUGHOST",0)
BUST U 1
wait
Death:
BUST U 1
stop
}
}

actor ProtoShotCB : ProtoShotC{translation "195:195=74:74"}
actor ProtoShotCR : ProtoShotC{translation "195:195=41:41"}
actor ProtoShotCO : ProtoShotC{translation "195:195=128:128"}
actor ProtoShotCP : ProtoShotC{translation "195:195=232:232"}

actor ProtoShot2C : ProtoShot2
{
Translation "204:204=215:215"
-SKYEXPLODE
Speed 26
Damage (22)
radius 14
height 14
States
{
Spawn:
TNT1 A 2
PCOI W 2 
PCOI W 0 A_ChangeFlag("THRUGHOST",0)
PCOI W 4
goto spawn+3
}
}

actor ProtoShot2CB : ProtoShot2C{translation "204:204=205:205"}
actor ProtoShot2CR : ProtoShot2C{translation "204:204=171:171"}
actor ProtoShot2CO : ProtoShot2C{translation "204:204=104:104"}
actor ProtoShot2CP : ProtoShot2C{translation "204:204=229:229"}

actor ProtoShot3C : ProtoShot3
{
Translation "192:192=87:87", "198:198=42:42", "202:202=210:210"
-SKYEXPLODE
Speed 60
Damage (39)
radius 18
height 18
States
{
Spawn:
PCOI X 2
PCOI Y 2 A_ChangeFlag("THRUGHOST",0)
PCOI Z 2
PCOI XYZ 2
Goto Spawn+3
}
}

actor ProtoShot3CB : ProtoShot3C{translation "192:192=205:205", "198:198=74:74", "202:202=205:205"}
actor ProtoShot3CR : ProtoShot3C{translation "192:192=171:171", "198:198=41:41", "202:202=171:171"}
actor ProtoShot3CO : ProtoShot3C{translation "192:192=104:104", "198:198=128:128", "202:202=104:104"}
actor ProtoShot3CP : ProtoShot3C{translation "192:192=229:229", "198:198=232:232", "202:202=229:229"}

actor ProtoStrikeShot : BasicExplosion
{
Translation "192:192=87:87", "198:198=42:42"
damagetype "ProtoBuster"
Obituary "$OB_PROTOSTRIKE"
Speed 60
scale 3.0
States
{
Spawn:
CHBU A 0
CHBU A 0 A_Explode(8,44,0,0,44)
CHBU A 2 A_Explode(8,44,0,0,44)
CHBU B 1 A_Explode(8,44,0,0,44)
CHBU B 1 A_Stop
CHBU CDABCD 2 A_Explode(8,44,0,0,44)
stop
}
}

actor ProtoStrikeShotB : ProtoStrikeShot{translation "192:192=205:205","198:198=74:74"}
actor ProtoStrikeShotR : ProtoStrikeShot{translation "192:192=171:171","198:198=41:41"}
actor ProtoStrikeShotO : ProtoStrikeShot{translation "192:192=104:104","198:198=128:128"}
actor ProtoStrikeShotP : ProtoStrikeShot{translation "192:192=229:229","198:198=232:232"}

actor ProtoStrikeShot2 : ProtoStrikeShot
{
scale 2.75
States
{
Spawn:
CHBU E 0
CHBU E 0 A_Explode(3,44,0,0,44)
CHBU E 2 A_Explode(3,32,0,0,32)
CHBU F 0 A_Stop
CHBU FGEFGEF 2 A_Explode(3,32,0,0,32)
stop
}
}
actor ProtoStrikeShot2B : ProtoStrikeShot2{translation "192:192=205:205","198:198=74:74"}
actor ProtoStrikeShot2R : ProtoStrikeShot2{translation "192:192=171:171","198:198=41:41"}
actor ProtoStrikeShot2O : ProtoStrikeShot2{translation "192:192=104:104","198:198=128:128"}
actor ProtoStrikeShot2P : ProtoStrikeShot2{translation "192:192=229:229","198:198=232:232"}

actor ProtoStrikeShot3 : ProtoStrikeShot2
{
scale 2.5
States
{
Spawn:
CHBU E 0
CHBU E 0 A_Explode(3,44,0,0,44)
CHBU E 1 A_Explode(3,32,0,0,32)
CHBU F 1 A_Stop
CHBU FGEFGEF 2 A_Explode(3,32,0,0,32)
stop
}
}

actor ProtoStrikeShot3B : ProtoStrikeShot3{translation "192:192=205:205","198:198=74:74"}
actor ProtoStrikeShot3R : ProtoStrikeShot3{translation "192:192=171:171","198:198=41:41"}
actor ProtoStrikeShot3O : ProtoStrikeShot3{translation "192:192=104:104","198:198=128:128"}
actor ProtoStrikeShot3P : ProtoStrikeShot3{translation "192:192=229:229","198:198=232:232"}

actor ProtoStrikeShot4 : ProtoStrikeShot2
{
scale 2.25
States
{
Spawn:
CHBU E 0
CHBU E 0 A_Explode(3,44,0,0,44)
CHBU E 0 A_Stop
CHBU FGEFGEF 2 A_Explode(3,32,0,0,32)
stop
}
}

actor ProtoStrikeShot4B : ProtoStrikeShot4{translation "192:192=205:205","198:198=74:74"}
actor ProtoStrikeShot4R : ProtoStrikeShot4{translation "192:192=171:171","198:198=41:41"}
actor ProtoStrikeShot4O : ProtoStrikeShot4{translation "192:192=104:104","198:198=128:128"}
actor ProtoStrikeShot4P : ProtoStrikeShot4{translation "192:192=229:229","198:198=232:232"}

actor ProtomanMain_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ProtoShotC",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ProtoShotCB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ProtoShotCR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ProtoShotCO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ProtoShotCP",0,0,8,0)
goto Done
}
}

actor ProtomanMain2_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ProtoShot2C",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ProtoShot2CB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ProtoShot2CR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ProtoShot2CO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ProtoShot2CP",0,0,8,0)
goto Done
}
}

actor ProtomanMain3_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ProtoShot3C",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ProtoShot3CB",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ProtoShot3CR",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ProtoShot3CO",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ProtoShot3CP",0,0,8,0)
goto Done
}
}

actor ProtomanAlt_CI : TeamColor_CI
{
states
{
FireX:
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot2",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot3",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot4",0,0,8,0)
goto Done
FireB:
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShotB",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot2B",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot3B",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot4B",0,0,8,0)
goto Done
FireR:
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShotR",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot2R",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot3R",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot4R",0,0,8,0)
goto Done
FireO:
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShotO",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot2O",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot3O",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot4O",0,0,8,0)
goto Done
FireP:
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShotP",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot2P",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot3P",0,0,8,0)
TNT1 A 0 A_FireCustomMissile("ProtoStrikeShot4P",0,0,8,0)
goto Done
}
}





actor ProtoCoil : BasicCustomInventory
{
inventory.pickupmessage "$PU_PROTOCOIL"
Tag "$TAG_PROTOCOIL"
inventory.icon "PCUP"
states
{
Spawn:
PCOI C 1
loop
Use:
WEAP B 0 A_PlaySoundEx("item/refill","Voice")
WEAP B 0 A_SpawnItemEx("PCoilTeleport", 40, 0, 256, 0, 0, -32, 0, SXF_NOCHECKPOSITION, 0)
stop
}
}

actor PCoil
{
- SOLID
+MISSILE
+DONTBLAST
+NOCLIP
+SKYEXPLODE
speed 0
scale 2.5
Radius 12
Height 32
reactiontime 250
meleerange 80
states
{
Spawn:
PCOI D 0 A_Jump(256,"Death")
PCOI D 0 A_ChangeFlag("MISSILE",0)
PCOI D 1 A_JumpIf(z-floorz<=0, "Look")
Goto Spawn+2
Look:
PCOI E 0 A_ChangeFlag("NOCLIP",0)
PCOI EF 2
PCOI AAAAAA 1 A_Chase
PCOI A 0 A_CountDown
Goto Look+3
Melee:
PCOI B 1 A_JumpIfInTargetInventory("StrongSpring",1,"Melee2")
PCOI B 18 A_GiveToTarget("SpringActivate",1)
PCOI A 0 A_Die
Goto Death
Melee2:
PCOI B 18 A_GiveToTarget("SpringActivate2",1)
PCOI B 0 A_Die
Goto Death
Death:
PCOI A 0 A_SpawnItemEx("ProtoItemDeath",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop
}
}


actor PCoilTeleport
{
Radius 12
Height 32
scale 2.5
+NOINTERACTION
PROJECTILE
+DONTBLAST
states
{
Spawn:
PCOI D 0
PCOI D 6
PCOI DDDDDDDDDD 1 A_CheckFloor("Next")
Goto Next
Next:
PCOI D 0 A_ChangeFlag("NOINTERACTION", 0)
PCOI D 0 A_ChangeFlag("NOGRAVITY", 0)
Goto Death
Death:
TNT1 A 0 A_SpawnItemEx("PCoil",0,0,0,0,0,momz,0,SXF_NOCHECKPOSITION,0)
stop
}
}

actor ProtoItemDeath
{
PROJECTILE
+RIPPER
+BLOODLESSIMPACT
+CLIENTSIDEONLY
+DONTBLAST
scale 2.5
Damage 0
Speed 30
Radius 4
reactiontime 35
Height 60
States
{
Spawn:
PCOI FE 2
PCOI D 0 ThrustThingZ(0, 40, 0, 1)
PCOI D 1 A_CountDown
Goto Spawn+3
Death:
PCOI D 0
stop
}
}

actor PCoilTeleport2 : PCoilTeleport
{
states
{
Spawn:
PCOI D 0
PCOI D 6
PCOI DDDDDDDDDD 1 A_CheckFloor("Next")
Goto Next
Next:
PCOI D 0 A_ChangeFlag("NOINTERACTION", 0)
PCOI D 0 A_ChangeFlag("NOGRAVITY", 0)
Goto Death
Death:
PCOI A 0 A_SpawnItemEx("Jetter",0,0,0,0,0,momz,0,SXF_NOCHECKPOSITION,0)
stop
}
}


actor ProtoJet : BasicCustomInventory
{
inventory.pickupmessage "$PU_PROTOJET"
Tag "$TAG_PROTOJET"
inventory.icon "PJUP"
states
{
Spawn:
PJET D 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("ProtoJetCounter",1,3)
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_SpawnItemEx("PCoilTeleport2", 40, 0, 256, 0, 0, -32, 0, SXF_NOCHECKPOSITION, 0)
stop
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("ProtoJetCounter",20)
stop
}
}

actor Jetter
{
- SOLID
+MISSILE
+DONTBLAST
+NOCLIP
+SKYEXPLODE
speed 0
scale 2.5
Radius 12
Height 32
reactiontime 250
meleerange 80
states
{
Spawn:
PCOI D 0 A_Jump(256,"Death")
PCOI D 0 A_ChangeFlag("MISSILE",0)
PCOI D 1 A_JumpIf(z-floorz<=0, "Look")
Goto Spawn+2
Look:
PCOI E 0 A_ChangeFlag("NOCLIP",0)
PCOI EF 2
PJET A 3 A_Chase
PJET A 0 A_CountDown
Goto Look+3
Melee:
TNT1 A 0 A_GiveToTarget("ProtoJetCounter",20)
TNT1 A 1 A_GiveToTarget("FlyActivate",1)
Goto FlyCheck1
FlyCheck1:
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 A 0 A_TakeFromTarget("ProtoJetCounter",1)
TNT1 A 0 A_JumpIfInTargetInventory("SpinTime",1,"Death2")
TNT1 A 0 A_JumpIfInTargetInventory("InBoat",1,"Death2")
TNT1 A 0 A_JumpIfInTargetInventory("ProtoJetCounter",1,"FlyCheck2")
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
FlyCheck2:
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX1",1)
TNT1 AAAAA 1 A_GiveToTarget("ProtoJetFX2",1)
TNT1 A 0 A_TakeFromTarget("ProtoJetCounter",1)
TNT1 A 0 A_JumpIfInTargetInventory("SpinTime",1,"Death2")
TNT1 A 0 A_JumpIfInTargetInventory("InBoat",1,"Death2")
TNT1 A 0 A_JumpIfInTargetInventory("ProtoJetCounter",1,"FlyCheck1")
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
Death:
RUSH F 0 A_SpawnItemEx("ProtoItemDeath",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop
Death2:
TNT1 A 0 A_TakeFromTarget("ProtoJetCounter",20)
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
}
}

actor ProtoJetFX1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 1 SetPlayerProperty(0,1,3)
TNT1 A 1 A_SpawnItemEx("ProtoJetFeet1",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop
}
}

actor ProtoJetFX2 : CustomInventory
{
States
{
Pickup:
TNT1 A 1 A_SpawnItemEx("ProtoJetFeet2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop
}
}

actor ProtoJetFeet1
{
-SOLID
+CLIENTSIDEONLY
+NOGRAVITY
+NOINTERACTION
Scale 2.5
States
{
Spawn:
PJET B 2
stop
}
}


actor ProtoJetFeet2
{
-SOLID
+CLIENTSIDEONLY
+NOGRAVITY
+NOINTERACTION
Scale 2.5
States
{
Spawn:
PJET C 2
stop
}
}

actor ProtoJetCounter : Inventory
{
inventory.amount 1
inventory.maxamount 20
}

actor ProtoMarine : BasicCustomInventory
{
inventory.pickupmessage "$PU_PROTOMARINE"
Tag "$TAG_PROTOMARINE"
inventory.icon "PMUP"
states
{
Spawn:
PJET O 1
loop
Use:
TNT1 A 0 A_JumpIfInventory("ProtoMarineCounter",1,3)
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_SpawnItemEx("ProtoMarine3Teleport", 40, 0, 256, 0, 0, -32, 0, SXF_NOCHECKPOSITION, 0)
stop
TNT1 A 0 A_PlaySoundEx("item/refill","Voice")
TNT1 A 0 A_GiveInventory("ProtoMarineCounter",80)
stop
}
}

actor ProtoMarine3Teleport
{
Radius 8
Height 8
scale 2.5
+NOINTERACTION
PROJECTILE
+DONTBLAST
states
{
Spawn:
PCOI D 0
PCOI D 7
PCOI D 0 A_SpawnItemEx("ProtoMarine3",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
stop
}
}

actor ProtoMarine3
{
+MISSILE
+NOCLIP
+NOINTERACTION
+DONTBLAST
+SKYEXPLODE
+DONTREFLECT
speed 0
scale 2.5
Radius 12
Height 32
meleerange 20
states
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("ProtoMarineCounter",80) 
Goto FlyCheck
FlyCheck:
TNT1 A 0 A_JumpIfInTargetInventory("InBoat",1,"Death2")
TNT1 A 0 A_JumpIfInTargetInventory("IsUnderwater",1,"GiveFlight")
TNT1 A 2
TNT1 A 0 A_JumpIfInTargetInventory("ProtoMarineCounter",1,"FlyCheck")
TNT1 A 0 A_TakeFromTarget("ProtoMarineCounter",9999)
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
GiveFlight:
TNT1 A 2 A_GiveToTarget("PMarineFX4",1)
TNT1 A 0 A_GiveToTarget("FlyActivate",1)
Goto GiveFlight2
GiveFlight2:
TNT1 A 0 A_JumpIfInTargetInventory("ProtoMarineCounter",1,"FlyingCheck")
TNT1 A 0 A_TakeFromTarget("ProtoMarineCounter",9999)
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
TNT1 A 2 A_GiveToTarget("PMarineFX4",1)
stop
FlyingCheck:
TNT1 A 0 A_JumpIfInTargetInventory("SpinTime",1,"Death2")
TNT1 A 0 A_JumpIfInTargetInventory("InBoat",1,"Death2")
TNT1 AAAAA 1 A_GiveToTarget("PMarineFX2",1)
TNT1 AAAAA 1 A_GiveToTarget("PMarineFX1",1)
TNT1 A 0 A_TakeFromTarget("ProtoMarineCounter",1)
TNT1 A 0 A_JumpIfInTargetInventory("IsUnderwater",1,"GiveFlight2")
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
TNT1 A 0 A_GiveToTarget("PMarineFX4",1)
TNT1 A 0 A_JumpIfInTargetInventory("ProtoMarineCounter",1,"FlyCheck")
stop
Death:
RUSH F 0 A_SpawnItemEx("ProtoItemDeath",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop
Death2:
TNT1 A 0 A_TakeFromTarget("ProtoMarineCounter",9999)
TNT1 A 0 A_GiveToTarget("FlyDeactivate",1)
stop
}
}

actor ProtoMarineCounter : Inventory
{
inventory.amount 1
inventory.maxamount 80
}

actor PMarineFX1 : CustomInventory{States{
Pickup:
TNT1 A 0 A_JumpIfInventory("FlightDisableFlag",1,2)
TNT1 A 1 SetPlayerProperty(0,1,3)
TNT1 A 1 A_SpawnItemEx("PMarineFeet1",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop}}
actor PMarineFX2 : CustomInventory{States{
Pickup:
TNT1 A 1 A_SpawnItemEx("PMarineFeet2",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop}}
actor PMarineFX3 : CustomInventory{States{
Pickup:
TNT1 A 1 A_SpawnItemEx("PMarineFeet3",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop}}
actor PMarineFX4 : CustomInventory{States{
Pickup:
TNT1 A 1 A_SpawnItemEx("PMarineFeet4",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
stop}}

actor PMarineFeet1{-SOLID +CLIENTSIDEONLY +NOGRAVITY +NOINTERACTION Scale 2.5 States{
Spawn:
PJET M 2
stop}}
actor PMarineFeet2{-SOLID +CLIENTSIDEONLY +NOGRAVITY +NOINTERACTION Scale 2.5 States{
Spawn:
PJET N 2
stop}}
actor PMarineFeet3{-SOLID +CLIENTSIDEONLY +NOGRAVITY +NOINTERACTION Scale 2.5 States{
Spawn:
PCOI DEF 2
stop}}
actor PMarineFeet4{-SOLID +CLIENTSIDEONLY +NOGRAVITY +NOINTERACTION Scale 2.5 States{
Spawn:
PCOI FED 2
stop}}
