class SourceTypeHitPrereqCondition extends BaseHitPrereqCondition
{
	var m_source : CName;

	public override function SetData( recordID : TweakDBID )
	{
		m_source = TweakDBInterface.GetCName( recordID + T".source", '' );
		super.SetData( recordID );
	}

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var result : Bool;
		var target : weak< ScriptedPuppet >;
		target = ( ( ScriptedPuppet )( hitEvent.target ) );
		if( !( target ) )
		{
			return false;
		}
		switch( m_source )
		{
			case 'Grenade':
				result = ( ( WeaponGrenade )( hitEvent.attackData.GetSource() ) );
			break;
			default:
				return false;
		}
		if( result )
		{
			result = CheckOnlyOncePerShot( hitEvent );
		}
		return ( ( m_invert ) ? ( !( result ) ) : ( result ) );
	}

}

