actor SakugarneWep : MegaBuster
{
Weapon.AmmoUse 1
Weapon.AmmoGive 28
Weapon.SlotNumber 6
Obituary "%o was destroyed by %k's Sakugarne."
Inventory.Pickupmessage "Power up! Sakugarne!"
weapon.ammotype "SakugarneAmmo"
inventory.pickupsound "weapon/weaponup"
+WEAPON.AMMO_OPTIONAL
inventory.icon "SAKUSI"
Scale 2.0
States
{
Spawn:
WEA2 Z 1
loop
Ready:
SAKH A 0 ACS_ExecuteAlways(998,0,45)
SAKH A 1 A_WeaponReady
Goto Ready+1
Deselect:
SAKH A 0 A_TakeInventory("SakugarneActive",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
SAKH A 1 A_Lower
loop
Select:
SAKH A 0 A_TakeInventory("SakugarneActive",1)
TNT1 AAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
SAKH A 1 A_Raise
Loop
Fire:
SAKH A 0 A_JumpIfNoAmmo("NoAmmo")
SAKH A 0 A_JumpIfInventory("RushJetCounter",1,"NoAmmo")
SAKH A 0 A_JumpIfInventory("BeatCounter",1,"NoAmmo")
SAKH A 0 A_JumpIfInventory("SakugarneActive",1,"AirReady")
SAKH A 0 A_JumpIf(z-floorz>0, "NoAmmo")
SAKH A 0 A_GiveInventory("SakugarneActive",1)
SAKH A 0 A_Stop
SAKH A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")
SAKH AAAABBBB 1 A_SpawnItemEx("Sakugarne1",8,0,-52)
SAKH A 0 ThrustThingZ(0,60,0,0)
SAKH CCCCCCCCCCCCCC 1 A_SpawnItemEx("Sakugarne2",8,0,-52)
Goto Air
Air:
SAKH C 0 A_JumpIf(z-floorz==0, "Jump")
SAKH C 0 A_SpawnItemEx("Sakugarne2",8,0,-52)
SAKH C 0 A_SpawnItemEx("SakugarneCrush",0,0,-10,0,0,-32)
SAKH C 1 A_WeaponReady
loop
AirReady:
SAKH C 0 A_SpawnItemEx("SakugarneCrush",0,0,-10,0,0,-32)
SAKH C 0 A_SpawnItemEx("Sakugarne2",8,0,-52)
SAKH C 1 A_JumpIf(z-floorz==0, "Jump2")
loop
Jump:
SAKH A 0 A_SpawnItemEx("SakugarneDriller",0,0,0)
SAKH A 0 A_JumpIfNoAmmo("NoAmmo")
SAKH A 0 A_Takeinventory("SakugarneAmmo",1)
SAKH A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")
SAKH A 0 A_Stop
SAKH AAAA 1 A_SpawnItemEx("Sakugarne1",6,0,-32)
SAKH A 0 A_Stop
SAKH BBBB 1 A_SpawnItemEx("Sakugarne1",6,0,-32)
SAKH A 0 A_Recoil(-10)
SAKH A 0 ThrustThingZ(0,60,0,0)
SAKH CCCCCCCCCCCCCC 1 A_SpawnItemEx("Sakugarne2",6,0,-52)
Goto Air
Jump2:
SAKH A 0 A_SpawnItemEx("SakugarneDriller",0,0,0)
SAKH A 0 A_JumpIfNoAmmo("NoAmmo")
SAKH A 0 A_Takeinventory("SakugarneAmmo",2)
SAKH A 0 A_PlaySoundEx("weapon/sakugarne","Weapon")
SAKH A 0 A_Stop
SAKH AAA 1 A_SpawnItemEx("Sakugarne1",6,0,-32)
SAKH A 0 A_Stop
SAKH BBB 1 A_SpawnItemEx("Sakugarne1",6,0,-32)
SAKH A 0 ThrustThingZ(0,80,0,0)
SAKH CCCCCCCCCCCCCC 1 A_SpawnItemEx("Sakugarne2",6,0,-52)
Goto Air
Hold:
SAKH A 1
SAKH A 0 A_Refire
Goto Ready+1
NoAmmo:
SAKH A 0 A_TakeInventory("SakugarneActive",1)
SAKH A 1 ACS_Execute(979,0)
SAKH A 0 A_Refire
goto Ready+1
}
}


actor SakugarneGiver : CustomInventory 10075
{
Inventory.Pickupmessage "Power up! Sakugarne!"
inventory.pickupsound "weapon/weaponup"
Inventory.RespawnTics 800
scale 2.5
states
{
Spawn:
WEA2 Z 1
loop
Pickup:
WEA2 Z 0 A_GiveInventory("SakugarneWep")
stop
}
}

actor Sakugarne1
{
-SOLID
scale 2.5
+NOGRAVITY
+NOINTERACTION
States
{
Spawn:
SAKU A 2
stop
}
}

actor Sakugarne2
{
-SOLID
scale 2.5
+NOGRAVITY
+NOINTERACTION
States
{
Spawn:
SAKU B 2
stop
}
}

actor SakugarneCrush
{
PROJECTILE
damage (20)
Radius 30
Height 2
renderstyle none
States
{
Spawn:
PLAY A 2
stop
}
}

actor SakugarneDriller
{
PROJECTILE
-SOLID
+NOGRAVITY
renderstyle none
States
{
Spawn:
PLAY A 0
PLAY A 4 A_Explode(80,128,0)
stop
}
}

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

actor SakugarneAmmo : Ammo
{
inventory.amount 1
inventory.maxamount 28
}

