class RarityOfEquippedCyberdeckPrereqState extends PrereqState
{
}

class RarityOfEquippedCyberdeckPrereq extends IScriptablePrereq
{
	var m_minimumQuality : Int32;

	protected override function Initialize( recordID : TweakDBID )
	{
		m_minimumQuality = TweakDBInterface.GetInt( recordID + T".minimumQuality", 0 );
	}

	public const override function IsFulfilled( game : GameInstance, context : IScriptable ) : Bool
	{
		var systemReplacementID : ItemID;
		var player : PlayerPuppet;
		var result : Bool;
		var deckQuality : Int32;
		player = GetPlayer( game );
		systemReplacementID = EquipmentSystem.GetData( player ).GetActiveItem( gamedataEquipmentArea.SystemReplacementCW );
		if( EquipmentSystem.IsCyberdeckEquipped( player ) )
		{
			deckQuality = TweakDBInterface.GetItemRecord( ItemID.GetTDBID( systemReplacementID ) ).Quality().Value();
		}
		result = deckQuality == m_minimumQuality;
		return result;
	}

}

