actor DoomPlayer2 : PlayerPawn replaces DoomPlayer
{
+NOSKIN
+NOICEDEATH
limitedtoteam 0
player.soundclass "marine"
player.displayname "Marine"
player.startitem "Clip", 150
player.startitem "Shell", 50
player.startitem "GrenadeAmmo", 10
player.startitem "Riotgun", 1
player.startitem "DualPistols", 1
player.startitem "Machinegun", 1
Player.ColorRange 112, 127
damagefactor "Grenade", 0.3
mass 400
States
{
Spawn:
PLAY Z 0 ACS_Execute(984,0)
PLAY Z 1
Loop
See:
PLAY A 0 ACS_Execute(984,0)
PLAY AB 5
PLAY A 0 A_SpawnItemEx ("MarineStomp", 0, 0, 0, 0, 0, -20, 0,0, 0) 
PLAY CD 5
PLAY A 0 A_SpawnItemEx ("MarineStomp", 0, 0, 0, 0, 0, -20, 0,0, 0) 
Goto Spawn
Missile:
PLAY E 12 
Goto Spawn
Melee:
PLAY F 6 BRIGHT
Goto Missile
Pain:
PLAY G 4 
PLAY G 4 A_Pain
Goto Spawn
Pain.Creepstun:
PLAY G 0 A_Pain
PLAY G 18 ACS_ExecuteAlways(986,0)
Goto Spawn
Death:
PLAY H 10
PLAY I 10 A_PlayerScream
PLAY J 10 A_NoBlocking
PLAY KLM 10
PLAY N -1
Stop
Death.Creeper:
PLAY A 0 A_PlaySoundEx("creeperattack", "Body")
PLAY A 0 A_GiveToTarget("Creeperheal",1)
PLAY H 10 ACS_ExecuteAlways(997,0)
PLAY I 10 A_PlayerScream
PLAY J 10 A_NoBlocking
PLAY KLM 10
PLAY N -1
Stop
Death.Jitter:
PLAY G 1 A_PlaySound("gibbage/xsplat")
NULL A 0 A_PlaySound("gibbage/playergib") 
NULL A 0 A_NoBlocking 
// Unleash The Gibs!
NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, 33, 160, 0)
NULL A 0 A_SpawnItemEx("PLAYERBOOT", 0, 0, 11, 0, 0, 27, -33, 160, 0)
NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 25, 0, 0, 50, random(0,360), 160, 0)
NULL A 0 A_SpawnItemEx("SHOTGUYARM", 0, 0, 36, 0, 0, 32, random(0,360), 160, 0)
NULL A 0 A_SkullPop("Custom_BloodySkull")
NULL A 1 A_SpawnItemEx("GIBBER", 0, 0, 0, 0, 0, 0, 0, 160, 0)
NULL A -1
Stop
}
}

actor MarineStomp : CyborgStomp
{
deathsound "floor/hardx"
+CLIENTSIDEONLY
}


ACTOR DualPistols : Weapon 2102
{
   Weapon.SelectionOrder 1800
   Inventory.PickupSound "weapons/getweapon02"
   Inventory.PickupMessage "You got an extra Pistol!"
   Obituary "%o was shot by %k's Dual Pistols."
   Weapon.AmmoType1 "Clip"
   Weapon.AmmoType2 "GrenadeAmmo"
   Weapon.AmmoGive 0
   Weapon.AmmoUse1 0
   Weapon.AmmoUse2 1
   decal "BulletChip"
   +WEAPON.NOAUTOAIM
   +WIMPY_WEAPON
   +INVENTORY.UNDROPPABLE
   +AMMO_OPTIONAL
   +WEAPON.ALT_AMMO_OPTIONAL
   States
   {
   Spawn:
      PIST A 1
      Stop
   Ready:
      PSTG A 1 A_WeaponReady
      Loop
   Deselect:
      PSTG A 1 A_Lower
      Loop
   Select:
      PSTG A 1 A_Raise
      Loop
   Fire:
      PSTG A 1 A_JumpIfInventory("DoublePistolChecker",1,9)
      PSTG B 0 A_Light1
      PSTG B 0 A_PlayWeaponSound("weapons/pistol") 
      PSTG B 3 Bright A_FireBullets(random(0,1),1,1,5,"BulletPuff2",1) 
      PSTG A 0 A_GiveInventory("DoublePistolChecker",1)
      PSTG A 0 A_Light0
      PSTG CD 2
	  PSTG D 1 A_ReFire
      Goto Ready
      PSTG A 1
      PSTG C 0 A_Light1
      PSTG C 0 A_PlayWeaponSound("weapons/pistol") 
      PSTG E 3 Bright A_FireBullets(random(0,1),1,1,5,"BulletPuff2",1) 
      PSTG A 0 A_TakeInventory("DoublePistolChecker",1)
      PSTG A 0 A_Light0
	  PSTG FG 2
      PSTG G 1 A_ReFire
      Goto Ready
   Altfire:
	  PSTG A 1 A_JumpIfNoAmmo ("NoGrenades") 
	  PSTG A 1 offset (0, 40)
	  PSTG A 1 offset (0, 50)
	  PSTG A 1 offset (0, 60)
	  PSTG A 1 offset (0, 70)
	  PSTG A 1 offset (0, 80)
	  PSTG A 1 offset (0, 90)
	  PSTG A 1 offset (0, 100)
	  PSTG A 1 offset (0, 110)
	  PSTG A 1 offset (0, 120)
	  TNT1 A 6 A_PlayWeaponSound("weapons/grenadepin")
	  HNDG H 1 offset (0, 40)
	  HNDG IJ 1
	  HNDG A 0 A_PlayWeaponSound("weapons/grenadethrow")
	  HNDG K 2 A_FireCustomMissile("ThrowingGrenade", 0, 1, 0, 10)
	  HNDG LMNOPQ 2
	  PSTG A 1 offset (0, 120)
	  PSTG A 1 offset (0, 110)
	  PSTG A 1 offset (0, 100)
	  PSTG A 1 offset (0, 90)
	  PSTG A 1 offset (0, 80)
	  PSTG A 1 offset (0, 70)
	  PSTG A 1 offset (0, 60)
	  PSTG A 1 offset (0, 50)
	  PSTG A 1 offset (0, 40)
	  Goto Ready
	NoGrenades:
	  PSTG A 28 A_PlaySound("weapons/grenadeno")
	  Goto Ready
   }
}

actor Riotgun : Shotgun replaces Shotgun
{
  obituary "%o got pummeled by %k's shotgun."
  radius 20
  height 16
  decal "BulletChip"
  attacksound "weapons/shotgf"
  inventory.pickupmessage "You got the shotgun!"
  weapon.selectionorder 1500
  weapon.kickback 100
  weapon.ammotype "Shell"
  weapon.ammouse 1
  weapon.ammogive 8
  +INVENTORY.UNDROPPABLE
  Weapon.AmmoUse2 1
  Weapon.AmmoType2 "GrenadeAmmo"
  +WEAPON.ALT_AMMO_OPTIONAL
  states
  {
  Spawn:
    SHOT A 1
    stop
  Ready:
    SHTG A 1 A_WeaponReady
    loop
  Deselect: 
    SHTG A 1 A_Lower
    loop
  Select:
    SHTG A 1 A_Raise
    loop
  Fire:
    SHTG A 3
    SHTG E 0 A_GunFlash
    SHTG E 2 A_FireBullets (5, 4, 7, 6, "BulletPuff2")
    SHTG F 3
    SHTG G 2
    SHTG BC 5
    SHTG D 4
    SHTG CB 5
    SHTG A 3
    SHTG A 7 A_ReFire
    goto Ready
  Hold:
    SHTG A 3
    SHTG E 0 A_GunFlash
    SHTG E 2 A_FireBullets (5, 4, 7, 6, "BulletPuff2")
    SHTG F 3
    SHTG G 2
    SHTG BC 5
    SHTG D 4
    SHTG CB 5
    SHTG A 3
    SHTG A 7 A_ReFire
    goto Ready
	Altfire:
	  SHTG A 1 A_JumpIfNoAmmo ("NoGrenades") 
	  SHTG A 1 offset (0, 40)
	  SHTG A 1 offset (0, 50)
	  SHTG A 1 offset (0, 60)
	  SHTG A 1 offset (0, 70)
	  SHTG A 1 offset (0, 80)
	  SHTG A 1 offset (0, 90)
	  SHTG A 1 offset (0, 100)
	  SHTG A 1 offset (0, 110)
	  SHTG A 1 offset (0, 120)
	  TNT1 A 6 A_PlayWeaponSound("weapons/grenadepin")
	  HNDG H 1 offset (0, 40)
	  HNDG IJ 1
	  HNDG A 0 A_PlayWeaponSound("weapons/grenadethrow")
	  HNDG K 2 A_FireCustomMissile("ThrowingGrenade", 0, 1, 0, 10)
	  HNDG LMNOPQ 2
	  SHTG A 1 offset (0, 120)
	  SHTG A 1 offset (0, 110)
	  SHTG A 1 offset (0, 100)
	  SHTG A 1 offset (0, 90)
	  SHTG A 1 offset (0, 80)
	  SHTG A 1 offset (0, 70)
	  SHTG A 1 offset (0, 60)
	  SHTG A 1 offset (0, 50)
	  SHTG A 1 offset (0, 40)
	  Goto Ready	
  Flash:
    NULL A 4 bright A_Light1
    NULL A 3 bright A_Light2
    NULL A 0 bright A_Light0
    stop
	NoGrenades:
	  SHTG A 28 A_PlaySound("weapons/grenadeno")
	  Goto Ready
  }
}

ACTOR DoublePistolChecker : Inventory
{
   Inventory.Amount 1
   Inventory.MaxAmount 1
}

ACTOR Machinegun : Weapon 2109
{
   Weapon.SelectionOrder 680
   Inventory.PickupSound "weapons/getweapon04"
   Inventory.PickupMessage "The Machine Gun!"
   Obituary "%o was fully perforated by %k's Machine Gun."
   Weapon.AmmoType1 "Clip"
   Weapon.AmmoGive 20
   decal "BulletChip"
   Weapon.AmmoUse1 1
   Scale 0.8
   Weapon.AmmoUse2 1
   Weapon.AmmoType2 "GrenadeAmmo"
   +WEAPON.ALT_AMMO_OPTIONAL
   States
   {
   Spawn:
      MG2W A 1
      Stop
   Ready:
      CHG2 A 1 A_WeaponReady
      Loop
   Deselect:
      CHG2 A 1 A_Light0
      CHG2 A 1 A_Lower
      Goto Deselect+1
   Select:
      CHG2 A 1 A_Raise
      Loop
   Fire:
	  CHG2 A 2
      CHG2 B 0 A_Light1
      CHG2 B 0 A_PlayWeaponSound("weapons/chngun2fire1")
      CHG2 B 0 A_Recoil(0.2)
      CHG2 B 4 Bright A_FireBullets(4,3,1,5,"BulletPuff2",1)
      CHG2 B 0 A_CheckReload
      CHG2 C 0 A_PlayWeaponSound("weapons/chngun2fire1")
      CHG2 C 0 A_Recoil(0.2)
      CHG2 C 4 Bright A_FireBullets(4,3,1,5,"BulletPuff2",1)
      CHG2 C 0 A_ReFire
      CHG2 A 16 A_Light0
      CHG2 D 20
      Goto Ready
   Hold:
      CHG2 B 0 A_Light2
      CHG2 B 0 A_PlayWeaponSound("weapons/chngun2fire1")
      CHG2 B 0 A_Recoil(0.2)
      CHG2 B 4 Bright A_FireBullets(4,3,1,5,"BulletPuff2",1)
      CHG2 B 0 A_CheckReload
      CHG2 C 0 A_PlayWeaponSound("weapons/chngun2fire1")
      CHG2 C 0 A_Recoil(0.2)
      CHG2 C 4 Bright A_FireBullets(4,3,1,5,"BulletPuff2",1)
      CHG2 C 0 A_ReFire
      CHG2 A 8 A_Light0
      CHG2 D 28
      Goto Ready
   Altfire:
	  CHG2 A 1 A_JumpIfNoAmmo ("NoGrenades") 
	  CHG2 A 1 offset (0, 40)
	  CHG2 A 1 offset (0, 50)
	  CHG2 A 1 offset (0, 60)
	  CHG2 A 1 offset (0, 70)
	  CHG2 A 1 offset (0, 80)
	  CHG2 A 1 offset (0, 90)
	  CHG2 A 1 offset (0, 100)
	  CHG2 A 1 offset (0, 110)
	  CHG2 A 1 offset (0, 120)
	  TNT1 A 6 A_PlayWeaponSound("weapons/grenadepin")
	  HNDG H 1 offset (0, 40)
	  HNDG IJ 1
	  HNDG A 0 A_PlayWeaponSound("weapons/grenadethrow")
	  HNDG K 2 A_FireCustomMissile("ThrowingGrenade", 0, 1, 0, 10)
	  HNDG LMNOPQ 2
	  CHG2 A 1 offset (0, 120)
	  CHG2 A 1 offset (0, 110)
	  CHG2 A 1 offset (0, 100)
	  CHG2 A 1 offset (0, 90)
	  CHG2 A 1 offset (0, 80)
	  CHG2 A 1 offset (0, 70)
	  CHG2 A 1 offset (0, 60)
	  CHG2 A 1 offset (0, 50)
	  CHG2 A 1 offset (0, 40)
	  Goto Ready
	NoGrenades:
	  CHG2 A 28 A_PlaySound("weapons/grenadeno")
	  Goto Ready
}
}

actor GrenadeAmmo : Ammo
{
  inventory.pickupmessage "Picked up a grenade."
  inventory.amount 1
  inventory.maxamount 50
  inventory.icon "PGRND0"
  ammo.backpackamount 10
  ammo.backpackmaxamount 100
  states
  {
  Spawn:
    PGRN A -1
    stop
  }
}

actor ThrowingGrenade
{
radius 7
height 5
PROJECTILE
+DOOMBOUNCE
damagetype "Grenade"
+BOUNCEONACTORS
- NOGRAVITY
Obituary "%o was blown to bits by %k."
speed 19
scale 0.38
bouncecount 2
bouncefactor 0.5
reactiontime 5
seesound "weapons/grenadebounce"
deathsound "weapons/grenadeexplode"
States
{
Spawn:
HGRN A 0
HGRN A 0 ThrustThingZ(0, 20, 0, 1)
HGRN ABCDEF 2
HGRN A 0 A_Countdown
Goto Spawn+2
Death:
NKXP A 0 A_SpawnItemEx("GrenadeExplosion", 0, 0, 0, 0, 0, 0, 0, 128, 0)
NKXP A 1 A_Explode(128,170,1)
Stop
}
}

actor GrenadeExplosion
{
renderstyle translucent
alpha 1.0
+NOGRAVITY
-SOLID
+NOBLOCKMAP
radius 1
height 1
States
{
Spawn:
NKXP BCDEFGHIJKLMNOPQRSTUV 2 bright A_FadeOut(0.04)
Stop
}
}

actor BulletPuff2 : BulletPuff
{
States
{
  Spawn:
  PUFF A 0
    PUFF A 4 bright A_PlaySound("puff/ric")
    PUFF B 4
    // Intentional fall-through
  Melee:
    PUFF CD 4
    stop

}
}