ACTOR SFortWrench : Weapon
{
  Weapon.SelectionOrder 4000
  Inventory.RestrictedTo "PioneerPlayer"
  Tag "Wrench"
  +WEAPON.NOAUTOAIM
  +WEAPON.NOLMS
  +WEAPON.ALLOW_WITH_RESPAWN_INVUL
  States
  {
  Ready:
	PIPW A 1 A_WeaponReady(WRF_ALLOWRELOAD)
	Loop
  Deselect:
	PIPW A 0 A_Lower
	Loop
  Select:
	PIPW A 1 A_Raise
	Loop
  Fire:
	TNT1 A 0 A_TakeInventory("PowerInvulnerable",1)
	TNT1 A 0 ACS_NamedExecute("SentryPlacing",0)
	PIPW A 1 A_SpawnItemEx("SentryGunShadow", 35, 0, 4, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION|SXF_CLIENTSIDE)
	TNT1 A 0 A_Refire("Fire")
	TNT1 A 0 A_CustomPunch(200,true,0,"SFortWrenchPuff",96)
	TNT1 A 0 A_Playsound("weapons/wrench",CHAN_WEAPON)
	TNT1 A 0 A_ChangeFlag(ISMONSTER,1)
	TNT1 A 0 A_SpawnItemEx("SentryGun", 35, 0, 4, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERTRANSLATION)
	TNT1 A 0 A_ChangeFlag(ISMONSTER,0)
	PIPW BCDEFGHI 1
	TNT1 A 12
	PIPW CB 1
	Goto Ready
  AltFire:
	TNT1 A 0 A_TakeInventory("PowerInvulnerable",1)
	TNT1 A 0 ACS_NamedExecute("DispenserPlacing",0)
	PIPW A 1 A_SpawnItemEx("DispenserShadow", 35, 0, 4, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION|SXF_CLIENTSIDE)
	TNT1 A 0 A_Refire("AltFire")
	TNT1 A 0 A_CustomPunch(200,true,0,"SFortWrenchPuff",96)
	TNT1 A 0 A_Playsound("weapons/wrench",CHAN_WEAPON)
	TNT1 A 0 A_ChangeFlag(ISMONSTER,1)
	TNT1 A 0 A_SpawnItemEx("Dispenser", 35, 0, 4, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERTRANSLATION)
	TNT1 A 0 A_ChangeFlag(ISMONSTER,0)
	PIPW BCDEFGHI 1
	TNT1 A 12
	PIPW CB 1
	Goto Ready
  Reload:
    TNT1 A 0 A_Print("$INFO_PIONEER",0.0625)
    Goto Ready
  }
}

ACTOR SFortWrenchPuff : FistHitPuff
{
  SeeSound "weapons/wrenchhit"
  AttackSound "weapons/wrenchwall"
  DamageType "Wrench"
  Decal BulletChip
  States
  {
  Spawn:
	PUFF CD 3
    Stop
  }
}

/*
ACTOR SFortScrewgun : Weapon
{
  Weapon.AmmoType "Shell"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 4
  Inventory.PickupSound "misc/w_pkup"
  Inventory.PickupMessage "You got the screwgun!"
  Inventory.RestrictedTo "PioneerPlayer"
  Tag "Screwgun"
  +WEAPON.NOAUTOAIM
  +WEAPON.NOLMS
  +WEAPON.ALLOW_WITH_RESPAWN_INVUL
  States
  {
  Spawn:
    NLSG D -1
    Stop
  Deselect:
    NLSG A 0 A_Lower
    Loop
  Select:
    NLSG A 0 A_Raise
    NLSG A 1 A_Raise
    Loop
  Ready:
    NLSG A 1 A_WeaponReady
    Loop
  Fire:
    TNT1 A 0 A_Playsound("weapons/screwgf",CHAN_WEAPON)
    TNT1 A 0 A_FireCustomMissile("Screw",-5.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",-4.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",-3.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",-2.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",-1.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",-0.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",0.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",1.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",2.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",3.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",4.5,0,0,0,0,frandom(-1,1))
    TNT1 A 0 A_FireCustomMissile("Screw",5.5,1,0,0,0,frandom(-1,1))
    NLSG BCB 2 Bright
    NLSG A 18
    TNT1 A 0 A_Refire
    Goto Ready
  Flash:
    TNT1 A 6 A_Light1
    Goto LightDone
  AltFire:
	TNT1 A 0 A_TakeInventory("PowerInvulnerable",1)
	PIPW CB 1 A_SpawnItemEx("SentryGunShadow", 35, 0, 4, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION|SXF_CLIENTSIDE)
  AltHold:
	TNT1 A 0 ACS_NamedExecute("SentryPlacing",0)
	PIPW A 1 A_SpawnItemEx("SentryGunShadow", 35, 0, 4, 0, 0, 0, 0, SXF_TRANSFERTRANSLATION|SXF_CLIENTSIDE)
	TNT1 A 0 A_Refire("AltHold")
	TNT1 A 0 A_ChangeFlag(ISMONSTER,1)
	TNT1 A 0 A_SpawnItemEx("SentryGun", 35, 0, 4, 0, 0, 0, 0, SXF_SETMASTER|SXF_TRANSFERTRANSLATION)
	TNT1 A 0 A_ChangeFlag(ISMONSTER,0)
	PIPW BCDEFGHI 1
	TNT1 A 6
	Goto Ready
	}
}

ACTOR Screw : Nail
{
	Damage (12)
	Speed 125
	Scale 0.5
	Obituary "%o was screwed by %k."
	States
	{
	XDeath:
      TNT1 A 0
      TNT1 A 1 A_Playsound("weapons/nailhit",CHAN_AUTO,0.5)
      Stop
	}
}*/

ACTOR PioneerFist : SFortFist
{
  Inventory.RestrictedTo "PioneerPlayer"
  States
  {
  Reload:
    TNT1 A 0 A_Print("$INFO_PIONEER",0.0625)
    Goto Ready
  }
}

ACTOR PioneerPistol : SFortPistol
{
  Inventory.RestrictedTo "PioneerPlayer"
  States
  {
  Reload:
    TNT1 A 0 A_Print("$INFO_PIONEER",0.0625)
    Goto Ready
  }
}

ACTOR PioneerShotgun : SFortShotgun
{
  Inventory.RestrictedTo "PioneerPlayer"
  States
  {
  Reload:
    TNT1 A 0 A_Print("$INFO_PIONEER",0.0625)
    Goto Ready
  }
}

ACTOR PioneerNailgun : SFortNailgun
{
  Inventory.RestrictedTo "PioneerPlayer"
  States
  {
  Reload:
    TNT1 A 0 A_Print("$INFO_PIONEER",0.0625)
    Goto Ready
  }
}

ACTOR PioneerToken : Inventory {}

ACTOR SentryGunShadow
{
	Projectile
	Radius 14
	Height 56
	Speed 0
	Alpha 0.5
	Renderstyle Translucent
	+NOGRAVITY
	+TOUCHY
	+CLIENTSIDEONLY
	-DROPOFF
	States
	{
	Spawn:
	  TNT1 A 0
	  SENT A 1
	  Stop
	Death:
	  TNT1 A 1
	  Stop
	}
}

ACTOR SentryGun
{
  Obituary "%o was ventilated by %k's Sentry."
  Health 200
  Radius 14
  Height 56
  Mass 1000000000
  AttackSound "sentry/attack"
  ActiveSound "sentry/active"
  MONSTER
  Species "Sentry"
  MinMissileChance 0
  PainChance 0
  MaxTargetRange 720
  Tag "Sentry Gun"
  DamageType "Bullet"
  DamageFactor "PlasmaGrenade", 10.0
  DamageFactor "Melee", 2.0
  DamageFactor "Plasma", 2.0
  DamageFactor "Pulse", 2.0
  DamageFactor "Lightning", 2.0
  DamageFactor "ScorcherFire", 0.0
  -SOLID
  +DONTBLAST
  +FLOORCLIP
  +NOBLOOD
  +NOPAIN
  +PAINLESS
  +LOOKALLAROUND
  +NEVERRESPAWN
  +NOINFIGHTING
  +STANDSTILL
  +FRIENDLY
  +DONTIDENTIFYTARGET
  States
  {
  Missile:
  // Missile goes to spawn state at first, because if the sentry is attacked
  // when it's being summoned, it would immediately retaliate and skip the
  // spawning of the sentry completely.
	TNT1 A 0
    TNT1 A 0 A_JumpIfInventory("SentryActiveToken",1,"Shoot")
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_GiveToSiblings("SentryRemover",1)//A_RemoveSiblings(1)
	TNT1 A 0 A_PlaySound("Sentry/Building")
	TNT1 A 0 A_JumpIf(CallACS("PioneerGamemodeCheck") == 1,"FastSpawn")
	SENT C 280 A_GiveInventory("SentryBuildingToken",1,AAPTR_MASTER)
	TNT1 A 0 A_GiveInventory("SentryActiveToken")
    TNT1 A 0 A_GiveInventory("SentryCompleteToken",1,AAPTR_MASTER)
	TNT1 A 0 A_PlaySound("Sentry/Ready",CHAN_AUTO)
	Goto Idle
  FastSpawn:
	SENT C 140 A_GiveInventory("FastSentryBuildingToken",1,AAPTR_MASTER)
    Goto Spawn+5
  Idle:
	SENT A 1 A_ClearTarget
  // The FLOAT flag makes the sentry able to target enemies from a ledge:
	TNT1 A 0 A_ChangeFlag(FLOAT,1)
    SENT A 1 A_Look
  // But it still needs to have gravity in case it's on the ledge of a lift, for example:
	TNT1 A 0 A_ChangeFlag(FLOAT,0)
    SENT A 1 A_Look
	TNT1 A 0 A_Jump(1,"SeeSound")
	TNT1 A 0 A_JumpIfInventory("PioneerToken",1,"See",AAPTR_MASTER)
	Goto Death.SelfDestruct
  IdleSound:
    TNT1 A 0 A_Playsound("Sentry/Active",CHAN_VOICE)
	Goto Idle
  See:
	TNT1 A 0 A_ChangeFlag(FLOAT,1)
    SENT A 1 A_Chase("","Missile",CHF_NOPLAYACTIVE)
	TNT1 A 0 A_ChangeFlag(FLOAT,0)
    SENT A 1 A_Chase("","Missile",CHF_NOPLAYACTIVE)
	TNT1 A 0 A_Jump(1,"SeeSound")
	TNT1 A 0 A_JumpIfInventory("PioneerToken",1,"See",AAPTR_MASTER)
	Goto Death.SelfDestruct
  SeeSound:
    TNT1 A 0 A_Playsound("Sentry/Active",CHAN_VOICE)
	Goto See
  Shoot:
	TNT1 A 0 A_JumpIfInventory("PowerGhostStealth9",1,"Idle",AAPTR_TARGET)
	TNT1 A 0 A_ChangeFlag(FLOAT,0)
	TNT1 A 0 A_PlaySound("Sentry/Target")
    SENT A 2 Bright A_FaceTarget
    SENT A 2 A_FaceTarget
    SENT A 2 Bright A_FaceTarget
    SENT A 2 A_FaceTarget
    SENT A 2 Bright A_FaceTarget
    SENT A 3 A_FaceTarget
	TNT1 A 0 A_MonsterRefire(0,"Idle")
	TNT1 A 0 A_JumpIfInventory("PioneerToken",1,"ShootLoop",AAPTR_MASTER)
	Goto Death.SelfDestruct
  ShootLoop:
	TNT1 A 0 A_JumpIfInventory("SentryAmmoFired",50,"ShootEmpty")
	TNT1 A 0 A_GiveInventory("SentryAmmoFired",1)
    SENT B 2 Bright A_CustomBulletAttack(1.5,1.5,1,15,"SFortBulletPuff",976,CBAF_NORANDOM)
    SENT A 1 A_MonsterRefire(0,"Idle")
    SENT B 2 Bright A_CustomBulletAttack(1.5,1.5,1,15,"SFortBulletPuff",976,CBAF_NORANDOM)
    SENT A 1 A_MonsterRefire(0,"Idle")
	TNT1 A 0 A_JumpIfCloser(976,"ShootLoop")
    Goto Idle
  ShootEmpty:
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_GiveInventory("SentryAmmoDepletedToken",1,AAPTR_MASTER)
    SENT A 3 A_Playsound("Sentry/Empty",CHAN_WEAPON)
    SENT A 2 A_Playsound("Sentry/Empty",CHAN_WEAPON)
	Goto ShootLoop+5
  Death:
    TNT1 A 0 A_GiveInventory("SentryDestroyedToken",1,AAPTR_MASTER)
	SENT # 1
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_ChangeFlag(SHOOTABLE,false)
    SENT D 1 A_PlaySound("Sentry/Death")
    TNT1 A 0 A_PlaySoundEx("weapons/rocklx", "SoundSlot6")
    TNT1 A 0 A_PlaySoundEx("weapons/debris", "SoundSlot7")
    TNT1 A 0 A_SpawnItem ("SentryBoom", 0, 48)
    SENT DDDDDDDDDDDDDDDDD 1 A_SpawnItemEx("SentrySpark", frandom(-2,2),frandom(-2,2), 32, frandom(-5,5),random(-5,5),random(0,10),random(0,359))
    SENT DDDDDDDDD 2 A_SpawnItemEx("SentrySpark", frandom(-2,2),frandom(-2,2), 32, frandom(-5,5),random(-5,5),random(0,10),random(0,359))
    SENT DDDDDDD 5 A_SpawnItemEx("SentrySpark", frandom(-2,2),frandom(-2,2), 32, frandom(-5,5),random(-5,5),random(0,10),random(0,359))
  FadeOut:
    SENT D 2 A_FadeOut (0.1)
    loop
  Death.SelfDestruct:
    SENT # 10
	TNT1 A 0 A_NoBlocking
	TNT1 A 95
	Stop
  }
}

ACTOR SentryAmmoFired : Inventory
{
	Inventory.MaxAmount 50
}

ACTOR SentryBoom
{
  radius 2
  height 2
  renderstyle Add
  Alpha 0.5
  +NOINTERACTION
  +CLIENTSIDEONLY
  states
  {
  Spawn:
    XPL1 ABCDEF 3 bright
    stop
  }
}

ACTOR SentrySpark : BulletPuff
{
	VSpeed 0
	-NOGRAVITY
}


ACTOR SentryActiveToken : Inventory
{
	Inventory.MaxAmount 1
}

ACTOR SentryBuildingToken : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	-INVENTORY.INVBAR
	+CLIENTSIDEONLY
	Inventory.MaxAmount 1
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedTerminate("SentryBuilding",0)
	  TNT1 A 0 ACS_NamedExecute("SentryBuildingStart",0)
	  Stop
	}
}

ACTOR FastSentryBuildingToken : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	-INVENTORY.INVBAR
	+CLIENTSIDEONLY
	Inventory.MaxAmount 1
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedTerminate("FastSentryBuilding",0)
	  TNT1 A 0 ACS_NamedExecute("FastSentryBuildingStart",0)
	  Stop
	}
}

ACTOR SentryCompleteToken : SentryBuildingToken
{
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedExecute("SentryComplete",0)
	  Stop
	}
}

ACTOR SentryDestroyedToken : SentryBuildingToken
{
	-CLIENTSIDEONLY
	Inventory.MaxAmount 1
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedTerminate("SentryBuilding",0)
	  TNT1 A 0 ACS_NamedTerminate("FastSentryBuilding",0)
	  TNT1 A 0 ACS_NamedExecute("SentryDestroyed",0)
	  TNT1 A 0 ACS_NamedExecute("SentryDestroyedGlobal",0)
	  Stop
	}
}

ACTOR SentryAmmoDepletedToken : SentryBuildingToken
{
	Inventory.MaxAmount 1
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedExecute("SentryAmmoDepleted",0)
	  Stop
	}
}

ACTOR SentryRemover : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	-INVENTORY.INVBAR
	States
	{
	Pickup:
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("SentryRemoverChecker") == 1,"Remove")
	  Stop
	Remove:
	  TNT1 A 1 Thing_Remove(0)
	  Stop
	}
}

ACTOR DispenserShadow
{
	Projectile
	Radius 16
	Height 56
	Speed 0
	Scale 0.7
	Alpha 0.5
	Renderstyle Translucent
	+NOGRAVITY
	+TOUCHY
	+CLIENTSIDEONLY
	-DROPOFF
	States
	{
	Spawn:
	  TNT1 A 0
	  DISP I 1
	  Stop
	Death:
	  TNT1 A 1
	  Stop
	}
}

ACTOR Dispenser
{
	Health 200
	Radius 16
	Height 56
	Scale 0.7
	Mass 1000000000
	MONSTER
	PainChance 0
	Tag "Dispenser"
	Species "Dispenser"
	DamageFactor "PlasmaGrenade", 10.0
	DamageFactor "Melee", 2.0
	DamageFactor "Plasma", 2.0
	DamageFactor "Pulse", 2.0
	DamageFactor "Lightning", 2.0
	DamageFactor "ScorcherFire", 0.0
	-SOLID
	+DONTBLAST
	-NOGRAVITY
	+FLOORCLIP
	+NOBLOOD
	+NEVERRESPAWN
	+STANDSTILL
	+FRIENDLY
	+DONTIDENTIFYTARGET
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 0 A_GiveToSiblings("DispenserRemover",1)
      TNT1 A 0 A_PlaySound("Sentry/Building")
	  TNT1 A 0 A_JumpIf(CallACS("PioneerGamemodeCheck") == 1,"FastSpawn")
	  DISP J 280 A_GiveInventory("DispenserBuildingToken",1,AAPTR_MASTER)
      TNT1 A 0 A_GiveInventory("DispenserCompleteToken",1,AAPTR_MASTER)
	  TNT1 A 0 A_PlaySound("Sentry/Ready",CHAN_AUTO)
	  Goto Idle
	FastSpawn:
	  DISP J 140 A_GiveInventory("FastDispenserBuildingToken",1,AAPTR_MASTER)
	  Goto Spawn+5
	Idle:
	  TNT1 A 0
	  TNT1 A 0 A_Jump(32,"IdleB")
	  DISP A 4 A_RadiusGive("DispenserItem",128,RGF_PLAYERS,1)
	  DISP BCD 4
	  TNT1 A 0 A_JumpIfInventory("PioneerToken",1,"Idle2",AAPTR_MASTER)
	  Goto Death.SelfDestruct
	IdleB:
	  TNT1 A 0 A_PlaySound("Dispenser/Idle",CHAN_AUTO)
	  DISP I 4 A_RadiusGive("DispenserItem",128,RGF_PLAYERS,1)
	  DISP BCD 4
	  TNT1 A 0 A_JumpIfInventory("PioneerToken",1,"Idle2",AAPTR_MASTER)
	  Goto Death.SelfDestruct
	Idle2:
	  DISP E 4 A_RadiusGive("DispenserItem",128,RGF_PLAYERS,1)
	  DISP FGH 4
	  TNT1 A 0 A_JumpIfInventory("PioneerToken",1,"Idle",AAPTR_MASTER)
	  Goto Death.SelfDestruct
    Death:
	  TNT1 A 0 A_GiveInventory("DispenserDestroyedToken",1,AAPTR_MASTER)
	  DISP # 1
	  TNT1 A 0 A_NoBlocking
      DISP K 1 A_PlaySound("Sentry/Death")
      TNT1 A 0 A_PlaySoundEx("weapons/rocklx", "SoundSlot6")
      TNT1 A 0 A_PlaySoundEx("weapons/debris", "SoundSlot7")
      TNT1 A 0 A_SpawnItem ("SentryBoom", 0, 56)
	  DISP KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK 1 A_SpawnItemEx("SentrySpark", frandom(-2,2),frandom(-2,2), 32, frandom(-5,5),random(-5,5),random(0,10),random(0,359))
	  DISP KKKKKKK 5 A_SpawnItemEx("SentrySpark", frandom(-2,2),frandom(-2,2), 32, frandom(-5,5),random(-5,5),random(0,10),random(0,359))
	FadeOut:
      DISP K 2 A_FadeOut (0.1)
      Loop
	Death.SelfDestruct:
	  DISP # 10
	  TNT1 A 0 A_NoBlocking
	  TNT1 A 95
	  Stop
	}
}

ACTOR DispenserItem : CustomInventory
{
	Inventory.PickupMessage "Received Dispenser health, armor & ammo."
	+INVENTORY.AUTOACTIVATE
	-INVENTORY.INVBAR
	States
	{
	Pickup:
	  TNT1 A 0 A_PlaySound("dispenser/pkup",CHAN_BODY)
	  TNT1 A 0 A_PlaySound("misc/ammo_pkup",CHAN_6)
	  TNT1 A 0 A_PlaySound("misc/bonus_pkup",CHAN_ITEM)
	  TNT1 A 0 A_JumpIfInventory("GunnerToken",1,"GunnerPickup")
	  TNT1 A 0 A_JumpIfInventory("CyborgToken",1,"GunnerPickup")
	  TNT1 A 0 A_JumpIfHealthLower(100,"Stimpack")
	MediDone:
	  TNT1 A 0 A_JumpIfArmorType("SFortRedArmor","RedArmor",1)
	  TNT1 A 0 A_JumpIfArmorType("SFortRedArmor2","RedArmor",1)
	  TNT1 A 0 A_GiveInventory("DispenserArmorBonus",1)
	ArmorDone:
	  TNT1 A 0 A_GiveInventory("DispenserClip",10)
	  TNT1 A 0 A_GiveInventory("DispenserShell",4)
	  TNT1 A 0 A_GiveInventory("DispenserRocketAmmo",1)
	  TNT1 A 0 A_GiveInventory("DispenserCell",20)
	  Stop
	Stimpack:
	  TNT1 A 0 A_PlaySound("misc/health_pkup",CHAN_ITEM)
	  TNT1 A 0 A_GiveInventory("SFortStimpack",1)
	  Goto MediDone
	GunnerPickup:
	  TNT1 A 0 A_JumpIfHealthLower(200,"Stimpack")
	  Goto MediDone
	RedArmor:
	  TNT1 A 0 A_GiveInventory("DispenserRedArmorBonus",1)
	  Goto ArmorDone
	}
}

ACTOR DispenserBuildingToken : SentryBuildingToken
{
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedTerminate("DispenserBuilding",0)
	  TNT1 A 0 ACS_NamedExecute("DispenserBuildingStart",0)
	  Stop
	}
}

ACTOR FastDispenserBuildingToken : SentryBuildingToken
{
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedTerminate("FastDispenserBuilding",0)
	  TNT1 A 0 ACS_NamedExecute("FastDispenserBuildingStart",0)
	  Stop
	}
}

ACTOR DispenserCompleteToken : SentryBuildingToken
{
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedExecute("DispenserComplete",0)
	  Stop
	}
}

ACTOR DispenserDestroyedToken : SentryBuildingToken
{
	States
	{
	Pickup:
	  TNT1 A 0 ACS_NamedTerminate("FastSentryBuilding",0)
	  TNT1 A 0 ACS_NamedTerminate("DispenserBuilding",0)
	  TNT1 A 0 ACS_NamedExecute("DispenserDestroyed",0)
	  Stop
	}
}

ACTOR DispenserRemover : SentryRemover
{
	+INVENTORY.AUTOACTIVATE
	-INVENTORY.INVBAR
	States
	{
	Pickup:
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("DispenserRemoverChecker") == 1,"Remove")
	  Stop
	Remove:
	  TNT1 A 0 Thing_Remove(0)
	  Stop
	}
}