class SadismEffector extends Effector
{
	var m_healingItemChargeRestorePercentage : Float;

	protected override function Initialize( record : TweakDBID, game : GameInstance, parentRecord : TweakDBID )
	{
		m_healingItemChargeRestorePercentage = TweakDBInterface.GetFloat( record + T".healingItemChargeRestorePercentage", 0.0 );
	}

	protected export override function ActionOn( owner : GameObject )
	{
		ProcessAction( owner );
	}

	protected export override function RepeatedAction( owner : GameObject )
	{
		ProcessAction( owner );
	}

	private function ProcessAction( owner : GameObject )
	{
		var statPoolsSystem : StatPoolsSystem;
		var healingItemsRechargeDuration : Float;
		var healingItemsRechargeTotal : Float;
		statPoolsSystem = GameInstance.GetStatPoolsSystem( owner.GetGame() );
		if( statPoolsSystem.GetStatPoolValue( owner.GetEntityID(), gamedataStatPoolType.Overshield, false ) <= 0.0 )
		{
			return;
		}
		healingItemsRechargeDuration = GameInstance.GetStatsSystem( owner.GetGame() ).GetStatValue( owner.GetEntityID(), gamedataStatType.HealingItemsRechargeDuration );
		healingItemsRechargeTotal = statPoolsSystem.GetStatPoolValue( owner.GetEntityID(), gamedataStatPoolType.HealingItemsCharges, false );
		healingItemsRechargeTotal += ( healingItemsRechargeDuration * m_healingItemChargeRestorePercentage );
		statPoolsSystem.RequestSettingStatPoolValue( owner.GetEntityID(), gamedataStatPoolType.HealingItemsCharges, healingItemsRechargeTotal, owner, false );
	}

}

