Actor DemonRuneRevenant : PowerupGiver
{
	Inventory.PickupMessage "Demon Rune!"
	Inventory.PickupSound "misc/p_pkup"
	Inventory.MaxAmount 0
	+COUNTITEM
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.BIGPOWERUP
	Powerup.Type TransformRevenant
	Powerup.Duration -60
	States
	{
	Spawn:
		DMRU ABCD 6 Bright
		loop
	}

}


Actor PowerTransformRevenant : PowerMorph
{
	PowerMorph.PlayerClass "RevenantPlayer"
}

Actor RevenantPlayer : DoomPlayer
{
	Radius 16
	Height 56
	Health 300
	Scale 1.0
	Player.ViewHeight 65
	Player.AttackZOffset 29
	Player.JumpZ 9
	Player.MorphWeapon "D4RevenantHUD"
	PainSound "skeleton/pain"
	DeathSound "skeleton/death"
	 damagefactor "Head", 0.0
	damagefactor "FriendBullet", 0.0
    damagefactor "Taunt", 0.0
    damagefactor "KillMe", 0.0
	damagefactor "Shotgun", 0.7
    damagefactor "SSG", 5.0
    damagefactor "Shrapnel", 0.0
    damagefactor "Blood", 0.5
    damagefactor "BlueBlood", 0.5
    damagefactor "GreenBlood", 0.5
    damagefactor "MinorHead", 0.0
    damagefactor "Decaptate", 0.0
	damagefactor "MonsterKnocked", 0.0
	damagefactor "MonsterBullet", 0.33
	damagefactor "MonsterShotgunBullet", 0.33
	damagefactor "MonsterCutless", 0.33
    damagefactor "Trample", 8.0
	damagefactor "Kick", 3.0
	damagefactor "Fatality", 5.0
	damagefactor "CancelTeleportFog", 0.0
	damagefactor "BHFTOnBarrel", 0.0
	damagefactor "GibRemoving", 0.0
	damagefactor "SuperPunch", 5.0
	damagefactor "HelperMarineFatallity", 0.0
	damagefactor "Leg", 0.0
	damagefactor "SpawnMarine", 0.0
	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseObjectsToSplash", 0.0
	Player.Face D4R
	Species "Marines"
	+NOSKIN
	+PLAYERPAWN.CROUCHABLEMORPH
	+PICKUP
	Player.CrouchSprite "SKEL"
	Speed 0.7
	States
	{
	Spawn:
		SKEL B 5
		Loop
	See:
		SKEL ABCDEF 3
		Goto Spawn
		
	Melee:
	Missile:
		SKEL J 2 BRIGHT
		SKEL K 2
		Goto Spawn
	Pain:
		SKEL L  2
		SKEL L  2 A_Pain
		Goto Spawn
	Death:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("D4RevenantHUD")
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		SKEL MNOP 4
		SKEL Q -1
		Stop
	XDeath:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("D4RevenantHUD")
		REDX A 1
		TNT1 A 0 A_Scream
		TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_PlaySound("misc/xdeath4")
		TNT1 AAA 0 A_CustomMissile ("XDeath1", 60, 0, random (0, 360), 2, random (0, 360))
		TNT1 AA 0 A_CustomMissile ("XDeath2b", 60, 0, random (0, 360), 2, random (0, 360))
		TNT1 AA 0 A_CustomMissile ("XDeath3b", 60, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_SpawnItem("MuchBlood2", 0, 50)
		TNT1 AAA 0 A_CustomMissile ("RevenantDust", 30, 0, random (0, 360), 2, random (0, 360))
		TNT1 AAAA 0 A_CustomMissile ("RevenantDust2", 30, 0, random (0, 360), 2, random (0, 360))
		TNT1 AA 0 A_CustomMissile ("BigLSPart1", 37, 0, random (0, 360), 2, random (30, 150))
		TNT1 AA 0 A_CustomMissile ("BigLSPart2", 37, 0, random (0, 360), 2, random (30, 150))
		TNT1 AAAAAAA 0 A_CustomMissile ("RevenantPiece", 37, 0, random (0, 360), 2, random (30, 150))
		TNT1 A 0 A_SpawnItem ("XDeadSkeleton22", 1)
		TNT1 A 0 A_SpawnItem("HellishMissileLauncher", 0, 40)
	    REDX ABCDEFGHIJK 3
		TNT1 A 0 A_SpawnItem("GrowingBloodPool")
		REDX K -1
		Stop	
		}
}



ACTOR D4RevenantHUD : DoomWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	+WEAPON.CHEATNOTWEAPON
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		D4RW A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		Loop
	
	Steady:	
		TNT1 A 0
		TNT1 A 1  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select
		
	
	Deselect:
		D4RW CBA 1
		D4RW AAAAAAAAAAAA 0 A_Lower
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAA 1 A_Lower
		Loop
	Select:
		TNT1 A 1 A_Raise
		D4RW AAAAAAAAA 0 A_Raise
		Select2:
		TNT1 A 0 A_PlaySound("skeleton/sight")
		D4RW ABC 1 A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		Goto Ready
		
	Fire:
		TNT1 A 0
		D4RW A 1 A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_FireCustomMissile("revenantseekermissiles2", random(-2,2),0,-12,0,0,random(-1,1))
		D4RW B 2 BRIGHT
		D4RW A 4 A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_FireCustomMissile("revenantseekermissiles2", random(-2,2),0,12,0,0,random(-1,1))
		D4RW C 2 BRIGHT A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		D4RW A 4 A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_FireCustomMissile("revenantseekermissiles2", random(-2,2),0,-12,0,0,random(-1,1))
		D4RW B 2 BRIGHT  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		D4RW A 4  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_FireCustomMissile("revenantseekermissiles2", random(-2,2),0,12,0,0,random(-1,1))
		D4RW C 2 BRIGHT  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		D4RW A 4  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_FireCustomMissile("revenantseekermissiles2", random(-2,2),0,-12,0,0,random(-1,1))
		D4RW B 2 BRIGHT  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		D4RW A 4  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		TNT1 A 0 A_PlaySound("MICRO1", 1)
		TNT1 A 0 A_FireCustomMissile("revenantseekermissiles2", random(-2,2),0,12,0,0,random(-1,1))
		D4RW C 2 BRIGHT  A_JumpIfInventory("CeaseMorph", 1, "CeaseMorph")
		D4RW A 30
		Goto Ready
		
	Spawn:
		SHOT A -1
		Stop
		
	CeaseMorph:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("CeaseMorph", 1)
		TNT1 A 0 ACS_NamedExecuteAlways("BDForceUnmorph")
		TNT1 A 1
		Goto Ready	
	}
}






ACTOR D4RevenantROcket: Rocket2
{
	Radius 8
	Height 8
	Damage 10
	Scale 0.5
	Speed 45
	-NOEXTREMEDEATH
	-GHOST
	-THRUGHOST
	+SEEKERMISSILE
	Damagetype "ExplosiveImpact"
	Species "Marines"
	States
	{
	Spawn:
	    MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 ThrustThingZ(0,random(-3, 2),0,1)
		MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 ThrustThingZ(0,random(-3, 2),0,1)
		MISL A 1 Bright 
		TNT1 A 0 A_SpawnItem("RedFlareSmall",-20,0)
		TNT1 A 0 A_CustomMissile ("MeleeSmoke", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 ThrustThing(angle*256/360+64,random(-1, 1),1, 0)
		Loop
	}
}