actor ArachnotronClass : Playerpawn
{
  health 500
  gibhealth 99999 //added - actor can not be gibbed
  radius 56
  height 56
  mass 600
  speed 0.60 //0.3 //0.40 3.0.1
  painchance 128
  Player.DisplayName "Arachnotron"
  Player.MaxHealth 500
  Player.ViewHeight 48
  Player.SoundClass "ArachnotronClass"
  Player.JumpZ 7 //0
  Player.MorphWeapon "ArPlasmaGun"
  Player.WeaponSlot 1, ArPlasmaGun
  
  DamageFactor "Suicide", 0 // puppetmaster can not suicide a monster
  DamageFactor "MarineDamage", 0.6
  DamageFactor "MarineRLDamage", 0.6
  DamageFactor "BFGSplash", 0.6
  DamageFactor "MarineRail", 0.6
  
  DamageFactor "CybRLDamage", 0.25
  DamageFactor "ImpBallDamage", 0
  DamageFactor "CacoDamage", 0
  DamageFactor "SkelDamage", 0
  DamageFactor "FatsoDamage", 0
  DamageFactor "KnightDamage", 0
  DamageFactor "ArachDamage", 0
  DamageFactor "viledamage", 0
  DamageFactor "Control", 0
  DamageFactor "ZombiesDamage", 0
  DamageFactor "Slime", 0
  
  -PICKUP
  +NOSKIN
  +NOPAIN
  -FRIENDLY
  +NOTARGET
  +NOTRIGGER //added - avoid issues in level design
   
  states
  {
  Spawn:
    BSPI A 5 A_PlaySoundEx ("baby/active","body")
    BSPI B 5 // add some here
    BSPI A -1 	
    loop
  See:
    BSPI A 20
    BSPI A 3 A_PlaySoundEx ("baby/walk","body") 
    BSPI ABBCC 3 
    BSPI D 3 A_PlaySoundEx ("baby/walk","body") 
    BSPI DEEFF 3 
    goto See+1
  Missile:
    BSPI G 4
    BSPI H 4 bright
    BSPI G 10
    goto Spawn	
  Death:
    //BSPI A 0 ACS_ExecuteAlways(426,0,4)
    BSPI A 0 A_GiveToTarget ("MarineExp",6)
    BSPI J 20 A_PlaySoundEx ("baby/death","body")
    BSPI K 7 A_NoBlocking
    BSPI L 7 Thing_changeTid(144,0)
    BSPI MNO 7 
    BSPI P 1 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0) //0
	BSPI P -1
    stop
  }
}

// Weapon

actor ArPlasmaGun : Weapon
{
  obituary "%o let %k get %h."
  weapon.kickback 100
  weapon.ammouse 0
  +WEAPON.NOALERT
  +Ammo_Optional
  +WEAPON.DONTBOB
  +WEAPON.CHEATNOTWEAPON
  //+INVENTORY.UNDROPPABLE //added

  states
  {
  Deselect:
    //ARPL A 0 ACS_ExecuteAlways(426,0,4)
    ARPL A 1 A_Lower
    loop
  Select:
    ARPL A 1 A_Raise
    loop
  Ready:
    ARPL ABCDCB 1 A_WeaponReady
    //ARPL A 0 A_JumpIfInventory ("Mskull",0,15)
    //ARPL ABCDCB 1 A_WeaponReady
    //ARPL A 0 A_JumpIfInventory ("Mskull",4,8)
    //ARPL ABCDCB 1 A_WeaponReady
    //ARPL A 0 A_JumpIfInventory ("Mskull",2,1)
	ARPL A 2 HealThing(5)
    Loop
  Fire:
    //ARPL A 0 ACS_ExecuteAlways(426,0,2)
	ARPL E 0 A_JumpIfInventory ("PM_AltFireX",1,"AltFireX")
	ARPL E 0 A_JumpIfInventory ("PM_AltFireY",1,"AltFireY")
	ARPL E 0 A_JumpIfInventory ("PM_AltFireZ",1,"AltFireZ")
    ARPL E 1 bright A_Light1 //2
    ARPL F 1 bright A_Light2 //2 
    ARPL G 1 bright A_FireCustomMissile ("ArPlasm",0,1,0,0,0) //4
    ARPL A 0 A_refire
    //ARPL A 0 ACS_ExecuteAlways(426,0,4)
    Goto Ready
	
  AltFireX:
    ARPL E 0 bright A_Light1 //2
    ARPL F 0 bright A_Light2 //2 
    ARPL G 1 bright A_FireCustomMissile ("ArPlasm",random(-15,15),1,0,0,0) //4
    ARPL A 0 A_refire
    Goto Ready
  AltFireY:
    ARPL E 1 bright A_Light1 //2
    ARPL F 1 bright A_Light2 //2 
	ARPL G 20 A_BFGSound 
    ARPL G 20 A_FireBFG //30
	ARPL A 20
    ARPL A 0 A_refire
    Goto Ready
  AltFireZ:
	ARPL A 0 A_PlaySound("weapons/RailAttackCyber", CHAN_WEAPON, 1, 0, ATTN_NONE)
	ARPL A 12 Bright A_RailAttack(random(16,25)*2, 15, 1, "none", "red", 0, 0, "PuppetCybRailPuff")
	ARPL A 0 A_PlaySound("weapons/RailAttackCyber", CHAN_WEAPON, 1, 0, ATTN_NONE)
	ARPL A 12 Bright A_RailAttack(random(16,25)*2, -15, 1, "none", "red", 0, 0, "PuppetCybRailPuff")
	Goto Ready
	
  AltFire: 
    ARPL A 3 ACS_ExecuteAlways (419,0,10) 
  Goto Ready
    Spawn:
    TNT1 A 0 Thing_Remove (0)
    Stop
  }
}



//AltFire X
actor MPlasmaArachFireAltY
{
  radius 4
  height 1
  speed 12
  alpha 1
  DamageType "ArachDamage"
  renderstyle add
  PROJECTILE
  +NOBLOCKMAP
  +NOGRAVITY
  PROJECTILE
  -BLOODLESSIMPACT
  states
  {
  Spawn:
    PAR3 ABCD 2
	loop
  Death:
    PAR3 ABCD 2
	PAR3 A 0 A_PlaySound("weapon/grenadeexplode", CHAN_WEAPON, 1, 0, ATTN_NORM)
	PAR3 A 0 A_Blast (BF_DONTWARN, 5000, 100, 20) //255 168 15
	PAR3 A 0 A_Explode(300,16,0,1)
	PAR3 A 0 A_Explode(150,32,0,1)
	PAR3 A 0 A_Explode(75,64,0,1)
    PAR3 A 0 A_Explode(50,128,0,1)
    PAR3 A 0 A_Explode(25,256,0,1)
	PAR3 A 0 A_Explode(15,512,0,1)
	PAR3 A 0 A_Explode(10,1024,0,1)
	PAR3 A 0 A_Explode(5,2048,0,1)
    stop
  }
}




//    Projectile

actor ArPlasm
{
  radius 12
  height 8
  speed 28
  damage 6
  renderstyle Add
  Alpha 0.75
  seesound "baby/attack"
  deathsound "baby/shotx"
  DamageType "ArachDamage"
  PROJECTILE
  +RANDOMIZE
  states
  {
  Spawn:
    APLS AB 3 bright
    loop
  Death:
    APBX ABCDE 5 bright
    stop
  }
}

actor ArachGunnerClass : Playerpawn
{
  health 500 //400 3.0.1
  gibhealth 99999 //added - actor can not be gibbed
  radius 56
  height 56
  mass 600
  speed 0.60 //0.3 //40 3.0.1
  painchance 128
  Player.DisplayName "Arachno-Gunner"
  Player.MaxHealth 400
  Player.ViewHeight 48
  Player.SoundClass "ArachGunnerClass"
  Player.JumpZ 7 //0
  Player.MorphWeapon "ArChaingun"
  Player.WeaponSlot 1, ArChaingun
  
  DamageFactor "Suicide", 0 // puppetmaster can not suicide a monster
  DamageFactor "MarineDamage", 0.6
  DamageFactor "MarineRLDamage", 0.6
  DamageFactor "BFGSplash", 0.6
  DamageFactor "MarineRail", 0.6
  
  DamageFactor "CybRLDamage", 0.25
  DamageFactor "ImpBallDamage", 0
  DamageFactor "CacoDamage", 0
  DamageFactor "SkelDamage", 0
  DamageFactor "FatsoDamage", 0
  DamageFactor "KnightDamage", 0
  DamageFactor "ArachDamage", 0
  DamageFactor "viledamage", 0
  DamageFactor "Control", 0
  DamageFactor "ZombiesDamage", 0
  DamageFactor "Slime", 0
  
  -PICKUP
  +NOSKIN
  +NOPAIN
  -FRIENDLY
  +NOTARGET
  +NOTRIGGER //added - avoid issues in level design
  
  states
  {
  Spawn:
    CSPI A 5 A_PlaySoundEx ("baby/active","body")
    CSPI B 5 // add some here
    CSPI A -1 	
    loop
  See:
    CSPI A 20
    CSPI A 3 A_PlaySoundEx ("baby/walk","body") 
    CSPI ABBCC 3 
    CSPI D 3 A_PlaySoundEx ("baby/walk","body") 
    CSPI DEEFF 3 
    goto See+1
  Missile:
    CHGG A 0 A_JumpIfInventory ("FHeat",100,"CantShot")
    CSPI H 2 bright 
    CSPI G 2
    CSPI H 2 bright 
    CSPI G 12
    goto Spawn
  CantShot:
    CSPI A 24
    goto Spawn
  Death:
    //CSPI A 0 ACS_ExecuteAlways(426,0,4)
    CSPI A 0 A_GiveToTarget ("MarineExp",6)
    CSPI J 20 A_PlaySoundEx ("CSPI/death","body")
    CSPI K 7 A_NoBlocking
    CSPI L 7 Thing_changeTid(144,0)
    CSPI MNO 7 
    CSPI P 1 A_SpawnItemEx ("MDeathGhost",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0) //0
	CSPI P -1
    stop
  }
}

ACTOR ArChaingun : Weapon
{
  OBITUARY "%o was perforated by %k."
  ATTACKSOUND "weapons/pistol"
  weapon.kickback 100
  Weapon.AmmoUse 0
  +WEAPON.NOALERT
  +WEAPON.AMMO_OPTIONAL
  +WEAPON.CHEATNOTWEAPON
  //+INVENTORY.UNDROPPABLE //added

  states
  {
  Spawn:
    CHGG A 0 Thing_Remove (0)
    Stop
  Ready:
    CHGG A 6 A_WeaponReady	
    //CHGG A 0 A_TakeInventory ("FHeat",2)
    //CHGG A 0 A_JumpIfInventory ("Mskull",0,7)
    //CHGG A 6 A_WeaponReady	
    //CHGG A 0 A_TakeInventory ("FHeat",2)
    //CHGG A 0 A_JumpIfInventory ("Mskull",4,4)
    //CHGG A 6 A_WeaponReady	
    //CHGG A 0 A_TakeInventory ("FHeat",2)
    //CHGG A 0 A_JumpIfInventory ("Mskull",2,1)
	CHGG A 2 HealThing(5)
    Loop
  DeSelect: 
    //CHGG A 0 ACS_ExecuteAlways(426,0,4)
    CHGG A 1 A_Lower
    Loop
  Select:
    CHGG A 1 A_Raise
    goto ready
  Fire:
  	CHGG A 0 A_JumpIfInventory ("PM_AltFireX",1,"AltFireX")
	CHGG A 0 A_JumpIfInventory ("PM_AltFireY",1,"AltFireY")
	CHGG A 0 A_JumpIfInventory ("PM_AltFireZ",1,"AltFireZ")
    CHGG A 0 A_JumpIfInventory ("FHeat",100,"Overheat")
    CHGG A 0 A_GiveInventory ("FHeat",2)
    //CHGG A 0 ACS_ExecuteAlways(426,0,2)
    CHGG A 2 A_GunFlash
	CHGG B 0 A_FireCustomMissile("PuppetBulletTracer", random(-10,10),0,12,-6,0,random(-1,1))
    CHGG B 2 A_FireBullets (3, 3, 2, 5, "PuppetBulletRico") //7.5, 2.5
    CHGG C 2
	CHGG C 0 A_FireCustomMissile("PuppetBulletTracer", random(-10,10),0,12,-6,0,random(-1,1))
    CHGG D 2 A_FireBullets (3, 3, 2, 5, "PuppetBulletRico") //7.5, 2.5
    CHGG A 0 A_Refire
    CHGG A 0 A_TakeInventory ("FHeat",1)
    CHGG ABCD 2
    CHGG ABCD 3 A_Refire
    CHGG A 0 A_TakeInventory ("FHeat",3)
    //CHGG A 0 ACS_ExecuteAlways(426,0,4)
    goto Ready
	
  AltFireX:
	CHGG A 1 A_GunFlash
	CHGG B 0 A_FireCustomMissile("PuppetBulletTracer", random(-10,10),0,12,-6,0,random(-1,1))
    CHGG B 2 A_FireBullets (6, 6, 2, 5, "PuppetBulletRico")
    CHGG C 1
	CHGG C 0 A_FireCustomMissile("PuppetBulletTracer", random(-10,10),0,12,-6,0,random(-1,1))
    CHGG D 2 A_FireBullets (6, 6, 2, 5, "PuppetBulletRico")
    CHGG A 0 A_Refire
    Goto Ready
  AltFireY:
  	CHGG A 1 A_GunFlash
	CHGG B 0 A_FireCustomMissile("PuppetBulletTracer", random(-10,10),0,12,-6,0,random(-1,1))
    CHGG B 1 A_FireBullets (12, 12, 2, 5, "PuppetBulletRico")
    CHGG C 0
	CHGG D 0 A_FireCustomMissile("PuppetBulletTracer", random(-10,10),0,12,-6,0,random(-1,1))
    CHGG D 1 A_FireBullets (12, 12, 2, 5, "PuppetBulletRico")
    CHGG A 0 A_Refire
    Goto Ready
  AltFireZ:
	CHGG A 0 A_PlaySound("weapons/RailAttackCyber", CHAN_WEAPON, 1, 0, ATTN_NONE)
	CHGG A 12 Bright A_RailAttack(random(16,25)*2, 15, 1, "none", "red", 0, 0, "PuppetCybRailPuff")
		CHGG A 0 A_PlaySound("weapons/RailAttackCyber", CHAN_WEAPON, 1, 0, ATTN_NONE)
		CHGG A 12 Bright A_RailAttack(random(16,25)*2, -15, 1, "none", "red", 0, 0, "PuppetCybRailPuff")
	goto Ready
	
  AltFire:
    CHGG A 5 ACS_ExecuteAlways (419,0,42)
    goto ready
  Overheat:
    //CHGG A 0 ACS_ExecuteAlways(426,0,2)
    CHGG A 0 A_PlaySoundEx ("cybie/overheat","body")
    CHGG A 24 ACS_ExecuteAlways (408)
    CHGG A 0 A_TakeInventory ("FHeat",4)
    //CHGG A 0 ACS_ExecuteAlways(426,0,4)
    goto ready
  Flash:
    CHGF A 2 bright A_Light1
    TNT1 A 2 A_Light2
    CHGF B 2 bright A_Light1
    TNT1 A 2 A_Light2
    TNT1 A 0 A_Light0
    Stop
  }
}

