class KurtzBossComponent extends ScriptableComponent
{
	private var m_owner : weak< NPCPuppet >;
	private var m_owner_id : EntityID;

	private function OnGameAttach()
	{
		m_owner = ( ( NPCPuppet )( GetOwner() ) );
		m_owner_id = m_owner.GetEntityID();
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.BossNoTakeDownInfinite", m_owner_id );
	}

	protected event OnAIEvent( aiEvent : AIEvent )
	{
		switch( aiEvent.name )
		{
			case 'KnifeOff':
				m_owner.ScheduleAppearanceChange( 'kurt_pistol_knfe_off_pistol_on' );
			break;
			case 'KnifeOn':
				if( m_owner.GetCurrentAppearanceName() != 'kurt_bossfight' )
				{
					m_owner.ScheduleAppearanceChange( 'kurt_bossfight' );
				}
			break;
		}
	}

	protected event OnDefeated( evt : DefeatedEvent )
	{
		StatusEffectHelper.ApplyStatusEffect( m_owner, T"AdamSmasher.Invulnerable", m_owner_id );
	}

	protected event OnDeath( evt : gameDeathEvent ) {}

	protected event OnStatusEffectApplied( evt : ApplyStatusEffectEvent )
	{
		var tags : array< CName >;
		tags = evt.staticData.GameplayTags();
		if( tags.Contains( 'BossGrenadeHackEffect' ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.SasquatchSuicideWithGrenade", m_owner_id );
		}
		if( StatusEffectSystem.ObjectHasStatusEffect( m_owner, T"Oda.Main_boss_oda_allow_knockdown" ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.Knockdown", m_owner_id );
		}
		if( tags.Contains( 'BossSuicide' ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.SuicideWithWeapon", m_owner_id );
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"Sasquatch.ForceStaggerSuicide", m_owner_id );
		}
	}

	protected event OnStatusEffectRemoved( evt : RemoveStatusEffect )
	{
		var tags : array< CName >;
		tags = evt.staticData.GameplayTags();
		if( tags.Contains( 'Madness' ) )
		{
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"BaseStatusEffect.SuicideWithWeapon", m_owner_id );
			StatusEffectHelper.ApplyStatusEffect( m_owner, T"Sasquatch.ForceStaggerSuicide", m_owner_id );
		}
	}

}

