/*
CREDITS:

Sprites:
Weapon - 3DRealms
Mines - LucasArts (SW:Dark Forces)
Static Field - Blood 2, Monolith, I think (Ripped by Zero X. Diamond)

Up, Mode - ID (ET:QW)
Mode2 -Raven (Wolf3)
Load - Raven\Lucasarts (JKIII)
Alt - Epic Games (Unreal)
Dry - ID (Doom 3)
Charge - Runnning with Scissors (Postal)
Fire - Mashup. One part is from ID, Quake 3 Team Arena. The other one, no idea.
Bounce, Tick, Arm, Nuke Mine Arm, Nuke Mine Tick - ID (Quake 3 Team Arena)
Explode - ID (Wolf:ET)
Static Field activate - Blizzard (Starcraft 2)
Static Loop, end - ?
*/

ACTOR Gopnik : DoomWeapon 24522
{
    //$Category Weapons
    //$Title Gopnik
    //$Sprite GOPGX0
    Inventory.PickupSound "misc/w_pkup"
    Inventory.PickupMessage "AI EM ''GOPNIK''! YOUGH, YES YOUGH - YOUGH AR NOT RUSSIA FROM! SO YOUGH AR VEARY DED! (6)"
    Obituary "%o couldn't comprehend %k's ''Gopnik'' mine layer speech."
    Weapon.SelectionOrder 3
    Weapon.UpSound "Weapons/GopnikUp"
    Weapon.AmmoType "RawketAmmo"
    Weapon.AmmoGive 20
    Weapon.AmmoUse 2
    Weapon.Kickback 50
    Weapon.SlotNumber 6
    +NOALERT
    +AMMO_OPTIONAL
    Scale 0.85
    States
    {
    Spawn:
	GOPG X -1
	Stop
    Deselect:
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"DiscDeselect")
	TNT1 A 0 A_StopSound(5)
	GO2G W 1 A_Lower
	TNT1 A 0 A_Lower
	Loop
    Select:
	TNT1 A 0 ACS_ExecuteAlways(712, 0)
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"DiscSelect")
	GO2G W 1 A_Raise
	TNT1 A 0 A_Raise
	Loop
	DiscDeselect:
	GOPG W 1 A_Lower
	GOPG W 0 A_Lower
	Loop
	DiscSelect:
	GOPG W 1 A_Raise
	GOPG W 0 A_Raise
	Loop
    Ready:
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"DiscReady")
	TNT1 A 0 A_StopSoundEx("SoundSlot5")
	TNT1 A 0 A_JumpIfInventory("GopnikNukeMode",1,"NukeReady")
	TNT1 A 0 A_JumpIfInventory("GopnikTeslaMode",1,"TeslaReady")
	TNT1 A 0 A_JumpIfInventory("GopnikFartMode",1,"FartReady")
	GO2G A 1 A_WeaponReady
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	Loop
    DiscReady:
	TNT1 A 0 A_JumpIfInventory("GopnikNukeMode",1,"DiscNukeReady")
	TNT1 A 0 A_JumpIfInventory("GopnikTeslaMode",1,"DiscTeslaReady")
	TNT1 A 0 A_JumpIfInventory("GopnikFartMode",1,"DiscFartReady")
	GOPG A 1 A_WeaponReady
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	Loop

	DiscFire:
	TNT1 A 0 A_JumpIfInventory("GopnikNukeMode",1,"DiscNukeFire")
	TNT1 A 0 A_JumpIfInventory("GopnikTeslaMode",1,"DiscStaticFire")
	TNT1 A 0 A_JumpIfInventory("GopnikFartMode",1,"DiscFartFire")
	Goto DiscFireMain
//// HE Mine.
    Fire:
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"DiscFire")
	
	TNT1 A 0 A_JumpIfInventory("GopnikNukeMode",1,"NukeFire")
	TNT1 A 0 A_JumpIfInventory("GopnikTeslaMode",1,"StaticFire")
	TNT1 A 0 A_JumpIfInventory("GopnikFartMode",1,"FartFire")
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",2,"Fire1")
	Goto FireDry
	DiscFireMain:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",2,1)
	Goto DiscDry
	TNT1 A 0 A_TakeInventory("RawketAmmo",2)
	TNT1 A 0 A_FireCustomMissile("HEDiscobolus",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	DiscFireSeq:
	TNT1 A 0 A_StopSoundEx("SoundSlot5")
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_PlaySound("Weapons/GopnikFire",1)
	TNT1 A 0 A_PlaySound("Weapons/GopnikLoad",5)
	TNT1 A 0 A_PlaySound("Weapons/ErasusAmbient",6)
	GOPF A 1 Bright A_ZoomFactor(0.95)
	GOPF B 1 Bright A_ZoomFactor(0.9)
	GOPF C 1 Bright A_ZoomFactor(0.89)
	GOPF D 1 Bright A_ZoomFactor(0.9)
	GOPR A 1 A_ZoomFactor(0.92)
	GOPR B 1 A_ZoomFactor(0.94)
	GOPR C 1 A_ZoomFactor(0.95)
	GOPR D 1 A_ZoomFactor(0.97)
	GOPR E 1 A_ZoomFactor(0.98)
	GOPR F 1 A_ZoomFactor(0.99)
	GOPR G 1 A_ZoomFactor(1)
	GOPG A 30
	Goto Ready
    Fire1:
	TNT1 A 0 A_ReFire("Fire2")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched1",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage
	HEUsage:
	TNT1 A 0 A_TakeInventory("RawketAmmo",2)
	Goto FiringSeq
	FiringSeq:
	TNT1 A 0 A_StopSoundEx("SoundSlot5")
	TNT1 A 0 A_GunFlash
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_PlaySound("Weapons/GopnikFire",1)
	TNT1 A 0 A_PlaySound("Weapons/ErasusAmbient",6)
	GO2F A 1 Bright A_ZoomFactor(0.95)
	GO2F B 1 Bright A_ZoomFactor(0.925)
	GO2F C 1 Bright A_ZoomFactor(0.95)
	GO2F D 1 Bright A_ZoomFactor(0.97)
	GO2R A 1 A_ZoomFactor(0.98)
	GO2R B 1 A_ZoomFactor(0.99)
	GO2R C 1 A_ZoomFactor(1)
	GO2R DEFG 1
	GO2G A 10
	Goto Ready
    FireDry:
	TNT1 A 0 A_PlaySound("Weapons/GopnikDry")
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"DiscDry")
	GO2G W 3 //WWWWWAAAAAAAAAAAAAAA!!!!!!
	GO2G A 2
	GO2G W 3
	GO2G A 2
	GO2G W 3
	GO2G A 2
	GO2G A 6
	Goto Ready
	DiscDry:
	GOPG W 3
	GOPG A 2
	GOPG W 3
	GOPG A 2
	GOPG W 3
	GOPG A 2
	GOPG A 6
	Goto Ready
    Fire2:
	TNT1 A 0 A_PlaySound("Weapons/GopnikCharge",5)
	GO2L A 14
	TNT1 A 0 A_Refire("Fire3")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched2",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage
    Fire3:
	GO2L B 14
	TNT1 A 0 A_Refire("Fire4")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched3",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage
    Fire4:
	GO2L C 14
	TNT1 A 0 A_Refire("Fire5")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched4",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage
    Fire5:
	GO2L D 14
	TNT1 A 0 A_Refire("Fire6")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched5",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage
    Fire6:
	GO2L E 14
	TNT1 A 0 A_Refire("Fire7")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched6",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage
    Fire7:
	GO2L F 14
	TNT1 A 0 A_Refire("Fire7")
	TNT1 A 0 A_FireCustomMissile("HEMineLaunched7",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto HEUsage


//// Gas Mine.
	DiscFartFire:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",4,1)
	Goto GasDiscDry
	TNT1 A 0 A_TakeInventory("RawketAmmo",4)
	TNT1 A 0 A_FireCustomMissile("GasDiscobolus",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto DiscFireSeq
    FartReady:
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	GO2G T 1 A_WeaponReady
	Goto Ready
    DiscFartReady:
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	GOPG T 1 A_WeaponReady
	Goto Ready
    FartFire:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",4,"FartFire1")
	Goto GasFireDry
	FartUsage:
	TNT1 A 0 A_TakeInventory("RawketAmmo",4)
	Goto FiringSeq
    FartFire1:
	TNT1 A 0 A_ReFire("FartFire2")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched1",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage
    GasFireDry:
	TNT1 A 0 A_PlaySound("Weapons/GopnikDry")
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"GasDiscDry")
	GO2G W 3 //WWWWWAAAAAAAAAAAAAAA!!!!!!
	GO2G T 2
	GO2G W 3
	GO2G T 2
	GO2G W 3
	GO2G T 2
	GO2G T 6
	Goto Ready
	GasDiscDry:
	GOPG W 3
	GOPG T 2
	GOPG W 3
	GOPG T 2
	GOPG W 3
	GOPG T 2
	GOPG T 6
	Goto Ready
    FartFire2:
	TNT1 A 0 A_PlaySound("Weapons/GopnikCharge",5)
	GO2L A 14
	TNT1 A 0 A_Refire("FartFire3")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched2",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage
    FartFire3:
	GO2L B 14
	TNT1 A 0 A_Refire("FartFire4")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched3",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage
    FartFire4:
	GO2L C 14
	TNT1 A 0 A_Refire("FartFire5")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched4",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage
    FartFire5:
	GO2L D 14
	TNT1 A 0 A_Refire("FartFire6")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched5",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage
    FartFire6:
	GO2L E 14
	TNT1 A 0 A_Refire("FartFire7")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched6",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage
    FartFire7:
	GO2L F 14
	TNT1 A 0 A_Refire("FartFire7")
	TNT1 A 0 A_FireCustomMissile("GasMineLaunched7",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto FartUsage


//// Static Mine.
	DiscStaticFire:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",8,1)
	Goto StaticDiscDry
	TNT1 A 0 A_TakeInventory("RawketAmmo",8)
	TNT1 A 0 A_FireCustomMissile("StaticDiscobolus",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto DiscFireSeq
    TeslaReady:
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	GO2G S 1 A_WeaponReady
	Goto Ready
    DiscTeslaReady:
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	GOPG S 1 A_WeaponReady
	Goto Ready
    StaticFire:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",8,"StaticFire1")
	Goto StaticFireDry
	StaticUsage:
	TNT1 A 0 A_TakeInventory("RawketAmmo",8)
	Goto FiringSeq
    StaticFire1:
	TNT1 A 0 A_ReFire("StaticFire2")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched1",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage
    StaticFireDry:
	TNT1 A 0 A_PlaySound("Weapons/GopnikDry")
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"StaticDiscDry")
	GO2G W 3  //WAAAZZZZAAAAA!!!!!
	GO2G S 2
	GO2G W 3
	GO2G S 2
	GO2G W 3
	GO2G S 2
	GO2G S 6
	Goto Ready
	StaticDiscDry:
	GOPG W 3
	GOPG S 2
	GOPG W 3
	GOPG S 2
	GOPG W 3
	GOPG S 2
	GOPG S 6
	Goto Ready
    StaticFire2:
	TNT1 A 0 A_PlaySound("Weapons/GopnikCharge",5)
	GO2L A 14
	TNT1 A 0 A_Refire("StaticFire3")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched2",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage
    StaticFire3:
	GO2L B 14
	TNT1 A 0 A_Refire("StaticFire4")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched3",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage
    StaticFire4:
	GO2L C 14
	TNT1 A 0 A_Refire("StaticFire5")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched4",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage
    StaticFire5:
	GO2L D 14
	TNT1 A 0 A_Refire("StaticFire6")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched5",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage
    StaticFire6:
	GO2L E 14
	TNT1 A 0 A_Refire("StaticFire7")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched6",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage
    StaticFire7:
	GO2L F 10
	TNT1 A 0 A_StopSound(5)
	GO2L F 4
	TNT1 A 0 A_Refire("StaticFire7")
	TNT1 A 0 A_FireCustomMissile("StaticMineLaunched7",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto StaticUsage


	//// Nuke Mine.
	DiscNukeFire:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",60,1)
	Goto NukeDiscDry
	TNT1 A 0 A_TakeInventory("RawketAmmo",60)
	TNT1 A 0 A_FireCustomMissile("NukeDiscobolus",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto DiscFireSeq
    NukeReady:
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	GO2G Z 1 A_WeaponReady
	Goto Ready
    DiscNukeReady:
	TNT1 A 0 A_JumpIfInventory("RO_GotoReload", 1, "Reload")
	GOPG Z 1 A_WeaponReady
	Goto Ready
    NukeFire:
	TNT1 A 0 A_JumpIfInventory("RawketAmmo",60,"NukeFire1")
	Goto NukeFireDry
	NukeUsage:
	TNT1 A 0 A_TakeInventory("RawketAmmo",60)
	Goto FiringSeq
    NukeFire1:
	TNT1 A 0 A_ReFire("NukeFire2")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched1",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage
    NukeFireDry:
	TNT1 A 0 A_PlaySound("Weapons/GopnikDry")
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"NukeDiscDry")
	GO2G W 3  //WAAAZZZZAAAAA!!!!!
	GO2G Z 2
	GO2G W 3
	GO2G Z 2
	GO2G W 3
	GO2G Z 2
	GO2G Z 6
	Goto Ready
	NukeDiscDry:
	GOPG W 3
	GOPG Z 2
	GOPG W 3
	GOPG Z 2
	GOPG W 3
	GOPG Z 2
	GOPG Z 6
	Goto Ready
    NukeFire2:
	TNT1 A 0 A_PlaySound("Weapons/GopnikCharge",5)
	GO2L A 14
	TNT1 A 0 A_Refire("NukeFire3")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched2",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage
    NukeFire3:
	GO2L B 14
	TNT1 A 0 A_Refire("NukeFire4")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched3",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage
    NukeFire4:
	GO2L C 14
	TNT1 A 0 A_Refire("NukeFire5")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched4",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage
    NukeFire5:
	GO2L D 14
	TNT1 A 0 A_Refire("NukeFire6")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched5",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage
    NukeFire6:
	GO2L E 14
	TNT1 A 0 A_Refire("NukeFire7")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched6",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage
    NukeFire7:
	GO2L F 14
	TNT1 A 0 A_StopSound(5)
	TNT1 A 0 A_Refire("NukeFire7")
	TNT1 A 0 A_FireCustomMissile("NukeMineLaunched7",frandom(1.0,-1.0),0,11,0,0,frandom(1.0,-1.0))
	Goto NukeUsage

//// Gun Mode.
	Reload:
	TNT1 A 0 A_PlaySound("Weapons/GopnikMode2",5,0.6)
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"Unload")
	TNT1 A 0 A_GiveInventory("DiscobolusMode",1)
	TNT1 A 0 A_Print("Launch Mode.")
	GOPG W 25 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
	Unload:
	TNT1 A 0 A_TakeInventory("DiscobolusMode",1)
	TNT1 A 0 A_Print("Lobber Mode.")
	GO2G W 25 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
//// Mine Mode.
    AltFire:
	TNT1 A 0 A_JumpIfInventory("GopnikNukeModeTrigger",1,"NukeMineMode")
	TNT1 A 0 A_JumpIfInventory("GopnikTeslaModeTrigger",1,"TeslaMineMode")
	TNT1 A 0 A_JumpIfInventory("GopnikFartModeTrigger",1,"FartMineMode")
	goto Ready
	NukeMineMode:
	TNT1 A 0 A_JumpIfInventory("GopnikNukeMode",1,"StandardMineMode")
	TNT1 A 0 A_TakeInventory("GopnikTeslaMode",1)
	TNT1 A 0 A_TakeInventory("GopnikFartMode",1)
	
	TNT1 A 0 A_GiveInventory("GopnikNukeMode",1)
	Goto UnloadTrigger
	TeslaMineMode:
	TNT1 A 0 A_JumpIfInventory("GopnikTeslaMode",1,"StandardMineMode")
	TNT1 A 0 A_TakeInventory("GopnikNukeMode",1)
	TNT1 A 0 A_TakeInventory("GopnikFartMode",1)
	
	TNT1 A 0 A_GiveInventory("GopnikTeslaMode",1)
	Goto UnloadTrigger
	FartMineMode:
	TNT1 A 0 A_JumpIfInventory("GopnikFartMode",1,"StandardMineMode")
	TNT1 A 0 A_TakeInventory("GopnikNukeMode",1)
	TNT1 A 0 A_TakeInventory("GopnikTeslaMode",1)

	TNT1 A 0 A_GiveInventory("GopnikFartMode",1)
	Goto UnloadTrigger
	StandardMineMode:
	TNT1 A 0 A_TakeInventory("GopnikNukeMode",1)
	TNT1 A 0 A_TakeInventory("GopnikTeslaMode",1)
	TNT1 A 0 A_TakeInventory("GopnikFartMode",1)
	UnloadTrigger:
	TNT1 A 0 A_TakeInventory("GopnikNormalModeTrigger",1)
	TNT1 A 0 A_TakeInventory("GopnikNukeModeTrigger",1)
	TNT1 A 0 A_TakeInventory("GopnikTeslaModeTrigger",1)
	TNT1 A 0 A_TakeInventory("GopnikFartModeTrigger",1)
	TNT1 A 0 A_PlaySound("Weapons/GopnikMode",5,0.6)
	TNT1 A 0 A_JumpIfInventory("DiscobolusMode",1,"Alternate")
	GO2G W 25 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
	Alternate:
	GOPG W 25 A_WeaponReady(WRF_NOFIRE)
	Goto Ready
    } 
}

ACTOR GopnikNukeMode : Inventory { Inventory.MaxAmount 1 }
ACTOR GopnikTeslaMode : Inventory { Inventory.MaxAmount 1 }
ACTOR GopnikFartMode : Inventory { Inventory.MaxAmount 1 }

ACTOR GopnikNormalModeTrigger: Inventory { Inventory.MaxAmount 1 }
ACTOR GopnikNukeModeTrigger : Inventory { Inventory.MaxAmount 1 }
ACTOR GopnikTeslaModeTrigger : Inventory { Inventory.MaxAmount 1 }
ACTOR GopnikFartModeTrigger : Inventory { Inventory.MaxAmount 1 }

ACTOR GopnikPower : Ammo
{
   Inventory.Amount 1
   Inventory.MaxAmount 6
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 6
   Inventory.Icon STTPRCNT
   Inventory.PickupMessage "Picked up a SEMKI! WAAAAHHH!! *BONG* (CRITICAL HIT!)"
   States
   {
   Spawn:
      TNT1 A -1
      Stop
   }
}

ACTOR GopnikCounter : Inventory
{
    Inventory.MaxAmount 999
}

ACTOR DiscobolusMode : Inventory
{
    Inventory.MaxAmount 1
}

//HE Mine
actor HEMineLaunched
{
  Radius 11
  Height 7
  Damage 0
  Speed 0
  Projectile
  BounceType Doom
  BounceFactor 0.35
  BounceCount 3
  BounceSound "Weapons/GopnikBounce"
  -NOGRAVITY
  +THRUGHOST
  Obituary "%o got caught by unarmed mine, thanks to %k's mine lobbed into %o's face."
  Scale 0.8
  States
  {
  Spawn:
	GMIN A 1
	loop
  Death:
	TNT1 A 0 A_PlaySound("Weapons/GopnikBounce")
  	TNT1 A 0 A_JumpIfInTargetInventory("NukerUpgrade",1,"NukerDeath")
	GMIN A 1 A_SpawnItem ("HEMineArmed")
	stop
  NukerDeath:
	GMIN A 1 A_SpawnItem ("NukerHEMineArmed")
	stop
  XDeath:  
  	TNT1 A 0 A_JumpIfInTargetInventory("NukerUpgrade",1,"NukerXDeath")
	TNT1 A 0 A_PlaySound("Weapons/GopnikExp")
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 A 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 A 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 A 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	stop
  NukerXDeath:
	TNT1 A 0 A_PlaySound("Weapons/GopnikExp")
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 A 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 A 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 A 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	stop
  }
}

actor HEDiscobolus : HEMineLaunched
{
  Speed 80
  Gravity 0.25
  Damage 40
  BounceType None
  Obituary "%o was blasted in the face by %k's hi-speed mine, lobbed into %p face."
  States
  {
  Spawn:
	 TNT1 AA 0 A_ChangeVelocity(0,0,frandom(1.0,1.5),0)
  Looplet:
	GMIN A 1 A_SpawnItemEx("HEMineTrail",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	loop
  Death:  
  	TNT1 A 0 A_JumpIfInTargetInventory("NukerUpgrade",1,"NukerDeath")
	TNT1 A 0 A_PlaySound("Weapons/GopnikExp")
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 A 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 A 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 A 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	stop
  NukerDeath:
	TNT1 A 0 A_PlaySound("Weapons/GopnikExp")
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 A 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 A 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 A 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	stop
  }
}

actor HEMineTrail
{
  +NOINTERACTION
  +NOGRAVITY
  Scale 0.8
  States
  {
  Spawn:
  GMIN A 1 A_FadeOut(0.1)
  Loop
  }
}

actor HEMineArmed
{
  Radius 6
  Height 6
  Speed 0
  Health 20
  Mass 999999999
  -NOGRAVITY
  +FRIENDLY
  +SHOOTABLE
  +NOBLOOD
  +DONTFALL
  +NOICEDEATH
  +DONTRIP
  +LOOKALLAROUND
  meleerange 144
  Obituary "%o should be more careful, since %k rather doesn't like trespassers."
  Scale 0.8
  States
  {
  Spawn:
	GMIN AAAA 8 A_Look
	GMIN B 8 A_PlaySound ("Weapons/GopnikTick")
	loop
  See:
	GMIN AAAA 8 A_Chase
	GMIN B 8 A_PlaySound ("Weapons/GopnikTick")
	loop
  Melee:
	GMIN B 2 A_PlayWeaponSound ("Weapons/GopnikArm")
	GMIN ABABAB 2
	GMIN A 0 A_Die 
  Death:
	TNT1 A 0 A_PlaySound("Weapons/GopnikExp")
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 B 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 C 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,164)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 D 5 A_SpawnItemEx("PushkaExplode",0,0,0,0,0,0,0,128,0)
	stop
  }
}

actor NukerHEMineArmed : HEMineArmed
{
  States
  {
  Death:
	TNT1 A 0 A_PlaySound("Weapons/GopnikExp")
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 B 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 C 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(200,192)
	TNT1 A 0 A_Explode(200,384,0)
	TNT1 D 5 A_SpawnItemEx("NukerPushkaExplode",0,0,0,0,0,0,0,128,0)
	stop
  }
}

actor HEMineLaunched1 : HEMineLaunched
{
  Speed 10
}

actor HEMineLaunched2 : HEMineLaunched
{
  Speed 15
}

actor HEMineLaunched3 : HEMineLaunched
{
  Speed 20
}

actor HEMineLaunched4 : HEMineLaunched
{
  Speed 25
}

actor HEMineLaunched5 : HEMineLaunched
{
  Speed 30
}

actor HEMineLaunched6 : HEMineLaunched
{
  Speed 35
}

actor HEMineLaunched7 : HEMineLaunched
{
  Speed 40
}


//Static Mine
actor StaticMineLaunched
{
  Radius 11
  Height 7
  Damage 0
  Speed 0
  Projectile
  BounceType Doom
  BounceFactor 0.35
  BounceCount 3
  BounceSound "Weapons/GopnikBounce"
  -NOGRAVITY
  +THRUGHOST
  Obituary "%o got caught by unarmed mine, thanks to %k's mine lobbed into %o's face."
  Scale 0.8
  States
  {
  Spawn:
	SMIN A 1
	loop
  Death:
	TNT1 A 0 A_PlaySound("Weapons/GopnikBounce")
	SMIN A 1 A_SpawnItemEx("StaticMineArmed",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	stop
  XDeath:  
	TNT1 A 0 A_PlaySound("Weapons/GopnikStaticActivate")

	TNT1 A 0 A_SpawnItemEx("MajorStaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_SpawnItemEx("StaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_SpawnItemEx("LesserStaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 8
	TNT1 A 0 A_SpawnItemEx("StaticDamager",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  }
}

actor StaticDiscobolus : StaticMineLaunched
{
  Speed 80
  Damage 40
  Gravity 0.25
  BounceType None
  Obituary "%o was blasted in the face by %k's hi-speed mine, lobbed into %p face."
  States
  {
  Spawn:
	 TNT1 AA 0 A_ChangeVelocity(0,0,frandom(1.0,1.5),0)
  Looplet:
	SMIN A 1 A_SpawnItemEx("StaticMineTrail",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	loop
  Death:  
	TNT1 A 0 A_PlaySound("Weapons/GopnikStaticActivate")

	TNT1 A 0 A_SpawnItemEx("MajorStaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_SpawnItemEx("StaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_SpawnItemEx("LesserStaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 8
	TNT1 A 0 A_SpawnItemEx("StaticDamager",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  }
}

actor StaticMineTrail : HEMineTrail
{
+CLIENTSIDEONLY
  States
  {
  Spawn:
  SMIN A 1 A_FadeOut(0.1)
  Loop
  }
}

actor StaticMineArmed
{
  Radius 6
  Height 6
  Speed 0
  Health 20
  Mass 999999999
  -NOGRAVITY
  +FRIENDLY
  +SHOOTABLE
  +NOBLOOD
  +DONTFALL
  +NOICEDEATH
  +DONTRIP
  +LOOKALLAROUND
  meleerange 192
  Obituary "%o got somehow killed by %k's static field mine."
  Scale 0.8
  States
  {
  Spawn:
	SMIN AAAA 8 A_Look
	SMIN B 8 A_PlaySound ("Weapons/GopnikTick")
	loop
  See:
	SMIN AAAA 8 A_Chase
	SMIN B 8 A_PlaySound ("Weapons/GopnikTick")
	loop
  Melee:
	SMIN B 2 A_PlayWeaponSound ("Weapons/GopnikArm")
	SMIN ABABAB 2
	SMIN A 0 A_Die 
  Death:
	TNT1 A 0 A_PlaySound("Weapons/GopnikStaticActivate")

	TNT1 A 0 A_SpawnItemEx("MajorStaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_SpawnItemEx("StaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_SpawnItemEx("LesserStaticField",0,0,0,0,0,0,0,128,0)
	TNT1 A 8
	TNT1 A 0 A_SpawnItemEx("StaticDamager",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  }
}

actor StaticMineLaunched1 : StaticMineLaunched
{
  Speed 10
}

actor StaticMineLaunched2 : StaticMineLaunched
{
  Speed 15
}

actor StaticMineLaunched3 : StaticMineLaunched
{
  Speed 20
}

actor StaticMineLaunched4 : StaticMineLaunched
{
  Speed 25
}

actor StaticMineLaunched5 : StaticMineLaunched
{
  Speed 30
}

actor StaticMineLaunched6 : StaticMineLaunched
{
  Speed 35
}

actor StaticMineLaunched7 : StaticMineLaunched
{
  Speed 40
}

ACTOR StaticField
{ 
    Scale 4.3
    Alpha 0.0
    RenderStyle Add
    +NOINTERACTION
	+CLIENTSIDEONLY
    +NOGRAVITY
    +THRUGHOST
    +DONTSPLASH
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 A 0 A_FadeIn(0.025)
      STFL A 1 //A_SetScale(ScaleX -0.3, ScaleY -0.3)
      TNT1 A 0 A_FadeIn(0.05)
      STFL C 1 //A_SetScale(ScaleX -0.3, ScaleY -0.3)
      TNT1 A 0 A_FadeIn(0.025)
      STFL E 1 //A_SetScale(ScaleX -0.3, ScaleY -0.3)
      TNT1 A 0 A_FadeIn(0.05)
      STFL G 1 //A_SetScale(ScaleX -0.3, ScaleY -0.3)
      TNT1 A 0 A_FadeIn(0.025)
      STFL I 1 //A_SetScale(ScaleX -0.3, ScaleY -0.3)
      TNT1 A 0 A_FadeIn(0.05)
      STFL K 1 //A_SetScale(ScaleX -0.2, ScaleY -0.2)
      TNT1 A 0 A_FadeIn(0.025)
      STFL M 1 //A_SetScale(ScaleX -0.2, ScaleY -0.2)
      TNT1 A 0 A_FadeIn(0.05)
      STFL O 1 //A_SetScale(ScaleX -0.2, ScaleY -0.2)
    Looper:
      TNT1 A 0 A_JumpIfInventory("GopnikCounter",10,"Death")
      TNT1 A 0 A_GiveInventory("GopnikCounter",1)
      STFL ABCDEFGHIJKLMNO 2 Bright
      Loop
    Death:
      TNT1 A 0 A_FadeOut(0.1)
      STFL B 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL D 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL F 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL H 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL J 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL L 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL N 2 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      Stop
    }
}

ACTOR LesserStaticField : StaticField
{ 
+CLIENTSIDEONLY
    Scale 1.3
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 A 0 A_FadeIn(0.1)
      STFL O 1 Bright //A_SetScale(ScaleX +0.2, ScaleY +0.2)
      TNT1 A 0 A_FadeIn(0.05)
      STFL M 1 Bright //A_SetScale(ScaleX +0.2, ScaleY +0.2)
      TNT1 A 0 A_FadeIn(0.1)
      STFL K 1 Bright //A_SetScale(ScaleX +0.2, ScaleY +0.2)
      TNT1 A 0 A_FadeIn(0.05)
      STFL I 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeIn(0.1)
      STFL G 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeIn(0.05)
      STFL E 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeIn(0.1)
      STFL C 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeIn(0.05)
      STFL A 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
    Looper:
      TNT1 A 0 A_JumpIfInventory("GopnikCounter",20,"Death")
      TNT1 A 0 A_GiveInventory("GopnikCounter",1)
      STFL OMNLKJIHGFEDCBA 1 Bright
      Loop
    Death:
      TNT1 A 0 A_FadeOut(0.1)
      STFL N 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeOut(0.05)
      STFL L 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL J 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeOut(0.05)
      STFL H 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL F 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeOut(0.05)
      STFL D 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL B 1 Bright //A_SetScale(ScaleX +0.1, ScaleY +0.1)
      Stop
    }
}

ACTOR MajorStaticField : StaticField
{ 
+CLIENTSIDEONLY
    Scale 6.2
    States
    {
    Spawn:
      TNT1 A 0
      TNT1 A 0 A_FadeIn(0.005)
      STFL A 1 Bright //A_SetScale(ScaleX +1.5, ScaleY +1.5)
      TNT1 A 0 A_FadeIn(0.005)
      STFL C 1 Bright //A_SetScale(ScaleX +1.5, ScaleY +1.5)
      TNT1 A 0 A_FadeIn(0.005)
      STFL E 1 Bright //A_SetScale(ScaleX +1.5, ScaleY +1.5)
      TNT1 A 0 A_FadeIn(0.005)
      STFL G 1 Bright //A_SetScale(ScaleX +0.5, ScaleY +0.5)
      TNT1 A 0 A_FadeIn(0.025)
      STFL I 1 Bright //A_SetScale(ScaleX +0.5, ScaleY +0.5)
      TNT1 A 0 A_FadeIn(0.025)
      STFL K 1 Bright //A_SetScale(ScaleX +0.2, ScaleY +0.2)
      TNT1 A 0 A_FadeIn(0.025)
      STFL M 1 Bright //A_SetScale(ScaleX +0.2, ScaleY +0.2)
      TNT1 A 0 A_FadeIn(0.025)
      STFL O 1 Bright //A_SetScale(ScaleX +0.2, ScaleY +0.2)
    Looper:
      TNT1 A 0 A_JumpIfInventory("GopnikCounter",4,"Death")
      TNT1 A 0 A_GiveInventory("GopnikCounter",1)
      STFL ABCDEFGHIJKLMNO 5 Bright
      Loop
    Death:
      TNT1 A 0 A_FadeOut(0.1)
      STFL B 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL D 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL F 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL H 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL J 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL L 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      TNT1 A 0 A_FadeOut(0.1)
      STFL N 4 Bright //A_SetScale(ScaleX -0.1, ScaleY -0.1)
      Stop
    }
}

ACTOR StaticDamager
{
  +NOINTERACTION
  +NOGRAVITY
  +FORCEPAIN
  +BLOODLESSIMPACT
  DamageType Nope
  States
  {
  Spawn:
  	TNT1 A 0
  	TNT1 A 0 A_JumpIfInventory("GopnikCounter",300,"Endo")
  	TNT1 A 0 A_PlaySoundEx("Weapons/GopnikStaticLoop","SoundSlot5",1)
  	TNT1 A 0 A_GiveInventory("GopnikCounter",1)
	TNT1 A 1 A_Explode(1,384,0,1,1)
	Loop
  Endo:
	TNT1 A 1 A_PlaySoundEx("Weapons/GopnikStaticEnd","SoundSlot5")
	stop
  }
}


//Gas Mine
actor GasMineLaunched
{
  Radius 11
  Height 7
  Damage 0
  Speed 0
  Projectile
  BounceType Doom
  BounceFactor 0.35
  BounceCount 3
  BounceSound "Weapons/GopnikBounce"
  -NOGRAVITY
  +THRUGHOST
  Obituary "%o got caught by unarmed mine, thanks to %k's mine lobbed into %o's face."
  Scale 0.8
  States
  {
  Spawn:
	TMIN A 1
	loop
  Death:
	TNT1 A 0 A_PlaySound("Weapons/GopnikBounce")
	TMIN A 1 A_SpawnItemEx("GasMineArmed",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	stop
  XDeath:
    TNT1 A 0 A_PlaySound("weapons/fistcombustion",5)
	TNT1 A 0 A_PlaySound("Weapons/GopnikGasActivate")
	TNT1 A 0 A_SpawnItemEx("FailPierd",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	TNT1 A 0 A_SpawnItemEx("FailGasExplode",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  }
}

actor GasDiscobolus : GasMineLaunched
{
  Speed 80
  Damage 40
  Gravity 0.25
  BounceType None
  Obituary "%o was blasted in the face by %k's hi-speed mine, lobbed into %p face."
  States
  {
  Spawn:
	 TNT1 AA 0 A_ChangeVelocity(0,0,frandom(1.0,1.5),0)
  Looplet:
	TMIN A 1 A_SpawnItemEx("GasMineTrail",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	loop
  Death: 
  XDeath:
    TNT1 A 0 A_PlaySound("weapons/fistcombustion",5)
	TNT1 A 0 A_PlaySound("Weapons/GopnikGasActivate")
	TNT1 A 0 A_SpawnItemEx("Pierd",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	TNT1 A 0 A_SpawnItemEx("GasExplode",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  }
}

actor GasMineTrail : HEMineTrail
{
+CLIENTSIDEONLY
  States
  {
  Spawn:
  TMIN A 1 A_FadeOut(0.1)
  Loop
  }
}

ACTOR FailGasExplode
{
	Radius 1
	Height 1
	Speed 1
	Damage 0
	Obituary "%k killed %o with uncharged fart... I mean, gas mine. Anyway, it was a total humiliation."
	PROJECTILE
	+NOGRAVITY
	+EXTREMEDEATH
	States
	{
	Spawn:	
	 TNT1 A 0
	 TNT1 A 1 A_Explode(100,128,0,1)
	 Stop
	}
}

ACTOR FailPierd
{
+CLIENTSIDEONLY
	Speed 10
	+NOGRAVITY
	+NOINTERACTION
	States
	{
	Spawn:	
	 TNT1 A 1
	 TNT1 A 0 Radius_Quake(3,100,0,20,0)
	 TNT1 AAAAAAAA 1 A_SpawnItemEx("GasCloud",random(1,3),random(1,3),13+random(1,2),0.1*random(9,15),0.1*random(9,15),0.1*random(-5,5),random(0,359))
	 TNT1 AAA 2 A_SpawnItemEx("GasCloud",random(1,3),random(1,3),13+random(1,2),0.1*random(9,15),0.1*random(9,15),0.1*random(-3,3),random(0,359))
	 Stop
	}
}

actor GasMineArmed
{
  Radius 6
  Height 6
  Speed 0
  Health 20
  Mass 999999999
  -NOGRAVITY
  +FRIENDLY
  +SHOOTABLE
  +NOBLOOD
  +DONTFALL
  +NOICEDEATH
  +DONTRIP
  +LOOKALLAROUND
  meleerange 192
  Obituary "%o was humiliated by %k's gas mine. You know, sucha long arm time, and yet he couldn't find a hide spot!?"
  Scale 0.8
  States
  {
  Spawn:
	TMIN AAAA 8 A_Look
	TMIN B 8 A_PlaySound ("Weapons/GopnikTick")
	loop
  See:
	TMIN AAAA 8 A_Chase
	TMIN B 8 A_PlaySound ("Weapons/GopnikTick")
	loop
  Melee:
	TMIN B 75 A_PlaySoundEx("weapons/fistcharge","SoundSlot5")
	TMIN A 0 A_GiveInventory("GopnikCounter",1)
	TMIN A 0 A_Die
  Death:
	TMIN A 0 A_JumpIfInventory("GopnikCounter",1,"HolySmokes")
    TNT1 A 0 A_PlaySound("weapons/fistcombustion",5)
	TNT1 A 0 A_PlaySound("Weapons/GopnikGasActivate")
	TNT1 A 0 A_SpawnItemEx("FailPierd",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	TNT1 A 0 A_SpawnItemEx("FailGasExplode",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  HolySmokes:
    TNT1 A 0 A_PlaySound("weapons/fistcombustion",5)
	TNT1 A 0 A_PlaySound("Weapons/GopnikGasActivate")
	TNT1 A 0 A_SpawnItemEx("Pierd",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	TNT1 A 0 A_SpawnItemEx("GasExplode",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS,0)
	Stop
  }
}

actor GasMineLaunched1 : GasMineLaunched
{
  Speed 10
}

actor GasMineLaunched2 : GasMineLaunched
{
  Speed 15
}

actor GasMineLaunched3 : GasMineLaunched
{
  Speed 20
}

actor GasMineLaunched4 : GasMineLaunched
{
  Speed 25
}

actor GasMineLaunched5 : GasMineLaunched
{
  Speed 30
}

actor GasMineLaunched6 : GasMineLaunched
{
  Speed 35
}

actor GasMineLaunched7 : GasMineLaunched
{
  Speed 40
}


//Nuke Mine
actor NukeMineLaunched
{
  Radius 11
  Height 7
  Damage 0
  Speed 0
  Projectile
  BounceType Doom
  BounceFactor 0.35
  BounceCount 3
  BounceSound "Weapons/GopnikBounce"
  -NOGRAVITY
  +THRUGHOST
  Obituary "%k was sick enough to lob nuclear mine into %o's face!"
  Scale 0.8
  States
  {
  Spawn:
	AMIN A 1
	loop
  Death:
  	TNT1 A 0 A_PlaySound("Weapons/GopnikBounce")
	AMIN A 1 A_SpawnItemEx("NukeMineArmed",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	stop
  XDeath:
	TNT1 A 0 A_PlaySound("Weapons/StalinowiczExplode",5)
	TNT1 A 0 A_SpawnItemEx("Nuke",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("KaBoom",random(-100,100),random(-100,100),random(-100,100),random(-4,4),random(-4,4),random(-2,6),random(0,359),SXF_TRANSFERTRANSLATION|SXF_SETMASTER|SXF_NOCHECKPOSITION,40)
	stop
  }
}

actor NukeDiscobolus : NukeMineLaunched
{
  Speed 80
  Damage 40
  Gravity 0.25
  BounceType None
  Obituary "%o was blasted in the face by %k's hi-speed mine, lobbed into %p face."
  States
  {
  Spawn:
	 TNT1 AA 0 A_ChangeVelocity(0,0,frandom(1.0,1.5),0)
  Looplet:
	AMIN A 1 A_SpawnItemEx("NukeMineTrail",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	loop
  Death:  
	TNT1 A 0 A_PlaySound("Weapons/StalinowiczExplode",5)
	TNT1 A 0 A_SpawnItemEx("Nuke",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("KaBoom",random(-100,100),random(-100,100),random(-100,100),random(-4,4),random(-4,4),random(-2,6),random(0,359),SXF_TRANSFERTRANSLATION|SXF_SETMASTER|SXF_NOCHECKPOSITION,40)
	stop
  }
}

actor NukeMineTrail : HEMineTrail
{
+CLIENTSIDEONLY
  States
  {
  Spawn:
  AMIN A 1 A_FadeOut(0.1)
  Loop
  }
}

actor NukeMineArmed
{
  Radius 6
  Height 6
  Speed 0
  Health 20
  Mass 999999999
  -NOGRAVITY
  +FRIENDLY
  +SHOOTABLE
  +NOBLOOD
  +DONTFALL
  +NOICEDEATH
  +DONTRIP
  +LOOKALLAROUND
  meleerange 192
  Obituary "It appears that %o trodded near %k's nuclear mine."
  Scale 0.8
  States
  {
  Spawn:
	AMIN AAAA 8 A_Look
	AMIN B 8 A_PlaySound ("Weapons/GopnikNukeTick")
	loop
  See:
	AMIN AAAA 8 A_Chase
	AMIN B 8 A_PlaySound ("Weapons/GopnikNukeTick")
	loop
  Melee:
	AMIN B 46 A_PlayWeaponSound("Weapons/GopnikNukeArm")
	AMIN A 0 A_Die 
  Death:
	TNT1 A 0 A_PlaySound("Weapons/StalinowiczExplode",5)
	TNT1 A 0 A_SpawnItemEx("Nuke",0,0,0,0,0,0,0,SXF_TRANSFERPOINTERS)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_SpawnItemEx("KaBoom",random(-100,100),random(-100,100),random(-100,100),random(-4,4),random(-4,4),random(-2,6),random(0,359),SXF_TRANSFERTRANSLATION|SXF_SETMASTER|SXF_NOCHECKPOSITION,40)
	stop
  }
}

//Nuke Power

actor NukeMineLaunched1 : NukeMineLaunched
{
  Speed 10
}

actor NukeMineLaunched2 : NukeMineLaunched
{
  Speed 15
}

actor NukeMineLaunched3 : NukeMineLaunched
{
  Speed 20
}

actor NukeMineLaunched4 : NukeMineLaunched
{
  Speed 25
}

actor NukeMineLaunched5 : NukeMineLaunched
{
  Speed 30
}

actor NukeMineLaunched6 : NukeMineLaunched
{
  Speed 35
}

actor NukeMineLaunched7 : NukeMineLaunched
{
  Speed 40
}
