//-------------I'm Using translation to differentiate monsters----------------//
Actor BaseNinja
{
	Radius 20
	Height 56
	Mass 500
	Speed 3
	Scale 0.7
	PainChance 48
	PainChance "SwordDamage", 255
	PainChance "FistsDamage", 255
	DamageFactor "SwordDamage", 1.5
	PainChance "GrenadeMonster", 255
	PainChance "GLauncherGrenade", 255
	PainChance "RLauncherRocket", 255
	PainChance "RailGunPlasmaDamage", 255
	PainChance "FlashBombDamage", 255
	Monster
	SeeSound "NINALRT"
	ActiveSound "NINAMB"
	PainSound "NINPAIN"
	BloodType "SpadowWarriorBlood"
	+NEVERFAST 
	+FLOORCLIP
	+NOTARGET
	+THRUSPECIES
	Species "DropBloodSpecies"
    States
	{
	Spawn:
	    NINZ A 15 A_Look
		Loop
	See:
	    ZILL A 0 A_JumpIfInventory("WanderTimer", 1, "Wander")
		NINZ AAAAA 1 A_Wander
		NINZ BBBBB 1 A_Chase
		NINZ CCCCC 1 A_Wander
		NINZ DDDDD 1 A_Chase
		Loop
	Wander:
	    NINZ AAAAABBBBBCCCCCDDDDD 1 A_Wander
		TNT1 A 0 A_TakeInventory("WanderTimer", 1)
		Goto See
		
//-------------------------Random Pain----------------------------------------//		
	Pain:
		NINZ N 5 A_FaceTarget
		TNT1 A 0 A_Pain
		TNT1 A 0 A_Jump(48, "BrockenNeck")
		Goto See
	Pain.FlashBombDamage:
	    TNT1 A 0 A_GiveInventory("WanderTimer", 30)
	    NINZ N 5 A_Pain
		Goto Wander
//----------------------------------------------------------------------------//
      BrockenNeck:
	   TNT1 A 0 A_SetTranslucent(1.0, 0)
	   TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
	   NINZ V 1 A_FaceTarget
	   NINZ V 0 A_PlaySound("NINBROCK")
	   NINZ VVVWWWXXX 4 A_CustomMissile ("BloodGib", 38, 0, Random(-30, 30), 2, 30)
	   NINZ WVWXWVWXWVWXWV 9
	   TNT1 A 0 A_Die
	   Stop 
//-------------------------DamageTypes----------------------------------------//
    Death.FistsDamage:
	    TNT1 A 0 A_GiveToTarget("LoWangFists", 1)
	Death:
	    TNT1 A 0 A_PlaySound("NINSCRM")
		TNT1 AAAAAAA 0 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NINZ OPQRS 3
		NINZ TU 3
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
	    NINZ U 1 A_SpawnItemEx("NinjaNormalDeath", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION)
	    Stop
	Death.SwordDamage:
	    TNT1 A 0 A_SetTranslucent(1.0, 0)
		TNT1 A 0 A_Stop
		TNT1 A 0 A_GiveToTarget("LoWangSplit", 1)
		NIND A 1 A_FaceTarget
	    NIND A 0 A_PlaySound("NINCUT3", 5)
		NIND F 0 A_PlaySound("NINSCRM")
		NIND AAAAAAAA 4 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NIND BB 3 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NIND B 1 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NIND CC 3 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15) 
		NIND DD 2 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)  
		NIND D 1 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NIND EEE 2 A_CustomMissile ("BloodGib", 34, -4, Random(0,360), 2, 35)
		NIND E 1 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NIND FF 2 A_CustomMissile ("BloodGib", 32, -3, Random(0,360), 2, 40)  
        NIND F 1 A_CustomMissile ("BloodGib", 38, -5, Random(0,360), 2, 15)
		NIND G 4 
		NIND H 5
		NIND I 5 A_Scream
		NIND J 1 A_NoBlocking
	    TNT1 A 0 A_SpawnItemEx("NinjaSwordDeath", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_TRANSFERTRANSLATION)
		Stop	
	Death.GrenadeMonster:
	Death.GLauncherGrenade:
	Death.RLauncherRocket:
	Death.RailGunPlasmaDamage:
	   TNT1 A 0 A_GiveToTarget("LoWangGibsTaunt", 1)
	Death.MonsterExplode:
	XDeath:
	    TNT1 A 0 A_NoBlocking
		TNT1 AAAAAAAAA 0 A_CustomMissile ("BloodGib", 30, 0, Random(0,360), 2, 30)
		TNT1 A 0 A_SpawnDebris("HeartGib", False, 6.0, 1.0)
		TNT1 A 0 A_SpawnDebris("LiverGib", False, 6.0, 1.0)
		TNT1 A 0 A_SpawnDebris("SkullGib", False, 6.0, 1.0)
		TNT1 A 0 A_SpawnDebris("Skull2Gib", False, 6.0, 1.0)
		TNT1 A 0 A_SpawnDebris("HandGib", False, 6.0, 1.0)
		TNT1 A 0 A_SpawnDebris("HandGib", False, 6.0, 1.0)
		//TNT1 A 0 A_SpawnDebris("BloodGib")
		//TNT1 A 0 A_SpawnItemEx("HeartGib",random(-30,30), random(-30, 30), 60)
		//TNT1 A 0 A_SpawnItemEx("LiverGib",random(-30,30), random(-30, 30), 60)
		//TNT1 A 0 A_SpawnItemEx("SkullGib",random(-30,30), random(-30, 30), 60)
		//TNT1 A 0 A_SpawnItemEx("Skull2Gib",random(-30,30), random(-30, 30), 60)
		//TNT1 A 0 A_SpawnItemEx("HandGib",random(-30,0), random(-30, 30), 60)
		//TNT1 A 0 A_SpawnItemEx("HandGib",random(0,30), random(-30, 30), 60)
		
		Stop
//----------------------------------------------------------------------------//		
	}
}

//---------And this is the basis of different variations of the deaths.-------//
ACTOR NinjaNormalDeath : StandartDeath
{
    Scale 0.7
    States
	{
	Spawn:
	    NINZ U -1
		Stop
    }
}

ACTOR NinjaSwordDeath : StandartDeath
{
    Scale 0.7
	States
	{
	Spawn:
	    NIND J -1
		Stop
    }
}

Actor NinjaBrown : BaseNinja 20031
{
    //$Category Shadow Warrior Monsters
    Health 60
	AttackSound "NINSHOOT"
    DropItem "UziAmmo" 50
	DropItem "MicroUziPickup" 50
    DropItem "ShurikensAmmo" 50
	Translation "112:127 = [252, 236, 220]:[64,24,12]"
    States
	{
	Missile:
	    NINZ A 1 A_JumpIfInTargetInventory("SmokeBombCheck", 1, "See")
	    NINZ A 1 A_FaceTarget
	    NINZ A 1 A_Jump(256, "BulletAttack","BulletAttack","ShirukenAttack","BulletAttack")
	    Goto See
	BulletAttack:
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,1,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,1,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,1,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		TNT1 A 0 A_Jump(96, "BulletAttack")
		Goto See		
	ShirukenAttack:
	    NINZ K 16 A_FaceTarget
		NINZ L 2 A_FaceTarget
		NINZ M 0 A_Playsound("PUNCH")
		NINZ M 0 A_CustomMissile("NinjaShuriken")
		NINZ M 8
	    Goto See
//----------------------------------------------------------------------------//
		}
}



//------------------------Shuriken for Ninja----------------------------------//
ACTOR NinjaShuriken
{
	Radius 4
	Height 4
	Speed 40
	scale 0.35
	Damage 2
	Projectile
	BloodType "SpadowWarriorBlood"
	+RANDOMIZE
	+NOGRAVITY
	+BLOODSPLATTER
	States
	{
	Spawn: 
		PSHR ABCD 3
		Loop
	Death:
		PSHR A 1
		PSHR A 1 A_playsound("STRCLNK")
		PSHR A 0 A_SpawnItem("ShurikenOnMap")
		Stop
	XDeath:
		PSHR A 1
		Stop	
	}
}
//----------------------------------------------------------------------------//





//Ninja Orange. Armed with M60 and shirukens//
ACTOR NinjaOrange : BaseNinja 20032
{  
    //$Category Shadow Warrior Monsters
	Health 60
	AttackSound "NINJAM60"
	DropItem "UziAmmo" 50
    DropItem "MicroUziPickup" 50
    DropItem "ShurikensAmmo" 50
	Translation "112:127 = [227, 211, 89]:[64,32,8]"
	States
	{
	Missile:
	    NINZ A 1 A_JumpIfInTargetInventory("SmokeBombCheck", 1, "See")
	    NINZ A 1 A_FaceTarget
	    NINZ A 1 A_Jump(256, "BulletAttack","BulletAttack","ShirukenAttack","BulletAttack")
	    Goto See
	BulletAttack:
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		TNT1 A 0 A_Jump(96, "BulletAttack")
		Goto See		
	ShirukenAttack:
	    NINZ K 16 A_FaceTarget
		NINZ L 2 A_FaceTarget
		NINZ M 0 A_Playsound("PUNCH")
		NINZ M 0 A_CustomMissile("NinjaShuriken")
		NINZ M 8
	    Goto See
//----------------------------------------------------------------------------//			
	}
}



//Here Ninja Red. He Armed with M60 and RocketLauncher
ACTOR NinjaRed : BaseNinja 20033
{
    //$Category Shadow Warrior Monsters
	Health 120
	DropItem "ROCKETLAMMO" 64
	AttackSound "NINJAM60"
	Translation "112:127 = [204, 24, 24]:[48,0,0]"
	States
	{
	Missile:
	    NINZ A 1 A_JumpIfInTargetInventory("SmokeBombCheck", 1, "See")
	    NINZ A 1 A_FaceTarget
	    NINZ A 1 A_Jump(256, "BulletAttack","BulletAttack","RocketAttack","BulletAttack")
	    Goto See
	BulletAttack:
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		TNT1 A 0 A_Jump(96, "BulletAttack") 
		Goto See
	RocketAttack:
	    NINZ A 16 A_FaceTarget
		NINZ A 0 A_playsound("ROKFIRE")
		NINZ A 1 Bright A_CustomMissile("ZillaRocket")
	    Goto See		
	}
}




//NinjaGray, He armed with M60 and GrenadeLauncher//
ACTOR NinjaGray : BaseNinja 20034
{
    //$Category Shadow Warrior Monsters
	Health 120
	DropItem "GLauncherAmmo" 64
	AttackSound "NINJAM60"
	Translation "112:127 = [252, 252, 252]:[28,28,28]"
	States
	{
	Missile:
	    NINZ A 1 A_JumpIfInTargetInventory("SmokeBombCheck", 1, "See")
	    NINZ A 1 A_FaceTarget
	    NINZ A 1 A_Jump(256, "BulletAttack", "GrenadeAttack", "BulletAttack", "BulletAttack")
	    Goto See
	BulletAttack:
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		NINZ I 3 bright A_FaceTarget
		NINZ J 3 bright A_CustomBulletAttack(8,8,1,2,"SWPuffOne")
		NINZ J 0 A_SpawnItemEx("MicroUziCasingSpawner",0,0,32)
		TNT1 A 0 A_Jump(96, "BulletAttack")
		Goto See
	GrenadeAttack:
	    NINZ A 16 A_FaceTarget
		NINZ A 0 A_playsound("GRLFIRE")
		NINZ A 1 Bright A_CustomMissile("ZillaGrenade")
	    Goto See			
	}
}
