// AeniBlood, a simple effect which I might
// release seperately for open use.
//written from scratch by Aenima, for Avi
//loosely based on F.E.A.R.

ACTOR AeniBlood : Blood //replaces Blood
{
  //SpawnID 130
  Mass 5
  //+NOBLOCKMAP
  +NOTELEPORT
  -ALLOWPARTICLES
  +NOGRAVITY
  Scale 0.25
  Alpha 0.5
  States
  {
  Spawn:
  Spray:
    BLOD C 0
	BLOD A 0 A_Playsound ("BLD/SPLT")//A_PlaySound("flesh/hit")
    BLOD C 0 A_SpawnItemEx ("AeniBloodEffectSpawner", 0,0,0, 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 64)
    BLOD C 0 A_SpawnItemEx ("Bludeffect1b", 0,0,0, 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 0)
    BLOD CCCC 0 A_SpawnItemEx ("AeniBlood2", 0,0,0, random(-14,14)*0.1,random(-14,14)*0.1,random(-14,14)*0.1, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 64)
	TNT1 A 1
    Stop
  }
}

ACTOR AeniBlood2 : AeniBlood
{
  Scale 4.0//2.0
  alpha 0.28
  +NOGRAVITY
	+FORCEXYBILLBOARD
  //gravity 0.25
  +CLIENTSIDEONLY
  +CANNOTPUSH
  States
  {
  Spawn:
    BLOD A 0
    BLUD AA 1 BRIGHT A_Jump(128,"Spawn2")
	
  Spawn2:
    BLUD AAABBBBCCCCCC 1 A_Fadeout(0.02)
    Stop
  }
}



ACTOR BludEffectSpawner
{
	+NOTELEPORT
  Radius 1
  Height 1
  +NOBLOCKMAP
  +NOTELEPORT
  +NOGRAVITY
  +NOCLIP
  -SOLID
  -SHOOTABLE
  +DONTSPLASH
  RENDERSTYLE NONE
  States
  {
  Spawn:
    TNT1 A 0
   	TNT1 A 0 Thing_ChangeTID (0, 1330) 
	TNT1 A 0 A_Jump(104, "BetterBlud")
   8LUD C 0 A_SpawnItemEx ("Bloodsquirt3", 0,0,0, 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
   	TNT1 A 1
   Stop
  BetterBlud:
   8LUD CCC 0 A_SpawnItemEx ("BetterBlood", 0,0,0, 0,0,0, random(-180,180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
   TNT1 A 0 A_PlaySound("bloodsplatt")
   	TNT1 A 1
   Stop
  }
}

ACTOR BludEffect1
{
	+NOTELEPORT
  Radius 8
  Height 4
  Speed 0//1
  Damage 0
  Projectile
  -RANDOMIZE
  -NOCLIP
  +THRUACTORS
  +DONTSPLASH
  +NOPAIN
  +PAINLESS
  +CANNOTPUSH
  RenderStyle Translucent
  Alpha 0.66//0.51
  scale 0.75
  States
  {
  Spawn:
    BLUD A 0
   	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    BLUD A 0 A_Jump(256, 2)//127
	BLUD A 0
	Stop
	
  Prefade:
    BLUD A 0 A_Jump(64, "WhichSpawn")
    BLUD A 0 A_FadeOut(0.01)
    Loop
	
  WhichSpawn:
    BLUD A 0 //A_SetPitch(random(-90,60))
    BLUD A 0 A_Jump(96, "Spawn2", "Spawn3")
	Goto Spawn1
	
  Spawn1:
    BLUD AAAA 2 A_FadeOut(0.04)
    //BLUD A 0 A_RadiusGive("VisorSplatter", 24, RGF_PLAYERS, 1)
    BLUD BBBB 2 A_FadeOut(0.04)
    //BLUD A 0 A_RadiusGive("VisorSplatter", 24, RGF_PLAYERS, 1)
    BLUD CCCCCCCC 2 A_FadeOut(0.04)
    stop	
  Spawn2:
    BLUD AAA 2 A_FadeOut(0.05)
    //BLUD A 0 A_RadiusGive("VisorSplatter", 24, RGF_PLAYERS, 1)
    BLUD BBB 2 A_FadeOut(0.05)
    //BLUD A 0 A_RadiusGive("VisorSplatter", 24, RGF_PLAYERS, 1)
    BLUD CCCCCCC 2 A_FadeOut(0.05)
    stop	
  Spawn3:
    BLUD AABB 2 A_FadeOut(0.06)
    //BLUD A 0 A_RadiusGive("VisorSplatter", 24, RGF_PLAYERS, 1)
    BLUD CCCCCC 2 A_FadeOut(0.06)
    stop
	
  Death:
  XDeath:
  Crash:
    BLUD C 0 //A_Stop
   NULL A 0 A_SpawnItemEx ("dripsound", 0, 0, 0, 0, 0, 0, 0, 128, 0)
  TNT1 A 0 A_CheckFloor("Death2")
  TNT1 AA 1
  Stop
 Death2:
  TNT1 A 1 A_SpawnItemEX("BloodSpot", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
  TNT1 A 0
  Stop
	Stop
  }
}
ACTOR BloodSpawner : BludEffect1
{
  //Mass 5
  scale 0.85
  /*
  -SHOOTABLE
  -SOLID
  +NOTELEPORT
  +CORPSE
  +DONTSPLASH
  */
  //Seesound "bld/splt"
  -NOGRAVITY
  Dropitem "Bloodspot"
  Alpha 0.825
  States
  {
  Spawn:
    BLUD CBA 2
    TNT1 A 0 Thing_ChangeTID (0, 1330) 
  Fall:
    BAL1 A 0 A_JumpIf(waterlevel == 3, "Cloud")
    BAL1 A 0 A_JumpIf(waterlevel == 2, "Cloud")
    BLUD A 1 A_CheckFloor("Death")
    LOOP
  Death:
    BLUD A 0
    BLUD A 0 A_Fall
	TNT1 A 2
    Stop
  Cloud:
      BSP4 AAA 1 A_FadeOut(0.01)
      BSP4 BBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ 1 A_FadeOut(0.01)
      BSP5 AAABBB 1
      Stop
  }
}

ACTOR BludEffect1c : BludEffect1
{
  -NOGRAVITY
  Gravity 0.75
  //Alpha 0.85
  States
  {
    WhichSpawn:
    BLUD A 0 //A_SetPitch(random(-90,60))
	BLUD C 0 ThrustThingZ(0, random(0,48), 0, 0)
	BLUD A 0 A_Recoil (random(-10,-4))
    BLUD A 0 A_Jump(96, "Spawn2", "Spawn3")
	Goto Spawn1
  }
}

ACTOR BludEffect1b : BludEffect1
{
  Alpha 0.51
  scale 1.25
  States
  {
  Spawn:
    BLUD A 0
   	TNT1 A 0 Thing_ChangeTID (0, 1330) 
    BLUD A 0 A_Jump(64, "Death")
	
  Prefade:
    BLUD A 0 A_Jump(16, "WhichSpawn")
    BLUD A 0 A_FadeOut(0.01)
    Loop	


  WhichSpawn:
    BLUD ABC 1 A_FadeOut(0.07)
    BLUD A 0 A_Jump(128, "Spawn2", "Spawn3")
	
  Spawn1:
    BLUD C 3 A_FadeOut(0.01)
	TNT1 A 0 A_ChangeVelocity(momx*0.5,momy*0.5,momz*0.5, CVF_REPLACE)
    BLUD C 0 A_Jump(30, "Death")
	Loop
  Spawn2:
    BLUD C 2 A_FadeOut(0.01)
	TNT1 A 0 A_ChangeVelocity(momx*0.75,momy*0.75,momz*0.75, CVF_REPLACE)
    BLUD C 0 A_Jump(20, "Death")
	Loop
  Spawn3:
    BLUD C 1 A_FadeOut(0.01)
    BLUD C 0 A_Jump(10, "Death")
	Loop
	
  Death:
  XDeath:
  Crash:
    BLUD C 0 A_Stop
    BLUD C 1 A_FadeOut(0.2)
	Loop
  }
}

ACTOR BludEffect2 : BludEffect1c
{
  Speed 8
  scale 0.4
}

ACTOR BludEffect3 : BludEffect1c
{
  Speed 10
  scale 0.6
}

ACTOR BludEffect4 : BludEffect1c
{
  Speed 12
  scale 0.8
}

ACTOR AeniBloodEffectSpawner
{
  +NOTELEPORT
  Radius 1
  Height 1
  +NOBLOCKMAP
  +NOTELEPORT
  //+NOGRAVITY
  Gravity 0.66//0.8
  +NOCLIP
  -SOLID
  -SHOOTABLE
  +DONTSPLASH
	+FORCEXYBILLBOARD
  RENDERSTYLE normal //none
  scale 0.8
  States
  {
  Spawn:
    TNT1 A 0
   	TNT1 A 0 Thing_ChangeTID (0, 1330) 
      BLUD AAA 1 Bright A_SpawnItemEx("BludEffect4", 0,0,0, 0,0,0, random(-2,2), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)//|SXF_ABSOLUTEANGLE)
      BLUD BBB 1 Bright A_SpawnItemEx("BludEffect3", 0,0,0, 0,0,0, random(-4,4), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)//|SXF_ABSOLUTEANGLE)
	  BLOD A 0 A_Jump(8, "Death")
      BLUD CCCC 1 Bright A_SpawnItemEx("BludEffect2", 0,0,0, 0,0,0, random(-8,8), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)//|SXF_ABSOLUTEANGLE)
      Stop
  Death:
    TNT1 AA 0
	Stop
  }
}
// -------------------------------------------

// Flying blood, a la SMHQ.
// Special thanks to StrikerMan!

actor BetterBlood
{
 +FORCEXYBILLBOARD
 +CLIENTSIDEONLY
 RenderStyle Translucent
 Alpha 0.7
 game Doom
 states
 {
 Spawn:
  //TNT1 A 1
    TNT1 A 0
   	TNT1 A 0 Thing_ChangeTID (0, 1330) 
  //TNT1 A 0 A_PlaySound("bloodsplatt")
   BLUD A 0 A_JumpIf(waterlevel == 3, "Nahh")
   BLUD A 0 A_JumpIf(waterlevel == 2, "Nahh")
  BLUD A 0 A_SpawnItemEx("Striker_FlyingBlood", 0, 0, 0, random(4, 8), random(4, 8), random(1, 8), Random(-180, 180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 186)
  BLUD A 0 A_SpawnItemEx("Striker_FlyingBlood", 0, 0, 0, random(2, 6), random(2, 6), random(1, 10), Random(-180, 180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 186)
  BLUD A 0 A_SpawnItemEx("Striker_FlyingBlood", 0, 0, 0, random(1, 4), random(1, 4), random(1, 12), Random(-180, 180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 186)
  BLUD A 0 A_SpawnItemEx("Fleshy_Splatter", 0, 0, 0, random(1, 2), random(1, 2), random(1, 8), Random(-180, 180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 224)
  BLUD A 0 A_SpawnItemEx("Fleshy_Splatter", 0, 0, 0, random(1, 2), random(1, 2), random(1, 8), Random(-180, 180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 224)
  BLUD A 0 A_SpawnItemEx("Fleshy_Splatter", 0, 0, 0, random(1, 2), random(1, 2), random(1, 8), Random(-180, 180), SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION, 224)
  TNT1 A 0
  stop
 Nahh:
  TNT1 A 1
  Stop
 }
}

actor Striker_FlyingBlood
{
 Game Doom
 Scale 0.5//.7
 Health 1
 Radius 4
 Height 1
 Mass 1
 ReactionTime 160
 RenderStyle Translucent
 Alpha 0.56
 decal betterblooddecal//semibigbloodsplat
 //+CORPSE
 PROJECTILE
 -NOGRAVITY
 Gravity 0.9
 +NOTELEPORT
 +NOBLOCKMAP
 +THRUACTORS
 +DONTSPLASH
 +CLIENTSIDEONLY
 +NOBLOCKMONST
 +FORCEXYBILLBOARD
 -ACTIVATEIMPACT
 -ACTIVATEPCROSS
  +CANNOTPUSH
 States
 {
 Spawn:
  TNT1 A 0 A_CountDown
   BLUD A 0 A_JumpIf(waterlevel == 3, "Death")
   BLUD A 0 A_JumpIf(waterlevel == 2, "Death")
  BLUD C 1 A_SpawnItemEX("Striker_FlyingBloodTrail", 0, 0, 0, Random(-1,1), Random(-1,1), Random(-1,1), 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
  Loop
 Death:
  TNT1 A 0 A_CheckFloor("Death2")
  TNT1 AA 1
  Stop
 Death2:
  TNT1 A 1 A_SpawnItemEX("BloodSpot", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
  TNT1 A 0
  Stop
 }
}

actor Striker_FlyingBloodTrail
{
 Game Doom
 //Scale 1.3 //OLD
 Scale 0.25//0.33
 Height 8
 Radius 2
 Mass 1
 RenderStyle Translucent
 Alpha 0.5
 -NOGRAVITY
 +NOTELEPORT
 +NOBLOCKMAP
 +CLIENTSIDEONLY
 +CORPSE
 +DONTSPLASH
 +FORCEXYBILLBOARD
 -ACTIVATEIMPACT
 -ACTIVATEPCROSS
  +CANNOTPUSH
 States
 {
  Spawn:
	TNT1 A 0
	TNT1 A 0 Thing_ChangeTID (0, 1330)
    BLUD A 0 A_Jump(127, "SpawnB", "SpawnC")
	
  SpawnA:
    X057 ABCDEFGHIJK 1 A_FadeOut(0.02)
	X057 LLMMNNOOPPQQRRSS 1 A_FadeOut(0.01)
	Stop
	
  SpawnB:
	X058 ABCDEFGHIJKLMNOPQRR 1 A_FadeOut(0.02)
	Stop
		
  SpawnC:
  SpawnD:
	X059 ABCDEF 1 A_FadeOut(0.04)
	X059 GGHHIIJJKKLLMM 1 A_FadeOut(0.01)
	Stop
  	//BLUD CCCCBBBBAAAAAAAA 1 A_FadeOut(0.03)// OLD ANIMATION
  	//Stop
  SpawnE:
  SpawnF:
	TNT1 A 1
	Stop
  Crash:
  	BLUD E 100 A_SetTranslucent(0.6,0)
  	BLUD EEEEEEEEEEEE 1 A_FadeOut
  	stop
 }
}

actor Fleshy_Splatter
{
 Game Doom
 Health 1
 Radius 4
 Height 1
 Mass 1
 ReactionTime 160
 +CORPSE
 +NOTELEPORT
 +NOBLOCKMAP
 +CLIENTSIDEONLY
 +DONTSPLASH
 +NOBLOCKMONST
 +FORCEXYBILLBOARD
 States
 {
 Spawn:
  TNT1 A 0 A_CountDown
  TNT1 A 2 A_SpawnItemEX("Fleshy_SplatterTrail", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
  Loop
 Crash:
  //TNT1 A 0 A_CheckSight("Disappear")
  TNT1 A 1 A_SpawnItemEX("Fleshy_BloodSpot", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_CLIENTSIDE|SXF_TRANSFERTRANSLATION)
  TNT1 A 0
  Stop
 Disappear:
  	TNT1 AA 1
  	stop
 }
}

actor Fleshy_BloodSpot
{
 Game Doom
 Radius 1
 Height 1
 Mass 1
 RenderStyle Translucent
 Alpha 0.6
 +NOTELEPORT
 -NOBLOCKMAP
 +CORPSE
 +CLIENTSIDEONLY
 +DONTSPLASH
 +FORCEXYBILLBOARD
 States
 {
 Spawn:
  TNT1 A 0
  TNT1 A 0 Thing_ChangeTID (0, 1330) 
  BLD3 E 400
  BLD3 EEEEEE 1 A_FadeOut
  Stop
 }
}

actor Fleshy_SplatterTrail
{
 Game Doom
 Height 1
 Radius 1
 Mass 1
 Gravity 0.2
 RenderStyle Translucent
 Alpha 0.7
 Scale 0.7
 -NOGRAVITY
 +NOTELEPORT
 +NOBLOCKMAP
 +CLIENTSIDEONLY
 +CORPSE
 +DONTSPLASH
 +FORCEXYBILLBOARD
  +CANNOTPUSH
 States
 {
  Spawn:
	TNT1 A 0
	TNT1 A 0 Thing_ChangeTID (0, 1330) 
  BLD3 ABCD 4
  Stop
 }
}

ACTOR visorsplatter : CustomInventory
{
	Radius 10
	Height 10
	Inventory.Amount 1
	Inventory.MaxAmount 999
	-COUNTITEM
        -INVBAR
        +FANCYPICKUPSOUND
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	States
	{
	Spawn:
		NULL A 1
		Stop
        Pickup:
        //Use:
                NULL A 0
                NULL A 0 ACS_ExecuteAlways(878,0, 3,0,0)
                Stop
	}
}