class EffectExecutor_GivePlayerReward extends EffectExecutor_Scripted
{
	editable var m_reward : TweakDBID;
	editable var m_amount : Int32;
	default m_amount = 1;

	public function Process( ctx : EffectScriptContext, applierCtx : EffectExecutionScriptContext ) : Bool
	{
		var player : PlayerPuppet;
		var targetNPC : NPCPuppet;
		var instigator : Entity;
		var target : Entity;
		var effect : StatusEffect;
		player = ( ( PlayerPuppet )( EffectScriptContext.GetInstigator( ctx ) ) );
		targetNPC = ( ( NPCPuppet )( EffectExecutionScriptContext.GetTarget( applierCtx ) ) );
		instigator = EffectScriptContext.GetInstigator( ctx );
		target = EffectExecutionScriptContext.GetTarget( applierCtx );
		effect = StatusEffectHelper.GetStatusEffectByID( targetNPC, T"BaseStatusEffect.UtilityGrenadeRewardHarvested" );
		if( ( ( ( ( !( TDBID.IsValid( m_reward ) ) || !( player ) ) || !( targetNPC ) ) || !( targetNPC.AwardsExperience() ) ) || ( instigator == target ) ) || effect )
		{
			return true;
		}
		RPGManager.GiveReward( GetGameInstance(), m_reward, m_amount, EffectExecutionScriptContext.GetTarget( applierCtx ).GetEntityID() );
		StatusEffectHelper.ApplyStatusEffect( targetNPC, T"BaseStatusEffect.UtilityGrenadeRewardHarvested", player.GetEntityID() );
		return true;
	}

}

