actor HyperStormBlasterWep_NormalBar : NormalBar { args 4, 76 }

actor HyperStormBlasterWep : BaseMM8BDMWep
{
Weapon.AmmoUse 2
Weapon.AmmoGive 56
Weapon.SlotNumber 4
inventory.pickupmessage "$PU_HYPERSTORMBLASTER"
Obituary "$OB_HYPERSTORMBLASTER"
Tag "$TAG_HYPERSTORMBLASTER"
weapon.ammotype "HyperStormBlasterAmmo"
inventory.icon "XTR0WI_U"
+WEAPON.NOAUTOAIM
States
{
SpawnLoop:
XWI0 U -1
loop

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

Ready:
XH0U A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_HYPERSTORMBLASTER)
XH0U A 1 A_WeaponReady
wait

Fire:
XH0U A 0 A_JumpIfNoAmmo("NoAmmo")
XH0U A 0 A_GunFlash("Flash",1)
goto Hold1
Hold1:
XH0U A 0 A_JumpIfNoAmmo("NoAmmo")
XH0U A 0 A_JumpIfInventory("WeaponCharge",15,"Hold2")
XH0U A 1 A_GiveInventory("HyperStormBlaster_Charge_P")
XH0U A 0 A_Refire("Hold1")
Goto Fire1
Hold2:
XH0U B 0 A_JumpIfInventory("WeaponCharge",25,"Hold3")
XH0U B 1 A_GiveInventory("HyperStormBlaster_Charge_P")
XH0U B 0 A_Refire(1)
Goto Fire2
XH0U B 1
XH0U B 0 A_Refire("Hold2")
Goto Fire2
Hold3:
XH0U C 1 A_GiveInventory("HyperStormBlaster_Charge_P")
XH0U C 0 A_Refire(1)
Goto Fire3
XH0U C 1 A_JumpIfInventory("IsBot",1,"BotCharge")
XH0U C 0 A_Refire("Hold3")
Goto Fire3
BotCharge:
XH0U C 0 A_Jump(32,"Fire3")
XH0U C 0 A_Refire("Hold3")
Goto Fire3

Flash:
TNT1 A 24 A_PlaySound("CBM/CopyWep/HyperStormBlasterSuction",1,1.0)
TNT1 A 0 A_JumpIfInventory("WeaponCharge",1,"Flash")
stop

Altfire:
XH0U C 0 A_JumpIfNoAmmo("NoAmmo")
Fire1:
XH0U C 0 A_GiveInventory("HyperStormBlaster_Fire_P")
XH0U ABCB 2
XH0U A 10
Goto Ready+1
Fire2:
XH0U B 0 A_JumpIfInventory("HyperStormBlasterAmmo",4, "Fire2r")
Goto Fire1
Fire2r:
XH0U C 0 A_GiveInventory("HyperStormBlaster_Fire_P")
XH0U BA 4
XH0U A 14
Goto Ready+1
Fire3:
XH0U C 0 A_JumpIfInventory("HyperStormBlasterAmmo",8,"Fire3r")
XH0U C 0 A_JumpIfInventory("HyperStormBlasterAmmo",4,"Fire2r")
Goto Fire1
Fire3r:
XH0U C 0 A_GiveInventory("HyperStormBlaster_Fire_P")
XH0U BA 6
XH0U A 16
Goto Ready+1
NoAmmo:
XH0U A 1 ACS_NamedExecuteAlways("core_noammo",0)
Goto Ready+1
}
}

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

actor HyperStormBlaster_Charge_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("WeaponCharge",25,"Suck1")
TNT1 A 0 A_JumpIfInventory("WeaponCharge",15,"Suck2")
Suck3:
TNT1 A 0 A_FireCustomMissile("HyperStormBlasterSuck_H3",0,0)
TNT1 A 0 A_FireCustomMissile("HyperStormBlaster_Puller_H3",0,0)
goto Ammo
Suck2:
TNT1 A 0 A_FireCustomMissile("HyperStormBlasterSuck_H2",0,0)
TNT1 A 0 A_FireCustomMissile("HyperStormBlaster_Puller_H2",0,0)
goto Ammo
Suck1:
TNT1 A 0 A_FireCustomMissile("HyperStormBlasterSuck_H1",0,0)
TNT1 A 0 A_FireCustomMissile("HyperStormBlaster_Puller_H1",0,0)
stop
Ammo:
TNT1 A 0 A_GiveInventory("WeaponCharge",1+CallACS("core_checkrune",RUNE_RAGE))
stop
}
}

actor HyperStormBlaster_Fire_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("WeaponCharge",25,2)
TNT1 A 0 A_JumpIfInventory("WeaponCharge",15,2)
Goto Fire1
TNT1 A 0 A_JumpIfInventory("HyperStormBlasterAmmo",8,"Fire3")
TNT1 A 0 A_JumpIfInventory("HyperStormBlasterAmmo",4,"Fire2")
Goto Fire1
Fire1:
TNT1 A 0 A_TakeInventory("HyperStormBlasterAmmo",2,1)
TNT1 A 0 A_ChangeVelocity(-Cos(pitch)*5, 0, sin(pitch)*4,1)
TNT1 A 0 A_FireCustomMissile("HyperStormBlasterBullet",0,0,8,0)
TNT1 AA 0 A_FireCustomMissile("HyperStormBlasterBullet",random(-3,3),0,8,0,0,random(-3,3))
goto End
Fire2:
TNT1 A 0 A_TakeInventory("HyperStormBlasterAmmo",4,1)
TNT1 A 0 A_ChangeVelocity(-Cos(pitch)*9, 0, sin(pitch)*7,1)
TNT1 A 0 A_FireCustomMissile("HyperStormBlasterBullet",0,0,8,0)
TNT1 AAAAA 0 A_FireCustomMissile("HyperStormBlasterBullet",random(-5,5),0,8,0,0,random(-4,4))
goto End
Fire3:
TNT1 A 0 A_TakeInventory("HyperStormBlasterAmmo",8,1)
TNT1 A 0 A_ChangeVelocity(-Cos(pitch)*14, 0, sin(pitch)*11,1)
TNT1 A 0 A_FireCustomMissile("HyperStormBlasterBullet",0,0,8,0)
TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("HyperStormBlasterBullet",random(-7,7),0,8,0,0,random(-5,5))
goto End
End:
TNT1 A 0 A_PlaySound("CBM/CopyWep/HyperStormBlasterFire",1)
TNT1 A 0 A_TakeInventory("WeaponCharge")
stop
}
}

actor PainHyperStormBlasterHit : Basic_PainFling_H{Args 7,0,2}
actor DeathHyperStormBlasterHit : Basic_DeathFling_H{Args 27,12,0}

actor HyperStormBlasterBullet : ProjSpawnFuncActor
{
PROJECTILE
DamageType "HyperStormBlaster"
Obituary "$OB_HYPERSTORMBLASTER"
+FORCEXYBILLBOARD
+BRIGHT
Damage (54)
Radius 10
Height 8
speed 45
scale 2.0
States
{
Spawn:
BASB A -1
loop
}
}

actor HyperStormBlaster_Puller_H1 : BasicWatcher
{
+SERVERSIDEONLY
Args 625,11,-1//Range,Angle,Power
States
{
Spawn:
TNT1 A 0
TNT1 A 3 ACS_NamedExecuteWithResult("cbm_ConedPushPull",Args[0],Args[1],Args[2],-1)
stop
}
}
actor HyperStormBlaster_Puller_H2 : HyperStormBlaster_Puller_H1{Args 625,11,-2}
actor HyperStormBlaster_Puller_H3 : HyperStormBlaster_Puller_H1{Args 625,11,-3}


actor HyperStormBlasterSuck_H1 : BasicExplosion
{
+NOTIMEFREEZE
speed 1
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("core_targetyawpitch",2,0)
TNT1 A 0
TNT1 A 0 A_SetArg(1,random(-10,10))
TNT1 A 0 A_SpawnItemEx("HyperStormBlasterSuckFX_H",0,0,random(-10,10),cos(pitch+Args[1]),0,-sin(pitch+Args[1]),random(-17,17),1+SXF_TRANSFERPITCH+SXF_TRANSFERPOINTERS+SXF_MULTIPLYSPEED)//512+1024+8192
TNT1 A 2
stop
}
}
actor HyperStormBlasterSuck_H2 : HyperStormBlasterSuck_H1
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("core_targetyawpitch",2,0)
TNT1 A 0
TNT1 A 0 A_SetArg(1,random(-10,10))
TNT1 A 0 A_SpawnItemEx("HyperStormBlasterSuckFX_H",0,0,random(-10,10),cos(pitch+Args[1]),0,-sin(pitch+Args[1]),random(-17,17),1+1024+8192)
TNT1 A 0 A_SetArg(1,random(-10,10))
TNT1 A 0 A_SpawnItemEx("HyperStormBlasterSuckFX_H",0,0,random(-10,10),cos(pitch+Args[1]),0,-sin(pitch+Args[1]),random(-17,17),1+512+1024+8192)
TNT1 A 2
stop
}
}
actor HyperStormBlasterSuck_H3 : HyperStormBlasterSuck_H1
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 ACS_NamedExecuteWithResult("core_targetyawpitch",2,0)
TNT1 A 0
TNT1 A 0 A_SetArg(1,random(-10,10))
TNT1 A 0 A_SpawnItemEx("HyperStormBlasterSuckFX_H",0,0,random(-10,10),cos(pitch+Args[1]),0,-sin(pitch+Args[1]),random(-17,17),1+1024+8192)
TNT1 A 0 A_SetArg(1,random(-10,10))
TNT1 A 0 A_SpawnItemEx("HyperStormBlasterSuckFX_H",0,0,random(-10,10),cos(pitch+Args[1]),0,-sin(pitch+Args[1]),random(-17,17),1+1024+8192)
TNT1 A 0 A_SetArg(1,random(-10,10))
TNT1 A 0 A_SpawnItemEx("HyperStormBlasterSuckFX_H",0,0,random(-10,10),cos(pitch+Args[1]),0,-sin(pitch+Args[1]),random(-17,17),1+512+1024+8192)
TNT1 A 2
stop
}
}

actor HyperStormBlasterSuckFX_H : FastProjectile
{
+SKYEXPLODE
+EXPLODEONWATER
+DONTBLAST
+DONTREFLECT
+DONTSPLASH
+CLIENTSIDEONLY
RenderStyle None
Damage (0)
radius 8
height 8
Speed 500
States
{
Spawn:
TNT1 A 1
TNT1 A 0
goto Death
Crash:
XDeath:
Death:
TNT1 A 0 A_CustomMissile("HyperStormBlasterSuckFX",0,0,0,0)
stop
}
}

actor HyperStormBlasterSuckFX : BasicGraphicEffectM
{
//PROJECTILE
+THRUACTORS
height 5
radius 5
Speed 37
Scale 1.5
States
{
Spawn:
NMFX DDDDDDDDDDDDDDD 1 A_JumpIfCloser(60,"Death")
stop
Death:
TNT1 A 0
stop
}
}
