//Projectiles on TRACER and MELEE lump
//Meatshield blocking effect on Head_Sys lump

ACTOR ZMANShield : Rifle
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "BDPistolAmmo"
	Weapon.AmmoType2 "MeatAmmo"
	States
	{
	Ready:
		
		ZSHG A 2 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("MeatAmmo", 100, 4)
		TNT1 A 0 A_SpawnItemEx("MeatShield", 15, 0, 15, 0)
		TNT1 A 0 A_AlertMonsters
        Loop
		TNT1 AAA 0
		Goto Destroy
	Deselect:
        Goto AltFire
	Select:
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
	    TNT1 A 0 A_TakeInventory("MeatAmmo", 100)
		TNT1 AAAAAAAA 0 A_Raise
		ZSHG A 1 offset(0,40)
		ZSHG A 1 offset(0,48)
		Goto LoadBullets
	
	LoadBullets:
		TNT1 A 0 A_JumpIfInventory("BDPistolAmmo",15,15)
		TNT1 A 0 A_JumpIfInventory("Clip1",1,3)
		Goto Ready
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDPistolAmmo",1)
		TNT1 A 0 A_Giveinventory("BDDualPistolAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip1",1)
		Goto LoadBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
        Goto Ready
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
		
	
    Fire:
	    TNT1 A 0
        TNT1 A 0 A_JumpIfInventory("BDPistolAmmo", 1, 1)
		Goto AltFire
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_SpawnItemEx("MeatShield", 15, 0, 15, 0)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
		TNT1 A 0 A_PlaySound("pfire")
        TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		TNT1 A 0 A_FireCustomMissile("MeatShieldTracer", random(1,-1), 0, 3, 0)
		TNT1 A 0 A_TakeInventory("BDPistolAmmo", 1)
		TNT1 A 0 A_TakeInventory("BDDualPistolAmmo", 1)
		ZSHF A 1 BRIGHT
		ZSHF BC 1
		ZSHG A 1
		Goto Ready
		

    AltFire:
		GRZ1 D 1 offset(-4, 32)
		GRZ1 D 1 offset(-9, 33)
		GRZ1 D 1 offset(-16, 34)
		GRZ1 D 2 offset(-24, 35)
		GRZ1 D 3 offset(-36, 48)
		GRZ1 D 1 offset(-24, 35)
		GRZ1 B 1 offset(-16, 34)
		GRZ1 B 1 offset(-9, 33)
		GRZ1 B 1 offset(-1, 32)
        TNT1 A 0 A_PlaySound("skeleton/swing")
		TNT1 A 0 A_FireCustomMissile("ThrowedZman", 0, 0, 0, 0)
		TNT1 A 0 A_TakeInventory("GoSpecial",1)
		TNT1 A 0 A_TakeInventory("GotMeatShield", 1)
		TNT1 A 0 A_TakeInventory("HasZmanShield",1)
		TNT1 A 0 A_Giveinventory("Punching",1)
        THEF B 4 
        THEF C 4
		TNT1 A 0 A_Giveinventory("Punching",1)
		THEF D 4
		TNT1 A 0 A_TakeInventory("GoSpecial",1)
		TNT1 A 0 A_TakeInventory("GotMeatShield", 1)
		TNT1 A 0 A_TakeInventory("HasZmanShield",1)
		TNT1 A 0 A_Giveinventory("Punching",1)
		TNT1 A 0 A_TakeInventory("ZmanShield",1)
		TNT1 A 10
		Goto Ready
 	Spawn:
		8876 A -1
		Stop
	Destroy:
	    TNT1 A 0
		TNT1 A 0 A_SpawnItem("ZombiemanHeadExplode", 0, 50)
		TNT1 A 0 A_TakeInventory("GoSpecial",1)
		ZSHG DEFGHII 5
		TNT1 A 0 A_TakeInventory("GoSpecial",1)
		TNT1 A 0 A_TakeInventory("GotMeatShield", 1)
		TNT1 A 0 A_TakeInventory("HasZManShield",1)
		TNT1 A 0 A_Giveinventory("Punching",1)
		TNT1 A 0 A_SpawnItem("DeadZombieman_NoHeadFront", 0, 30)
		TNT1 A 0 A_TakeInventory("ZManShield",1)
		Goto Ready
		
	}
}



ACTOR ThrowedZman
{
	Radius 16
	Height 16
	Speed 30
	Damage (random(120, 120))
	+MISSILE
    Scale 1.0
	+FORCEXYBILLBOARD
	-NOGRAVITY
	+NOEXTREMEDEATH
	+SKYEXPLODE
	+SHOOTABLE
	+NOEXTREMEDEATH
	+THRUGHOST
	+THRUSPECIES
	Species "Marines"
	Health 30
	Gravity 1.0
	DamageType Kick
	DamageFactor "Cut", 2.00 DamageFactor "Saw", 2.00 damagefactor "PussyGrab", 10.0
	Decal BrutalBloodSuper
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Playsound("BURNZOM", 1)
	Flying:
        X721 H 2
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		X721 GFEDCBA 2
		Loop
		
    Death:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_CheckCeiling("HitCeil")
		TNT1 A 0 A_JumpIfHealthLower(-40, "Death.Gibs")
		TNT1 A 0 A_JumpIfHealthLower(1, "Death.Shotgun")
		X721 H 2
		NULL AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (0, 160))
	    TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL A 0 A_CustomMissile ("ThrowedZombieManRicochet", 0, 0, 0, 2, 38)
		Stop
	
	HitCeil:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL A 0 A_CustomMissile ("ThrowedZombieManRicochet", 0, 0, 0, 2, -5)
		Stop
		
	Crashing:
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_SpawnItem("MuchBlood2")
		NULL AA 0 A_CustomMissile ("XDeath1", 0, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_SpawnItem("DeadZombieman1")
		TNT1 A 3
		Stop
		
	Death.Melee:
	Death.Fatality:
	Death.ExtremePunches:
	Death.Kick:
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		NULL A 0 A_CustomMissile ("ThrowedZombieManRicochet", 0, 0, 180, 2, 32)
		Stop
	
	Death.Gibs:
	Death.Explosives:
	Death.Shotgun:
		TNT1 A 0
		TNT1 A 0 A_SpawnItem("ZombieXDeath")
		Stop
	}
}



ACTOR ThrowedZombieManRicochet: ThrowedZMan
{
    +BOUNCEONWALLS
	+THRUGHOST
	+BOUNCEONACTORS
	Radius 12
	Height 14
	WallBounceFactor 0.6
	Speed 10
	States
	{
	Spawn:
        X721 H 2
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		X721 GFEDCBA 2
		Loop
    Death:
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_StopSound(1)
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_JumpIfHealthLower(-40, "Death.Gibs")
		TNT1 A 0 A_JumpIfHealthLower(1, "Death.Shotgun")
	Goto Crashing
	}
}

ACTOR ThrowedZombieMan2: ThrowedZMan
{
    +NOGRAVITY
	Damage 20
}


ACTOR ThrowedSergeantPiece: ThrowedZombieMan2
{
	Damage 10
	States
	{
	Spawn:
        SP2X HIJK 5
		Loop
		
    Death:
	    TNT1 A 0 A_SpawnItem("MeatDeath")
		TNT1 A 5
		Stop
	}
}



ACTOR ExtremePunchedZMan: ThrowedZMan
{
	Radius 10
	Height 14
	Speed 30
	+THRUGHOST
	States
	{
	Spawn:
        POS4 ZZ 2 A_CustomMissile ("Brutal_FlyingBloodTrail", 0, 0, random (0, 360), 2, random (0, 90))
		TNT1 A 0 A_ChangeFlag("THRUGHOST", 0)
		Loop
    Death:
		TNT1 A 0
		TNT1 A 0 A_CheckFloor("Floor")
		TNT1 A 0 A_CheckCeiling("Floor")
		TNT1 A 0 A_SetAngle(angle-180)
		TNT1 A 0 A_Stop
		TNT1 A 0 A_ChangeFlag("LOWGRAVITY", 1)
		TNT1 AA 0 A_CustomMissile ("XDeath2", 32, 0, random (170, 190), 2, random (0, 0))
		TNT1 AA 0 A_CustomMissile ("XDeath3", 32, 0, random (170, 190), 2, random (0, 0))
		TNT1 A 0 A_SpawnItem("Muchblood2", 0, 40)
		
	    TNT1 AAA 0 A_CustomMissile ("Guts", 32, 0, random (150, 210), 2, random (0, 40))
		TNT1 AA 0 A_CustomMissile ("XDeathArm1", 32, 0, random (170, 190), 2, random (0, 40))
		TNT1 A 0 A_CustomMissile ("ZombiemanHeadExplode", 32, 0, random (170, 190), 2, random (0, 40))
        TNT1 A 0 A_XScream
		TNT1 A 0 A_NoBlocking
        ZZD1 EEEEEFF 6
		TNT1 A 0 A_ChangeFlag("LOWGRAVITY", 0)
		ZZD1 GH 6
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
		ZZD1 H 0
		TNT1 A 0 A_GiveToTarget("SoulAmmo", 10)
		TNT1 A 0 A_SpawnItem("DeadZombiemanJustLegsAreLeft2")
		TNT1 A -1
        Stop
		
	Floor:	
		TNT1 AA 0 A_CustomMissile ("XDeath1", 35, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_Recoil(-30)
		POS4 ABCD 3 A_CustomMissile ("Brutal_LiquidBlood3", 15, 0, random (0, 360), 2, random (0, 40))
		POS4 EFGHIJ 3 A_JumpIf((MomY == 0), "DSFStop")
		Goto DSFStop+1
		
	DSFStop:
		TNT1 A 0 A_SpawnItem("Ploft3")
		TNT1 A 0 A_Stop
		TNT1 A 0 A_SpawnItem ("GrowingBloodPool")
		TNT1 A 0 A_CustomMissile ("SuperWallRedBlood", 2, 0, random (170, 190), 2, random (0, 0))
		POS4 J 0
		TNT1 A 0 A_SpawnItem("DeadZombiemanShotguntotheFace1")
		TNT1 A 0 A_GiveToTarget("SoulAmmo", 10)
		TNT1 A -1
		Stop
	}
}



