actor Oilman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_1H"
dropitem "OilSliderWep"
Weapon.AmmoUse 0
Weapon.AmmoGive 3
Obituary "$OB_OILSLIDER"
weapon.ammotype "SkateOrSlideAmmo"
weapon.ammotype2 "ExtraOilAmmo"
states
{
Spawn:
C_01 H 1
loop

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

Ready:
OILA A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_OILMAN)
OILA A 0 A_GunFlash("Flash.Wait",1)
OILA A 0 A_TakeInventory("OilSledFlag")
OILA A 0 A_TakeInventory("OilCheck")
OILA A 0 A_GiveInventory("OilmanIsDone",1)
goto Ready1
Ready1:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 1 A_WeaponReady
loop
Ready2:
OILA A 10 A_WeaponReady
goto Ready1

Fire:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
FireH0:
OILA A 0 A_JumpIfInventory("IsBot",1,"BotFire")
FireH1:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",10,"FireH2")
OILA A 1 A_GiveInventory("SkateOrSlideAmmo",1+CallACS("core_checkrune",RUNE_RAGE))
OILA A 0 A_ReFire(1)
goto Fire1
OILA A 1 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 0 A_ReFire(1)
goto Fire1
OILA A 1 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 0 A_ReFire("FireH1")
goto Fire1
FireH2:
OILA B 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA B 0 A_JumpIfInventory("SkateOrSlideAmmo",20,"FireH3")
OILA B 1 A_GiveInventory("SkateOrSlideAmmo",1+CallACS("core_checkrune",RUNE_RAGE))
OILA B 0 A_ReFire(1)
goto Fire2
OILA B 1 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA B 0 A_ReFire(1)
goto Fire2
OILA B 1 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA B 0 A_ReFire("FireH2")
goto Fire2
FireH3:
OILA B 1 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA B 0 A_ReFire(1)
goto Fire3
OILA B 1 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA B 0 A_ReFire(1)
goto Fire3
OILA B 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA B 1 A_GiveInventory("SkateOrSlideAmmo",1+CallACS("core_checkrune",RUNE_RAGE))
OILA B 0 A_ReFire("FireH3")
goto Fire3

Fire1:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 0 A_PlaySoundEx("weapon/OilShotX","Weapon")
OILA C 3 A_FireCustomMissile("OilmanBlobShot",0,1,-8,0)
goto FireEnd
FireEnd:
OILA C 2
OILA B 5 A_TakeInventory("SkateOrSlideAmmo")
OILA A 3
OILA A 0 A_Refire("FireH0")
goto Ready1
Fire2:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 0 A_PlaySoundEx("weapon/OilShotX","Weapon")
//A_FireCustomMissile("OilmanBlobBall2",0,1,-8,0)
OILA C 3 A_FireCustomMissile("OilmanBlobShot2",random(-3,3),1,-8,0)
OILA C 0 A_PlaySoundEx("weapon/OilShotX","Body")
OILA C 2 A_FireCustomMissile("OilmanBlobShot2",random(-3,3),1,-8,0)
goto FireEnd
Fire3:
OILA C 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA C 0 A_PlaySoundEx("weapon/OilShotX","Weapon")
//A_FireCustomMissile("OilmanBlobBall",0,1,-8,0)
OILA C 3 A_FireCustomMissile("OilmanBlobShot3",random(-6,6),1,-8,0)
OILA C 0 A_PlaySoundEx("weapon/OilShotX","Body")
OILA C 3 A_FireCustomMissile("OilmanBlobShot3",random(-6,6),1,-8,0)
OILA C 0 A_PlaySoundEx("weapon/OilShotX","Weapon")
OILA C 2 A_FireCustomMissile("OilmanBlobShot3",random(-6,6),1,-8,0)
goto FireEnd

BotFire:
OILA A 0 A_JumpIfInventory("ExtraOilAmmo",224,"BotFire0")
OILA A 0 A_Jump(16,"SlideBegin")
OILA A 0 A_Jump(64,"Altfire")
OILA A 0 A_Jump(96,"Fire1")
OILA A 0 A_Jump(48,"Fire2")
OILA A 0 A_Jump(24,"Fire3")
goto BotFireH
BotFire0:
OILA A 0 A_Jump(128,1)
goto BotFire+1
OILA A 0 A_GiveInventory("OilmanFingerSnapF",1)
goto BotFire+1

BotFireH:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideBegin")
OILA A 3 A_GiveInventory("SkateOrSlideAmmo",1+CallACS("core_checkrune",RUNE_RAGE))
OILA A 0 A_ReFire("BotFire1")
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",20,"Fire3")
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",10,"Fire2")
goto Fire1
BotFire1:
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",20,"BotFire3")
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",10,"BotFire2")
OILA A 0 A_Jump(6,"Fire1")
goto BotFireH
BotFire2:
OILA B 0 A_Jump(12,"Fire2")
goto BotFireH
BotFire3:
OILA C 0 A_Jump(24,"Fire3")
goto BotFireH


SlideFireBoard:
OILA A 0 A_SpawnItemEx("OilmanSliderBoard",2,0,2,20,0,0,0,1)
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",20,4)
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",10,2)
OILA A 1 A_TakeInventory("OilCheck")
goto FireH1
OILA B 1 A_TakeInventory("OilCheck")
goto FireH2
OILA C 1 A_TakeInventory("OilCheck")
goto FireH3

SlideBegin:
OILA A 0 A_JumpIfInventory("SkateOrSlideAmmo",1,"SlideFireBoard")
OILA A 0 A_JumpIfInventory("OilmanJump",1,"OilPogo")
OILA A 0 A_GiveInventory("OilM_SlideBegin_P")
OILA A 0 A_GunFlash("Flash.Slide",0)
OILA A 0 A_JumpIfInventory("IsBot",1,"BotSlide")
Goto Slide+1

BotSlide:
OILA A 4 A_SpawnItemEx("SliderDamagerB",24,0,10,momx,momy,momz,0,8)
OILA A 0 A_GiveInventory("CutterFlag",1)
OILA A 0 A_JumpIfInventory("Cutterflag",15,3)
OILA A 0 A_Jump(64,1)
Loop
OILA A 0 A_GiveInventory("OilM_SlideAlt_P")
Loop
OILA A 0 A_TakeInventory("Cutterflag")
OILA A 0 A_Jump(224,"OilPogo")
Goto SlideEnd

Slide:
OILA A 0 A_TakeInventory("OilSledFlag",1)
OILA A 0 A_SpawnItemEx("SliderDamagerB",24,0,10,momx,momy,momz,0,8)
OILA A 4 A_WeaponReady(2)
OILA A 0 A_JumpIfInventory("OilSledFlag",1,"Slide")
Goto SlideEnd

OilPogo:
OILA A 0 A_GiveInventory("OilPogo_P",1)
Goto SlideEnd

SlideEnd:
OILA A 2 A_GiveInventory("OilM_SlideEnd_P")
OILA A 2
OILA A 2 A_TakeInventory("OilSledFlag")
goto Ready2

Altfire:
OILA A 0 A_JumpIfInventory("OilCheck",1,"SlideSpill")
OILA C 4 A_GiveInventory("Oilman_Alt1_P")
OILA B 3
OILA A 2
goto Ready1

SlideSpill:
OILA C 0 A_GiveInventory("OilM_SlideAlt_P")
OILA C 2 A_WeaponReady(10)
OILA B 2 A_WeaponReady(10)
OILA B 0 A_JumpIfInventory("OilSledFlag",1,1)
Goto SlideEnd
OILA B 0 A_TakeInventory("OilSledFlag",1)
//This is here to check if you're still holding altfire and deal no damage.
OILA A 4 A_WeaponReady(2)
OILA A 0 A_JumpIfInventory("OilSledFlag",1,"Slide")
Goto SlideEnd


Flash:
TNT1 A 2 A_GiveInventory("OilM_FlashState_P")//1
TNT1 A 0 A_JumpIfInventory("OilmanFingerSnapF",1,"Flash.Snap")
//TNT1 A 1 A_JumpIfInventory("PowerRage_ST",1,"Flash")
//TNT1 A 0 A_JumpIfInventory("OilmanFingerSnapF",1,"Flash.Snap")
loop

Flash.Slide:
TNT1 A 0
goto Flash

Flash.Snap:
OILA D 0 A_GiveInventory("VivifyDelay4",1)
OILA DE 2 A_GiveInventory("OilM_FlashState_P",1)
OILA G 0 A_GiveInventory("Oilman_Item_P")
OILA GFF 2 A_GiveInventory("OilM_FlashState_P",1)
OILA FFFED 2 A_GiveInventory("OilM_FlashState_P",1)
goto Flash

}
}

actor SkateOrSlideAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 20
+INVENTORY.IGNORESKILL
}

actor ExtraOilAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 224
+INVENTORY.IGNORESKILL
}

actor PowerOilmanStopSpeed : PowerSpeed
{
+POWERSPEED.NOTRAIL
powerup.duration 12
speed 0.30
}

actor OilStaminaFlag : Inventory
{
inventory.amount 1
inventory.maxamount 252
}

actor OilSledFlag : Inventory
{
inventory.amount 1
inventory.maxamount 56
}

actor OilmanJump : OnceC {}
actor OilmanFingerSnapF : OnceC {}
actor OilmanIsDone : OnceC {}


actor OilmanItem : BasicClassItem
{
inventory.icon "OilMIcon"
inventory.pickupmessage "Hey, you add fire to me, and we're in for some serious trouble! Not a thing'll be left!"
Tag "Oil Finger Snap"
states
{
Spawn:
OILA [ 1
wait
Use:
TNT1 A 0 A_JumpIfInventory("OilmanFingerSnapF",1,"No")
TNT1 A 0 A_JumpIfInventory("ExtraOilAmmo",224,"Use2")
fail
Use2:
TNT1 A 0 A_GiveInventory("OilmanFingerSnapF",1)
fail
}
}

actor Oilman_Alt1_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("OilmanSpillShot",random(-4,4),0,-8,0)
TNT1 A 0 A_PlaySoundEx("weapon/oilshot","Weapon")
TNT1 A 0 A_GiveInventory("ExtraOilAmmo",3)
stop
}
}
actor Oilman_Item_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("OilmanFingerSnapBoom",0,0,0,0)
TNT1 A 0 A_PlaySoundEx("weapon/OilSnap","SoundSlot7")
TNT1 A 0 A_TakeInventory("OilmanFingerSnapF",9)
TNT1 A 0 A_TakeInventory("ExtraOilAmmo",56)
TNT1 A 0 A_TakeInventory("ExtraOilAmmo",168,1)
stop
}
}

actor OilM_FlashState_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("OilmanJump",1,"OilSledThrust")
TNT1 A 0 A_GiveInventory("OilStaminaFlag",1)
TNT1 A 0 A_JumpIfInventory("SkateOrSlideAmmo",1,2)
TNT1 A 0 A_GiveInventory("ExtraOilAmmo",4)
stop
TNT1 A 0 A_GiveInventory("ExtraOilAmmo",1)
stop
OilSledThrust:
TNT1 A 0 A_GiveInventory("OilM_WaterThrust_P")
TNT1 A 0 A_JumpIf(z-floorz==0,"Ground")
TNT1 A 0 A_Recoil(-2)
goto End
Ground:
TNT1 A 0 A_Recoil(-4)
goto End
End:
TNT1 A 0 A_GiveInventory("ExtraOilAmmo",1)
TNT1 A 0 A_JumpIfInventory("OilSoundTime",1,"No")
TNT1 A 0 A_PlaySoundEx("weapon/OilSlider","Weapon")
TNT1 A 0 A_GiveInventory("OilSoundTime",1)
TNT1 A 0 A_GiveInventory("PowerOilmanStopSpeed")
stop
No:
TNT1 A 0
stop
}
}

actor OilM_WaterThrust_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("HasFeetInWater",1,"UnderWater")//IsUnderWater
TNT1 A 0 A_JumpIfInventory("IsUnderBubbleWater",1,"UnderWater")
stop
UnderWater:
TNT1 A 0 A_JumpIf(z-floorz>32,1)
stop
TNT1 A 0 A_JumpIf(momz<=0,2)
TNT1 A 0 A_ChangeVelocity(0,0,0.7/*0.875*/,1)//ThrustThingZ(0,7,0,1)
stop
TNT1 A 0 ThrustThingZ(0,2,0,0)//5
stop
}
}

actor OilM_SlideAlt_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("SliderDamagerBX",24,0,2,momx,momy,momz,0,8)
TNT1 A 0 A_JumpIfInventory("OilStaminaFlag",1,1)
stop
TNT1 A 0 A_TakeInventory("OilSledFlag",1)
TNT1 A 0 A_TakeInventory("OilStaminaFlag",1)
TNT1 A 0 A_PlaySoundEx("weapon/oilshot","Body")
TNT1 A 0 A_FireCustomMissile("OilmanSpillShotX",random(-4,4),1,-8,0)
stop
}
}

actor OilM_SlideBegin_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 //ACS_NamedExecuteWithResult("core_stopplayer",0,1)
TNT1 A 0 A_GiveInventory("OilSledFlag",42)
TNT1 A 0 A_GiveInventory("OilmanJump",1)
TNT1 A 0 A_GiveInventory("OilBoat",1)
TNT1 A 0 A_TakeInventory("OilmanIsDone")
stop
}
}

actor OilM_SlideEnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEx("OilmanSliderBoard",2,0,2,20,0,0,0,1)
TNT1 A 0 //ACS_NamedExecuteWithResult("core_stopplayer",0,0)
TNT1 A 0 A_StopSound(CHAN_WEAPON)
TNT1 A 0 A_GiveInventory("OilmanIsDone",1)
TNT1 A 0 A_TakeInventory("PowerOilmanStopSpeed")
TNT1 A 0 A_TakeInventory("OilSoundTime")
TNT1 A 0 A_TakeInventory("OilSledFlag")
TNT1 A 0 A_TakeInventory("OilCheck")
TNT1 A 0 A_TakeInventory("OilBoat")
TNT1 A 0 A_TakeInventory("OilmanJump")
stop
}
}

actor OilPogo_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_ScaleVelocity(0.75)
TNT1 A 0 A_JumpIf(z-floorz!=0,"Ground")
TNT1 A 0 A_SpawnItemEx("OilPogoSkidSnd_H")
stop
Ground:
TNT1 A 0 A_PlaySoundEx("weapon/OilJump","Body")
TNT1 A 0 ThrustThingZ(0,45,0,0)
stop
}
}
actor OilPogoSkidSnd_H : BasicHelper
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAA 3 A_GiveToTarget("OilPogoSkidSnd_P",1)
stop
}
}
actor OilPogoSkidSnd_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("SMB3/Skid","Body")
stop
}
}

actor OilmanBlobBall : ProjSpawnFuncActor
{
PROJECTILE
Damagetype "MegaOilBall"
Obituary "$OB_OILBALL"
-NOGRAVITY
+SKYEXPLODE
+BOUNCEONWALLS
+BOUNCEONFLOORS
+BOUNCEONCEILINGS
+CANBOUNCEWATER
+USEBOUNCESTATE
+FORCEXYBILLBOARD
Bouncecount 6
Bouncefactor 0.65
Wallbouncefactor 0.70
//Gravity 1.0
ReactionTime 6
Damage(200)
Radius 16
Height 24
Speed 40
Scale 2.0
States
{
Spawn:
OILA T 0
OILA T 0 A_ChangeVelocity(0,0,4)
OILA T 0 A_JumpIf(ReactionTime==1,"Spawn2")
OILA TTTTTTTTTTTT 1 A_SpawnItemEx("OilmanBlobBallFX",frandom(-16,16),frandom(-16,16),frandom(2,24),0,0,frandom(-1,-3),0,1)
OILA T 0 A_CountDown
OILA T 0 A_SpawnItemEx("OilmanBlobFlung",0,0,0,0,0,0,0,1)
OILA T 0 A_JumpIf(ReactionTime==1,"Spawn2")
OILA TTTTTTTTTTTT 1 A_SpawnItemEx("OilmanBlobBallFX",frandom(-16,16),frandom(-16,16),frandom(2,24),0,0,frandom(-1,-3),0,1)
OILA T 0 A_CountDown
OILA T 0 A_SpawnItemEx("OilmanBlobFlung",0,0,0,0,0,0,0,1)
Goto Spawn+2
Spawn2:
OILA T 2
wait
Bounce:
OILA U 0 A_PlaySound("weapon/oilshot",4,0.5)
OILA U 0 A_CountDown
OILA U 3 A_SpawnItemEx("OilmanBlobFlung",0,0,0,0,0,0,0,1)
OILA V 3
goto Spawn+2
Crash:
XDeath:
TNT1 A 1
stop
Death:
TNT1 A 0
TNT1 A 1 A_SpawnItemEx("OilmanBlobFlung",0,0,0,0,0,0,0,1)
stop
}
}
actor OilmanBlobBall2 : OilmanBlobBall
{
bouncecount 4
ReactionTime 4
Speed 33
}

actor OilmanBlobBallFX : BasicGraphicEffect
{
Translation "192:192=167:167","198:198=226:226"
-NOGRAVITY
+THRUACTORS
ReactionTime 1
Radius 3
Height 3
Scale 0.5
States
{
SpawnFrame:
ACID T 0
ACID T 105
ACID T 4 A_CountDown
loop
Death:
ACID U 0 A_SetGravity(0.0)
ACID UV 5
stop
}
}

actor OilmanBlobShot : ProjSpawnFuncActor
{
PROJECTILE
damagetype "OilM_Shot"
Obituary "$OB_OILSLIDER"
-NOGRAVITY
+SKYEXPLODE
+EXPLODEONWATER
+FORCEXYBILLBOARD
Damage (200)
Radius 8
Height 5
speed 28
Scale 2.0
States
{
Spawn:
Q_1H B 0
Q_1H B 0 A_ChangeVelocity(0,0,1.5)
Q_1H B 5
wait
Crash:
XDeath:
Q_1H B 1
stop
Death:
Q_1H B 0 
Q_1H B 0 A_JumpIf(z-floorz<=0,"Death2")
Q_1H B 1 A_GiveInventory("CutterFlag",1)
Q_1H B 0 A_JumpIfInventory("CutterFlag",175,"Xdeath")
loop
Death2:
Q_1H B 1 A_SpawnItemEx("OilmanBlob")//+32768
stop
}
}

actor OilmanBlobShot2 : OilmanBlobShot
{
Damage (150)
Speed 36
}
actor OilmanBlobShot3 : OilmanBlobShot
{
Damage (150)
Speed 52
}

actor OilmanBlobFlung : OilmanBlobShot
{
Damage (150)
States
{
Spawn:
Q_1H B 0
Q_1H B 0 A_ChangeVelocity(0,0,0.25)
Q_1H B 5
wait
}
}

actor OilmanSpillShot : OilmanBlobShot
{
Damage (80)
Radius 12
Height 8
speed 28
States
{
Spawn:
Q_1H G 0
Q_1H G 0 A_ChangeVelocity(0,0,1.5)
Q_1H G 5 //A_CheckFloor("Death")
loop
Crash:
XDeath:
Q_1H G 1
stop
Death:
Q_1H G 0 
Q_1H G 0 A_JumpIf(z-floorz<=0,"Death2")
Q_1H G 1 A_GiveInventory("CutterFlag",1)
Q_1H G 0 A_JumpIfInventory("CutterFlag",88,"Xdeath")
loop
Death2:
Q_1H G 1 A_SpawnItemEx("OilmanSpillBlob")
stop
}
}

actor OilmanSpillShot2 : OilmanSpillShot
{
States
{
Spawn:
Q_1H G 0
Q_1H G 0 A_ChangeVelocity(0,0,0.25)
Q_1H G 5
wait
}
}

actor OilmanSpillShotX : OilmanSpillShot
{
+DONTSPLASH
Damage (40)
Radius 8
Height 5
speed 40
Scale 2.0
States
{
Death:
Q_1H G 0 
Q_1H G 0 A_JumpIf(z-floorz<=0,"Death2")
Q_1H G 1 A_GiveInventory("CutterFlag",1)
Q_1H G 0 A_JumpIfInventory("CutterFlag",44,"Xdeath")
loop
Death2:
Q_1H G 1 A_SpawnItemEx("OilmanSpillBlobX")
stop
}
}

actor OilmanSpillShotX2 : OilmanSpillShotX
{
States
{
Spawn:
Q_1H G 0
Q_1H G 0 A_ChangeVelocity(0,0,0.25)
Q_1H G 5
wait
}
}

Actor OilmanBlob : ProjSpawnFuncActor
{
damagetype "OilM_Blob"
Obituary "$OB_OILBLOB"
+MISSILE
+NODAMAGETHRUST
+NONSHOOTABLE
+DONTDRAIN
+NOBLOOD
+EXPLODEONWATER
+DONTSPLASH
+NOEXPLODEFLOOR
+NOTARGETSWITCH
//+DONTTHRUST
painchance 256
damagefactor "Ignition", 1.0
mass 99999
Health 100000
reactiontime 175
Damage (100)
Radius 8
Height 10
scale 2.5
states
{
Spawn:
Q_1H D 0
Q_1H D 0 //A_JumpIf(Args[2]>0,2)
Q_1H D 0 A_SetArg(2,ReactionTime)
Q_1H D 1
Q_1H D 0 A_ChangeFlag("SHOOTABLE",1)
Goto Spawn2

Pain.Ignition:
Q_1H C 0
Q_1H C 0 A_Jump(256,"SpawnFlame")
goto SpawnFlame
SpawnFlame:
Q_1H C 0 A_ChangeFlag("NOPAIN",1)
Q_1H C 1 A_SpawnItemEx("OilmanBlobFlame")
Q_1H C 0 A_Jump(256,"Death")
stop
Spawn2:
Q_1H D 0 //A_CountDownArg(2)
Q_1H D 1 A_Stop
Goto SlideWait
SlideWait:
Q_1H C 0 A_CountDownArg(2)//A_GiveInventory("CutterFlag",1)
Q_1H C 1 A_JumpIfCloser(40,"Slide")
Q_1H C 0 A_JumpIf(abs(z*100000-floorz*100000)>50,"NewShot")
//Q_1H C 0 A_JumpIfInventory("CutterFlag",175,"Death")
loop
Slide:
Q_1H C 0 A_JumpIfInTargetInventory("OilCheck",1,"Spawn2")
TNT1 A 2 A_GiveToTarget("OilCheck",1)
stop
NewShot:
//Q_1H C 0 A_LogInt(z*100000)
//Q_1H C 0 A_LogInt(floorz*100000)
//Q_1H C 0 A_LogInt(momz*100000)
Q_1H C 0 //A_CheckFlag("BLASTED","NewShotX")
//Goto Death
//NewShotX:
Q_1H C 0 A_SpawnItemEx("OilmanBlobFlung",0,0,0,momx,momy,momz,0,8)//+32768
Goto Death
Death:
TNT1 A 0
stop
}
}

actor OilM_SledBoost_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIf(z-floorz==0,2)
TNT1 A 0 A_Recoil(-12)
stop
TNT1 A 0 A_Recoil(-20)
stop
}
}

actor OilmanSpillBlob : OilmanBlob
{
Damage (50)
Radius 12
Height 10
ReactionTime 100
states
{
Spawn:
Q_1H I 0
Q_1H I 0 A_SetArg(2,ReactionTime)
Q_1H I 1
Q_1H I 0 A_ChangeFlag("SHOOTABLE",1)
Goto Spawn2
SpawnFlame:
Q_1H H 0 A_ChangeFlag("NOPAIN",1)
Q_1H H 1 A_SpawnItemEx("OilmanSpillFlame")
Q_1H H 0 A_Jump(256,"Death")
stop
Spawn2:
Q_1H H 1 A_Stop
Goto SlideWait
SlideWait:
Q_1H H 0 A_CountDownArg(2)
Q_1H H 1 A_JumpIfCloser(40,"Slide")
Q_1H H 0 A_JumpIf(abs(z*100000-floorz*100000)>50,"NewShot")
//Q_1H H 0 A_JumpIfInventory("CutterFlag",100,"Death")
loop
Slide:
Q_1H H 0 A_JumpIfInTargetInventory("OilCheck",1,"Slide2")
goto Spawn2
Slide2:
Q_1H I 0 A_SetArg(2,Args[2]+25)
Q_1H I 0 A_GiveToTarget("OilM_SledBoost_P")
Q_1H I 1 A_GiveToTarget("OilSledFlag",5)
goto SlideDone
SlideDone:
Q_1H H 1 A_CountDownArg(2)
Q_1H H 0 A_JumpIf(abs(z*100000-floorz*100000)>50,"NewShot")
loop
NewShot:
Q_1H H 0 A_SpawnItemEx("OilmanSpillShot2",0,0,0,momx,momy,momz,0,8)
Goto Death
Death:
TNT1 A 0
stop
}
}

actor OilmanSpillBlobX : OilmanSpillBlob
{
Damage (40)
Radius 8
Height 5
Scale 2.0
States
{
Spawn:
Q_1H I 0
Q_1H I 0 A_JumpIfCloser(56,"SlideX")
goto Super::Spawn

SlideX:
Q_1H I 0 A_JumpIfInTargetInventory("OilCheck",1,"SlideX2")
goto Super::Spawn
SlideX2:
Q_1H I 1 A_GiveToTarget("OilSledFlag",3)
Q_1H I 0 A_SetArg(2,ReactionTime+25)
Q_1H I 0 A_ChangeFlag("SHOOTABLE",1)
goto SlideDone

SpawnFlame:
Q_1H H 0 A_ChangeFlag("NOPAIN",1)
Q_1H H 1 A_SpawnItemEx("OilmanSpillFlameX")
Q_1H H 0 A_Jump(256,"Death")
stop
Slide:
Q_1H H 0 A_JumpIfInTargetInventory("OilCheck",1,"Slide2")
goto Spawn2
Slide2:
Q_1H I 0 A_SetArg(2,Args[2]+25)
Q_1H I 1 A_GiveToTarget("OilSledFlag",3)
goto SlideDone
NewShot:
Q_1H H 0 A_SpawnItemEx("OilmanSpillShotX2",0,0,0,momx,momy,momz,0,8)
Goto Death
}
}

actor OilmanBlobFlame : ProjSpawnFuncActor
{
PROJECTILE
-NOGRAVITY
+NODAMAGETHRUST
+NOBLOOD
+DOOMBOUNCE
+DONTSPLASH
+FLOORHUGGER
+DONTBLAST
+BRIGHT
Damage (200)
damagetype "OilM_Flame"
Obituary "$OB_OILSLIDER2"
Height 48
Radius 8
scale 2.5
mass 99999
reactiontime 100
States
{
Spawn:
Q_1H F 0
Q_1H F 2 A_ChangeFlag("DOOMBOUNCE",0)
Q_1H F 0 A_SpawnItemEx("OilM_CBM_OilPitIgnite",0,0,8)
Q_1H EF 3 A_CountDown
goto Spawn+3
Death: 
TNT1 A 1
stop
}
}

actor OilmanSpillFlame : OilmanBlobFlame
{
reactiontime 75
Damage (140)
Radius 12
Height 52
States
{
Spawn:
Q_1H K 0
Q_1H K 2 A_ChangeFlag("DOOMBOUNCE",0)
Q_1H K 0 A_SpawnItemEx("OilM_CBM_OilPitIgnite",0,0,8)
Q_1H JK 3 A_CountDown
goto Spawn+3
}
}

actor OilmanSpillFlameX : OilmanSpillFlame
{
reactiontime 50
Damage (120)
Radius 8
Height 46
Scale 2.0
}


actor SliderDamagerB : BasicImplosion
{
damagetype "OilM_Slider"
Obituary "$OB_OILSLIDER"
States
{
Spawn:
TNT1 A 0//98
TNT1 A 2 A_Explode(100+CallACS("core_checkrune",RUNE_SPREAD,2)*200,80,0,0,8)
stop
}
}

actor SliderDamagerBX : SliderDamagerB
{
States
{
Spawn:
TNT1 A 0
TNT1 A 2 A_Explode(30+CallACS("core_checkrune",RUNE_SPREAD,2)*60,96,0,0,8)
stop
}
}

actor OilmanFingerSnapBoom : ProjSpawnFuncActor
{
SeeSound "weapon/OilSnap"
PROJECTILE
damagetype "OilM_Snap"
Obituary "$OB_OILFINGERSNAP"
+THRUACTORS
+DONTBLAST
+DONTSPLASH
+DONTREFLECT
ReactionTime 1
damage (0)
Radius 4
Height 4
speed 65
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_CountDown
wait
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilM_CBM_OilPitIgnite")
TNT1 A 0 A_SpawnItemEx("OilmanFingerSnapBoomFX",0,0,0,0,0,0,0,1)
TNT1 A 2 A_Explode(20,48,0,0,48)
stop
}
}

actor OilmanFingerSnapBoomFX : BasicGraphicEffect
{
+BRIGHT
+FORCEXYBILLBOARD
States
{
SpawnFrame:
OILA "\]" 2
stop
}
}

actor OilM_CBM_OilPitIgnite : OilPitIgnite{Args 140}

actor OilmanSliderBoard : ProjSpawnFuncActor
{
PROJECTILE
damagetype "OilM_Board"
Obituary "$OB_OILBLOB"
-NOGRAVITY
+NOEXPLODEFLOOR
+DONTREFLECT
+NOCLIP

+EXPLODEONWATER
//+DONTSPLASH
+NOEXPLODEFLOOR
+STEPMISSILE
maxstepheight 15

damage (180)
Radius 12
Height 16
speed 20
scale 2.5
States
{
Spawn:
Q_1H A 0
Q_1H A 0 A_ChangeFlag("NOCLIP",0)
Q_1H A 0 A_PlaySound("wep_L/OilSlider",1,0.2,1)
Q_1H A 1
wait
Death:
TNT1 A 1 A_StopSound(1)
stop
}
}


actor Oilman_W_NormalBar : NormalBar {Args 68,47}
actor Oilman_W_SecondBar : SecondBar {Args 218,43}
actor Oilman_W_ScriptBar : ScriptBar {}