//Extra blood effects monsters spew out

ACTOR CAmonsterBlud
{
    +NOGRAVITY
	Renderstyle Translucent
    Health 6
    States
    {
    Spawn:
    	MBLD A 3
    	MBLD B 3 A_SpawnDebris("cs_go")
    	MBLD C 3
        Stop
    }
}

Actor cs_go: PlasmaBall
{
    Renderstyle Translucent
    Reactiontime 3
    Damage 0
    Speed 100
    DontHurtShooter
    +HEXENBOUNCE
    +RIPPER
    Health 6
    -NOGRAVITY
    Scale 0.35
    damage 0
    seesound ""
    deathsound ""
    States
    {
    Spawn:
    	MBLD ABCBABCBABCB 1
    	TROO H 0 BRIGHT A_COuntDown
    Death:
    	MBLD ABC 3 BRIGHT
    	TNT1 A 1 A_Jump(5,1)
    	Stop
    	TNT1 A 1
    	Stop
    }
}

//===================================================================================
//===================================================================================

//CLIPS AND CASING EFFECTS
//Code shamelessly borrowed from Pillowblaster's Trailblazer
//Mod, with permission of course


ACTOR MonsterCasingSpawner //Shamelessly stolen from probably one of Weasel's mods, yoink. (Then taken by me, double yoink)
{
	Speed 13
	PROJECTILE
	+NOCLIP
	States
	{
	Spawn:
		TNT1 AA 0 A_CustomMissile("MonsterCasing",0,0,random(-100,-80),CMF_AIMDIRECTION,random(-15,15))
		Stop
	}
}

ACTOR MonsterCasing
{
	Radius 2
	Height 4
	Speed 8
	Scale 0.1
	PROJECTILE
	-NOGRAVITY
	+BOUNCEONACTORS
	+DONTSPLASH
	Gravity 0.75
	BounceType Doom
	BounceCount 6
	BounceFactor 0.6  
	+clientsideonly
	States
	{
	Spawn:
		MCS1 ABCDEFGH 1 bright
		Goto rollingloop
	rollingloop:
		TNT1 A 0 a_playsound ("MonsterCasing/Bullet",0,1,0,1.6)
		MCS1 A 0 A_Jump(128,1,3,5,7)
		MCS1 ABCDEFGH 1 bright
		Loop
	Death:
		TNT1 A 0 a_jump (256, "dead1","dead2")
		loop
	dead1:
		TNT1 A 0 a_playsound ("MonsterCasing/Bullet",0,1,0,1.6)
		MCS1 I 60 bright
		MCS1 I 1 bright a_fadeout (0.01)
		wait
 	dead2:
		TNT1 A 0 a_playsound ("MonsterCasing/Bullet",0,1,0,1.6)
		MCS1 J 60 bright
		MCS1 J 1 bright a_fadeout (0.01)
		wait
	}
}

ACTOR MonsterShellSpawner //Shamelessly stolen from probably one of Weasel's mods, yoink. (Then taken by me, double yoink)
{
	Speed 13
	PROJECTILE
	+NOCLIP
	States
	{
	Spawn:
		TNT1 AA 0 A_CustomMissile("MonsterShell",0,0,random(-100,-80),CMF_AIMDIRECTION,random(-15,15))
		Stop
	}
}

ACTOR MonsterShell
{
	Radius 2
	Height 4
	Speed 8
	Scale 0.2
	PROJECTILE
	-NOGRAVITY
	+BOUNCEONACTORS
	+DONTSPLASH
	Gravity 0.75
	BounceType Doom
	BounceCount 6
	BounceFactor 0.6  
	+clientsideonly
	States
	{
	Spawn:
		MCS2 ABCDEFGH 1 bright
		Goto rollingloop
	rollingloop:
		TNT1 A 0 a_playsound ("MonsterCasingShotgun",0,1,0,1.6)
		MCS2 A 0 A_Jump(128,1,3,5,7)
		MCS2 ABCDEFGH 1 bright
		Loop
	Death:
		TNT1 A 0 a_jump (256, "dead1","dead2")
		loop
	dead1:
		TNT1 A 0 a_playsound ("MonsterCasingShotgun",0,1,0,1.6)
		MCS2 I 60 bright
		MCS2 I 1 bright a_fadeout (0.01)
		wait
 	dead2:
		TNT1 A 0 a_playsound ("MonsterCasingShotgun",0,1,0,1.6)
		MCS2 J 60 bright
		MCS2 J 1 bright a_fadeout (0.01)
		wait
	}
}



ACTOR monstersmokespawner
{
	projectile
	RenderStyle Translucent
	speed 20
	-SOLID
	+NOBLOCKMAP
	+NOGRAVITY
	+NOCLIP
	+DONTSPLASH
	+NOTELEPORT
	+clientsideonly
	States
	{
	Spawn:
        TNT1 A 0
        TNT1 A 1
        TNT1 AA 0 A_SpawnItemEx("monstersmoke",frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(-1.5,-1.5),frandom(0.5,5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,32)
        TNT1 A 1 A_SpawnItemEx("monstersmoke",frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(-1.5,-1.5),frandom(0.5,5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,32)
        TNT1 AA 0 A_SpawnItemEx("monstersmoke",frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(-1.5,-1.5),frandom(0.5,5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,32)
        TNT1 A 1 A_SpawnItemEx("monstersmoke",frandom(-0.1,0.1),frandom(-0.1,0.1),frandom(-1.5,-1.5),frandom(0.5,5),frandom(-0.5,0.5),frandom(-0.5,0.5),0,32)
		Stop
	}
}

actor monstersmoke
{
    Radius 1
    Height 1
	Scale 0.10
	renderstyle add
	Alpha 0.80
    Projectile
	+clientsideonly
    +NOCLIP
    States
    {
   Spawn:
      TNT1 A 2
      MSMK ABCDEFGHIJKLMNOPQ 2 A_FadeOut(0.1)
      Stop
    }
}

ACTOR MonsterSpark
{
	Health 4
	radius 3
	height 6
	speed .1
	RenderStyle ADD
	Alpha		1
	Scale 0.5
	Mass		0
	+missile
	+doombounce
	+FLOORCLIP
	+DONTSPLASH
	+NOTELEPORT
	+clientsideonly
	States
	{
		PUFF A 1
		PUFF AAA 1  Bright A_SetTranslucent(.8,1)
		PUFF AAAA 1  Bright A_SetTranslucent(.6,1)
		PUFF AAAAAA 1  Bright A_SetTranslucent(.4,1)
		PUFF AAAAAAAA 1 Bright A_SetTranslucent(.2,1)
		Stop
	}
}

actor FireDebris
{
	+cannotpush
	+movewithsector
	+dontsplash
	+noblockmap
	+thruactors	
	+doombounce
	+clientsideonly
	+missile
	+bright
	+nogravity
	+usebouncestate
	bouncecount 2
	bouncefactor 0.40
	Wallbouncefactor 0.80
	scale 0.10
	reactiontime 30
	gravity 0.93

	var int user_DebrisTimer;
	states
	{
	spawn:	
		MNLZ A 1 a_spawnitemex ("FireDebrisTrail",0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_scalevelocity (frandom (0.96,0.98))
		TNT1 A 0 a_setuservar("user_DebrisTimer", user_DebrisTimer+random(1,2))
		TNT1 A 0 a_jumpif (user_DebrisTimer >= 13, "TimeToFall")
		loop
	TimeToFall:
		MNLZ A 1 a_spawnitemex ("FireDebrisTrail",0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_gravity
		Goto Falling
	Falling:
		MNLZ A 1 a_spawnitemex ("FireDebrisTrail",0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_countdown
		loop
	Bounce.floor:
		MNLZ A 1 a_scalevelocity (frandom (0.96,0.98))
		goto Falling
	Death:
		TNT1 A 0
		TNT1 A 0 a_setscale (0.30)
		TNT1 A 0 a_nogravity
		MNFI ABCDEFGHI 1
		stop
	}
}

actor FireDebrisTrail
{
    Radius 1
    Height 1
	Scale 0.50
	renderstyle add
	Alpha 0.80
    Projectile
	+clientsideonly
    +NOCLIP
    States
    {
	Spawn:
		TNT1 A 2
		MNFI ABCDEFGHI 1
		stop
	Death:
		TNT1 A 1
		stop
	}
}



Actor BigFireDebris : FireDebris
{
	scale 0.20
	states
	{
	spawn:	
		MNLZ A 1 a_spawnitemex ("BigFireDebrisTrail",0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_scalevelocity (frandom (0.96,0.98))
		TNT1 A 0 a_setuservar("user_DebrisTimer", user_DebrisTimer+random(1,2))
		TNT1 A 0 a_jumpif (user_DebrisTimer >= 13, "TimeToFall")
		loop
	TimeToFall:
		MNLZ A 1 a_spawnitemex ("BigFireDebrisTrail",0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_gravity
		Goto Falling
	Falling:
		MNLZ A 1 a_spawnitemex ("BigFireDebrisTrail",0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		TNT1 A 0 a_countdown
		loop
	Death:
		TNT1 A 0
		TNT1 A 0 a_setscale (0.50)
		TNT1 A 0 a_nogravity
		MNFI ABCDEFGHI 1
		stop
	}
}


Actor BigFireDebrisTrail : FireDebrisTrail
{
	scale 1
}

//===================================================================================
//===================================================================================



//Monster projectile trails

actor Monsterbullettracer
{
	RenderStyle add
	Alpha 0.95
	Scale 0.7
	+NOBLOCKMAP
	+NOGRAVITY
	+NOCLIP
	+DONTSPLASH
	+NOTELEPORT
	+clientsideonly
	States
	{
	spawn:
		PUFF A 2 
		stop
	death:
		TNT1 A 1
		stop
	}
}



ACTOR MonsterVenttrail
{
	+NOINTERACTION
	+NOCLIP
    +BRIGHT
	+clientsideonly
	Radius 1
	Height 1
	Renderstyle Add
	Alpha 0.60
	Scale 0.60
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		BAL1 AAA 1
		BAL1 A 1 A_SetScale(0.40)
		BAL1 A 1 A_SetScale(0.20)
		BAL1 A 1 A_SetScale(0.10)
		Stop
	}
}

ACTOR MonsterVenttrail2 : MonsterVentTrail
{
	Scale 0.30
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 1
		BAL1 AAA 1
		BAL1 A 1 A_SetScale(0.15)
		BAL1 A 1 A_SetScale(0.10)
		BAL1 A 1 A_SetScale(0.05)
		Stop
	}
}


//Fire effects

ACTOR Monsterfire
{
	radius 3
	height 6
	speed 10
	scale 0.45
	projectile
	-nogravity
	+nointeraction
	+FLOORCLIP
	+DONTSPLASH
	+thruactors
	+NOTELEPORT
	+clientsideonly
	States
	{
	spawn:	
		MNFI ABCDE 1 bright
		MNFI FGHI 1  Bright
		Stop
	}
}


ACTOR MonsterFireTrail
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+RANDOMIZE
	RenderStyle Add
	Alpha 0.5
	Scale 0.35
	+clientsideonly
	Mass 5
	States
	{
	Spawn:
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
	fade:
		MNLZ A 2 Bright A_FadeOut(0.1)
		loop
	}
}

ACTOR MonsterFireEmber1
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+RANDOMIZE
	RenderStyle Add
	Alpha 0.5
	Scale 0.1
	+clientsideonly
	Mass 5
	States
	{
	Spawn:
		MNLZ A 2 Bright A_FadeOut(0.04)
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
		MNLZ A 2 Bright A_FadeOut(0.1)
	fade:
		MNLZ D 2 Bright A_FadeOut(0.1)
		Loop
	}
}

ACTOR MonsterFireEmber2
{
	+NOBLOCKMAP
	+ALLOWPARTICLES
	+RANDOMIZE
	Gravity 0.2
	RenderStyle Add
	Alpha 0.5
	Scale 0.05
	Mass 5
	+clientsideonly
	States
	{
	Spawn:
		MNLZ A 35 Bright
		MNLZ AAAAAAAAAAAAAAAAA 2 Bright A_FadeOut(0.04)
		Stop
	}
}


ACTOR MonsterFireExplosion
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+RANDOMIZE
	RenderStyle Add
	Alpha 0.6
	Scale 0.50
	Mass 5
	+clientsideonly
	States
	{
	Spawn:
		MNLZ A 1 Bright 
		MNSK A 1 Bright 
	Fade:
		MNEX A 1 Bright
	Fade2:
		MNEX A 1 Bright A_FadeOut(0.5)
		loop
	}
}


ACTOR MiscreantExplosion
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+RANDOMIZE
	+noclip
	+bright
	RenderStyle Add
	Alpha 0.6
	Scale 1.30
	Mass 5
	states
	{
	spawn:
		MISL BCD 4
		stop
	death:
		TNT1 A 1
		stop
	}
}


actor MonsterFireSmoke
{
    Radius 1
    Height 1
	Scale 0.10
	Alpha 0.1
    Projectile
    +NOCLIP
	+clientsideonly
    States
    {
	Spawn:
		TNT1 A 3
		MSMK ABCDEFGHIJKLMNOPQ 3 A_FadeIn(0.02)
		Stop
    }
}

actor MonsterFireSmoke2
{
    Radius 1
    Height 1
	Scale 0.20
	Alpha 0.6
    Projectile
	+clientsideonly
    +NOCLIP
    States
    {
	Spawn:
		TNT1 A 2
		MSMK ABCDEFGHIJKLMNOPQ 2 A_FadeOut(0.1)
		Stop
    }
}


//Special effects for Combined_Arms weapons

//This is the little blip animation that spawns from enemies
//when they're killed from Past Linked weapons
actor CALinkedKill
{
	projectile
	+nointeraction
	speed 10
	+BRIGHT
	+CLIENTSIDEONLY
	Alpha 0.85
	scale 3
	states
	{
	spawn:	
		ZDTH A 3
		ZDTH B 3
		ZDTH A 3
		Stop
	}
}


actor CALinkedBossKill : CALinkedKill
{
	scale 6
}

//Explosion effects for bosses being killed by Past Linked weapons

ACTOR CALinkedBossExplosion
{
	+NOBLOCKMAP
	+NOGRAVITY
	+ALLOWPARTICLES
	+RANDOMIZE
	+bright
	RenderStyle Add
	Alpha 0.85
	Scale 3
	Mass 5
	+clientsideonly
	States
	{
	Spawn:
		ML1B ABCDEFGHIJK 1
		stop
	death:
		TNT1 A 0
		TNT1 A 1
		stop
	}
}


