actor TenorBlasterWep_NormalBar : NormalBar{args 228, 69}
actor TenorBlasterWep_ScriptBar : ScriptBar{}
actor TenorBlasterWep : BaseMM8BDMWep 
{
Weapon.AmmoUse 1
Weapon.AmmoGive 56
Weapon.SlotNumber 2
Inventory.Pickupmessage "$PU_TENORBLASTER"
Obituary "$OB_TENORBLASTER"
Tag "$TAG_TENORBLASTER"
weapon.ammotype "TenorBlasterAmmo"
inventory.icon "TRBSICON"
States
{
SpawnLoop:
TRBS Z 1
loop
Ready:
TRBS A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_TENORBLASTER)
TRBS A 0 A_JumpIfInventory("TenorBlasterAirFlag",1,"AirJump")
TRBS A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
TRBS A 0 
goto DeselectSwap
Select:
TRBS A 0 
goto SelectSwap
Fire:
TRBS A 0 A_JumpIfInventory("TenorBlasterAirShotFlag",1,"FireX")
TRBS A 0 A_JumpIfNoAmmo("NoAmmo")
goto Hold
FireR:
TRBS A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
TRBS A 0 A_FireCustomMissile("TenorBlasterShot",0,1,8,0)
TRBS A 2 A_TakeInventory("WeaponCharge",999)
TRBS BC 2
TRBS A 1
TRBS A 0 A_Refire
goto Ready+1
Altfire:
TBRS A 0 A_JumpIfInventory("Vile_ClassAltfire", 1, "ClassAltfire")
TBRS A 0 A_JumpIf(CallACS("Vile_class_altfire"), "ClassAltfire")
TBRS A 1 A_JumpIfInventory("MM8BDMPlayer", 1, 1)
wait
TBRS A 0 A_JumpIfNoAmmo("NoAmmo")
TRBS A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
TRBS A 0 A_FireCustomMissile("TenorBlasterShot",0,1,8,0)
TRBS A 2 A_TakeInventory("WeaponCharge",999)
TRBS BC 2
TRBS A 1
TRBS A 0 A_Refire
goto Ready+1
ClassAltfire:
TRBS A 0 
goto Super::Altfire
Fire2:
TRBS A 0 A_JumpIfInventory("TenorBlasterAmmo", 4, "Fire2r")
TRBS A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
TRBS A 0 A_FireCustomMissile("TenorBlasterShot",0,1,8,0)
TRBS A 2 A_TakeInventory("WeaponCharge",999)
TRBS BC 2
TRBS A 1
TRBS A 0 A_Refire
goto Ready+1
Fire2r:
TRBS A 0 A_TakeInventory("WeaponCharge",999)
TRBS A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
TRBS A 1 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_TENORBLASTER,1)
TRBS A 0 A_TakeInventory("TenorBlasterAmmo",4,TIF_NOTAKEINFINITE)
TRBS A 0 A_FireCustomMissile("TenorBlasterMidShot",0,0,8,0)
TRBS BC 2
TRBS B 0 A_Refire
goto Ready+1
Fire3:
TRBS A 0 A_JumpIfInventory("TenorBlasterAmmo", 12, "Fire3r")
TRBS A 0 A_TakeInventory("WeaponCharge",999)
TRBS A 0 A_PlaySoundEx("weapon/mirrordeflect","Weapon")
TRBS B 2 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_TENORBLASTER,1)
TRBS A 0 A_TakeInventory("TenorBlasterAmmo",4,TIF_NOTAKEINFINITE)
TRBS A 0 A_FireCustomMissile("TenorBlasterMidShot",0,0,8,0)
TRBS CA 4
TRBS B 0 A_Refire
goto Ready+1
Fire3r:
TRBS A 0 A_TakeInventory("TenorBlasterAmmo",12,TIF_NOTAKEINFINITE)
TRBS A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_TENORBLASTER,1)
TNRB A 0 A_PlaySoundEx("weapon/napalm","Weapon")
TRBS A 0 A_ChangeVelocity(-Cos(pitch)*35,0,sin(pitch)*25,CVF_RELATIVE)
TRBS A 0 A_FireCustomMissile("TenorBlasterChargeShot",0,0,8,0)
TRBS A 0 A_TakeInventory("WeaponCharge",999)
TRB0 ABCDEF 2
TRBS AAAA 2 A_JumpIf(z-floorz>0, "AirJumpMode")
TRBS AA 2 A_JumpIf(z-floorz>0, "AirJumpMode")
TRBS A 6
TRBS A 0 A_Refire
goto Ready+1

AirJumpMode:
TRBS A 0 A_GiveInventory("TenorBlasterAirFlag",1)
TRBS A 0 A_GiveInventory("TenorBlasterAirShotFlag",1)
AirJump:
TRBS A 0 A_WeaponReady(WRF_DISABLESWITCH)
TRBS A 1 A_CheckFloor("AirJumpModeEnd")
loop
AirJumpModeEnd:
TRBS A 0 A_TakeInventory("TenorBlasterAirFlag",1)
TRBS A 0 A_TakeInventory("TenorBlasterAirShotFlag",1)
TRBS A 1 A_Refire
goto Ready+1
FireX:
TRBS A 2
FireX2Check:
TRBS A 0 A_JumpIfInventory("TenorBlasterAirShotFlag",1,1)
goto Altfire
FireX2:
TRBS A 0 A_JumpIf(z-floorz<=0, "AirJumpModeEnd")
TRBS A 0 A_PlaySoundEx("weapon/mirrordeflect2","Weapon")
TRBS A 0 A_GiveInventory("TenorBlasterHover",1)
TRBS A 0 A_FireCustomMissile("TenorBlasterShotTri",0,0,random(16,24),0)
TRBS A 0 A_FireCustomMissile("TenorBlasterShotTri",0,0,random(-8,0),0)
TRBS A 0 A_FireCustomMissile("TenorBlasterShotTri",0,0,8,0)
TRBS A 0 A_TakeInventory("WeaponCharge",999)
TRBS BC 1
TRBS C 1
TRBS A 0 A_Refire("FireX2Check")
TRBS A 1
goto Ready+1
Charge1:
TRBS A 0 A_JumpIfInventory("WeaponCharge",35,"Charge2Start")
TRBS D 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_TENORBLASTERCHARGE1,TCLR_CHARGE1)
TRBS D 0 A_Refire("Charge1.a")
Goto Fire2
Charge1.a:
TRBS A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_TENORBLASTER,TCLR_NONE)
TRBS A 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
TRBS D 0 A_Refire("Charge1")
Goto Fire2
Charge2Start:
TRBS A 0 A_PlaySoundEx("weapon/tenorcharge2","Weapon")
Goto Charge2
Charge2:
TRBS A 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_TENORBLASTERCHARGE2,TCLR_CHARGE2)
TRBS D 0 A_Refire("Charge2.a")
Goto Fire3
Charge2.a:
TRBS E 1 ACS_NamedExecuteWithResult("core_chargecolor", COLOR_TENORBLASTER,TCLR_NONE)
TRBS A 0 A_JumpIfInventory("WeaponCharge", 35, 2)
TRBS A 0 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
"####" "#" 0 A_JumpIfInventory("IsBot", 1, "BotFire")
TRBS A 0 A_Refire("Charge2")
Goto Fire3
BotFire:
"####" "#" 0 A_Jump(16, "Fire3")
"####" "#" 0 A_Refire("Charge2")
Goto Fire3
Hold:
TRBS A 0 A_JumpIfInventory("TenorBlasterAmmo", 4, "Hold2")
TRBS A 0 A_JumpIfNoAmmo("NoAmmo")
TRBS A 1
goto FireR
Hold2:
TRBS A 0 A_JumpIfInventory("WeaponCharge",18,"Charge")
TRBS A 1 A_GiveInventory("WeaponCharge", 1 + CallACS("core_checkrune", RUNE_RAGE))
TRBS A 0 A_Refire
Goto FireR
Charge:
TRBS A 0 A_JumpIfInventory("WeaponCharge",19,"Charge1")
TRBS A 0 A_PlaySoundEx("weapon/tenorcharge1","Weapon")
Goto Charge1
NoAmmo:
TRBS A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor TenorBlasterAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 56
+INVENTORY.IGNORESKILL
}

actor TenorBlasterShot : BasicProjectile
{
PROJECTILE
damagetype "Buster"
Obituary "$OB_TENORBLASTER"
Speed 48
Damage (CallACS("vile_cbm_damage",7))
radius 7
height 5
scale 2.5
States
{
Spawn:
TNOB A 1 A_ScaleVelocity(1.1)
wait
}
}

actor TenorBlasterShotTri : BasicProjectile
{
PROJECTILE
damagetype "Buster"
Obituary "$OB_TENORBLASTER"
Speed 48
Damage (CallACS("vile_cbm_damage",4))
radius 7
height 5
scale 2.5
States
{
Spawn:
TNOB A 1 A_ScaleVelocity(1.1)
wait
}
}

actor TenorBlasterMidShot : BasicProjectile
{
+BRIGHT
PROJECTILE
damagetype "SparkShock"
Obituary "$OB_TENORBLASTER"
Speed 32
Damage (CallACS("vile_cbm_damage",16))
radius 7
height 5
scale 2.5
States
{
Spawn:
TNOB D 1 
wait
}
}

actor TenorBlasterChargeShot : BasicProjectile
{
+BRIGHT
PROJECTILE
damagetype "TenorBlaster"
Obituary "$OB_TENORBLASTER"
Speed 40
Damage (CallACS("vile_cbm_damage",55))
radius 16
height 12
scale 2.0
States
{
Spawn:
TNOB BC 4 
loop
}
}

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

ACTOR TenorBlasterAirShotFlag : Powerup
{
  Powerup.Duration -3
  //Speed 2.0
}


actor TenorBlasterHover : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("TenorBlasterAirShotFlag",1,"Pickup0")
stop
Pickup0:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyNoGravity",1,"No")
TNT1 A 0 A_JumpIfInventory("TenorBlasterAirShotFlag",1,"Pickup1")
stop
No:
TNT1 A 0
stop
Pickup1:
TNT1 A 0 A_JumpIf(momz<0,"Pickup2")
stop
Pickup2:
TNT1 A 0 ThrustThingZ(0,8,1,0)
stop
}
}