actor GasPointMaker
{
-SOLID
+NOINTERACTION
+NOTIMEFREEZE
Height 1
Radius 1
-NOGRAVITY
+DONTSPLASH
speed 0
states
{
Spawn:
TNT1 A 0 
TNT1 A 1 A_SpawnItemEx("GasPoint",0,0,-(z-floorz),0,0,0,0,SXF_NOCHECKPOSITION,0,7000)
stop
}
}

actor GasPoint
{
-SOLID
+NOINTERACTION
+NOTIMEFREEZE
Height 1
Radius 1
+NOGRAVITY
+DONTSPLASH
+FLOORHUGGER
+DONTBLAST
+DONTREFLECT
speed 0
scale 2.5
renderstyle none
	states
	{
	Spawn:
	SHAB RRRRSSSSSTTTTT 2 
	loop
	GasStart:
	BASS A 5 A_SpawnItemEx("GasBeacon")
	Gas:
	//BASS H 0 A_JumpIf(damage==0, "End")
	//BASS H 0 A_JumpIf(damage==512, "End")
	//BASS H 0 A_JumpIf(damage<512, "End")
	//BASS H 0 A_JumpIf(damage<500, "Faster")
	BASS H 0 A_SetAngle(angle+(2.9 * 1))
	Spew:
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 15, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 30, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 45, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 60, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 75, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 90, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 105, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 120, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 135, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 150, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 165, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 180, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 195, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 210, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 225, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 240, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 255, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 270, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 285, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 300, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 315, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 330, SXF_NOCHECKPOSITION)
	BASS H 1 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 345, SXF_NOCHECKPOSITION)
	Goto Gas
	Faster:
	BASS H 0 A_SetAngle(angle+(2.9 * 2))
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 90, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 180, SXF_NOCHECKPOSITION)
	BASS H 1 A_SpawnItemEx("GasFXSpawner", damage, 0, -(z-floorz), 0, 0, 0, 270, SXF_NOCHECKPOSITION)
	Goto Gas
	End:
	BASS A -1// A_SpawnItemEx("GasFXSpawner", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	loop
	}
}

actor GasFXSpawner// : MapMarker
{
-SOLID
//+MISSILE
+DONTSPLASH
+NOCLIP
+NOTIMEFREEZE
Height 1
Radius 1
gravity 999
scale 0.5
renderstyle "None"
	states
	{
	Spawn:
	SHAB T 0
	SHAB T 0 A_SpawnItemEx("GasMapMarker", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	SHAB T 8 A_SpawnItemEx("GasFX", 0, 0, 0, 0, 0, 32, 0, SXF_NOCHECKPOSITION)
	stop
	}
}

actor GasBeacon : MapMarker
{
height 1
radius 1
-SOLID
+NOTIMEFREEZE
	states
	{
	Spawn:
	TNT1 A 1
	TNT1 A 1 A_SpawnItemEx("SafetyRadiusPointer",0,0,-(z-floorz))
	TNT1 A -1 A_SpawnItemEx("GasBeaconFX",0,0,-(z-floorz))
	stop
	}
}

actor GasBeaconFX
{
+NOINTERACTION
+NOGRAVITY
+NOTIMEFREEZE
Height 1
radius 1
+FORCEYBILLBOARD
+FLOORHUGGER
scale 2.0
renderstyle Translucent
alpha 0.6
translation "192:192=87:87", "198:198=93:93"
//translation "4:4=236:236", "192:192=238:238", "198:198=239:239"
	states
	{
	Spawn:
	LMSG A 2
	LMSG A 0 A_JumpIf(z>9000, "Death")
	LMSG A 1 A_SpawnItemEx("GasBeaconFX2", 0, 0, 128)
	Fading:
	LMSG A 0 A_SpawnItemEx("GasSafetyMarker", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	LMSG AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_FadeOut(0.01)
	LMSG AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_FadeIn(0.01)
	loop
	Death:
	TNT1 A 1
	stop
	}
}

actor GasBeaconFX2 : GasBeaconFX
{
-FLOORHUGGER
}

actor SafetyRadiusPointer
{
+NOTIMEFREEZE
-SOLID
+NOINTERACTION
Height 1
Radius 1
+NOGRAVITY
+DONTSPLASH
+FLOORHUGGER
scale 2.5
renderstyle none
	states
	{
	Spawn:
	Gas:
	BASS H 0 A_SetAngle(angle+3)
	Spew:
	BASS H 0 A_SpawnItemEx("SafetyFX", 768, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("SafetyFX", 768, 0, 0, 0, 0, 0, 90, SXF_NOCHECKPOSITION)
	BASS H 0 A_SpawnItemEx("SafetyFX", 768, 0, 0, 0, 0, 0, 180, SXF_NOCHECKPOSITION)
	BASS H 1 A_SpawnItemEx("SafetyFX", 768, 0, 0, 0, 0, 0, 270, SXF_NOCHECKPOSITION)
	Goto Gas
	End:
	BASS A -1// A_SpawnItemEx("GasFXSpawner", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	loop
	}
}
actor SafetyFX// : MapMarker
{
-SOLID
//+MISSILE
+DONTSPLASH
+NOCLIP
+NOTIMEFREEZE
+FLOORHUGGER
Height 1
Radius 1
gravity 999
scale 1.5
	states
	{
	Spawn:
	TNT1 A 0
	TNT1 A 1
	TNT1 A 0 A_Countdown
	goto Death
	Death:
	TNT1 A 0 A_SpawnItemEx("SafetyMarker", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	TNT1 A 0 A_SpawnItemEx("SAFETY")
	stop
	}
}

actor SAFETY// : MapMarker
{
+NOGRAVITY
+NOINTERACTION
+NOTIMEFREEZE
Height 1
Radius 1
scale 1.5
	states
	{
	Spawn:
	TNT1 A 0
	SAFE B 1
	stop
	}
}

actor GasMapMarker : MapMarker
{
-SOLID
+DONTSPLASH
+NOTIMEFREEZE
+NOCLIP
Height 1
Radius 1
gravity 999
scale 0.5
+CLIENTSIDEONLY
	states
	{
	Spawn:
	SHAB T 20
	stop
	}
}

actor GasSafetyMarker : MapMarker
{
-SOLID
+DONTSPLASH
+NOCLIP
+NOTIMEFREEZE
Height 1
Radius 1
gravity 999
scale 1.5
+CLIENTSIDEONLY
	states
	{
	Spawn:
	SAFE A 40
	stop
	}
}

actor SafetyMarker : MapMarker
{
-SOLID
+DONTSPLASH
+NOTIMEFREEZE
+NOCLIP
Height 1
Radius 1
gravity 999
scale 0.5
+CLIENTSIDEONLY
	states
	{
	Spawn:
	SAFE A 2
	stop
	}
}

actor GasFX
{
renderstyle translucent
alpha 0.65
-SOLID
+DONTSPLASH
+MISSILE
+NOGRAVITY
+CLIENTSIDEONLY
+RIPPER
+NOTIMEFREEZE
+NOINTERACTION
Damage 0
scale 4.5
States
{
	Spawn:
	SHAB RSTSRSTSRST 2
	stop
}
}

actor GasFXInventory : CustomInventory
{
+INVENTORY.AUTOACTIVATE
states
{
pickup:
TNT1 A 0 A_SpawnItemEx("TempGasFX", random(0, 75), 0, random(0, 80), 0, 0, 0, random(0,360))
stop
}
}

actor TempGasFX : GasFX
{
scale 1.3
alpha 0.7
States
{
	Spawn:
	SHAB RSTSR 6 A_FadeOut(0.1)
	loop
}
}

actor GasStackerInventory : Inventory
{
inventory.amount 1
inventory.maxamount 500
}

actor GasFogPowerup : Powerup
{
powerup.duration -10
powerup.color 255 90 255 0.25
}

actor FoilInvulnerability : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_ChangeFlag("INVULNERABLE", 0)
TNT1 A 0 SetPlayerProperty(0,0,5)
stop
}
}

actor SH_LMSGas_Radar_P : CustomInventory
{
states
{
Pickup:
TNT1 A 0 ACS_NamedExecuteAlways("SH_RadarPointer",0,0)
stop
}
}