actor MatchBlastWep_NormalBar : NormalBar{args 162, 222}
actor MatchBlastWep : BaseMM8BDMWep
{
Weapon.AmmoUse 2
Weapon.AmmoGive 28
Weapon.SlotNumber 4
Inventory.Pickupmessage "$PU_MATCHBLAST"
Obituary "$OB_MATCHBLAST"
Tag "$TAG_MATCHBLAST"
weapon.ammotype "MatchBlastAmmo"
inventory.icon "MBLSICON"
States
{
SpawnLoop:
MBLS Z 1
loop
Ready:
MBLS A 0 ACS_NamedExecuteWithResult("core_weaponcolor",COLOR_MATCHBLAST)
MBLS A 1 A_WeaponReady
Goto Ready+1
ReadyC: Goto Ready+1
Deselect:
MBLS A 0 
goto DeselectSwap
Select:
MBLS A 0 
goto SelectSwap
Fire:
MBLS A 0 A_JumpIfNoAmmo("NoAmmo")
MBLS A 0 A_PlaySoundEx("weapon/matchblast", "Weapon")
MBLS A 0 A_SpawnItemEx("MatchBlastHit")
MBLS A 0 A_SpawnItemEx("MatchBlast")
JGRN G 0 A_FireCustomMissile("MatchBlastFlame",8,0,8,0,0)
JGRN G 0 A_FireCustomMissile("MatchBlastFlame",-8,1,8,0,0)
MBLS A 0 A_ChangeVelocity(-Cos(pitch)*12.5,0,sin(pitch)*20,CVF_RELATIVE)
MBLS AAAAAAAAAAAAAAAAAA 0 A_SpawnItemEx("MatchBlastFX",8,0,32,random(-7,7),random(-7,7),random(-7,7),random(0,360))
MBLS BBBCCC 1 A_SpawnItemEx("MatchBlastFX",8,0,32,random(-7,7),random(-7,7),random(-7,7),random(0,360))
MBLS AAA 1 A_SpawnItemEx("MatchBlastFX",8,0,32,random(-7,7),random(-7,7),random(-7,7),random(0,360))
MBLS A 0 A_Refire
Fire2:
MBLS A 0 A_Checkfloor("Land")
MBLS AAAAA 0 A_SpawnItemEx("MatchBlastFX",0,0,32,random(-7,7),random(-7,7),random(-7,7),random(0,360))
MBLS A 1
MBLS A 0 A_Refire
loop
Land:
MBLS A 0
Goto Ready+1
NoAmmo:
MBLS A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

actor MatchBlastHit : BasicExplosion
{
Obituary "$OB_MATCHBLAST"
damagetype "MatchBlast"
States
{
Spawn:
TNT1 A 0
TNT1 A 1 A_Explode(CallACS("vile_cbm_damage",24),42,0,0,30)
stop
}
}


actor MatchBlast : BasicProjectile
{
+BRIGHT
PROJECTILE
damagetype "MatchBlast"
Obituary "$OB_MATCHBLAST"
Speed 0
+RIPPER
Damage (CallACS("vile_cbm_damage",4))
radius 40
height 40
scale 2.5
reactiontime 6
renderstyle "translucent"
States
{
Spawn:
TNT1 A 0
MABL A 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 26212, 192) // 6553 = 0.1 * 65536
MABL A 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL A 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL A 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL A 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL B 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL B 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL B 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL B 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL B 1 A_Warp(AAPTR_TARGET,5,0,30,8,WARPF_USECALLERANGLE|WARPF_NOCHECKPOSITION)
MABL B 0 A_Countdown
Loop
Death:
TNT1 A 0
stop
}
}

actor MatchBlastFX : BasicProjectile
{
+BRIGHT
damagetype "MatchBlast"
Obituary "$OB_MATCHBLAST"
Damage (CallACS("vile_cbm_damage",2))
gravity 0.4
radius 8
height 8
reactiontime 1
renderstyle "translucent"
States
{
Spawn:
TNT1 A 0
MABL C 0 ACS_NamedExecuteWithResult("core_alphaprojectile", CallACS("core_getptrtid", AAPTR_TARGET), APROJ_TEAM, 26212, 192) // 6553 = 0.1 * 65536
TNT1 A 0 A_GiveInventory("ProjTeamColor1Server",1)
MABL CD 4
MABL C 0 A_Countdown
goto Spawn+3
Death:
TNT1 A 0
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
stop
}
}


actor MatchBlastFlame : BasicProjectile
{
+BRIGHT
translation "227:227=222:222", "208:212=162:162"
+BRIGHT
Damage (CallACS("vile_cbm_damage",15))
Height 16
Radius 16
damagetype "MatchBlast"
Obituary "$OB_MATCHBLAST"
-NOGRAVITY
speed 24
States
{
Spawn:
S_UN Q 0
S_UN Q 1 ThrustThingZ(0,25,0,1)
S_UN QR 3 A_CheckFloor("Death")
goto Spawn+2
XDeath:
Crash:
FLMB H 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
stop
Death:
FLMB H 0 A_JumpIf(CeilingZ - FloorZ <=48 , "XDeath")
FLMB H 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
FLMB H 0 A_CheckFloor("Floor")
FLMB H 0 A_JumpIf(CeilingZ-Z < 8, "Floor")
Goto XDeath
Floor:
FLMB H 0 A_SpawnItemEx("MatchBlastPillar",0,0,0)
stop
}
}

actor MatchBlastPillar : BasicProjectile
{
+BRIGHT
translation "227:227=222:222", "208:212=162:162"
+BRIGHT
-MISSILE
-NOGRAVITY
+NOEXPLODEFLOOR
Height 16
damagetype "MatchBlast"
Obituary "$OB_MATCHBLAST"
Speed 0
Radius 16
Damage (CallACS("vile_cbm_damage",15))
reactiontime 15
States
{
Spawn:
S_UN Q 0 
S_UN Q 0 A_ChangeFlag("MISSILE",1)
S_UN QQQRRR 1 A_CheckFloor("Flame")
Goto Spawn+2
Flame:
TNT1 A 0 A_SpawnItemEx("OilPitIgnite",0,0,8)
S_UN A 0 A_ChangeFlag("FLOORHUGGER",1)
S_UN A 0 A_CountDown
S_UN QQQRRR 1 
Goto Flame+2
Death:
S_UN A 0 
stop
}
}

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