actor Pirateman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_BD"
dropitem "RemoteMineWep"
Weapon.AmmoUse 1
Weapon.AmmoGive 30
Inventory.Pickupmessage "$PU_REMOTEMINE"
Obituary "$OB_REMOTEMINE"
weapon.ammotype "JollyRogerAmmo"
weapon.ammotype2 "WetRogerAmmo"
States
{
Spawn:
C_0B D 1
loop

Deselect:
PRMI A 0
goto DeselectSwap
Select:
PRMI A 0
goto SelectSwap

Ready:
PRMI A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_PIRATEMAN,0,TINT_PIRATE)
PRMI A 0 A_GunFlash("Flash",1)
Ready1:
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble")
PRMI A 1 A_WeaponReady
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble")
PRMI A 1 A_WeaponReady
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble")
PRMI A 1 A_WeaponReady
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble")
PRMI A 1 A_WeaponReady
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble")
PRMI A 1 A_WeaponReady
PRMI A 0 A_GiveInventory("WetRogerAmmo",1)
Goto Ready1
ReadyBubble:
PRMI A 0 A_JumpIfInventory("WetRogerAmmo",56,"ReadyBubble2")
PRMI A 7 A_WeaponReady
PRMI A 0 A_GiveInventory("WetRogerAmmo",2)
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble")
goto Ready1
ReadyBubble2:
PRMI A 1 A_WeaponReady
PRMI A 0 A_JumpIfInventory("PBubbleFlag",1,"ReadyBubble2")
goto Ready1


BotFire:
PRMI A 1 A_GiveInventory("PirateMineFlag",1)
PRMI A 0 A_JumpIfInventory("PirateMineFlag",20,3)//60
PRMI A 0 A_Jump(16,2)
PRMI A 0 A_Refire("FireH")
PRMI A 0
goto FireEnd+2

Fire:
PRMI A 0 A_JumpIfInventory("JollyRogerAmmo",1,"Fire0")
goto RemoteExplode
Fire0:
//PRMI A 0 A_JumpIfNoAmmo("RemoteExplode")
PRMI A 0 A_GiveInventory("Pirateman_Fire_P")
PRMI B 1
PRMI B 0 A_Refire(2)
PRMI B 4 A_GiveInventory("PirateMineSticky",1)
goto FireEnd
PRMI B 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI B 0 A_Refire(2)
PRMI B 3 A_GiveInventory("PirateMineSticky",1)
goto FireEnd
PRMI B 1
PRMI B 0 A_Refire(2)
PRMI B 2 A_GiveInventory("PirateMineSticky",1)
goto FireEnd
PRMI B 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI B 0 A_Refire(2)
PRMI B 1 A_GiveInventory("PirateMineSticky",1)
goto FireEnd
PRMI B 1
PRMI B 0 A_Refire(2)
PRMI B 0 A_GiveInventory("PirateMineSticky",1)
goto FireEnd
PRMI C 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI C 0 A_Refire(2)
PRMI C 4 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+1
PRMI C 1
PRMI C 0 A_Refire(2)
PRMI C 3 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+1
PRMI C 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI C 0 A_Refire(2)
PRMI C 2 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+1
PRMI C 1
PRMI C 0 A_Refire(2)
PRMI C 1 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+1
PRMI C 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI C 0 A_Refire(2)
PRMI C 0 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+1
PRMI A 1
PRMI A 0 A_Refire(2)
PRMI A 4 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+2
PRMI A 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI A 0 A_Refire(2)
PRMI A 3 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+2
PRMI A 1
PRMI A 0 A_Refire(2)
PRMI A 2 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+2
PRMI A 1 A_JumpIfInventory("PlayerPropertyRage",1,3)
PRMI A 0 A_Refire(2)
PRMI A 1 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+2
PRMI A 1 A_JumpIfInventory("IsBot",1,"BotFire")
PRMI A 0 A_Refire(2)
PRMI A 0 A_GiveInventory("PirateMineSticky",1)
goto FireEnd+2
FireH:
PRMI A 1 A_GiveInventory("PirateMineFlag",1)
PRMI A 0 A_JumpIfInventory("PirateMineFlag",60,2)
PRMI A 0 A_Refire("FireH")
PRMI A 0
goto FireEnd+2

FireEnd:
//PRMI B 5
PRMI CA 5
PRMI A 8 A_GiveInventory("PirateMineSticky",1)
PRMI A 0 A_TakeInventory("PirateMineFlag")
Goto Ready1

RemoteExplode:
PRMI A 0 A_PlaySoundEx("weapon/adapterreturn","Weapon")
PRMI A 0 //A_GiveInventory("JollyRogerAmmo",30)
PRMI A 0 A_GiveInventory("PRemoteFlag",1)
PRMI BA 3
PRMI C 0 A_GiveInventory("JollyRogerAmmo",10)
PRMI C 0 A_PlaySoundEx("weapon/rminestick","Weapon")
PRMI CBA 2
PRMI C 0 A_GiveInventory("JollyRogerAmmo",10)
PRMI C 0 A_PlaySoundEx("weapon/rminestick","Weapon")
PRMI CBA 2
PRMI C 0 A_GiveInventory("JollyRogerAmmo",10)
PRMI C 0 A_PlaySoundEx("weapon/rminestick","Weapon")
PRMI CB 2
PRMI A 2 A_TakeInventory("PRemoteFlag",1)
goto Ready1

Altfire:
PRMI A 0 A_JumpIfInventory("BasicArmor",1,"BubbleDash")
goto Altfire2
Altfire2:
PRMI A 2 Offset(-20,62)
PRMI D 2 Offset(17,80)
PRMI D 0 A_WeaponReady(14)
goto AltfireH
AltfireH:
PRMI D 1 A_GiveInventory("Pirateman_Alt_P1")
PRMI D 0 A_Refire(1)
goto AltfireE
PRMI D 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
PRMI D 1 A_GiveInventory("Pirateman_Alt_P2")
PRMI D 0 A_Refire(1)
goto AltfireE
PRMI E 1 A_GiveInventory("Pirateman_Alt_P3")
PRMI E 0 A_Refire(1)
goto AltfireE
PRMI E 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
PRMI E 1 A_GiveInventory("Pirateman_Alt_P4")
PRMI E 0 A_Refire(1)
goto AltfireE
PRMI F 1 A_GiveInventory("Pirateman_Alt_P5")
PRMI F 0 A_Refire(1)
goto AltfireE
PRMI F 0 A_JumpIfInventory("PlayerPropertyRage",1,"AltfireH")
PRMI F 1 A_GiveInventory("Pirateman_Alt_P6")
PRMI F 0 A_Refire("AltfireH")
goto AltfireE

AltfireE:
PRMI D 2 Offset(17,80)
PRMI A 2 Offset(-20,62)
goto Ready1


BubbleDash:
PRMI A 0 A_JumpIf(CallACS("cbm_GetPointerButtonInput",0,true) & BT_JUMP,"DashRealC")
goto Altfire2
DashRealC:
PRMI A 0 A_JumpIfInventory("WetRogerAmmo",56,"DashReal")
goto Altfire2
DashReal:
PRMI A 0 A_GiveInventory("PirateBDashFlag",1)
PRMI A 2 Offset(-20,62)
TNT1 A 1 A_Stop
TNT1 A 0 A_PlaySoundEx("weapon/topspin","Weapon")
TNT1 A 0 A_SetArg(4,angle*100000)
TNT1 A 0 A_SetArg(3,pitch*100000)
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEON)
TNT1 A 0 A_GiveInventory("PirateBDashFlag",28)
Dashing:
TNT1 A 0 A_GiveInventory("PirateBubbleDash_P")
TNT1 A 0 A_SpawnItemEx("BubbleDashExplode",0,0,28,momx,momy,momz,0,8)
TNT1 A 1 A_SpawnItemEx("BubbleDashChecker",0,0,8,momx,momy,momz,0,8)
TNT1 A 0 A_JumpIfInventory("PirateBubblePopped",1,"DashEndPop")
TNT1 A 0 A_TakeInventory("PirateBDashFlag",1)
TNT1 A 0 A_TakeInventory("WetRogerAmmo",2)
TNT1 A 0 A_JumpIfInventory("PirateBDashFlag",1,1)
goto DashEnd
TNT1 A 0 A_GiveInventory("PirateBubbleDash_P")
TNT1 A 1 A_SpawnItemEx("BubbleDashChecker",0,0,8,momx,momy,momz,0,8)
TNT1 A 0 A_JumpIfInventory("PirateBubblePopped",1,"DashEndPop")
TNT1 A 0 A_TakeInventory("PirateBDashFlag",1)
TNT1 A 0 A_TakeInventory("WetRogerAmmo",2,1)
TNT1 A 0 A_JumpIfInventory("PirateBDashFlag",1,"Dashing")
goto DashEnd
DashEndPop:
TNT1 A 0 A_SpawnItemEx("PBubbleFXBOP",0,0,-32,0,0,0,0,8,0)
TNT1 A 0 A_ChangeVelocity(-20,0,10,3)
DashEnd:
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
TNT1 A 0 A_TakeInventory("WetRogerAmmo",999,1)
TNT1 A 0 A_TakeInventory("PirateBubblePopped")
TNT1 A 0 A_TakeInventory("PirateBDashFlag")
PRMI A 2 Offset(-20,62)
goto Ready1

Flash:
TNT1 A 1 A_JumpIfInventory("PBubbleFlag",1,"FlashBubble")
loop
FlashBubble:
TNT1 A 1 A_SpawnItemEx("PBubbleFX",0,0,0,momx,momy,momz,0,8,0)
TNT1 A 0 A_JumpIfInventory("PBubbleFlag",1,"FlashBubble")
TNT1 A 0 A_Jump(256,"FlashEnd")
FlashEnd:
TNT1 A 1 A_SpawnItemEx("PBubbleFXPOP",0,0,-32,momx,momy,momz,0,8,0)
goto Flash

}
}

actor JollyRogerAmmo : Ammo
{
Inventory.Amount 1
Inventory.MaxAmount 30
+INVENTORY.IGNORESKILL
}

actor WetRogerAmmo : Ammo
{
Inventory.Amount 1
Inventory.MaxAmount 56
+INVENTORY.IGNORESKILL
}

actor PirateMineFlag : Inventory
{
inventory.amount 1
inventory.maxamount 60
}

actor PirateMineSticky :Inventory{}
actor PBubbleFlag :Inventory{}

actor PRemoteFlag :Inventory{}
actor PirateBubblePopped :Inventory{}

actor PirateBDashFlag : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 28
}


actor PirateBubbleItem : BasicClassItem
{
inventory.icon "PIRASI"
inventory.pickupmessage "Luckily you can't pilfer this item."
Tag "Pirate Bubble Trigger"
states
{
Spawn:
PRBU U 1
loop
UseCBM:
TNT1 A 0 A_JumpIfInventory("BasicArmor",1,"Deactivate")
TNT1 A 0 A_JumpIfInventory("WetRogerAmmo",56,"SpawnBubble")
fail
SpawnBubble:
TNT1 A 0 A_PlaySoundEx("weapon/PirateBubble","Body")
TNT1 A 0 A_GiveInventory("PirateM_BasicArmor_P")
TNT1 A 0 A_GiveInventory("SetDynamicArmorDosage")
TNT1 A 0 A_GiveInventory("PBubbleFlag")
TNT1 A 0 A_SpawnItemEx("PBubbleWatcher")
fail
Deactivate:
TNT1 A 0 A_TakeInventory("WetRogerAmmo",1)
TNT1 A 0 A_TakeInventory("DynamicArmorDosage")
TNT1 A 0 A_TakeInventory("BasicArmor")
TNT1 A 0 A_TakeInventory("PBubbleFlag",999)
fail
}
}



actor Pirateman_Fire_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/GrenadeShot","Weapon")
TNT1 A 0 A_TakeInventory("PirateMineSticky")
TNT1 A 0 A_GiveInventory("PirateMineFlag",1)
TNT1 A 0 A_FireCustomMissile("PirateRMine",0,0,-8,0)
TNT1 A 0 A_TakeInventory("JollyRogerAmmo",5)
TNT1 A 0 A_TakeInventory("JollyRogerAmmo",5,1)
stop
}
}


actor Pirateman_Alt_P1 : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Under")
TNT1 A 0 A_PlaySound("weapon/WaterSpray",1,0.75)
goto Water
Water:
TNT1 A 0 A_FireCustomMissile("PiratePushWater",0,0,10,0)
stop

Under:
TNT1 A 0 A_PlaySoundEx("weapon/wrapfire","Weapon")
goto Bub1
Bub1:
TNT1 A 0 A_FireCustomMissile("PiratePushBubbles",0,0,10,0)
stop
Bub2:
TNT1 A 0 A_FireCustomMissile("PiratePushBubbles0",random(-5,5),0,10,0,0,random(-3,3))
stop
}
}
actor Pirateman_Alt_P2 : Pirateman_Alt_P1
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Bub2")
stop
}
}
actor Pirateman_Alt_P3 : Pirateman_Alt_P1
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Bub1")
goto Water
}
}

actor Pirateman_Alt_P4 : Pirateman_Alt_P1
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Under")
TNT1 A 0 A_PlaySound("weapon/WaterSpray",1,0.75)
stop
Under:
TNT1 A 0 A_PlaySoundEx("weapon/wrapfire","Weapon")
goto Bub2
}
}

actor Pirateman_Alt_P5 : Pirateman_Alt_P1
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Bub1")
goto Water
TNT1 A 0 A_FireCustomMissile("PiratePushBubbles",0,0,10,0)
stop
}
}

actor Pirateman_Alt_P6 : Pirateman_Alt_P1
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Bub2")
stop
}
}

actor PirateBubbleDash_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIf(CallACS("cbm_IsDashingDisabled"),"No")
TNT1 A 0 A_JumpIfInventory("IsUnderWater",1,"Dash_W")
TNT1 A 0 A_JumpIfInventory("IsUnderBubbleWater",1,"Dash_W")
goto Dash
Dash_W:
TNT1 A 0 A_ChangeVelocity(cos(Args[3]/100000.0)*34*cos(Args[4]/100000.0),cos(Args[3]/100000.0)*34*sin(Args[4]/100000.0),-sin(Args[3]/100000.0)*34,CVF_REPLACE)
stop
Dash:
TNT1 A 0 A_ChangeVelocity(cos(Args[3]/100000.0)*24*cos(Args[4]/100000.0),cos(Args[3]/100000.0)*24*sin(Args[4]/100000.0),-sin(Args[3]/100000.0)*24,CVF_REPLACE)
stop
No:
TNT1 A 0
stop
}
}


actor PirateRMine : ProjSpawnFuncActor
{
PROJECTILE
damagetype "PirateM_Mine"
Obituary "$OB_REMOTEMINE"
+SKYEXPLODE
+EXPLODEONWATER
+DONTSPLASH
+FORCEXYBILLBOARD
+THRUSPECIES
Species "DumbPirateMine"
reactiontime 1//42
Damage (20)
Radius 14
Height 14
speed 30//36
scale 2.5
States
{
Spawn:
RPMI A 0
RPMI A 0 //ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI A 0//1

RPMI A 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI A 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI A 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI A 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI A 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI A 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI A 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI A 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI A 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI A 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI A 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI A 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI B 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI B 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI B 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI B 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI B 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI B 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI B 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI B 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI B 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI B 1 A_JumpIfInTargetInventory("PirateMineSticky",1,"Death")
RPMI B 0 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI B 0 A_ChangeVelocity(cos(-pitch)*30,0,sin(-pitch)*30,3)
RPMI A 0 A_GiveInventory("ResyncPickup",1)
RPMI A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"Death")

goto Spawn+3

Crash:
XDeath:
TNT1 A 0
TNT1 A 0 A_Stop
TNT1 A 0 A_GiveInventory("ResyncPickup",1)
TNT1 A 0 //A_TakeFromTarget("JollyRogerAmmo",10)
TNT1 A 1 A_SpawnItemEx("PirateRMineExplosionX")
stop

SDeath:
TNT1 A 0
RPMI A 0 A_GiveInventory("PirateMineSticky",1)
RPMI A 1 A_CountDown
wait

Death:
TNT1 A 0
REMI A 0 A_JumpIfInventory("PirateMineSticky",1,"XDeath")
REMI A 0 //A_TakeFromTarget("JollyRogerAmmo",10)
REMI A 0 A_Stop
REMI A 0 A_SpawnItemEx("PirateRMinePlace")
stop

}
}

actor PirateRMinePlace : ProjSpawnFuncActor
{
PROJECTILE
damagetype "PirateM_Mine"
Obituary "$OB_REMOTEMINE"
+SKYEXPLODE
+EXPLODEONWATER
+FORCEXYBILLBOARD
+DONTSPLASH
+DONTREFLECT

//+SHOOTABLE
+NONSHOOTABLE
//-NOBLOCKMAP
+DONTDRAIN
+NOBLOOD
//+NOTARGETSWITCH
//+NOPAIN
+QUICKTORETALIATE
+CANTSEEK
+THRUGHOST
+THRUSPECIES
Species "DumbPirateMine"

painchance 0
painchance "PropBlower", 256

//(Deal 1 damage about)
damagefactor "Normal", 0.0
damagefactor "PropBlower", 1.0

damagefactor "PirateM_Boom", 0.0

mass 999999
Health 600

reactiontime 1
Damage (20+CallACS("cbm_countinv_snatcher",2))
Radius 14
Height 14
speed 0
scale 2.5
States
{
Spawn:
RPMI A 0
RPMI A 0 A_GiveInventory("OnceC",1)
RPMI A 0 A_PlaySoundEx("weapon/rminestick","Weapon")
RPMI A 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_TARGET,AAPTR_TARGET)
RPMI A 0 A_ChangeFlag("SHOOTABLE",1)
RPMI A 0 A_ChangeFlag("NOBLOCKMAP",0)
RPMI A 0 A_ChangeFlag("NOPAIN",0)
RPMI A 0 A_GiveInventory("ResyncPickup",1)
goto Spawn2
Spawn2:
RPMI A 0 A_GiveInventory("PirateMineFlag",1)
RPMI AAAEEEAAAEEE 1 A_JumpIfInventory("PRemoteFlag",1,"SDeath2",AAPTR_MASTER)
RPMI A 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_MASTER),"SDeath2")
RPMI A 0 A_JumpIfInventory("PirateMineFlag",21,"SDeath")//A_CountDown
loop

Pain.PiratePush:
Pain.PropBlower:
RPMI C 0 A_ChangeFlag("NOPAIN",1)
RPMI C 0 A_PlaySoundEx("S3_K/Beep","Voice")
RPMI C 1 A_GiveInventory("PRemoteFlag",1)
RPMI C 0 HealThing(50,600)
RPMI C 1 ACS_NamedExecuteWithResult("cbm_CopyPointerAnglePitch",2,1)
RPMI C 0 A_RearrangePointers(AAPTR_DEFAULT,AAPTR_DEFAULT,AAPTR_TARGET)
RPMI C 0 A_ChangeVelocity(Cos(pitch)*52,0,-sin(pitch)*52,3)
RPMI C 0 A_ChangeFlag("NOPAIN",0)
RPMI C 0 A_JumpIfInventory("PirateMineFlag",21,"SDeath1")
goto Spawn2+1
SDeath1:
RPMI C 0
goto SDeath+2
SDeath:
RPMI A 0 A_ChangeFlag("DONTBLAST",1)
RPMI A 0 A_Stop
RPMI A 0 A_GiveInventory("ResyncPickup",1)
RPMI AACCAACCAACCAACCAACC 1 A_JumpIfInventory("PRemoteFlag",1,"SDeath2",AAPTR_MASTER)
goto SDeath2
SDeath2:
RPMI A 1 A_CountDown
wait
XDeath:
Crash:
Death:
RPMI C 0 A_ChangeFlag("DONTBLAST",1)
RPMI C 0 A_ChangeFlag("SHOOTABLE",0)
RPMI C 0 A_ChangeFlag("NOGRAVITY",1)
RPMI C 0 //A_GiveInventory("JollyRogerAmmo",10,AAPTR_MASTER)
RPMI C 0 A_JumpIfInventory("OnceC",1,"DeathCheck")
goto DeathFlung
DeathCheck:
RPMI C 0 A_JumpIfInventory("PRemoteFlag",1,"DeathMaster",AAPTR_MASTER)
RPMI C 0 A_JumpIfInventory("PRemoteFlag",1,"DeathTracer")
goto DeathMasterW
DeathTracer:
RPMI C 0 A_RearrangePointers(AAPTR_TRACER)
RPMI C 0 A_Stop
goto DeathFlung
DeathMaster:
RPMI C 0 A_RearrangePointers(AAPTR_MASTER)
RPMI C 0 A_Stop
goto DeathFlung
DeathMasterW:
RPMI C 0 A_RearrangePointers(AAPTR_MASTER)
goto DeathFlungW
DeathFlung:
TNT1 A 1 A_SpawnItemEx("PirateRMineExplosion")
stop
DeathFlungW:
TNT1 A 1 A_SpawnItemEx("PirateRMineExplosionX")
stop
}
}

actor PirateRMineExplosion : BasicExplosion
{
damagetype "PirateM_Boom"
Obituary "$OB_REMOTEMINE"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySound("weapon/PirateRBomb",1)//weapon/rmineexplode
TNT1 A 0 A_SpawnItemEx("PirateRMineExplosionFX",0,0,0,0,0,0,0,1)
TNT1 A 4 A_Explode(160,100,0,0,24)
TNT1 AAAAAAAAA 4 A_Explode(140,100,0,0,24)
stop
}
}

actor PirateRMineExplosionX : PirateRMineExplosion
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_PlaySound("weapon/PirateRBomb1",1)
TNT1 A 0 A_SpawnItemEx("PirateRMineExplosionFX2",0,0,0,0,0,0,0,1)
TNT1 A 2 A_Explode(150,100,0,0,24)
stop
}
}

actor PirateRMineExplosionFX : BasicGraphicEffect
{
+FORCEXYBILLBOARD
+BRIGHT
States
{
SpawnFrame:
PRBU ABACADAEAFAGAHAIAJAKALAMABACADAEAFAGAHANAPOPO 1
stop
}
}
actor PirateRMineExplosionFX2 : PirateRMineExplosionFX
{
States
{
SpawnFrame:
TNT1 A 0
TNT1 A 0 A_Jump(256,"Spawn1","Spawn2","Spawn3","Spawn4")
Spawn1:
PRBU ABACAD 1
goto SpawnEnd
Spawn2:
PRBU AEAFAG 1
goto SpawnEnd
Spawn3:
PRBU AHAIAJ 1
goto SpawnEnd
Spawn4:
PRBU AKALAM 1
goto SpawnEnd

SpawnEnd:
PRBU ANAPOPO 1
stop
}
}

actor PirateM_BoomProtect : PowerProtection
{
Powerup.Duration 16
DamageFactor "PirateM_Boom", 0.5
}

actor PropBlowerEffect_Pirate1 : PropBlowerEffect
{
Args 96
}
actor PropBlowerEffect_Pirate2 : PropBlowerEffect
{
Args 108
}

actor PiratePushWater : ProjSpawnFuncActor
{
PROJECTILE
Obituary "$OB_PIRATEWATER"
DamageType "PirateM_Hose"
//+RIPPER
+FORCEXYBILLBOARD
+BOUNCEONWALLS
//+BOUNCEONFLOORS
+NOEXPLODEFLOOR
+BOUNCEONCEILINGS
+DONTSPLASH
BounceFactor 0.0
WallBounceFactor 0.0
renderstyle translucent
alpha 0.75
//renderstyle none
damage (20)
radius 24//32
height 24//32
speed 30
scale 1.5
States
{
Spawn:
RPMI R 0
RPMI R 0 A_SpawnItemEx("PropBlowerEffect_Pirate1")
RPMI RRR 1 A_SpawnItemEx("PiratePushWaterFX2",0,0,0,0,0,0,0,1)
RPMI S 0 A_SpawnItemEx("PropBlowerEffect_Pirate1")
RPMI SSS 1 A_SpawnItemEx("PiratePushWaterFX2",0,0,0,0,0,0,0,1)
RPMI T 0 A_SpawnItemEx("PropBlowerEffect_Pirate1")
RPMI TT 1 A_SpawnItemEx("PiratePushWaterFX2",0,0,0,0,0,0,0,1)
RPMI T 1 A_SpawnItemEx("PiratePushWaterFX1",0,0,0,0,0,0,0,1)
stop
Death:
TNT1 A 1 A_SpawnItemEx("SoakifyEffect")
stop
}
}

actor PiratePushBubbles : PiratePushWater
{
speed 32
States
{
Spawn:
PRBU X 0
PRBU X 0 A_SpawnItemEx("PropBlowerEffect_Pirate2")
PRBU XXYY 1 A_SpawnItemEx("PiratePushBubblesFX2",0,0,0,0,0,0,0,1)
PRBU Z 0 A_SpawnItemEx("PropBlowerEffect_Pirate2")
PRBU ZZXX 1 A_SpawnItemEx("PiratePushBubblesFX2",0,0,0,0,0,0,0,1)
PRBU T 0 A_SpawnItemEx("PropBlowerEffect_Pirate2")
PRBU YYZ 1 A_SpawnItemEx("PiratePushBubblesFX2",0,0,0,0,0,0,0,1)
PRBU Z 1 A_SpawnItemEx("PiratePushBubblesFX1",0,0,0,0,0,0,0,1)
stop
Death:
TNT1 A 1 A_SpawnItemEx("SoakifyEffect")
stop
}
}

actor PiratePushBubbles0 : PiratePushBubbles
{
Damage(0)
States
{
Spawn:
PRBU XXYYZZXXYYZ 1 A_SpawnItemEx("PiratePushBubblesFX2",0,0,0,0,0,0,0,1)
PRBU Z 1 A_SpawnItemEx("PiratePushBubblesFX1",0,0,0,0,0,0,0,1)
stop
}
}

actor PiratePushWaterFX1 : BasicGraphicEffect
{
+FORCEXYBILLBOARD
renderstyle translucent
alpha 0.8
scale 1.5
States
{
SpawnFrame:
RPMI RST 1
RPMI T 0 A_SpawnItemEx("PiratePushWaterFX2",0,0,0,0,0,0,0,1)
stop
}
}

actor PiratePushWaterFX2 : PiratePushWaterFX1
{
alpha 0.4
scale 1.0
States
{
SpawnFrame:
RPMI RRSSTT 1
stop
}
}

actor PiratePushBubblesFX1 : PiratePushWaterFX1
{
States
{
SpawnFrame:
PRBU XYZ 1
PRBU Z 0 A_SpawnItemEx("PiratePushBubblesFX2",0,0,0,0,0,0,0,1)
stop
}
}

actor PiratePushBubblesFX2 : PiratePushWaterFX2
{
States
{
SpawnFrame:
PRBU XXYYZZ 1
stop
}
}


actor PBubbleWatcher : BasicHelper
{
states
{
Spawn:
TNT1 A 0 A_JumpIfInTargetInventory("IsDead",1,"Death")
TNT1 A 1
TNT1 A 0 A_JumpIfInTargetInventory("BasicArmor",1,"Spawn")
TNT1 A 1
goto Death
Death:
TNT1 A 0 A_TakeFromTarget("WetRogerAmmo",32,1)
TNT1 A 0 A_TakeFromTarget("BasicArmor")
TNT1 A 0 A_TakeFromTarget("DynamicArmorDosage")
TNT1 A 0 A_TakeFromTarget("PBubbleFlag",999)
TNT1 A 1
stop
}
}

actor BubbleDashExplode : BasicExplosion
{
Obituary "$OB_PIRATEBUBBLE"
Damagetype "PirateM_BubbleRam"
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(100+CallACS("core_checkrune",RUNE_SPREAD,2)*200,128,0,0,16)
stop
}
}

actor BubbleDashChecker
{
PROJECTILE
Obituary "$OB_PIRATEBUBBLE"
Damagetype "PirateM_BubbleRam"
+DONTSPLASH
+DONTBLAST
+NOEXPLODEFLOOR
+THRUGHOST
+DONTREFLECT
+STEPMISSILE
maxstepheight 16
Species "DumbPirateMine"
Damage (0)
radius 16//18
height 48//58//50
Speed 36
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0
TNT1 A 1
stop
Crash:
XDeath:
TNT1 A 1
stop

Death:
TNT1 A 0 A_TakeFromTarget("PirateBDashFlag",99)
TNT1 A 1 A_GiveToTarget("PirateBubblePopped",1)
stop
}
}

actor PBubbleFX : BasicGraphicEffect
{
+NOTIMEFREEZE
States
{
SpawnFrame:
PRBU Q 0
PRBU Q 1
stop
}
}

actor PBubbleFXPOP : BasicExplosion
{
var int user_TranslateWhiteColors;
scale 5.0
States
{
Spawn:
PRBU V 0
PRBU V 1 A_PlaySoundEx("classes/burstpop","Weapon")
stop
}
}
actor PBubbleFXBOP : PBubbleFXPOP
{
States
{
Spawn:
PRBU V 0
PRBU V 1 A_PlaySoundEx("weapon/BubbleBounce","Weapon")
stop
}
}


//actor Pirateman_W_NormalBar : NormalBar {Args 41,3}
actor Pirateman_W_SecondBar : SecondBar {Args 4,94}
actor Pirateman_W_ScriptBar : ScriptBar {}