//=============================================================================
// KFSkinTypeEffects_InvulnerabilityShield
//=============================================================================
// Invulnerability shield effects (for bosses with invulnerability shield)
//=============================================================================
// Killing Floor 2
// Copyright (C) 2019 Tripwire Interactive LLC
//=============================================================================

class KFSkinTypeEffects_InvulnerabilityShield extends KFSkinTypeEffects;

function bool ConfigureEmitter(KFPawn P, vector InHitLocation, vector InHitDirection, int HitZoneIndex,
	out vector OutHitLocation, out vector OutHitDirection, out name OutHitBoneName, EEffectDamageGroup EffectGroup)
{
	if (HitZoneIndex >= P.HitZones.Length)
	{
		return false;
	}

	OutHitDirection = -InHitDirection;
	OutHitBoneName = P.HitZones[HitZoneIndex].BoneName;
	return true;
}

/** Overriden to orient the effect toward in the direction of the hit and not attach it to a specific bone */
function ParticleSystemComponent SpawnEmitter(KFPawn P, ParticleSystem ParticleTemplate,
	optional name HitBoneName, optional vector HitLocation, optional vector HitDirection)
{
	local ParticleSystemComponent PSC;

	PSC = P.WorldInfo.ImpactFXEmitterPool.SpawnEmitter(ParticleTemplate, HitLocation, rotator(HitDirection), P);
	if (PSC != none)
	{
		PSC.SetLightingChannels(P.PawnLightingChannel);
	}

	return PSC;
}

defaultproperties
{
}