actor Blizzardman_W : BaseMM8BDMWep_CBM
{
tag "$TAGC_6A"
dropitem "BlizzardAttackWep"
Weapon.AmmoUse1 2
Weapon.AmmoUse2 100
Weapon.AmmoGive 0
Obituary "$OB_BLIZZARDBOWL"
weapon.ammotype1 "BowloramaAmmo"
weapon.ammotype2 "BowloramaAmmo"
+WEAPON.ALT_AMMO_OPTIONAL
+WEAPON.NOAUTOAIM
inventory.icon "BSKIY"
States
{
Spawn:
C_06 A 1
loop

Deselect:
BSKI E 0
goto DeselectSwap
Select:
BSKI E 0
goto SelectSwap

Ready:
BSKI E 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_BLIZZARDMAN)
goto Ready1
Ready1:
BSKI E 0 A_JumpIfInventory("BowloramaAmmo",112,"Ready2")
BSKI E 3 A_WeaponReady(WRF_NOSECONDARY)
BSKI E 0 A_GiveInventory("BowloramaAmmo",2)
loop
Ready2:
BSKI E 1 A_WeaponReady
loop

Fire:
BSKI E 0 A_GiveInventory("Blizzardman_Fire1_P")
BSKI F 2
BSKI G 2 A_GiveInventory("BowloramaAmmo",1)
BSKI H 2
BSKI I 2 A_GiveInventory("BowloramaAmmo",1)
BSKI J 2
BSKI K 2 A_GiveInventory("BowloramaAmmo",1)
BSKI L 2
BSKI M 2 A_GiveInventory("BowloramaAmmo",1)
BSKI N 2
BSKI E 2 A_GiveInventory("BowloramaAmmo",1)
BSKI E 2
BSKI EE 4 A_GiveInventory("BowloramaAmmo",1)
BSKI E 2 A_GiveInventory("BowloramaAmmo",1)
Goto Ready1

Altfire:
BSKI E 0 A_JumpIfInventory("BowloramaAmmo",112,"Checking")
goto Ready1
Checking:
BSKI E 0 A_PlaySoundEx("weapon/BassCombine","Weapon")
BSKI E 0 A_SetArg(1,angle*100000)
BSKI E 0 ACS_NamedExecuteWithResult("core_stopplayer",0,1)
BSKI E 0 A_JumpIfInventory("PlayerPropertyRage",1,"CheckingR")
BSKI E 1 OffSet(0,42)
BSKI E 1 OffSet(0,52)
BSKI E 1 OffSet(0,62)
BSKI E 1 OffSet(0,72)
BSKI E 1 OffSet(0,82)
BSKI E 1 OffSet(0,92)
BSKI E 1 OffSet(0,102)
BSKI E 1 OffSet(0,112)
BSKI E 1 OffSet(0,122)
goto RollingPrepare
CheckingR:
BSKI E 1 OffSet(0,52)
BSKI E 1 OffSet(0,72)
BSKI E 1 OffSet(0,92)
BSKI E 1 OffSet(0,112)
BSKI E 1 OffSet(0,132)
goto RollingPrepare
RollingPrepare:
TNT1 A 0 A_TakeInventory("BallTimer")
TNT1 A 1 A_TakeInventory("CrackFlag")
TNT1 A 0 A_GiveInventory("BlizzardM_StartBowl_P")
goto Rolling
Rolling:
TNT1 A 1 A_GiveInventory("BlizzardM_Bowling_P1")
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,"RollEnd")

TNT1 A 1 A_GiveInventory("BlizzardM_Bowling_P2")
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,"RollEnd")

TNT1 A 1 A_GiveInventory("BlizzardM_Bowling_P3")
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,"RollEnd")
TNT1 A 0 A_JumpIfInventory("BallTimer",40,"RollEnd")
loop
RollEnd:
TNT1 A 2 A_GiveInventory("BlizzardM_EndBowl_P")
BSKI E 1 OffSet(0,122)
BSKI E 1 OffSet(0,107)
BSKI E 1 OffSet(0,92)
BSKI E 1 OffSet(0,77)A_TakeInventory("VivifyFlag1")
BSKI E 1 OffSet(0,62)
BSKI E 0 A_ChangeFlag("THRUACTORS",0)
BSKI E 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
BSKI E 1 OffSet(0,47)A_TakeInventory("BallTimer")
Goto Ready1
}
}


actor Blizzardman_W2 : BaseMM8BDMWep_CBM
{
tag "$TAGC_6A2"
dropitem "BlizzardAttackWep"
Weapon.AmmoUse1 2
Weapon.AmmoUse2 100
Weapon.AmmoGive 0
Obituary "$OB_BLIZZARDATTACK"
weapon.ammotype1 "BowloramaAmmo"
weapon.ammotype2 "BowloramaAmmo"
+WEAPON.ALT_AMMO_OPTIONAL
+WEAPON.NOAUTOAIM
inventory.icon "BSKIX"
States
{
Spawn:
C_06 A 1
loop

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

Ready:
BSKI A 0 ACS_NamedExecuteWithResult("core_weaponcolor",DYE_BLIZZARDMAN)
goto Ready1
Ready1:
BSKI A 0 A_JumpIfInventory("BowloramaAmmo",112,"Ready2")
BSKI A 3 A_WeaponReady(WRF_NOSECONDARY)
BSKI A 0 A_GiveInventory("BowloramaAmmo",2)
loop
Ready2:
BSKI A 1 A_WeaponReady
loop

Fire:
BSKI A 0 A_JumpIfInventory("BlizFireFlag",1,"Fire2")
Fire1:
BSKI A 0 A_GiveInventory("BlizFireFlag",1)
BSKI A 0 A_GiveInventory("Blizzardman_Fire2_P")
BSKI B 2 OffSet(4,32)
BSKI B 2 OffSet(8,32)A_GiveInventory("BowloramaAmmo",1)
BSKI B 2 OffSet(12,32)
BSKI B 2 OffSet(12,32)A_GiveInventory("BowloramaAmmo",1)
BSKI B 2 OffSet(8,32)
BSKI A 2 OffSet(4,32)A_GiveInventory("BowloramaAmmo",1)
//BSKI A 0 A_GiveInventory("BowloramaAmmo",1)
BSKI A 0 A_ReFire("Fire2")
Goto Ready1
Fire2:
BSKI A 0 A_TakeInventory("BlizFireFlag",1)
BSKI A 0 A_GiveInventory("Blizzardman_Fire3_P")
BSKI C 2 OffSet(-4,32)
BSKI C 2 OffSet(-8,32)A_GiveInventory("BowloramaAmmo",1)
BSKI C 2 OffSet(-12,32)
BSKI C 2 OffSet(-12,32)A_GiveInventory("BowloramaAmmo",1)
BSKI C 2 OffSet(-8,32)
BSKI A 2 OffSet(-4,32)A_GiveInventory("BowloramaAmmo",1)
//BSKI BCDE 3
//BSKI A 16
//BSKI A 0 A_GiveInventory("BowloramaAmmo",1)
BSKI A 0 A_ReFire("Fire1")
Goto Ready1

Altfire:
BSKI A 0 A_JumpIfInventory("BowloramaAmmo",112,"Checking")
goto Ready1
Checking:
BSKI A 0 A_PlaySoundEx("weapon/BassCombine","Weapon")
BSKI A 0 A_SetArg(1,angle*100000)
BSKI A 0 ACS_NamedExecuteWithResult("core_stopplayer",0,1)
BSKI A 0 A_JumpIfInventory("PlayerPropertyRage",1,"CheckingR")
BSKI A 1 OffSet(0,42)
BSKI A 1 OffSet(0,52)
BSKI A 1 OffSet(0,62)
BSKI A 1 OffSet(0,72)
BSKI A 1 OffSet(0,82)
BSKI A 1 OffSet(0,92)
BSKI A 1 OffSet(0,102)
BSKI A 1 OffSet(0,112)
BSKI A 1 OffSet(0,122)
goto RollingPrepare
CheckingR:
BSKI A 1 OffSet(0,52)
BSKI A 1 OffSet(0,72)
BSKI A 1 OffSet(0,92)
BSKI A 1 OffSet(0,112)
BSKI A 1 OffSet(0,132)
goto RollingPrepare
RollingPrepare:
TNT1 A 0 A_TakeInventory("BallTimer")
TNT1 A 1 A_TakeInventory("CrackFlag")
TNT1 A 0 A_GiveInventory("BlizzardM_StartBowl_P")
goto Rolling
Rolling:
TNT1 A 1 A_GiveInventory("BlizzardM_Bowling_P1")
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,"RollEnd")

TNT1 A 1 A_GiveInventory("BlizzardM_Bowling_P2")
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,"RollEnd")

TNT1 A 1 A_GiveInventory("BlizzardM_Bowling_P3")
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,"RollEnd")
TNT1 A 0 A_JumpIfInventory("BallTimer",40,"RollEnd")
loop
RollEnd:
TNT1 A 2 A_GiveInventory("BlizzardM_EndBowl_P")
BSKI A 1 OffSet(0,122)
BSKI A 1 OffSet(0,107)
BSKI A 1 OffSet(0,92)
BSKI A 1 OffSet(0,77)A_TakeInventory("VivifyFlag1")
BSKI A 1 OffSet(0,62)
BSKI A 0 A_ChangeFlag("THRUACTORS",0)
BSKI A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEOFF_DAMAGE,CallACS("core_getmaxhealth")/10)
BSKI A 1 OffSet(0,47)
Goto Ready1
}
}

actor BowloramaAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 112
+INVENTORY.IGNORESKILL
}


actor BlizFireFlag : Inventory{}

actor CrackFlag : Inventory{}

actor BallTimer : Inventory
{
inventory.amount 1
inventory.maxamount 40
}


actor Blizzardman_Fire1_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("BlizzardAttackAim",random(-6,-12),0,random(26,52),random(-2,6))
TNT1 A 0 A_FireCustomMissile("BlizzardAttackAim",random(0,-6),0,random(0,26),random(-2,6))
TNT1 A 0 A_FireCustomMissile("BlizzardAttackAim",random(6,0),0,random(-26,0),random(-2,6))
TNT1 A 0 A_FireCustomMissile("BlizzardAttackAim",random(12,6),0,random(-52,-26),random(-2,6))
End:
TNT1 A 0 A_GiveInventory("CrackFlag",1)
TNT1 A 0 A_PlaySoundEx("weapon/blizzboss","Weapon")
stop
}
}
actor Blizzardman_Fire2_P : Blizzardman_Fire1_P
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("BlizzardBossAttack",random(10,8),0,random(48,30),0)
TNT1 A 0 A_FireCustomMissile("BlizzardBossAttack",random(2,0),0,random(28,20),0)
goto End
}
}
actor Blizzardman_Fire3_P : Blizzardman_Fire1_P
{
States
{
Pickup:
TNT1 A 0 A_FireCustomMissile("BlizzardBossAttack",random(-10,-8),0,random(-48,-30),0)
TNT1 A 0 A_FireCustomMissile("BlizzardBossAttack",random(-2,0),0,random(-28,-20),0)
goto End
}
}

actor BlizzardM_StartBowl_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_TakeInventory("BallTimer")
TNT1 A 0 A_TakeInventory("CrackFlag")
TNT1 A 0 A_TakeInventory("BowloramaAmmo",28)
TNT1 A 0 A_TakeInventory("BowloramaAmmo",84,1)
TNT1 A 0 A_GiveInventory("VivifyFlag1",1)
TNT1 A 0 ACS_NamedExecuteWithResult("core_unsolidplayer",0,USP_TOGGLEON)
TNT1 A 0 A_ChangeFlag("THRUACTORS",1)
TNT1 A 0 ACS_NamedExecuteWithResult("core_invulnerableplayer",0,1)
stop
}
}

actor BlizzardM_Bowling_P1 : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_PlaySoundEx("weapon/blizzbowl","Body")
TNT1 A 0 A_SpawnItemEX("BlizzardBallFX1",0,0,0,0,0,0,0,1)
goto Pickup2
Pickup2:
TNT1 A 0 A_SpawnItemEX("BlizzardBallIsNotMoving_H",0,0,32)
TNT1 A 0 A_SpawnItemEX("BlizzardBallCheck",0,0,8,momx,momy,momz,0,8)
TNT1 A 0 A_SpawnItemEX("BlizzardBallBox",0,0,8,momx,momy,momz,0,8)
TNT1 A 0 A_JumpIf(z-floorz==0,"Ground")
goto Air
Air:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 A 0 A_ChangeVelocity(cos(Args[1]*0.00001)*2.5,sin(Args[1]*0.00001)*2.5,0)//A_Recoil(-2.5)
stop
TNT1 A 0 A_ChangeVelocity(cos(Args[1]*0.00001)*3.75,sin(Args[1]*0.00001)*3.75,0)//A_Recoil(-3.75)
stop
Ground:
TNT1 A 0 A_JumpIfInventory("PlayerPropertyRage",1,2)
TNT1 A 0 A_ChangeVelocity(cos(Args[1]*0.00001)*7,sin(Args[1]*0.00001)*7,0)//A_Recoil(-7)
stop
TNT1 A 0 A_ChangeVelocity(cos(Args[1]*0.00001)*10.5,sin(Args[1]*0.00001)*10.5,0)//A_Recoil(-10.5)
stop
}
}
actor BlizzardM_Bowling_P2 : BlizzardM_Bowling_P1
{
States
{
Pickup:
TNT1 A 0 A_SpawnItemEX("BlizzardBallFX2",0,0,0,0,0,0,0,1)
goto Pickup2
}
}
actor BlizzardM_Bowling_P3 : BlizzardM_Bowling_P1
{
States
{
Pickup:
TNT1 A 0 A_GiveInventory("BallTimer",1)
TNT1 A 0 A_SpawnItemEX("BlizzardBallFX3",0,0,0,0,0,0,0,1)
goto Pickup2
}
}

actor BlizzardM_EndBowl_P : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_JumpIfInventory("CrackFlag",1,1)
goto Pickup2
TNT1 A 0 A_ChangeVelocity(cos(Args[1]*0.00001)*-40,sin(Args[1]*0.00001)*-40,17.5,2)
TNT1 A 0 A_PlaySoundEx("weapon/blizzstrike","Body")
Pickup2:
TNT1 A 0 ACS_NamedExecuteWithResult("core_stopplayer",0,0)
TNT1 A 0 A_GiveInventory("CrackFlag",1)
TNT1 A 0 ACS_NamedExecuteWithResult("core_invulnerableplayer",0,0)
TNT1 A 0 A_TakeInventory("BallTimer")
stop
}
}


actor BlizzardM_WalkFX
{
+MISSILE
+NOGRAVITY
+THRUACTORS
+DONTBLAST
+NOINTERACTION
+CLIENTSIDEONLY
damage 0
Radius 16
Height 4
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_JumpIf(z-floorz!=0,4)
TNT1 A 0 A_SpawnItemEx("BlizzardM_WalkFX2",-4,-20,10,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("BlizzardM_WalkFX2",-4,0,10,0,0,0,0,1)
TNT1 A 0 A_SpawnItemEx("BlizzardM_WalkFX2",-4,20,10,0,0,0,0,1)
TNT1 A 0
stop
}
}

actor BlizzardM_WalkFX2 : BasicGraphicEffect
{
States
{
SpawnFrame:
QMFX S 0
QMFX S 0 A_SetScale(ScaleX*(random(0,1)*2-1),ScaleY)
QMFX STU 6
stop
}
}

actor BlizzardAttackAim : ProjSpawnFuncActor
{
PROJECTILE
+DONTSEEKINVISIBLE//
+SEEKERMISSILE
+SCREENSEEKER
+FORCEXYBILLBOARD
Obituary "$OB_BLIZZARDATTACK"
damagetype "BlizzardM_Shot"
damage (60)
Radius 8
Height 8
speed 32
scale 2.5
States
{
Spawn:
TNT1 A 0
BSKI UUUUUU 1 A_SeekerMissile(2,10,3,72,6)
BSKI U 3
BSKI V 10
Fly:
BSKI W 1
loop
Death:
TNT1 A 0 A_SpawnItemEX("IcePitFreeze")
stop
}
}

actor BlizzardBossAttack : ProjSpawnFuncActor
{
PROJECTILE
damagetype "BlizzardM_Shot"
Obituary "$OB_BLIZZARDATTACK"
+FORCEXYBILLBOARD
Damage (70)//100//Legacy
Height 12//10
Radius 12//10
Speed 1
Scale 3.0
States
{
Spawn:
TNT1 A 0
BSKI U 0
BSKI U 0 A_ScaleVelocity(0.25)
BSKI UVW 2
BSKI W 0 A_ScaleVelocity(160)
Spawn2:
BSKI W 1
loop
Death:
TNT1 A 0 A_SpawnItemEX("IcePitFreeze")
stop
}
}

actor BlizzardM_BowlProtect : PowerProtection
{
Powerup.Duration 3
DamageFactor "BlizzardM_Bowl", 0.0
}

actor PainBlizzardM_BowlHit : BasicWatcher
{
States
{
Spawn:
TNT1 A 0 nodelay A_GiveToTarget("CrackFlag",1,AAPTR_TARGET)
stop
}
}
actor DeathBlizzardM_BowlHit : Basic_DeathFling_H{Args 60,106,0}

actor BlizzardBallBox
{
PROJECTILE
Damagetype "BlizzardM_Bowl"
Obituary "$OB_BLIZZARDBOWL"
+DONTSPLASH
+DONTBLAST
+NOEXPLODEFLOOR
+THRUGHOST
+DONTREFLECT
damage (400+CallACS("core_checkrune",RUNE_SPREAD,2)*800)
Radius 76
Height 76
scale 2.5
States
{
Spawn:
TNT1 A 1
stop
Crash:
XDeath:
TNT1 A 1 //A_GiveToTarget("CrackFlag",1)
stop
Death:
TNT1 A 1
Stop
}
}


actor BlizzardBallIsNotMoving_H : BasicWatcher
{
+SERVERSIDEONLY
States
{
Spawn:
TNT1 A 0
TNT1 A 2
TNT1 A 1 A_JumpIfCloser(30,"Stopped")
stop
Stopped:
TNT1 A 1 A_GiveToTarget("BallTimer",1)
stop
}
}

actor BlizzardBallCheck
{
PROJECTILE
Damagetype "BlizzardM_Bowl"
Obituary "$OB_BLIZZARDBOWL"
+DONTSPLASH
+DONTBLAST
+DONTREFLECT
+NOEXPLODEFLOOR
+THRUGHOST
+DONTREFLECT
+SKYEXPLODE
+EXPLODEONWATER
+STEPMISSILE
maxstepheight 22
//+SERVERSIDEONLY
Damage (0)
radius 14//18
height 48//58
Speed 2
scale 2.5
States
{
Spawn:
TNT1 A 0
TNT1 A 1
stop
Crash:
XDeath:
TNT1 A 1
stop
Death:
TNT1 A 1 A_GiveToTarget("CrackFlag",1)
stop
}
}

actor BlizzardBallFX1 : BasicExplosion
{
radius 72
height 72
Scale 2.5
States
{
Spawn:
TNT1 A 0
BLZZ R 1
stop
}
}
actor BlizzardBallFX2 : BlizzardBallFX1
{
States
{
Spawn:
TNT1 A 0
BLZZ S 1
stop
}
}

actor BlizzardBallFX3 : BlizzardBallFX1
{
States
{
Spawn:
TNT1 A 0
BLZZ T 1
stop
}
}


actor Blizzardman_W_NormalBar : NormalBar {Args 4,197}
actor Blizzardman_W2_NormalBar : NormalBar {Args 4,197}