actor Mercury_W : BaseMM8BDMWep_CBM 
{
tag "$TAGC_VB"
dropitem "GrabBusterWep"
weapon.preferredskin "Mercury-CBM"
Weapon.AmmoUse 0
Weapon.AmmoGive 28
Inventory.Pickupmessage "You picked up the Manifesto of the Communist Party"
Obituary "$OB_MERCURYGRAB"
weapon.ammotype "SeizeAllTheAmmo"
weapon.ammotype2 "MercuryBlobFormAmmo"
inventory.icon "GRABBI"
States
{
Spawn:
C_0V B 1
loop

Deselect:
MRCH A 0 Offset(0,124)
goto DeselectSwap
Select:
MRCH P 0 Offset(0,32)
goto SelectSwap

Ready:
goto SwitchBlobOff

Ready1:
MRCH A 2 A_WeaponReady
MRCH A 0 A_GiveInventory("MercuryBlobFormAmmo",2)
loop

ReadyBlob1:
MRCH P 0 A_JumpIfInventory("SeizeAllTheAmmo",4,"ReadyBlob2")
MRCH P 1 A_WeaponReady(WRF_NOPRIMARY|WRF_NOSECONDARY)
loop
ReadyBlob2:
MRCH P 1 A_WeaponReady
loop

SwitchBlobOn:
MRCH B 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_MERCURY,1)
MRCH B 0 A_GiveInventory("VivifyDelay4",1)
MRCH B 0 A_GunFlash("Flash",0)
MRCH B 1 Offset(15,38)A_GiveInventory("Mercury_BlobSwapOn_P")
MRCH E 2 Offset(15,38)
MRCH F 2 Offset(15,38)
MRCH G 1 Offset(15,38)
MRCH H 1 Offset(15,44)A_JumpIfInventory("PlayerPropertyRage",1,1)
MRCH H 1 Offset(18,76)A_GiveInventory("Mercury_BlobSwapOn_P2")
goto ReadyBlob1

SwitchBlobOff:
MRCH H 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_MERCURY,1)
MRCH H 0 A_GunFlash("NoFlash",0)
MRCH H 0 A_GiveInventory("Mercury_BlobSwapOff_P",1)
MRCH H 1 Offset(18,76)A_JumpIfInventory("PlayerPropertyRage",1,1)
MRCH H 1 Offset(15,44)A_PlaySoundEx("Merc/BlobSwap","Weapon")
MRCH G 1 Offset(15,38)
MRCH F 2 Offset(15,38)
MRCH E 2 Offset(15,38)
MRCH B 1 Offset(15,38)A_GiveInventory("Mercury_BlobSwapOff_P2")
goto Ready1

Fire:
MRCH B 2 A_PlaySoundEx("wep_L/MercGrabBuster","Weapon")
MRCH C 0 A_FireCustomMissile("Merc_GrabBuster_L",-18,0,8,0)
MRCH C 0 A_FireCustomMissile("Merc_GrabBuster",0,0,8,0)
MRCH C 0 A_FireCustomMissile("Merc_GrabBuster_R",18,0,8,0)
MRCH CCBAAA 3
MRCH A 2
MRCH A 1 A_GiveInventory("MercuryBlobFormAmmo",8)
goto Ready1

BlobFire:
MRCH G 1 Offset(18,76)A_PlaySoundEx("weapon/GameBoyFire","Weapon")
MRCH F 1 Offset(15,57)
MRCH E 0 A_TakeInventory("SeizeAllTheAmmo",4,1)
MRCH E 0 A_FireCustomMissile("MercuryBlob2",0,0,0,0)
MRCH EQQEFG 2 Offset(12,38)
MRCH H 2 Offset(12,57)
MRCH P 2 Offset(1,38)//A_TakeInventory("MercuryBlobFormAmmo",18,1)
Goto ReadyBlob1

Altfire:
MRCH I 0 A_GiveInventory("MercurySnatchDamager_P",1)
MRCH I 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH I 1 A_SpawnItemEx("MercurySnatchFX",cos(pitch)*38,15,36-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,1+8)
MRCH I 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH I 1 Offset(-19,27)A_SpawnItemEx("MercurySnatchFX",cos(pitch)*38,10,35-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,1+8)
MRCH J 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH J 1 Offset(1,31)A_SpawnItemEx("MercurySnatchFX",cos(pitch)*38,8,34-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,1+8)
MRCH J 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH J 1 Offset(-19,34)A_SpawnItemEx("MercurySnatchFX",cos(pitch)*38,3,33-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,1+8)
MRCH K 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH K 1 Offset(1,31)A_SpawnItemEx("MercurySnatchFX",cos(pitch)*38,-5,32-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,1+8)
MRCH K 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH K 1 Offset(-46,37)A_SpawnItemEx("MercurySnatchFX",cos(pitch)*38,-12,31-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,1+8)
MRCH L 0 A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH L 1 Offset(1,31)
MRCH M 1 Offset(1,31)A_SpawnItemEx("MercurySnatch",cos(pitch)*38,0,14-(sin(pitch)*32),cos(pitch)*velx,vely,0,0,8)
MRCH M 1 Offset(-11,53)
MRCH M 1 Offset(-23,76)
TNT1 A 10
MRCH B 2 Offset(-2,57)
MRCH B 4 A_WeaponReady(14)
MRCH A 2
MRCH A 1 A_GiveInventory("MercuryBlobFormAmmo",8)
//MRCH A 0 A_Refire("AltFire")
goto Ready1

BlobAlt:
MRCH R 0 A_GiveInventory("VivifyDelay5")
MRCH R 0 A_GiveInventory("Mercury_Alt2_P")
MRCH R 0 A_Refire(1)
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd1")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd1")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd2")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd2")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd3")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltEnd3")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 0 A_GiveInventory("MercuryClimbing_F")
//MRCH R 0 A_JumpIf(momz==0,"BlobAltEnd4")
goto BlobAltLoop
BlobAltLoop://A_TakeInventory("MercuryBlobFormAmmo",1)
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltH")
MRCH R 0 A_JumpIf(momz==0,"BlobAltLoopZ")
//MRCH R 0 //A_JumpIfInventory("RyuRecoverFlag",110,"Recovered")
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 0 A_JumpIfInventory("MercuryStuckToWall",1,"BlobAltEnd4")
MRCH R 1 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
//MRCH R 1 //A_GiveInventory("RyuRecoverFlag",1)
loop
BlobAltLoopZ:
MRCH R 0 A_JumpIfInventory("Mercury_Slammed_F",1,"BlobAltH")
MRCH R 0 A_JumpIfInventory("MercuryStuckToWall",1,"BlobAltEnd4")
MRCH R 0 A_SpawnItemEX("MercuryCollider",0,0,-8,momx,momy,momz,0,8)
MRCH R 1
MRCH R 0 A_JumpIf(z-floorz==0,"BlobAltH")
MRCH R 0 A_JumpIf(momz==0,"BlobAltH")
goto BlobAltLoop+2

BlobAltH:
MRCH S 0 A_PlaySoundEx("classes/burstpop","Weapon")
MRCH S 0 A_FireCustomMissile("MercurySplashRadius",0,0,0,0)
MRCH S 0 A_GiveInventory("Mercury_Slammed_F")
MRCH S 2 A_ScaleVelocity(0.5)//AAA 1 0.25
MRCH T 11 A_GiveInventory("MercuryClimbing_F")
MRCH H 2 Offset(18,63)
MRCH P 2 Offset(5,38)
Goto ReadyBlob1

BlobAltEnd1:
MRCH S 0 A_GiveInventory("Mercury_Slammed_F")
goto BlobAltEnd+1
BlobAltEnd2:
MRCH S 0 A_GiveInventory("Mercury_Slammed_F")
goto BlobAltEnd+2
BlobAltEnd3:
MRCH S 0 A_GiveInventory("Mercury_Slammed_F")
goto BlobAltEnd+3
BlobAltEnd4:
MRCH S 0 A_GiveInventory("Mercury_Slammed_F")
goto BlobAltEnd+4
BlobAltEnd:
MRCH SSSS 2 A_GiveInventory("Mercury_Slammed_F")
MRCH S 7 A_GiveInventory("MercuryClimbing_F")
MRCH H 2 Offset(21,57)
MRCH P 2 Offset(4,38)
Goto ReadyBlob1

Flash:
TNT1 A 1 A_GiveInventory("MercuryFlashClimb_P")
TNT1 A 1 A_GiveInventory("MercuryFlashClimb_P2")
loop
}
}

actor Mercury_W2 : Mercury_W 
{
tag "$TAGC_VB2"
weapon.preferredskin "Mercury-Blob"
Inventory.Pickupmessage "You picked up the Power to... melt!"
Obituary "$OB_MERCURYSLAM"
inventory.icon "MercIcon"
States
{

Deselect:
MRCH P 0 Offset(0,124)
goto DeselectSwap
Select:
MRCH A 0 Offset(0,32)
goto SelectSwap

Ready:
goto SwitchBlobOn

Fire:
goto BlobFire

Altfire:
goto BlobAlt
}
}

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

actor MercuryBlobFormAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 280
+INVENTORY.IGNORESKILL
}

actor MercuryClimbing_F : Inventory {}

actor MercuryStuckToWall : PowerUp
{
Powerup.Duration 4
}

actor Merc_BlobOff_F : Inventory{}
actor Merc_BlobTired_F : Inventory{}

actor Mercury_Slammed_F : Powerup
{
powerup.duration 5
}

actor PowerMercurySlowSpeed : PowerSpeed
{
powerup.duration 4
Speed 0.8
+POWERSPEED.NOTRAIL
}


actor Mercury_Alt2_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_GiveInventory("VivifyDelay5")
TNT1 A 0 A_TakeInventory("SeizeAllTheAmmo",4,1)
TNT1 A 0 A_TakeInventory("MercuryClimbing_F")
TNT1 A 0 A_JumpIfInventory("SeizeAllTheAmmo",0,2)//Infinite ammo?
TNT1 A 0 A_SpawnItemEx("MercuryBlob1Alt")
TNT1 A 0
TNT1 A 0 A_PlaySoundEx("weapon/WoodLeap","Weapon")
TNT1 A 0 A_ChangeVelocity(cos(pitch)*36,0,-sin(pitch)*20+4,3)
stop
}
}

actor MercuryFlashClimb_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MercuryBlobFormAmmo",1,"ClimbStart")
TNT1 A 0 A_JumpIfInventory("Merc_BlobTired_F",1,"NoFlash")
goto Reset

Reset:
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
TNT1 A 0 A_GiveInventory("Merc_BlobTired_F")
TNT1 A 0 A_TakeInventory("CBM_120_SpeedPower")
TNT1 A 0 A_GunFlash("NoFlash",1)
goto PickupClimb+1
NoFlash:
TNT1 A 0
stop

ClimbStart:
TNT1 A 0 A_JumpIfInventory("MercuryClimbing_F",1,1)
goto PickupClimb
TNT1 A 0 A_TakeInventory("MercuryBlobFormAmmo",1)
TNT1 A 0 A_SpawnItemEx("MercuryClimbCheck",0,0,16,0,0,34)
goto PickupClimb
PickupClimb:
TNT1 A 0 A_JumpIfInventory("MercuryStuckToWall",1,"PickupClimbYes")
TNT1 A 0 A_GiveInventory("CBM_AviationOff_P")
TNT1 A 0 A_TakeInventory("PowerMercurySlowSpeed",1)
stop
PickupClimbYes:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyGrounded",1,2)
TNT1 A 0 A_GiveInventory("CBM_AviationOn_P")
TNT1 A 0 A_GiveInventory("PowerMercurySlowSpeed",1)
stop
}
}
actor MercuryFlashClimb_P2 : MercuryFlashClimb_P
{
states
{
ClimbStart:
TNT1 A 0 A_JumpIfInventory("MercuryClimbing_F",1,1)
goto PickupClimb
TNT1 A 0 A_TakeInventory("MercuryBlobFormAmmo",1,1)
TNT1 A 0 A_SpawnItemEx("MercuryClimbCheck",0,0,16,0,0,34)
goto PickupClimb
}
}

actor MercuryClimbCheck //: SnakeClimbCheck
{
PROJECTILE
+DONTBLAST
+DONTSPLASH
+SKYEXPLODE
+EXPLODEONWATER
+THRUACTORS
+DONTREFLECT
+SERVERSIDEONLY
Damage (0)
radius 48
height 16
speed 0
States
{
Spawn:
TNT1 A 0
TNT1 A 0 //A_CheckFloor("Death")
TNT1 A 1
stop
Death:
TNT1 A 0 //A_TakeFromTarget("MercuryBlobFormAmmo",1)//Ammo
TNT1 A 0 A_GiveToTarget("MercuryStuckToWall",1)
TNT1 A 1
stop
Death2:
TNT1 A 0
stop
}
}


actor Mercury_BlobSwapOn_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("Merc_BlobOff_F")
//TNT1 A 0 A_TakeInventory("MercuryBlobFormAmmo",18,1)
TNT1 A 0 A_PlaySoundEx("Merc/BlobSwap","Weapon")
TNT1 A 0 A_TakeInventory("MercuryBlobFormAmmo",1)
TNT1 A 0 A_JumpIfInventory("MercuryBlobFormAmmo",1,2)
TNT1 A 0 A_GiveInventory("Merc_BlobTired_F",1)
TNT1 A 0
stop
}
}
actor Mercury_BlobSwapOn_P2 : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("Merc_BlobTired_F",1,2)
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEON)
TNT1 A 0 A_GiveInventory("CBM_120_SpeedPowerGiver",1)
TNT1 A 0 A_GiveInventory("CBM_Ratio7JumpPowerGiver",1)
TNT1 A 0 A_GiveInventory("MercuryClimbing_F",1)
TNT1 A 0 A_TakeInventory("Merc_BlobOff_F")
stop
}
}

actor Mercury_BlobSwapOff_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("Merc_BlobTired_F",1,2)
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
TNT1 A 0 A_GiveInventory("CBM_AviationOff_P")
TNT1 A 0 A_TakeInventory("Merc_BlobTired_F")
TNT1 A 0 //A_PlaySoundEx("Merc/BlobSwap","Weapon")
TNT1 A 0 A_TakeInventory("MercuryBlobFormAmmo",1)
Share:
TNT1 A 0 A_GiveInventory("Merc_BlobOff_F",1)
TNT1 A 0 A_TakeInventory("MercuryClimbing_F")
stop
}
}
actor Mercury_BlobSwapOff_P2 : Mercury_BlobSwapOff_P
{
states
{
Pickup:
TNT1 A 0 A_TakeInventory("CBM_120_SpeedPower")
TNT1 A 0 A_TakeInventory("CBM_Ratio7JumpPower")
goto Share
}
}


actor MercuryCollider
{
PROJECTILE
Damagetype "Mercury_Slam"
Obituary "$OB_MERCURYSLAM"
+NOGRAVITY
+SKYEXPLODE
+EXPLODEONWATER
+DONTSPLASH
+DONTBLAST
+THRUGHOST
+DONTREFLECT
damage (0)
Radius 62
Height 72
States
{
Spawn:
TNT1 A 0
TNT1 A 1
TNT1 A 0
stop
XDeath:
TNT1 A 0 A_GiveToTarget("Mercury_Slammed_F",1)
TNT1 A 0
Stop
Death:
TNT1 A 1
Stop
}
}

actor MercurySnatchDamager_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("PirateTreasureStack",9999,"StealLife")
TNT1 A 0 A_Jump(1,"StealLifeChance")
goto Pickup2
Pickup2:
TNT1 A 0 A_PlaySoundEx("weapon/SlashClaw","Weapon")
TNT1 A 0 A_FireCustomMissile("MercurySnatchDamager",0,0,0,0)
stop
StealLifeChance:
TNT1 A 0 A_JumpIfInventory("PirateTreasureStack",91,"StealLife")
TNT1 A 0 A_Jump(8,"StealLife")//Shiny Chance
goto Pickup2
StealLife:
TNT1 A 0 A_PlaySoundEx("wep_L/MercShinySwipe","Weapon")
TNT1 A 0 A_FireCustomMissile("MercurySnatchDamager256",0,0,0,0)
stop
}
}

actor MercurySnatchDamager
{
PROJECTILE
damagetype "Mercury_Swipe"
obituary "$OB_MERCURYSWIPE"
+THRUSPECIES
+THRUGHOST
+DONTREFLECT
+DONTBLAST
species "Mercury"
RenderStyle None
damage (50+CallACS("cbm_countinv_snatcher",2))
radius 14
height 28
Speed 0
states
{
Spawn:
TNT1 A 0
TNT1 AAAAAAA 1 A_Warp(2,32,0,16,0,72)
stop
}
}

actor MercurySnatchDamager256 : MercurySnatchDamager
{
damagetype "Mercury_Swipe2"
obituary "$OB_MERCURYSWIPEX"
damage (2000+CallACS("cbm_countinv_snatcher",2)*10)
}

actor MercurySnatchFX : BasicGraphicEffect
{
scale 1.0
states
{
SpawnFrame:
MRCR T 1
MRCR SR 1 A_FadeOut(0.25)
stop
}
}

actor MercurySnatch
{
var int user_USER;
-SOLID
+NOGRAVITY
+DONTDRAIN
species "Mercury"
health 1
radius 28
height 32
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_RearrangePointers(0,0,2)
TNT1 A 0 A_ChangeFlag("SHOOTABLE",1)
TNT1 A 0 A_ChangeFlag("DONTRIP",1)
TNT1 A 1
TNT1 A 1
stop
Death:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("cbm_GiveIfPlayerHitMe",501)
TNT1 A 1 A_SpawnItemEx("MercurySnatchBlockD",0,0,0,0,0,0,0,32)
stop
}
}

actor MercurySnatchBlockD
{
PROJECTILE
damagetype "Mercury_Swipe"
obituary "$OB_MERCURYSWIPE"
+DONTBLAST
+DONTREFLECT
+DONTDRAIN
+NOGRAVITY
-NOBLOCKMAP
+SHOOTABLE
+INVULNERABLE
+NORADIUSDMG
+DONTRIP
+NOBLOOD
+THRUSPECIES
species "Mercury"
Damage (0)
radius 28
height 32
speed 0
States
{
Spawn:
TNT1 A 1
stop
}
}

actor MercurySnatchSuccess : Powerup
{
powerup.duration 15
}
actor MercurySnatchPickup : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_JumpIfInventory("MercurySnatchSuccess",1,5)
TNT1 A 0 A_GiveInventory("MercurySnatchSuccess",1)
TNT1 A 0 A_PlaySoundEx("item/JunkPick","Body")
TNT1 A 0 A_GiveInventory("PirateTreasureStack",1)
TNT1 A 0 A_GiveInventory("SeizeAllTheAmmo",4)
TNT1 A 0
stop
}
}



actor Merc_GrabBuster : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Mercury_Shot"
Obituary "$OB_MERCURYGRAB"
+DONTREFLECT
+HITTRACER
+BOUNCEONWALLS
bouncecount 3
Damage (100)
radius 9
height 9
Speed 44
scale 2.5
States
{
Spawn:
TNT1 A 1
MRCR AC 1
MRCR A 0 A_ChangeFlag("BOUNCEONWALLS",0)
MRCR ABCD 3
Goto Spawn+3
Crash:
XDeath:
TNT1 A 0 A_JumpIf(CallACS("cbm_istracerenemy"),"Give")
Goto Death
Give:
MRCR A 0 A_FaceTarget
MRCR A 0 A_SpawnItemEx("Merc_GrabBusterChase",0,0,0,30,0,0,frandom(0,360))
Death:
MRCR AC 1 A_FadeOut(0.1)
loop
}
}

actor Merc_GrabBusterChase : ProjSpawnFuncActor
{
PROJECTILE
+SEEKERMISSILE
+DONTBLAST
+DONTREFLECT
+NOINTERACTION
renderstyle translucent
alpha 0.8
reactiontime 25//135
speed 40//50
scale 1.5
states
{
Spawn:
MRCR U 0
MRCR U 0 A_ChangeVelocity(0,0,0.25*random(0,35)*(random(0,1)*2-1))//ThrustThingZ(0,random(0,35),random(0,1),0)
MRCR U 0 A_RearrangePointers(0,0,AAPTR_TARGET)
MRCR UVUVUV 1
SpawnLoop:
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR U 0 A_FaceTracer(90,90)
MRCR U 0 A_ChangeVelocity(50,0,sin(pitch)*50,3)
MRCR U 1 A_JumpIfCloser(64,"Death")
MRCR V 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR V 1 A_JumpIfCloser(64,"Death")
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR U 0 A_FaceTracer(90,90)
MRCR U 0 A_ChangeVelocity(50,0,sin(pitch)*50,3)
MRCR U 1 A_JumpIfCloser(64,"Death")
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR V 1 A_JumpIfCloser(64,"Death")
MRCR U 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"No")
MRCR U 0 A_CountDown
loop
/*
SpawnOld:
MRCR U 0 A_SetPitch(30)//momz
goto SpawnSlow+2
SpawnSlow:
MRCR U 0 A_JumpIf(Args[4]>=9,"SpawnSpeedStart")
MRCR U 0 A_JumpIfCloser(64,"Death")
MRCR U 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"No")
MRCR U 0 A_SetArg(4,Args[4]+1)
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR U 0 A_FaceTracer(5,2)
MRCR U 1 A_ChangeVelocity(30-3*Args[4],0,sin(pitch)*(30-3*Args[4]),3)//momz*(1-Args[4]*0.05),3)
MRCR V 0 A_FaceTracer(5,2)
MRCR V 1 A_ChangeVelocity(30-3*Args[4],0,sin(pitch)*(30-3*Args[4]),3)
loop
SpawnSpeedStart:
MRCR U 0 A_JumpIfCloser(64,"Death")
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR U 0 A_FaceTracer(6,3)
MRCR U 1 A_ChangeVelocity(6,0,sin(pitch)*6,3)
MRCR V 0 A_FaceTracer(6,3)
MRCR V 1 A_ChangeVelocity(6,0,sin(pitch)*6,3)
goto SpawnSpeed
SpawnSpeed:
MRCR U 0 A_JumpIf(Args[3]>=16,"SpawnL")
MRCR U 0 A_JumpIfCloser(64,"Death")
MRCR U 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"No")
MRCR U 0 A_SetArg(3,Args[3]+1)
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR U 0 A_FaceTracer(6,3)
MRCR U 1 A_ChangeVelocity(3+3*Args[3],0,sin(pitch)*(3+3*Args[3]),3)
MRCR V 0 A_JumpIfCloser(64,"Death")
MRCR V 0 A_FaceTracer(6,3)
MRCR V 1 A_ChangeVelocity(3+3*Args[3],0,sin(pitch)*(3+3*Args[3]),3)
loop

SpawnL:
MRCR U 0 A_JumpIfCloser(64,"Death")
MRCR U 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"No")
MRCR U 0 A_CountDown
//A_SeekerMissile(90,90,2)
MRCR U 0 A_SpawnItemEx("Merc_GrabBusterChaseFX",0,0,0,0,0,0,0,1)
MRCR U 0 A_FaceTracer(90,90)
MRCR U 1 A_ChangeVelocity(50,0,sin(pitch)*50,3)
MRCR V 0 A_JumpIfCloser(64,"Death")
MRCR V 0 A_FaceTracer(90,90)
MRCR V 1 A_ChangeVelocity(50,0,sin(pitch)*50,3)
loop
*/
Death:
TNT1 A 0 A_PlaySoundEx("item/JunkPick","Weapon")
TNT1 A 1 A_GiveToTarget("SeizeAllTheAmmo",2)
stop
No:
TNT1 A 0
stop
}
}

actor Merc_GrabBusterChaseFX : BasicGraphicEffect
{
alpha 0.8
scale 1.5
states
{
SpawnFrame:
MRCR UV 1 A_FadeOut(0.05)
loop
}
}

actor Merc_GrabBuster_L : Merc_GrabBuster
{
States
{
Spawn:
TNT1 A 1
MRCR AC 1
MRCR A 0 A_ChangeFlag("BOUNCEONWALLS",0)
MRCR ABCD 3 A_ChangeVelocity(0,8,0,CVF_RELATIVE)
Goto Spawn+3
}
}

actor Merc_GrabBuster_R : Merc_GrabBuster
{
States
{
Spawn:
TNT1 A 1
MRCR AC 1
MRCR A 0 A_ChangeFlag("BOUNCEONWALLS",0)
MRCR ABCD 3 A_ChangeVelocity(0,-8,0,CVF_RELATIVE)
Goto Spawn+3
}
}

actor MercurySplashRadius : BasicExplosion
{
damagetype "Mercury_Slam"
Obituary "$OB_MERCURYSLAM"
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(360,128,0,0,24)
TNT1 AAAAAAAA 0 A_SpawnItemEx("MercuryBlobSplashFX",0,0,-24,random(2,8),0,random(4,12),random(0,359),1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,30,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,60,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,90,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,120,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,150,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,180,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,210,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,240,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,270,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,300,1)
TNT1 A 0 A_SpawnItemEx("MercuryBlobWaveFX",0,0,-28,5,0,0,330,1)
TNT1 A 4
stop
}
}

actor MercuryBlobSplashRadius : MercurySplashRadius
{
damagetype "Mercury_Blob"
Obituary "$OB_MERCURYBLOB"
states
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(180,128,0,0,10)
TNT1 AAAAAAAA 0 A_SpawnItemEx("MercuryBlobSplashFX",0,0,4,random(2,8),0,random(4,12),random(0,359),1)
TNT1 A 2
stop
}
}
actor MercuryBlobSplashRadius2 : MercurySplashRadius
{
damagetype "Mercury_Blob"
Obituary "$OB_MERCURYBLOB"
states
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Explode(180,128,0,0,10)
goto Super::Spawn+2
}
}
actor MercuryBlobSplashRadiusW : MercuryBlobSplashRadius
{
states
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(90,128,0,0,10)
TNT1 AAAA 0 A_SpawnItemEx("MercuryBlobSplashFX",0,0,4,random(2,8),0,random(4,12),random(0,359),1)
TNT1 A 2
stop
}
}

actor MercuryContactDamage : BasicImplosion
{
damagetype "Mercury_Slam"
Obituary "$OB_MERCURYSLAM"
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(20,96,0,0,2)
stop
}
}

actor MercuryBlobSplashFX : BasicGraphicEffectM
{
-NOGRAVITY
+THRUACTORS
Speed 5
States
{
SpawnFrame:
TNT1 A 1
MRCR AC 2
Goto SpawnFrame+1
Death:
MRCR A 0 A_SetScale(scaleX-0.15) 
MRCR A 1 A_FadeOut(0.1)
MRCR C 0 A_SetScale(scaleX-0.15) 
MRCR C 1 A_FadeOut(0.1)
loop
}
}


actor MercuryBlobWaveFX : MercuryBlobSplashFX
{
+NOGRAVITY
alpha 0.7
Speed 15
Scale 1.5
States
{
SpawnFrame:
MRCR W 0
MRCR WWWWWWWWWWWW 1 A_SetScale(1.5,scaleY-0.08) 
MRCR W 1 A_FadeOut(0.5)
wait
Death:
TNT1 A 0
stop
}
}

actor MercuryBlob1 : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Mercury_Blob"
Obituary "$OB_MERCURYBLOB"
-NOGRAVITY
+SKYEXPLODE
+NOEXPLODEFLOOR
+EXPLODEONWATER
+DONTREFLECT
+NOTARGETSWITCH
+THRUSPECIES

/*
Bouncetype Classic
-BOUNCEONWALLS
-BOUNCEONFLOORS
-BOUNCEONCEILINGS
-ALLOWBOUNCEONACTORS
+CANBOUNCEWATER
BounceFactor 1.0
WallBounceFactor 1.0

//bouncecount 5*/
reactiontime 37
species "Mercury"
Damage (100)
radius 13
height 32//13
speed 1
scale 2.5
States
{
Spawn:
TNT1 A 0
MRCR EFGF 2
MRCR E 0 A_CheckFloor("Spawn2")
Fall:
MRCR EFGF 1 A_CheckFloor("Landing")
loop
Landing:
MRCR E 0 //A_GiveInventory("ResyncPickup",1)
MRCR E 0 A_PlaySoundEx("classes/burstpop","Weapon")
MRCR E 0 A_SpawnItemEx("MercuryBlobSplashRadius2",0,0,28)
MRCR EF 1
goto Spawn2
Spawn2:
MRCR E 0 //A_GiveInventory("ResyncPickup",1)
MRCR EEE 1 A_JumpIfCloser(56,"Give")
MRCR F 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"Home")
MRCR FFF 1 A_JumpIfCloser(56,"Give")
MRCR G 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"Home")
MRCR GGG 1 A_JumpIfCloser(56,"Give")
MRCR F 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"Home")
MRCR FFF 1 A_JumpIfCloser(56,"Give")
MRCR E 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathOOC")
MRCR E 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"Home")
goto Spawn2+1
Give:
TNT1 A 0 A_ChangeFlag("NOINTERACTION",1)
TNT1 A 0 A_PlaySoundEx("item/JunkPick","Body")
TNT1 A 1 A_GiveToTarget("SeizeAllTheAmmo",4)
stop
Home:
MRCR E 0 A_ChangeFlag("FLOORHUGGER",1)
MRCR E 0 A_ChangeFlag("BOUNCEONWALLS",1)
MRCR E 0 A_FaceTarget
MRCR E 0 A_ChangeVelocity(44,0,0,3)
MRCR EEE 1 A_JumpIfCloser(56,"Give")
MRCR E 0 A_CountDown
MRCR E 0 A_FaceTarget
MRCR F 0 A_ChangeVelocity(44,0,0,3)
MRCR FFF 1 A_JumpIfCloser(56,"Give")
MRCR E 0 A_CountDown
MRCR E 0 A_FaceTarget
MRCR G 0 A_ChangeVelocity(44,0,0,3)
MRCR GGG 1 A_JumpIfCloser(56,"Give")
MRCR E 0 A_CountDown
MRCR E 0 A_FaceTarget
MRCR F 0 A_ChangeVelocity(44,0,0,3)
MRCR FFF 1 A_JumpIfCloser(56,"Give")
MRCR E 0 A_CountDown
MRCR E 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathOOC")
goto Home+2
DeathOOC:
TNT1 A 1 A_CountdownArg(0)
wait
Death:
TNT1 A 0 A_SetGravity(0.0)
TNT1 A 0 A_PlaySoundEx("classes/burstpop","Weapon")
TNT1 AAAAAAAA 0 A_SpawnItemEx("MercuryBlobSplashFX",0,0,4,random(2,8),0,random(4,12),random(0,359),1)
TNT1 A 0 A_SpawnItemEx("MercuryBlob1ReturnHit")
MRCR MNOP 4
stop
}
}

actor MercuryBlob1Alt : MercuryBlob1
{
+THRUACTORS
States
{
Spawn:
TNT1 A 0
MRCR EFGF 2
MRCR E 0 A_ChangeFlag("THRUACTORS",0)
MRCR E 0 A_CheckFloor("Spawn2")
Goto Fall
}
}

actor MercuryBlob1Return : MercuryBlob1
{
States
{
Spawn:
MRCR E 0
goto Home
}
}

actor MercuryBlob1ReturnHit : MercuryBlob1
{
+THRUACTORS
+DONTBLAST
RenderStyle Translucent
Alpha 0.75
States
{
Spawn:
MRCR E 0
goto Home
Give:
TNT1 A 0 A_ChangeFlag("NOINTERACTION",1)
TNT1 A 0 A_PlaySoundEx("item/JunkPick","Body")
TNT1 A 1 A_GiveToTarget("SeizeAllTheAmmo",3)
stop
Death:
TNT1 A 0 A_SetGravity(0.0)
TNT1 A 0 A_PlaySoundEx("classes/burstpop","Weapon")
TNT1 AAAAAAAA 0 A_SpawnItemEx("MercuryBlobSplashFX",0,0,4,random(2,8),0,random(4,12),random(0,359),1)
MRCR MNOP 4
stop
}
}

actor MercuryBlob2 : ProjSpawnFuncActor
{
PROJECTILE
damagetype "Mercury_Blob"
Obituary "$OB_MERCURYBLOB"
BounceSound "weapon/BubbleBounce"
-NOGRAVITY
+DONTREFLECT
+NOTARGETSWITCH
+THRUSPECIES
+BOUNCEONWALLS
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+CANBOUNCEWATER
+USEBOUNCESTATE
species "Mercury"
bouncecount 5
reactiontime 50
Damage (100)
radius 13
height 13
speed 38
scale 2.5
States
{
Spawn:
MRCR EEE 1
MRCR F 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR FFF 1
MRCR G 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR GGG 1
MRCR F 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR FFF 1
MRCR E 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathOOC")
MRCR E 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR E 0 A_CountDown
loop
SpawnGive:
MRCR EEE 1 A_JumpIfCloser(56,"Give")
MRCR F 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR FFF 1 A_JumpIfCloser(56,"Give")
MRCR G 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR GGG 1 A_JumpIfCloser(56,"Give")
MRCR F 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR FFF 1 A_JumpIfCloser(56,"Give")
MRCR E 0 A_JumpIf(!CallACS("cbm_PointerExists",AAPTR_TARGET),"DeathOOC")
MRCR E 0 A_JumpIfInTargetInventory("Merc_BlobOff_F",1,"SpawnR")
MRCR E 0 A_CountDown
loop
Bounce:
MRCR E 0 A_PlaySoundEx("classes/burstpop","Weapon")
MRCR E 0 A_JumpIfInventory("VivifyDelay8",1,"WeakBounce")
MRCR E 0 A_GiveInventory("VivifyDelay8",1)
MRCR E 0 A_SpawnItemEx("MercuryBlobSplashRadius",0,0,8)
Goto SpawnGive
WeakBounce:
MRCR E 0 A_SpawnItemEx("MercuryBlobSplashRadiusW",0,0,8)
Goto SpawnGive
SpawnR:
MRCR E 0 A_SpawnItemEx("MercuryBlob1Return")
stop
Give:
TNT1 A 0 A_ChangeFlag("NOINTERACTION",1)
TNT1 A 0 A_ChangeFlag("USEBOUNCESTATE",0)
TNT1 A 0 A_PlaySoundEx("item/JunkPick","Body")
TNT1 A 1 A_GiveToTarget("SeizeAllTheAmmo",4)
stop
DeathOOC:
TNT1 A 1 A_CountdownArg(0,"XDeath")
wait
Crash:
XDeath:
TNT1 A 0 A_SetGravity(0.0)
TNT1 A 0 A_PlaySoundEx("classes/burstpop","Weapon")
TNT1 AAAAAAAA 0 A_SpawnItemEx("MercuryBlobSplashFX",0,0,4,random(2,8),0,random(4,12),random(0,359),1)
TNT1 A 0 A_SpawnItemEx("MercuryBlob1ReturnHit")
MRCR MNOP 4
stop
Death:
TNT1 A 0 A_JumpIfInTargetInventory("SeizeAllTheAmmo",0,2)
TNT1 A 0 A_SpawnItemEx("MercuryBlob1")
TNT1 A 1
stop
}
}


actor Mercury_W_NormalBar : NormalBar {Args 4,104}
actor Mercury_W_SecondBar : SecondBar {Args 128,130}
actor Mercury_W_ScriptBar : ScriptBar {}
actor Mercury_W2_NormalBar : NormalBar {Args 4,104}
actor Mercury_W2_SecondBar : SecondBar {Args 128,130}
actor Mercury_W2_ScriptBar : ScriptBar {}