


//***Che this class encapsulates fatalities for both the evil marines
// and the NPC marines. 
// I frankensteined it from Marine_Rifle's fatality states
//   adding some more from Player.txt



ACTOR Marine_AbstractFat //: SwitchableDecoration // The NPC marines have to inherit from it
{
	
	// moved from MARINES_syn
	var int user_head_tid;
	var int user_head_type;
	var int user_head_rel;
	var int user_head_scale;
	var int user_head_xyzf; /* 
		a packed value: 
		bits 0..7 =x+128, clamped to -128..127
		bits 8..15 =y+128, clamped to -128..127
		bits 16..23 =z, clamped to 1..255
		bit 29 is a command to assume an unique TID, used in monster-on-monster headshotting
		A zero value is a command to terminate
	*/		
	var int user_maradeur;
	var int user_syn_mode;
	var int user_see_after_wp_sw;
	
	var int user_voice_set;
	
	
	//Activation THINGSPEC_Switch | THINGSPEC_ThingTargets | THINGSPEC_NoDeathSpecial
	
	States
	{
		AfterFatality:
			// the ancestor class has to define the state "Triumph"
			"----" A 1 A_JumpIf(true, "Triumph") // this sprite would *only* show 
			// in Zandronum multiplayer client while it waits for server's state update
			Wait
			
		CheckForFatality:  // melee attacks must jump here afterwards,
			// *without* invoking any A_Look or A_Chase 
			//    that would jump to Idle as inevitably as death and taxes!
			
			"----" A 0 A_JumpIfInventory("ZombiemanFatality3", 1, "FatalityZombieman")
			"----" A 0 A_JumpIfInventory("ImpFatality3", 1, "FatalityImp")
			"----" A 0 A_JumpIfInventory("SergeantFatality", 1, "FatalitySergeant")
			"----" A 0 A_JumpIfInventory("RevenantFatality", 1, "FatalityRevenant")
			"----" A 0 A_JumpIfInventory("Fatality_Marine", 1, "FatalityPVP") // NPC marine
			"----" A 0 A_JumpIfInventory("PVPFatality", 1, "FatalityPVP") // player
			"----" A 0 A_JumpIfInventory("ComandoFatality", 1, "FatalityComando")
			
			"----" A 0 A_JumpIf(user_see_after_wp_sw == 2, "IdleLoop")
			"----" A 0 A_JumpIf(user_syn_mode, "ThreatSensePhase")
			"----" A 4 A_JumpIf(true, "See")
			Wait

			
		FatalityZombieman:
			TNT1 A 0
			TNT1 A 0 A_Jump(256, "FatalityZombieman1", "FatalityZombieman3") // "FatalityZombieman2", 
			Goto FatalityZombieman1
	
		FatalityZombieman1:
			TNT1 A 0
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			FPZ3 A 10
			FPZ3 ABCDE 4
			XXXX A 0 A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			FPZ3 FGGGG 4

			FPZ3 HHIIIIIIHJJ 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 AA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))

			FPZ3 KKLLLLKJJ 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 AA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))

			FPZ3 MMNNNNMOO 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 AA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ3 MMNNNNMOO 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 AA 0 A_CustomMissile ("XDeath1", 30, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("Brains1", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains2", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains3", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains4", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAA 0 A_CustomMissile ("SmallBrainPiece", 5, 0, random (0, 360), 2, random (0, 160))


			FPZ3 PPQQQQPRR 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))

			FPZ3 PPQQQPRR 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ3 RP 5

			FPZ3 P 0 A_PlaySound("PLATA1", 1)
			//////////////////////////////////////////////////////
			FPZ3 P 0 A_TakeInventory("ZombieManFatality3",1)
			FPZ3 P 0 A_TakeInventory("GoFatality", 1)
			FPZ3 P 0 A_SpawnItemEx ("FBD_DeadZombieManFatality3", 0,0,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			FPZ3 P 0 A_UnSetInvulnerable
			
			Goto AfterFatality

		FatalityZombieman2:
			TNT1 A 0
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			//////////////////////////////////////////////////////
			FPZ2 AB 5
			XXXX A 0 A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAA 0 A_CustomMissile ("CeilBloodLauncher", 50, 0, random (0, 360), 2, random (50, 130))
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath2", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath3", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 60, 0, random (0, 360), 2, random (0, 160))
			FPZ2 C 15
			TNT1 A 0 A_PlaySound("imp/melee")
			FPZ2 D 15
			TNT1 AAAAA 0 A_CustomMissile ("Guts2", 32, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 60, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			FPZ2 EF 5
			TNT1 A 0 A_PlaySound("grunt/death")
			FPZ2 G 10
			//////////////////////////////////////////////////////
			FPZ2 G 0 A_TakeInventory("ZombieManFatality3",1)
			FPZ2 G 0 A_TakeInventory("GoFatality", 1)
			FPZ2 G 0 A_SpawnItem ("ZombieManDyingAfterFatality")
			FPZ2 G 0 A_UnSetInvulnerable
			
			Goto AfterFatality
		
		
		FatalityZombieman3:
			TNT1 A 0
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			FPZ4 AB 3
			XXXX A 0 A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			FPZ4 CDEEE 3
			FPZ4 FGH 3

			FPZ4 HHI 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ4 JJJIH 2

			FPZ4 HHI 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ4 JJJIH 2

			FPZ4 HHI 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ4 OOOMN 2


			FPZ4 NNM 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ4 OOOMN 2

			FPZ4 NNM 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FPZ4 OOOMN 2



			FPZ4 NNM 2
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))

			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("Brains1", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains2", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains3", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains4", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAA 0 A_CustomMissile ("SmallBrainPiece", 5, 0, random (0, 360), 2, random (0, 160))
			FPZ4 P 7
			FPZ4 L 10
			//////////////////////////////////////////////////////
			FPZ4 L 0 A_TakeInventory("ZombieManFatality3",1)
			FPZ4 L 0 A_TakeInventory("GoFatality", 1)
			FPZ4 L 0 A_SpawnItem ("FBD_DeadZombieManFatality3")
			FPZ4 L 0 A_UnSetInvulnerable
			
			Goto AfterFatality
		
		
		
		FatalityImp:
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			TNT1 A 0 A_Jump(128, "FatalityImp2")
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			//////////////////////////////////////////////////////
			FTCI AB 4
			XXXX A 0 A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			FTCI CDE 4
			FTCI E 8

			FTCI FGG 5
			FTCI H 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FTCI I 10
			FTCI H 5
			FTCI G 8

			FTCI H 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FTCI I 10
			FTCI H 5
			FTCI G 8

			FTCI H 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FTCI I 10
			FTCI H 5
			FTCI G 8

			FTCI H 2
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 A 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			FTCI I 10
			FTCI H 5
			FTCI G 8

			FTCI H 2

			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("grunt/pain", 1)
			TNT1 A 0 A_PlaySound("player/cyborg/fist", 4)
			TNT1 AAAAA 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Teeth", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("Brains1", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains2", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains3", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains4", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 5, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAA 0 A_CustomMissile ("SmallBrainPiece", 5, 0, random (0, 360), 2, random (0, 160))
			FTCI L 10
			FTCI J 20
			//////////////////////////////////////////////////////
			FTCI J 0 A_TakeInventory("GoFatality", 1)
			FTCI J 0 A_ChangeFlag (shootable, 1)
			FTCI J 0 A_TakeInventory("ImpFatality3",1)
			FTCI J 0 A_GiveInventory("Stimpack",1)
			FTCI J 0 A_SpawnItem ("impfacesorapedomgthisiscruel")
			FTCI J 0 A_UnSetInvulnerable

			Goto AfterFatality
		
		
		FatalityImp2:
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			FTYI ABB 7
			FTYI CDEFG 2
			TNT1 A 0  A_PlaySound("imp/pain")
			TNT1 A 0 A_SpawnItemEx("FootStep5", 0, 0, 40, 0, 0)
			TNT1 A 0 A_PlaySound("CLAP")
			XXXX A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			FTYI GGGGHHHHHHHHIJJJ 2
			FTYI K 3
			XXXX A 0 A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(582, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(583, 0, 0, 0, 0)
			TNT1 A 0 A_SpawnItemEx("FootStep5", 0, 25, 30, 0, 0)
			TNT1 AAA 0 A_CustomMissile ("Brains1", 11, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains2", 11, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains3", 11, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains4", 11, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("Brains5", 11, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 15, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 15, 0, random (0, 360), 2, random (0, 160))
			FTYI LLLL 1 A_SpawnItemEx("FBD_Blood", 0, 25, 10, 0, 0)
			FTYI LMNNN 4
			FTYI NO 6
			TNT1 A 0 A_PlaySound("misc/xdeath3")
			FTYI NO 6
			TNT1 A 0 A_PlaySound("misc/xdeath3")
			FTYI NO 6
			TNT1 A 0 A_PlaySound("misc/xdeath3")
			FTYI N 8
			//////////////////////////////////////////////////////
			FTYI N 0 A_TakeInventory("GoFatality", 1)
			FTYI N 0 A_TakeInventory("ImpFatality3",1)
			FTYI N 0 A_CustomMissile ("StompedImp", 1, 0, random (0, 360), 2, random (0, 160))
			FTYI N 0 A_UnSetInvulnerable
			
			Goto AfterFatality
		
		
		FatalitySergeant:
			TNT1 A 0
			TNT1 A 0 A_Jump(128, "FatalitySergeant2")
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			FTYS A 8 A_PlaySound("grunt/pain")
			FTYS BC 8
			TNT1 A 0 A_PlaySound("BURNZOM", 3)

			TNT1 A 0 A_PlaySound("misc/xdeath")
			FTYS DE 4
			TNT1 A 0 A_PlaySound("misc/xdeath")
			FTYS DE 4
			TNT1 A 0 A_PlaySound("misc/xdeath")
			FTYS DE 4

			XXXX A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("misc/xdeath", 3)
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 20, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 60, 0, random (0, 360), 2, random (0, 160))
			FTYS FGHIPP 4 A_CustomMissile ("Blood", 1, 0, random (0, 360), 2, random (0, 160))

			FTYS QR 8 
			TNT1 A 0 A_SpawnItemEx("FootStep5", 0, 0, 40, 0, 0)
			FTYS R 20
			///////////////////////////////////////////////////////
			FTYS R 0 A_TakeInventory("GoFatality", 1)
			FTYS R 0 A_TakeInventory("SergeantFatality",1)
			FTYS R 0 A_CustomMissile ("BeheadedSergeantZombie", 1, 0, random (0, 360), 2, random (0, 160))
			FTYS R 0 A_UnSetInvulnerable
						
			Goto AfterFatality
		
		
		
		
		FatalitySergeant2:  ///////
			TNT1 A 0
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			FSP3 A 8

			FSP3 B 4 A_PlaySound("grunt/pain")
			XXXX A 0 A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			FSP3 CDE 4
			FSP3 E 6

			FSP3 FG 4
			TNT1 A 0 A_PlaySound("grunt/death")		
			XXXX A 0 //A_CustomMissile ("ShakeYourAssMinor", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 20, 0, random (0, 360), 2, random (0, 160))
			//TNT1 AA 0 A_CustomMissile ("XDeath2", 20, 0, random (0, 360), 2, random (0, 160))
			//TNT1 AA 0 A_CustomMissile ("XDeath3", 20, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAA 0 A_CustomMissile ("PlayerFlyingBlood", 60, 0, random (0, 360), 2, random (0, 160))
			FSP3 HIIIII 5

			TNT1 A 0 A_PlaySound("weapons/sg")	
			XXXX A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAA 0 A_CustomMissile ("XDeath1", 70, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath2", 70, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath3", 70, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 70, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("FlyingImpaledSergeant", 50, 0, random (0, 360), 2, random (70, 110))


			FSP3 L 3 BRIGHT
			FSP3 K 3
			FSP3 J 40
			///////////////////////////////////////////////////////
			FSP3 J 0 A_TakeInventory("GoFatality", 1)
			FSP3 J 0 A_TakeInventory("SergeantFatality",1)
			FSP3 J 0 A_UnSetInvulnerable
						
			Goto AfterFatality
		
		
		FatalityRevenant:
			
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			FREV ABABAB 3
			XXXX A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAA 0 A_CustomMissile ("CeilBloodLauncher", 40, 0, random (0, 360), 2, random (50, 130))
			TNT1 AAAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAAAAAAAAAAAAAAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 50, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(582, 0, 0, 0, 0)
			FREV C 4 A_PlaySound("skeleton/pain")
			FREV D 4
			FREV EFGHIJJJKL 4
			FREV M 5 A_PlaySound("skeleton/sight")
			FREV M 10
			FREV N 2
			FREV O 2

			XXXX A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 AA 0 A_CustomMissile ("XDeath1", 50, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath2", 50, 0, random (0, 360), 2, random (0, 160))
			TNT1 AAA 0 A_CustomMissile ("XDeath3", 50, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_CustomMissile ("XDeathRevenantHead", 45, 0, random (0, 360), 2, random (50, 130))
			TNT1 A 0 ACS_Execute(580, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(581, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(582, 0, 0, 0, 0)
			TNT1 A 0 ACS_Execute(583, 0, 0, 0, 0)

			FREV PQR 2
			//////////////////////////////////////////////////////
			FREV R 0 A_TakeInventory("GoFatality", 1)
			FREV R 0 A_TakeInventory("RevenantFatality",1)
			FREV R 0 A_SpawnItemEx("DyingRevenant", 0, 35, 35, 1, 1)
			FREV R 0 SetPlayerProperty(0,0,0)
			FREV R 0 A_UnSetInvulnerable
						
			Goto AfterFatality
		
		
		
		
		FatalityComando:
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_GiveInventory("GoFatality", 1) // most demons stop attacking a target that has this
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			CFTA AAABCDE 2
			NULL A 0 A_PlaySound("grunt/pain")
			NULL A 0 A_SpawnItemEx("FootStep5", 0, 0, 40, 0, 0)
			//XXXX A 0 A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			NULL A 0 A_PlaySound("CLAP")
			CFTA EFF 7
			CFTA GHIJK 2
			NULL A 0 A_PlaySound("grunt/pain")
			NULL A 0 A_SpawnItemEx("FootStep5", 0, 0, 40, 0, 0)
			//NULL A 0 A_CustomMissile ("CameraShake", 50, 0, random (0, 360), 2, random (0, 160))
			NULL A 0 A_CustomMissile ("GoreSound", 22, 0, random (0, 360), 2, random (0, 160))
			CFTA L 7

			CFTA M 15
			CFTA OPQR 4
			NULL A 0 A_PlaySound("grunt/pain")
			NULL A 0 A_PlaySound("grunt/death")
			CFTA R 15
			NULL A 0 A_PlaySound("BURNZOM")
			//NULL A 0 A_CustomMissile ("CameraShake", 50, 0, random (0, 360), 2, random (0, 160))
			NULL AAAAAA 0 A_CustomMissile ("CeilBloodLauncher", 40, 0, random (0, 360), 2, random (50, 130))
			NULL AAAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), 2, random (0, 160))
			NULL AAA 0 A_CustomMissile ("XDeath2", 10, 0, random (0, 360), 2, random (0, 160))
			NULL AAA 0 A_CustomMissile ("XDeath3", 10, 0, random (0, 360), 2, random (0, 160))
			NULL AAAAAAAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 50, 0, random (0, 360), 2, random (0, 160))
			CFTA S 25
			//////////////////////////////////////////////////////
			CFTA S 0 A_TakeInventory("ComandoFatality",1)
			CFTA S 0 A_TakeInventory("GoFatality", 1)
			CFTA S 0 A_SpawnItemEx("DyingComando", 0, 0, 40, 0, 0)
			CFTA S 0 A_UnSetInvulnerable
						
			Goto AfterFatality
			

	
		FatalityPVP:
			NULL A 0
			
			// Have to laugh *before* the animation 
			// -- thus cannot delegate to descendant classes.
			// Also, no jumping to AfterFatality after:
			// the fatality itself incorporates a taunting animation
			
			TNT1 A 0 ACS_NamedExecuteWithResult("FBD_SynthMarineVoice", CHE_TRIUMPH)
/*			
			TNT1 A 0 A_JumpIf(!user_head_type, "FatalityPVPLaughNPC")
			TNT1 A 0 A_JumpIf(user_maradeur == 1, "FatalityPVPLaughMaradeur1")
			TNT1 A 0 A_JumpIf(user_maradeur == 2, "FatalityPVPLaughMaradeur2")
			TNT1 A 0 A_JumpIf(user_maradeur == 3, "FatalityPVPLaughMaradeur3")
		FatalityPVPLaughChhaosMarine:
			TNT1 A 0 A_PlaySound("chaosmarine/triumph", CHAN_VOICE)
			Goto FatalityPVPContinue	
		FatalityPVPLaughNPC:
			TNT1 A 0 A_PlaySound("npcmarine/triumph", CHAN_VOICE)
			Goto FatalityPVPContinue
		FatalityPVPLaughMaradeur1:
			TNT1 A 0 A_PlaySound("maradeur/1/triumph", CHAN_VOICE)
			Goto FatalityPVPContinue
		FatalityPVPLaughMaradeur2:
			TNT1 A 0 A_PlaySound("maradeur/2/triumph", CHAN_VOICE)
			Goto FatalityPVPContinue
		FatalityPVPLaughMaradeur3:
			TNT1 A 0 A_PlaySound("maradeur/3/triumph", CHAN_VOICE)
			Goto FatalityPVPContinue
			
		FatalityPVPContinue:	
*/		
			NULL A 0 A_Jump(256, "FatalityPVP1", "FatalityPVP3") 
			//***Che seems unfinished: no head dropped, no body dropped "FatalityPVP2",
		
		FatalityPVP1: // lift you over his head and tear you in half
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			PVPF ABB 10
			PVPF C 6
			PVPF DDD 3 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			TNT1 A 0 A_PlaySound("misc/xdeath4c")
			TNT1 A 0 A_SpawnItemEX("MuchBlood", 0, 0, 60)
			NULL A 0 A_CustomMissile ("RipGuts", 60, 0, random (0, 360), 2, random (0, 160))      
			NULL A 0 A_SpawnItemEx("XDeathHalfMarine", 0,0,50, 0,5,5, 0,SXF_NOCHECKPOSITION,0)
			NULL AAA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 160))  
			NULL A 0 A_SpawnItemEx("PlayerJustGotCutInHalf", 0,0,50, 0,-5,0, 0,SXF_NOCHECKPOSITION,0)
			PVPF EEEFFFFGGGG 4 A_CustomMissile ("BloodMistSmall", 60, 0, random (0, 360), 2, random (30, 90))
			//////////////////////////////////////////////////////
			PVPF G 0 A_TakeInventory("Fatality_Marine",1)
			PVPF G 0 A_TakeInventory("PVPFatality",1)
			PVPF G 0 A_TakeInventory("GoFatality", 1)
			PVPF G 0 A_UnSetInvulnerable
						
			"----" A 1 A_JumpIf(true, "Idle")
			Wait			



		FatalityPVP2: // rips your head off
//***Che: TODO: complete this one, make it work!		
			TNT1 A 0 A_SetInvulnerable
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			PVP1 A 10
			NULL AA 0 A_CustomMissile ("MuchBlood", 30, 0, random (0, 360), 2, random (0, 160))  
			NULL AAA 0 A_CustomMissile ("XDeath1", 30, 0, random (0, 360), 2, random (0, 160))  
			PVP1 A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			PVP1 BCDE 5
			//////////////////////////////////////////////////////
			PVP1 E 0 A_TakeInventory("Fatality_Marine",1)
			PVP1 E 0 A_TakeInventory("PVPFatality",1)
			PVP1 E 0 A_TakeInventory("GoFatality", 1)
			PVP1 E 0 A_UnSetInvulnerable
						
			"----" A 1 A_JumpIf(true, "Idle")
			Wait			



		FatalityPVP3: // rips you apart, limb by limb
			TNT1 A 0 A_ChangeFlag (shootable, 0)
			TNT1 A 0 A_ChangeFlag (Invulnerable, 1)
			TNT1 A 0 A_JumpIf(!user_head_tid, 2)
			TNT1 A 0 ACS_NamedExecuteWithResult("DeleteHeadboxMkII")
			//////////////////////////////////////////////////////
			TNT1 A 0 A_PlaySound("misc/xdeath1")
			NULL AA 0 A_CustomMissile ("MuchBlood", 30, 0, random (0, 360), 2, random (0, 160))  
			NULL AAA 0 A_CustomMissile ("XDeath1", 30, 0, random (0, 360), 2, random (0, 160))  
			NULL A 0 A_CustomMissile ("XDeathArm1", 30, 0, random (0, 360), 2, random (0, 160))  
			PVP1 A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			PVP2 ABCCC 4 A_CustomMissile ("BloodMistSmall", 48, 0, random (0, 360), 2, random (30, 90))
			TNT1 A 0 A_PlaySound("misc/xdeath1")
			NULL A 0 A_CustomMissile ("RipGuts", 30, 0, random (0, 360), 2, random (0, 160))      
			NULL AAA 0 A_CustomMissile ("XDeath1", 30, 0, random (0, 360), 2, random (0, 160))
			NULL AA 0 A_CustomMissile ("XDeath2", 30, 0, random (0, 360), 2, random (0, 160))
			PVP1 A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			PVP2 DEEFF 5 A_CustomMissile ("BloodMistSmall", 48, 0, random (0, 360), 2, random (30, 90))
			TNT1 A 0 A_PlaySound("misc/xdeath1")
			NULL A 0 A_CustomMissile ("XDeathArm1", 60, 0, random (0, 360), 2, random (0, 160)) 
			//NULL A 0 A_CustomMissile ("XDeathMarineHead1", 60, 0, random (0, 360), 2, random (0, 160)) 
			NULL AA 0 A_CustomMissile ("XDeath2", 60, 0, random (0, 360), 2, random (0, 160))
			NULL AA 0 A_CustomMissile ("XDeath3", 60, 0, random (0, 360), 2, random (0, 160))
			PVP1 A 0 //A_CustomMissile ("CameraShake", 1, 0, random (0, 360), 2, random (0, 160))
			PVP2 GGGGG 3 A_CustomMissile ("BloodMistSmall", 48, 0, random (0, 360), 2, random (30, 90))
			//////////////////////////////////////////////////////
			PVP2 G 0 A_SpawnItemEx("PlayerJustGotCutInHalf", 0,30,0, 0,0,0, 0,SXF_NOCHECKPOSITION,0)
			PVP2 G 0 A_TakeInventory("Fatality_Marine",1)
			PVP2 G 0 A_TakeInventory("PVPFatality",1)
			PVP2 G 0 A_TakeInventory("GoFatality", 1)
			PVP2 G 0 A_UnSetInvulnerable
			
			"----" A 1 A_JumpIf(true, "Idle")
			Wait

		// Stubs to prevent parser doing weird things while calculating jumps. 
		// Will be re-defined by ancestors

		Idle: 
			PVP2 A 1 
			Loop
			
		ThreatSensePhase:
			PVP2 A 1 
			Loop
			
		Triumph:
			PVP2 A 1 
			Loop
			
		See:
			PVP2 A 1 
			Loop			
		
	}


}