actor CaveBossWeapon : MegaBuster
{
tag "Combustible Lemon Launcher"
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.SlotNumber 1
Obituary "$OB_CAVELEMON"
+INVENTORY.UNDROPPABLE
weapon.ammotype "BossJumpCharge"
weapon.ammotype2 "BossRageCharge"
+WEAPON.AMMO_OPTIONAL
Scale 2.0
States
{
Spawn:
TNT1 A 0
stop
Ready:
CVGN A 0 ACS_NamedExecuteAlways("GiveExecution",0)
CVGN A 0 A_GiveInventory("SingleGunFlag",1)
CVGN A 0 ACS_ExecuteAlways(991,0,502)
CVGN A 1 A_WeaponReady(WRF_NOSWITCH)
Goto Ready+1
Deselect:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
CVGN A 1 A_Lower
loop
Select:
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
CVGN A 1 A_Raise
Loop
Fire:
CVGN B 1 Offset(5, 41)
CVGN B 1 Offset(9, 45) A_FireCustomMissile("CombustableLemon",0,1,8,0)
CVGN A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
CVGN B 2 Offset(9, 45) 
CVGN C 4 Offset(10, 46)
CVGN C 2 Offset(5, 41)
CVGN C 2 Offset(2, 37)
CVGN D 2 Offset(10, 46)
CVGN D 2 Offset(5, 40)
CVGN D 32 A_WeaponReady(14)
CVGN A 5 A_WeaponReady(14)
CVGN A 0 A_Refire
Goto Ready+1
Altfire:
CVGN A 0 A_JumpIfInventory("BossRageCharge",500,"Rage")
CVGN A 1
//CVGN B 5
//CVGN C 5 A_FireCustomMissile("CombustableLemon",0,1,8,0)
CVGN B 2 Offset(5, 41)
CVGN B 2 Offset(9, 45)
CVGN B 1 Offset(10, 46)
CVGN A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
CVGN C 2 Offset(9, 45) A_FireCustomMissile("CombustableLemon2",0,1,8,0)
CVGN C 2 Offset(5, 41)
CVGN C 1 Offset(2, 37)
CVGN D 2 Offset(5, 40)
CVGN D 38 A_WeaponReady(14)
CVGN A 0 A_Refire
Goto Ready+1
Rage:
CVGN A 0 A_TakeInventory("SingleGunFlag",1)
CVDB A 0 A_GiveInventory("CaveRageAmmo",200)
CVGN A 1 Offset(0,32)
TNT1 A 0 A_TakeInventory("BossRageCharge",9999)
CVGN A 1 Offset(0,46)
CVGN A 1 Offset(0,58)
CVGN A 1 Offset(0,70)
CVGN A 1 Offset(0,100)
CVDB A 1 Offset(0,100)
CVDB A 1 Offset(0,70)
CVDB A 1 Offset(0,58)
CVDB A 1 Offset(0,46)
CVDB A 1 Offset(0,32)
CVDB A 0 A_PlaySoundEx("Cave/Rage","Item")
CVDB A 0 A_GiveInventory("WeaponCharge",200)
CVDB A 0 A_GiveInventory("KnightFlag")
CVDB A 0 ACS_ExecuteAlways(191,0,APROP_Speed,85,100)
CVDB A 0 A_GunFlash("RageFlash")
RageLoop:
CVDB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
CVDB B 3 A_FireCustomMissile("LemonStormBlue",0,0,-12,0)
CVDB C 3 
CVDB A 0 A_PlaySoundEx("weapon/mbuster","Weapon")
CVDB D 3 A_FireCustomMissile("LemonStormYellow",0,0,14,0)
CVDB C 3 
CVDB A 0 A_JumpIfInventory("KnightFlag",1,"RageLoop")
CVDB A 0 A_GiveInventory("SingleGunFlag",1)
RageEnd:
CVDB A 0 ACS_ExecuteAlways(191,0,APROP_Speed,1,1)
CVDB A 2 Offset(0,32)
CVDB A 2 Offset(0,42)
CVDB A 2 Offset(0,52)
CVDB A 2 Offset(0,62)
CVDB A 2 Offset(0,72)
CVDB A 2 Offset(0,82)
CVDB A 2 Offset(0,92)
CVDB A 2 Offset(0,100)
CVGN A 2 Offset(0,92)
CVGN A 2 Offset(0,82)
CVGN A 2 Offset(0,72)
CVGN A 2 Offset(0,62)
CVGN A 2 Offset(0,52)
CVGN A 2 Offset(0,42)
CVGN A 2 Offset(0,32)
goto Ready+1
NoAmmo:
CVGN A 1 ACS_Execute(979,0)
CVGN A 0 A_Refire
goto Ready+1
Flash:
TNT1 A 1 A_JumpIfInventory("KnightFlag",1,"RageFlash")
loop
RageFlash:
TNT1 A 1 A_TakeInventory("CaveRageAmmo",1)
TNT1 A 0 A_JumpIfInventory("CaveRageAmmo",1,"RageFlash")
RageFlashEnd:
TNT1 A 0 A_TakeInventory("KnightFlag",1)
TNT1 A 0 //A_TakeInventory("LemonStormAmmo",999)
goto Flash
}
}

actor CombustableLemon
{
PROJECTILE
-NOGRAVITY
+HEXENBOUNCE
+CANBOUNCEWATER
+HITTRACER
+DONTBLAST
Obituary "$OB_CAVELEMON"
Damage (10)
Radius 18
Height 18
scale 3.0
speed 30
damagetype "BossInstagib"
bouncefactor 0.6
wallbouncefactor 0.0
seesound "weapon/megaball"
reactiontime 15
bouncecount 5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ThrustThingZ(0,5,0,1)
TNT1 A 0 A_CountDown
SXP1 D 4 A_SpawnItemEX("CombustLemonFX",0,0,12,0,0,0,0)
SXP1 E 4
SXP1 F 4 A_SpawnItemEX("CombustLemonFX",0,0,12,0,0,0,0)
SXP1 G 4
Goto Spawn+2
Death:
TNT1 A 0 A_PlaySoundEx("weapon/napalm","Weapon")
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_Explode(40,100,0)
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,0)
TNT1 A 1 A_SpawnItemEx("CombustLemonSplodeFX",0,0,0)
stop
Crash:
TNT1 A 0 A_PlaySoundEx("weapon/napalm","Weapon")
TNT1 A 0 A_SpawnItemEx("CombustLemonSplodeFX",0,0,0)
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_Stop
TNT1 A 0 A_JumpIfInventory("CombustLemonMark",1,"Death",AAPTR_TRACER)
TNT1 A 0 A_GiveInventory("CombustLemonMark",1,AAPTR_TRACER)
Goto CombustLemon
BurnSustain:
TNT1 A 0 A_GiveInventory("CombustLemonMark",1,AAPTR_TRACER)
Goto CombustLemon
CombustLemon:
TNT1 AAAAAAAAAA 1 A_Warp(AAPTR_TRACER,0,0,0,0,WARPF_NOCHECKPOSITION)
TNT1 A 0 A_Warp(AAPTR_TRACER,0,0,0,0,WARPF_NOCHECKPOSITION)
TNT1 A 0 A_SpawnItemEx("LemonBurn",0,0,28,0,0,0,0,SXF_ABSOLUTEMOMENTUM)
TNT1 A 0 A_JumpIfInventory("CombustLemonMark",1,"CombustLemon",AAPTR_TRACER)
goto Death2
Death2:
TNT1 A 0
stop
XDeath:
TNT1 A 0
stop
}
}

actor CombustableLemon2
{
PROJECTILE
+DOOMBOUNCE
+CANBOUNCEWATER
-BOUNCEONACTORS
+HITTRACER
+DONTBLAST
Obituary "$OB_CAVELEMON"
Damage (15)
Radius 18
Height 18
scale 3.0
speed 30
damagetype "BossInstagib"
speed 65
gravity 1.8
bouncefactor 0.5
wallbouncefactor 0.60
seesound "weapon/megaball"
reactiontime 45
States
{
Spawn:
TNT1 A 0
TNT1 A 1 
Goto Spawn2
Spawn2:
SXP1 D 0 A_ChangeFlag("THRUACTORS",0)
SXP1 D 2 A_CountDown
SXP1 D 0 A_Checkfloor("Slowdown")
SXP1 E 2 A_CountDown
SXP1 E 0 A_Checkfloor("Slowdown")
SXP1 F 2 A_CountDown
SXP1 F 0 A_Checkfloor("Slowdown")
SXP1 F 0 A_Changeflag("NOGRAVITY",false)
SXP1 G 2 A_CountDown
SXP1 G 0 A_Checkfloor("Slowdown")
Goto Spawn2
Slowdown:
SXP1 D 0 A_ChangeFlag("THRUACTORS",1)
SXP1 D 1 A_ScaleVelocity(0.7)
SXP1 D 1 A_CountDown
SXP1 D 0 A_Checkfloor("Slowdown")
Goto Spawn2
Crash:
XDeath:
Death:
TNT1 A 0 A_PlaySoundEx("weapon/napalm","Weapon")
TNT1 A 0 A_ChangeFlag("NOGRAVITY",1)
TNT1 A 0 A_Explode(40,100,0)
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,0)
TNT1 A 0 A_SpawnItemEx("CombustLemonSplodeFX",0,0,0)
TNT1 A 0
stop
}
}

Actor LemonBurn
{
PROJECTILE
+DONTBLAST
+RIPPER
damagetype "BossInstagib"
Obituary "$OB_CAVELEMON"
Radius 1
Height 1
States
{
Spawn:
TNT1 A 0
TNT1 AAAAA 0 A_SpawnItemEx("CombustLemonFX",random(-25,25),random(-25,25),random(0,25),0,0,random(1,25),0)
TNT1 A 1 A_Explode(5,32,0,0,32)
stop
}
}

Actor LemonBurn2 : LemonBurn
{
States
{
Spawn:
TNT1 A 0
TNT1 AAAAA 0 A_SpawnItemEx("CombustLemonFX",random(-25,25),random(-25,25),random(0,25),0,0,random(1,25),0)
TNT1 A 1 A_Explode(3,32,0,0,32)
stop
}
}

actor CombustLemonFX : GeminiTrail
{
translation "192:192=229:229", "198:198=42:42"
renderstyle "Translucent"
alpha 0.75
scale 2.5
States
{
Spawn:
TNT1 A 0
CWFT ABC 3 A_Fadeout
loop
}
}

actor CombustLemonSplodeFX : GeminiTrail
{
translation "209:212=229:229"
renderstyle "Translucent"
alpha 1.0
scale 2.5
States
{
Spawn:
TNT1 A 0
NAPA EFGHIJKLMNOPQRS 2 
stop
}
}

actor CombustLemonMark : Powerup{inventory.amount 1 inventory.maxamount 1 powerup.duration 86}

actor LemonStormBlue
{
PROJECTILE
Obituary "$OB_CAVEBARRAGEBLUE"
translation "4:4=197:197", "209:212=198:198"
damage (5)
damagetype "LemonBlue"
speed 50
Radius 16
Height 16
scale 3.0
States
{
Spawn:
TNT1 A 0
SXP1 F 1 A_SpawnItemEx("LemonStormBlueTrail",0,0,8)
loop
Death:
TNT1 A 0 A_PlaySoundEx("weapon/napalm", "Weapon")
TNT1 A 0 A_Explode(25,160,0,0,80)
NAPA EFGHIJKLMNOPQRS 2 A_Stop
stop
}
}

actor LemonStormYellow : LemonStormBlue
{
Obituary "$OB_CAVEBARRAGEYELLOW"
translation "4:4=229:229", "209:212=230:230"
Damagetype "LemonYellow"
States
{
Spawn:
TNT1 A 0
SXP1 F 1 A_SpawnItemEx("LemonStormYellowTrail",0,0,8)
loop
}
}

actor LemonStormBlueTrail : HardKnuckleFX
{
translation "0:255=198:198"
renderstyle "translucent"
alpha 0.5
scale 3.0
States
{
Spawn:
TNT1 A 0
HARD C 1 A_Fadeout
wait
}
}

actor LemonStormYellowTrail : LemonStormBlueTrail
{
translation "0:255=229:229"
}

actor LemonBlueVision : PowerUp
{
powerup.color "Blue", 0.8
powerup.duration 0x7FFFFFFF
}

actor LemonBlueTime : Inventory
{
inventory.amount 1
inventory.maxamount 105
}

actor CaveRageAmmo : Inventory
{
inventory.amount 1
inventory.maxamount 200
}

actor SingleGunFlag : Inventory
{
inventory.amount 1
inventory.maxamount 1
}

actor LemonBlueWatcher
{
Height 0
Radius 0
+NOINTERACTION
-SOLID
+NOGRAVITY
+MISSILE
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("LemonBlueSlowdown", 1)
TNT1 A 0 A_TakeFromTarget("LemonBlueTime", 1)
TNT1 AAAAAA 0 A_SpawnItemEx("LemonBlueFX", random(-20, 20), random(-20, 20), 0)
TNT1 A 0 A_JumpIfInTargetInventory("LemonBlueTime", 1, "Spawn")
TNT1 A 0 A_TakeFromTarget("LemonBlueVision", 1)
stop
}
}

actor LemonBlueSlowdown : PowerSpeed
{
powerup.duration 5
Speed 0.3
}

actor LemonBlueFX : ConcreteFX
{
translation "88:88=196:196", "95:95=198:198"
States
{
Spawn:
TNT1 A 0
CONC KL 5
stop
}
}

actor LemonYellowVision : PowerUp
{
powerup.color "Yellow", 0.8
powerup.duration 0x7FFFFFFF
}

actor LemonYellowTime : Inventory
{
inventory.amount 1
inventory.maxamount 105
}

actor LemonYellowWatcher : LemonBlueWatcher
{
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_GiveToTarget("LemonYellowGravity", 1)
TNT1 A 0 A_TakeFromTarget("LemonYellowTime", 1)
TNT1 A 0 A_JumpIfInTargetInventory("LemonYellowTime", 1, "Spawn")
TNT1 A 0 A_TakeFromTarget("LemonYellowVision", 1)
stop
}
}

actor LemonYellowGravity : CustomInventory
{
States
{
Pickup:
TNT1 A 0
TNT1 AAAAAA 0 A_SpawnItemEx("LemonYellowFX", random(-20, 20), random(-20, 20), 0)
TNT1 A 0 A_JumpIf(z-floorz<5, "End")
TNT1 A 0 ThrustThingZ(0, 20, 1, 1)
stop
End:
TNT1 A 0
stop
}
}

actor LemonYellowFX : LemonBlueFX
{
translation "88:88=229:229", "95:95=230:230"
}