Actor IsCameronClass  : ClassToken {}

ACTOR CameronClass : PlayerPawn
{
  Health 150
  Player.MaxHealth 150
  Radius 16
  Height 56
  Mass 100
  PainChance 255
  Player.DisplayName "Cameron"
  Player.CrouchSprite "CMRC"
  Player.StartItem "CamRifle"
  Player.StartItem "CamPistol"
  Player.StartItem "CamWrench"
  Player.StartItem "CamPistolAmmo", 36
  Player.StartItem "CamPistolMagazine", 12
  Player.StartItem "CamShotgunMagazine", 8
  Player.StartItem "CamRifleMagazine", 30
  Player.StartItem "CamRifleAmmo", 90
  Player.StartItem "CamChaingunBelt", 100
  Player.StartItem "CamRocketPack", 5
  Player.StartItem "CamLaserCell", 50
  Player.StartItem "IsCameronClass", 1
  Player.StartItem "CameronRegeneration", 1
  Player.ColorRange 112, 127
  Player.StartItem "DefaultHud", 1
  Player.ScoreIcon "CAMICON"
  Species "Player"
  Player.SoundClass "Cameron"
  Player.WeaponSlot 1, CamWrench
  Player.WeaponSlot 2, CamPistol
  Player.WeaponSlot 3, CamShotgun, CamSuperShotgun
  Player.WeaponSlot 4, CamRifle, CamChaingun
  Player.WeaponSlot 5, CamRL
  Player.WeaponSlot 6, CamLaserCannon
  Player.WeaponSlot 7, CamDecimator
  States
  {
  Spawn:
	CMRN A 16
	TNT1 A 0 A_GiveInventory("CameronRegeneration",1)
	TNT1 A 0 A_RADIUSGIVE("CameronHealingFieldPlayers",512,RGF_PLAYERS,1)
	TNT1 A 0 A_RADIUSGIVE("CameronHealingFieldAlliedMonsters",512,RGF_MONSTERS,1)
    Loop
  See:
    CMRN ABCD 4
	CMRN A 0 A_RADIUSGIVE("CameronHealingFieldPlayers",512,RGF_PLAYERS,1)
	CMRN A 0 A_RADIUSGIVE("CameronHealingFieldAlliedMonsters",512,RGF_MONSTERS,1)
    Loop
  Missile:
    CMRN E 12 
    Goto Spawn
  Melee:
    CMRN F 6 BRIGHT
    Goto Missile
  Pain:
    CMRN G 4 
    CMRN G 4 A_Pain
    Goto Spawn
  Death:
    CMRN H 10 A_PlayerScream
    CMRN I 10
    CMRN J 10 A_NoBlocking
    CMRN KLM 10
    CMRN N -1
    Stop
  XDeath:
    CMRN O 5 A_PlayerScream
    CMRN P 5
    CMRN Q 5 A_NoBlocking
    CMRN RSTUV 5
    CMRN W -1
    Stop
  }
}

actor CameronHealingFieldPlayers : CustomInventory
{
  -COUNTITEM
  +INVENTORY.AUTOACTIVATE
  inventory.pickupmessage "Cameron heals you!"
  states
  {
	Pickup:
		TNT1 A 0 ACS_NamedExecuteWithResult("GiveHealthWithItem",10,1)
		Goto CheckPickup
	CheckPickup:
		TNT1 A 0 A_JumpIfInventory("PickedUp", 0, "PickedUp")
		Fail
		PickedUp:
		TNT1 A 0 A_PlaySound("Weapons/medkit", 5)
		TNT1 A 0
		Stop
  }
}

actor CameronHealingFieldAlliedMonsters : CustomInventory
{
    +INVENTORY.AUTOACTIVATE
    Inventory.MaxAmount 0
    States
    {
    Pickup:
        TNT1 A 0 ACS_NamedExecuteWithResult("CameronFriendlyMonsterFilter", 0)
	CheckPickup:
		TNT1 A 0 A_JumpIfInventory("PickedUp", 0, "PickedUp")
		Fail
	PickedUp:
		TNT1 A 0 A_PlaySound("Weapons/medkit", 5)
		TNT1 A 0
        Stop
    }
}

actor CameronRegenerationPower : PowerRegeneration {}

actor CameronRegeneration : PowerupGiver
{
	Inventory.MaxAmount 1
	Inventory.InterHubAmount 0
	Inventory.Icon ""
	+Inventory.AUTOACTIVATE
	+Inventory.ALWAYSPICKUP
	+Inventory.UNTOSSABLE
	Powerup.Type "CameronRegenerationPower"
	Powerup.Strength 5
	Powerup.Duration 0x7FFFFFFF
}
