actor MonsterMasterClass : playerpawn

{
  Speed 1//0.7
  Health 1
  Radius 16 //0
  Height 0 //0
  Mass 100
  PainChance 0
  Player.ViewHeight 25
  Player.DisplayName "PuppetMaster"
  Player.SoundClass  "PuppetMaster"
  Player.StartItem     mastergun
  Player.WeaponSlot 1, mastergun
  FloatSpeed 1
  
  // immune to everything 
  DamageFactor "MarineDamage", 0
  DamageFactor "BFGSplash", 0
  DamageFactor "MarineRLDamage", 0
  DamageFactor "MarineRail", 0
  DamageFactor "MarineSuperweapon", 0
  DamageFactor "MarineKickBasic", 0
  DamageFactor "MarineKickPowered", 0
  DamageFactor "PorkDamage", 0
  
  DamageFactor "CybYamato", 0
  DamageFactor "KirGrenDamage", 0
  DamageFactor "ImpBallDamage", 0
  DamageFactor "Control", 0
  DamageFactor "CacoDamage", 0
  DamageFactor "SkelDamage", 0
  DamageFactor "FatsoDamage", 0
  DamageFactor "KnightDamage", 0
  DamageFactor "ArachDamage", 0
  DamageFactor "ZombiesDamage", 0
  DamageFactor "ZombiesFCDamage", 0
  DamageFactor "viledamage", 0
  DamageFactor "Slime", 0
  DamageFactor "CybRLDamage", 0
  
  RenderStyle "None"
  -NOBLOODDECALS
  -DONTSPLASH
  -NOINTERACTION
  -SHOOTABLE
  -SOLID
  -PICKUP
  -TELESTOMP
  -FRIENDLY
  +CANNOTPUSH
  +NONSHOOTABLE
  +NOTARGET
  
  SPECIES "PuppetPlayerSpecies" //added - simultaneous teleporting
  //Team "PuppetPlayerTeam" //added
  
  limitedtoteam 1
  
  States
  {
  Spawn:
	NULL A 1
	NULL A 4 A_SpawnItemEx ("MGhost",-20,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	LOOP

  See:
	NULL A 1
	NULL A 0 SetPlayerProperty (0, 1, 1)
	NULL A 0 SetPlayerProperty (0, 1, 3)
	NULL A 0 A_changeflag("float",1)
	NULL A 0 A_changeflag("nogravity",1)
	NULL A 0 A_changeflag("NOBLOCKMAP",1) //new
	NULL A 0 A_changeflag("NOBLOCKMONST",1) //new
	NULL A 0 A_changeflag("NOTRIGGER",1) //moved from spawn
	NULL A 0 A_changeflag("NOCLIP",1) //new, ZAN 2.1.2 gibbed marines on spawn with this flag
	//NULL A 0 A_SetSize(0,0)// //to be able walk through walls better
		NULL A 0 A_GIVEINVENTORY("mastergun",1)
		NULL A 0 A_SELECTWEAPON("MASTERGUN")
		NULL A 0 A_GIVEINVENTORY("active",1)
	NULL A 0 Thing_ChangeTid(0,144)
	//NULL A 0 A_SetSize(0,-1,0) //does not work setting 0 radius
  See2:
	NULL A 4 A_SpawnItemEx ("MGhost",-20,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	LOOP

  Missile:
	NULL A 1
	goto see

  Death:
	NULL A 1 A_hidething
	NULL A 1 A_TakeInventory("onteam",1)
	NULL A -1 
	stop
  }
}

actor MGhost
{
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  RenderStyle add
  Alpha 0.20
  scale 0.7
  +RANDOMIZE
  +NOTRIGGER //added - avoid issues in level design
  
  States
  {	
  Spawn:
    SPIR A 3
    SPIR B 3 Thing_ChangeTid(0,143)
    
  Death:
    SPIR AB 3
    TNT1 A  0
    TNT1 A  1 Thing_Remove(143)
    STOP
  }
}

ACTOR MDeathGhost
{
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  RenderStyle add
  alpha 1
  scale 0.8
  +NOTRIGGER //added - avoid issues in level design
  
  States
  {
  Spawn:
    SPIR EFGHIJ 3
    stop
  }
}


// Player kill count
actor Mskull : Inventory
{
  inventory.amount 1
  inventory.maxamount 9999 //6
  states
  {
  Spawn:
    NULL A -1
    stop
  }
}


// Total teamkill counter per level
actor Teamkill : Inventory
{ Inventory.Amount 0
Inventory.MaxAmount 9999
+Inventory.Undroppable }

// Total teamkill counter per level
actor CourtMartialled : Inventory
{ Inventory.Amount 0
Inventory.MaxAmount 1
+Inventory.Undroppable }

// Individual death counter per level
actor MarineManDown : Inventory
{ Inventory.Amount 0
Inventory.MaxAmount 9999
+Inventory.Undroppable }



actor ACtive : Inventory
{
  inventory.amount 1
  inventory.maxamount 6
}

actor onteam : Inventory
{
  inventory.maxamount 1
}

actor closeit : Inventory
{
  inventory.maxamount 700
}


//Added
Actor FHeat: Inventory
{
}

//Puppet 3 nuke counter per level
actor PuppetYamatoLimit : Inventory
{ Inventory.Amount 0
Inventory.MaxAmount 5
+Inventory.Undroppable }

//Puppet Push AltFire limitation
actor PuppetPushLimit : Inventory
{ Inventory.Amount 0
Inventory.MaxAmount 8
+Inventory.Undroppable }

//Puppet Flame AltFire limitation
actor PuppetFlameLimit : Inventory
{ Inventory.Amount 0
Inventory.MaxAmount 54
+Inventory.Undroppable }