abstract class AICondition extends IScriptable
{

	[ profile = "" ]
	public static function ActivationCheck( const context : ScriptExecutionContext, actionRecord : AIAction_Record ) : Bool
	{
		if( !( actionRecord ) )
		{
			return false;
		}
		return ScriptExecutionContext.GetTweakActionSystem( context ).ActivationCheck( context, actionRecord.GetID() );
	}

	public static function NextPhaseCheck( const context : ScriptExecutionContext, phase : Uint32, actionRecord : AIAction_Record ) : Bool
	{
		if( !( actionRecord ) )
		{
			return false;
		}
		return ScriptExecutionContext.GetTweakActionSystem( context ).NextPhaseCheck( context, actionRecord.GetID(), phase );
	}

	public static function RepeatPhaseCheck( const context : ScriptExecutionContext, phase : Uint32, actionRecord : AIAction_Record ) : Bool
	{
		if( !( actionRecord ) )
		{
			return false;
		}
		return ScriptExecutionContext.GetTweakActionSystem( context ).RepeatPhaseCheck( context, actionRecord.GetID(), phase );
	}

	public static function AnimationStreamedInCheck( const context : ScriptExecutionContext, actionRecord : AIAction_Record ) : Bool
	{
		var animData : AIActionAnimData_Record;
		var variationSubAction : AISubAction_Record;
		var animVariation : Int32;
		var phaseToCheck : Int32;
		animData = actionRecord.AnimData();
		if( !( animData ) )
		{
			return true;
		}
		if( !( animData.AnimSlot() ) )
		{
			return true;
		}
		if( !( IsNameValid( animData.AnimFeature() ) ) )
		{
			return true;
		}
		phaseToCheck = 0;
		if( actionRecord.Startup() )
		{
			phaseToCheck = 1;
		}
		else if( actionRecord.Loop() )
		{
			phaseToCheck = 2;
		}
		else if( actionRecord.Recovery() )
		{
			phaseToCheck = 3;
		}
		if( animData.AnimSlot().UsePoseMatching() )
		{
			animVariation = -1;
		}
		else
		{
			variationSubAction = animData.AnimVariationSubAction();
			if( variationSubAction )
			{
				animVariation = AIScriptUtils.CallGetAnimVariation( context, variationSubAction );
			}
			else
			{
				animVariation = animData.AnimVariation();
			}
		}
		if( !( AIScriptUtils.CheckAnimation( context, animData.AnimFeature(), animVariation, phaseToCheck, true ) ) )
		{
			return !( actionRecord.FailIfAnimationNotStreamedIn() );
		}
		return true;
	}

	public static function CheckActionConditions( const context : ScriptExecutionContext, conditions : ref< array< weak< AIActionCondition_Record > > > ) : Bool
	{
		var i : Int32;
		if( conditions.Size() == 0 )
		{
			return true;
		}
		for( i = 0; i < conditions.Size(); i += 1 )
		{
			if( CheckActionCondition( context, conditions[ i ] ) )
			{
				return true;
			}
		}
		return false;
	}

	public static function CheckActionCondition( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		return AIScriptUtils.CheckActionCondition( context, condition );
	}

	public static function CheckActionCondition( puppet : weak< ScriptedPuppet >, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var context : ScriptExecutionContext;
		if( AIHumanComponent.GetScriptContext( puppet, context ) )
		{
			return AIScriptUtils.CheckActionCondition( context, condition );
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckSlots( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AISlotCond_Record >;
		count = condition.GetSlotANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSlotANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetSlotORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSlotORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckItems( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIItemCond_Record >;
		count = condition.GetInventoryANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetInventoryANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetInventoryORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetInventoryORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckAbilities( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIAbilityCond_Record >;
		count = condition.GetAbilityCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetAbilityItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckStatusEffects( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIStatusEffectCond_Record >;
		count = condition.GetStatusEffectANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetStatusEffectANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetStatusEffectORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetStatusEffectORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckSignals( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AISignalCond_Record >;
		count = condition.GetSignalANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSignalANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetSignalORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSignalORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckSpatials( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AISpatialCond_Record >;
		count = condition.GetSpatialANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSpatialANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetSpatialORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSpatialORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckMovements( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIMovementCond_Record >;
		count = condition.GetMovementANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetMovementANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetMovementORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetMovementORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckCommands( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AICommandCond_Record >;
		count = condition.GetCommandANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetCommandANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetCommandORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetCommandORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckTickets( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AISquadCond_Record >;
		count = condition.GetSquadANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSquadANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetSquadORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetSquadORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckStatPools( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIStatPoolCond_Record >;
		count = condition.GetStatPoolANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetStatPoolANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetStatPoolORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetStatPoolORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckAmmoCounts( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIAmmoCountCond_Record >;
		count = condition.GetAmmoCountANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetAmmoCountANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetAmmoCountORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetAmmoCountORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckWeakSpots( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIWeakSpotCond_Record >;
		count = condition.GetWeakSpotANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetWeakSpotANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetWeakSpotORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetWeakSpotORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckVehicles( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIVehicleCond_Record >;
		count = condition.GetVehicleANDCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetVehicleANDItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		count = condition.GetVehicleORCount();
		if( count == 0 )
		{
			return true;
		}
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetVehicleORItem( i );
			if( Check( context, record ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public static function CheckTresspassings( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AITresspassingCond_Record >;
		count = condition.GetTresspassingCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetTresspassingItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckRestrictedMovementAreas( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIRestrictedMovementAreaCond_Record >;
		count = condition.GetRestrictedMovementAreaCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetRestrictedMovementAreaItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckCalculatePaths( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AICalculatePathCond_Record >;
		count = condition.GetCalculatePathCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetCalculatePathItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckCalculateLineOfSightVector( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AICalculateLineOfSightVector_Record >;
		count = condition.GetCalculateLineOfSightVectorCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetCalculateLineOfSightVectorItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckReactions( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIReactionCond_Record >;
		count = condition.GetReactionCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetReactionItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckLookats( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AILookAtCond_Record >;
		count = condition.GetLookatCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetLookatItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	[ profile = "" ]
	public static function CheckStates( const context : ScriptExecutionContext, condition : weak< AIActionCondition_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : weak< AIStateCond_Record >;
		count = condition.GetStateCount();
		for( i = 0; i < count; i += 1 )
		{
			record = condition.GetStateItem( i );
			if( !( Check( context, record ) ) )
			{
				return false;
			}
		}
		return true;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AISlotCond_Record > ) : Bool
	{
		var triggerModes : array< weak< TriggerMode_Record > >;
		var item : weak< ItemObject >;
		var weaponRecord : weak< WeaponItem_Record >;
		var itemRecord : weak< Item_Record >;
		var object : weak< GameObject >;
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		if( AIActionTransactionSystem.ShouldPerformEquipmentCheck( ( ( ScriptedPuppet )( object ) ), condition.EquipmentGroup() ) )
		{
			if( !( AIActionTransactionSystem.CheckSlotsForEquipment( context, condition.EquipmentGroup() ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		if( !( condition.Slot() ) || !( TDBID.IsValid( condition.Slot().GetID() ) ) )
		{
			return false;
		}
		if( condition.CheckIfEmptySlotIsSpawningItem() != -1 )
		{
			if( condition.CheckIfEmptySlotIsSpawningItem() == 1 )
			{
				if( !( AIActionTransactionSystem.IsSlotEmptySpawningItem( ScriptExecutionContext.GetOwner( context ), condition.Slot().GetID() ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
				else
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
			}
			else
			{
				if( AIActionTransactionSystem.IsSlotEmptySpawningItem( ScriptExecutionContext.GetOwner( context ), condition.Slot().GetID() ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
				else
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
			}
		}
		item = GameInstance.GetTransactionSystem( object.GetGame() ).GetItemInSlot( object, condition.Slot().GetID() );
		if( !( item ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.ItemID() && ( ItemID.GetTDBID( item.GetItemID() ) != condition.ItemID().GetID() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.ItemTag() != '' && !( item.GetItemData().HasTag( condition.ItemTag() ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		itemRecord = TweakDBInterface.GetItemRecord( ItemID.GetTDBID( item.GetItemID() ) );
		if( condition.ItemType() && ( condition.ItemType() != itemRecord.ItemType() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.ItemCategory() && ( condition.ItemCategory() != itemRecord.ItemCategory() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.RequestedTriggerModes() && condition.RequestedTriggerModes().Type() != AIActionHelper.GetLastRequestedTriggerMode( ( ( weak< weak< WeaponObject > > )( item ) ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		weaponRecord = ( ( WeaponItem_Record )( itemRecord ) );
		if( condition.Evolution() && ( !( weaponRecord ) || ( weaponRecord.Evolution() != condition.Evolution() ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.GetTriggerModesCount() > 0 )
		{
			condition.TriggerModes( triggerModes );
			if( !( weaponRecord ) || !( AIActionHelper.WeaponHasTriggerModes( ( ( WeaponObject )( item ) ), weaponRecord, triggerModes ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIItemCond_Record > ) : Bool
	{
		var itemID : ItemID;
		if( AIActionTransactionSystem.ShouldPerformEquipmentCheck( ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ), condition.EquipmentGroup() ) )
		{
			if( !( AIActionTransactionSystem.CheckEquipmentGroupForEquipment( context, condition ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		if( condition.ItemID() )
		{
			itemID = ItemID.CreateQuery( condition.ItemID().GetID() );
		}
		else if( condition.ItemCategory() )
		{
			if( !( AIActionTransactionSystem.GetFirstItemID( ScriptExecutionContext.GetOwner( context ), condition.ItemCategory(), condition.ItemTag(), itemID ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		else if( condition.ItemType() )
		{
			if( !( AIActionTransactionSystem.GetFirstItemID( ScriptExecutionContext.GetOwner( context ), condition.ItemType(), condition.ItemTag(), itemID ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		else if( !( AIActionTransactionSystem.GetFirstItemID( ScriptExecutionContext.GetOwner( context ), condition.ItemTag(), itemID ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ItemID.IsValid( itemID ) )
		{
			if( condition.Invert() )
			{
				return !( AIActionTransactionSystem.DoesItemMeetRequirements( itemID, condition, condition.Evolution() ) );
			}
			return AIActionTransactionSystem.DoesItemMeetRequirements( itemID, condition, condition.Evolution() );
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIIsOnNavmeshCond_Record > ) : Bool
	{
		var obj : weak< GameObject >;
		var navigationSystem : AINavigationSystem;
		var radius : Float;
		var result : Bool;
		var tolerance : Vector4;
		tolerance = Vector4( 0.1, 0.1, 1.0, 1.0 );
		if( !( AIActionTarget.GetObject( context, condition.Target(), obj ) ) )
		{
			return false;
		}
		navigationSystem = GameInstance.GetAINavigationSystem( ScriptExecutionContext.GetOwner( context ).GetGame() );
		if( !( navigationSystem ) )
		{
			return false;
		}
		result = navigationSystem.IsPointOnNavmesh( obj, obj.GetWorldPosition(), tolerance );
		if( result )
		{
			radius = condition.Radius();
			if( radius > 0.0 )
			{
				result = navigationSystem.IsPointOnNavmesh( obj, obj.GetWorldPosition() - ( obj.GetWorldForward() * radius ), tolerance );
				if( result )
				{
					result = navigationSystem.IsPointOnNavmesh( obj, obj.GetWorldPosition() + ( obj.GetWorldRight() * radius ), tolerance );
					if( result )
					{
						result = navigationSystem.IsPointOnNavmesh( obj, obj.GetWorldPosition() - ( obj.GetWorldRight() * radius ), tolerance );
					}
				}
			}
		}
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIStatusEffectCond_Record > ) : Bool
	{
		var obj : weak< GameObject >;
		var statusEffectID : TweakDBID;
		var hasStatusEffect : Bool;
		var statusEffectTypeID : TweakDBID;
		var hasStatusEffectType : Bool;
		var statusEffectGameplayTag : CName;
		var hasGameplayTag : Bool;
		if( !( AIActionTarget.GetObject( context, condition.Target(), obj ) ) )
		{
			return false;
		}
		if( condition.StatusEffect() )
		{
			statusEffectID = condition.StatusEffect().GetID();
		}
		if( TDBID.IsValid( statusEffectID ) )
		{
			hasStatusEffect = StatusEffectSystem.ObjectHasStatusEffect( obj, statusEffectID );
			if( condition.Invert() )
			{
				if( hasStatusEffect )
				{
					return false;
				}
			}
			else
			{
				if( !( hasStatusEffect ) )
				{
					return false;
				}
			}
		}
		if( condition.StatusEffectType() )
		{
			statusEffectTypeID = condition.StatusEffectType().GetID();
		}
		if( TDBID.IsValid( statusEffectTypeID ) )
		{
			hasStatusEffectType = StatusEffectSystem.ObjectHasStatusEffectOfType( obj, condition.StatusEffectType().Type() );
			if( condition.Invert() )
			{
				if( hasStatusEffectType )
				{
					return false;
				}
			}
			else
			{
				if( !( hasStatusEffectType ) )
				{
					return false;
				}
			}
		}
		statusEffectGameplayTag = condition.GameplayTag();
		if( statusEffectGameplayTag != '' )
		{
			hasGameplayTag = StatusEffectSystem.ObjectHasStatusEffectWithTag( obj, statusEffectGameplayTag );
			if( condition.Invert() )
			{
				if( hasGameplayTag )
				{
					return false;
				}
			}
			else
			{
				if( !( hasGameplayTag ) )
				{
					return false;
				}
			}
		}
		return true;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AISignalCond_Record > ) : Bool
	{
		var signalTable : gameBoolSignalTable;
		var signalId : Uint16;
		var signalName : CName;
		signalName = condition.Name();
		if( !( IsNameValid( signalName ) ) )
		{
			return false;
		}
		signalTable = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ).GetSignalTable();
		if( !( signalTable ) )
		{
			return false;
		}
		signalId = signalTable.GetOrCreateSignal( signalName );
		if( !( signalTable.GetCurrentValue( signalId ) ) )
		{
			if( condition.Invert() )
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		if( condition.Invert() )
		{
			return false;
		}
		return true;
	}

	private static function CheckDistanceInternal( owner : gamePuppet, sourcePosition : Vector4, targetPosition : Vector4, distanceRange : Vector2, condition : weak< AISpatialCond_Record >, out returnVal : Bool ) : Bool
	{
		var vecToTarget : Vector4;
		var distanceSquared : Float;
		var distanceMul : Float;
		distanceMul = 1.0;
		if( ( distanceRange.X > 0.0 ) || ( distanceRange.Y > 0.0 ) )
		{
			vecToTarget = targetPosition - sourcePosition;
			distanceSquared = Vector4.LengthSquared( vecToTarget );
			distanceMul = CombatSpaceHelper.GetDistanceMultiplier( owner, condition.SpatialHintMults() );
			if( distanceRange.X > 0.0 )
			{
				distanceRange.X *= distanceMul;
			}
			if( distanceRange.Y > 0.0 )
			{
				distanceRange.Y *= distanceMul;
			}
			if( ( distanceRange.X > 0.0 ) && ( distanceSquared < ( distanceRange.X * distanceRange.X ) ) )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
			if( ( distanceRange.Y > 0.0 ) && ( distanceSquared > ( distanceRange.Y * distanceRange.Y ) ) )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
		}
		return false;
	}

	private static function CheckAngle2ObjInternal( owner : weak< gamePuppet >, source : weak< GameObject >, sourcePosition : Vector4, sourceCoverID : Uint64, target : weak< GameObject >, targetPosition : Vector4, targetCoverID : Uint64, coneAngleRange : Vector2, condition : weak< AISpatialCond_Record >, out returnVal : Bool ) : Bool
	{
		var vecToTarget : Vector4;
		var direction, rotationAxis : Vector4;
		var angleToTarget : Float;
		var cm : CoverManager;
		if( ( ( coneAngleRange.X > 0.0 ) || ( coneAngleRange.Y > 0.0 ) ) || ( condition.AngleDirection() != 0 ) )
		{
			if( condition.UseTargetPOV() )
			{
				vecToTarget = sourcePosition - targetPosition;
				if( !( target ) && ( targetCoverID == ( ( Uint64 )( 0 ) ) ) )
				{
					returnVal = false;
					return true;
				}
				if( target )
				{
					direction = target.GetWorldForward();
					rotationAxis = target.GetWorldUp();
				}
				else
				{
					cm = GameInstance.GetCoverManager( owner.GetGame() );
					if( !( cm ) )
					{
						returnVal = false;
						return true;
					}
					direction = cm.GetCoverWorldForward( targetCoverID );
					rotationAxis = cm.GetCoverWorldUp( targetCoverID );
				}
			}
			else
			{
				vecToTarget = targetPosition - sourcePosition;
				if( !( source ) && ( sourceCoverID == ( ( Uint64 )( 0 ) ) ) )
				{
					returnVal = false;
					return true;
				}
				if( source )
				{
					direction = source.GetWorldForward();
					rotationAxis = source.GetWorldUp();
				}
				else
				{
					cm = GameInstance.GetCoverManager( owner.GetGame() );
					if( !( cm ) )
					{
						returnVal = false;
						return true;
					}
					direction = cm.GetCoverWorldForward( sourceCoverID );
					rotationAxis = cm.GetCoverWorldUp( sourceCoverID );
				}
			}
			angleToTarget = Vector4.GetAngleDegAroundAxis( vecToTarget, direction, rotationAxis );
			if( ( coneAngleRange.X > 0.0 ) && ( AbsF( angleToTarget ) < ( coneAngleRange.X * 0.5 ) ) )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
			if( ( coneAngleRange.Y > 0.0 ) && ( AbsF( angleToTarget ) > ( coneAngleRange.Y * 0.5 ) ) )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
			if( ( angleToTarget * ( ( Float )( condition.AngleDirection() ) ) ) < 0.0 )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
		}
		return false;
	}

	private static function CheckAngle3ObjInternal( owner : weak< gamePuppet >, source : weak< GameObject >, sourcePosition : Vector4, sourceCoverID : Uint64, target : weak< GameObject >, targetPosition : Vector4, targetCoverID : Uint64, targetOpt : weak< GameObject >, targetPositionOpt : Vector4, targetCoverIDOpt : Uint64, coneAngleRange : Vector2, condition : weak< AISpatialCond_Record >, out returnVal : Bool ) : Bool
	{
		var direction1, direction2, rotationAxis : Vector4;
		var angleToTarget : Float;
		var cm : CoverManager;
		if( ( ( coneAngleRange.X > 0.0 ) || ( coneAngleRange.Y > 0.0 ) ) || ( condition.AngleDirection() != 0 ) )
		{
			if( condition.UseTargetPOV() )
			{
				direction1 = sourcePosition - targetPosition;
				direction2 = targetPositionOpt - targetPosition;
				if( !( target ) && ( targetCoverID == ( ( Uint64 )( 0 ) ) ) )
				{
					returnVal = false;
					return true;
				}
				if( target )
				{
					rotationAxis = target.GetWorldUp();
				}
				else
				{
					cm = GameInstance.GetCoverManager( owner.GetGame() );
					if( !( cm ) )
					{
						returnVal = false;
						return true;
					}
					rotationAxis = cm.GetCoverWorldUp( targetCoverID );
				}
			}
			else
			{
				direction1 = targetPosition - sourcePosition;
				direction2 = targetPositionOpt - sourcePosition;
				if( !( source ) && ( sourceCoverID == ( ( Uint64 )( 0 ) ) ) )
				{
					returnVal = false;
					return true;
				}
				if( source )
				{
					rotationAxis = source.GetWorldUp();
				}
				else
				{
					rotationAxis = cm.GetCoverWorldUp( sourceCoverID );
				}
			}
			angleToTarget = Vector4.GetAngleDegAroundAxis( direction1, direction2, rotationAxis );
			if( ( coneAngleRange.X > 0.0 ) && ( AbsF( angleToTarget ) < ( coneAngleRange.X * 0.5 ) ) )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
			if( ( coneAngleRange.Y > 0.0 ) && ( AbsF( angleToTarget ) > ( coneAngleRange.Y * 0.5 ) ) )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
			if( ( angleToTarget * ( ( Float )( condition.AngleDirection() ) ) ) < 0.0 )
			{
				returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
				return true;
			}
		}
		return false;
	}

	private static function CheckZDiffInternal( sourcePosition : Vector4, targetPosition : Vector4, ZDiffRange : Vector2, condition : weak< AISpatialCond_Record >, out returnVal : Bool ) : Bool
	{
		var vecToTarget : Vector4;
		vecToTarget = sourcePosition - targetPosition;
		if( ( ZDiffRange.X > 0.0 ) && ( AbsF( vecToTarget.Z ) < ZDiffRange.X ) )
		{
			returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
			return true;
		}
		if( ( ZDiffRange.Y > 0.0 ) && ( AbsF( vecToTarget.Z ) > ZDiffRange.Y ) )
		{
			returnVal = ( ( condition.Invert() ) ? ( true ) : ( false ) );
			return true;
		}
		return false;
	}

	public static function CheckSpatial( const ownerContext : ScriptExecutionContext, const targetContext : ScriptExecutionContext, condition : weak< AISpatialCond_Record > ) : Bool
	{
		var sourcePosition, targetPosition, targetPositionOpt : Vector4;
		var coneAngleRange, ZDiffRange : Vector2;
		var distanceRange : Vector2;
		var source, target, targetOpt : weak< GameObject >;
		var sourceCoverID, targetCoverID, targetCoverIDOpt : Uint64;
		var targetOptPresent : Bool;
		var returnVal : Bool;
		targetOptPresent = false;
		returnVal = false;
		if( !( AIActionTarget.Get( ownerContext, condition.Source(), false, source, sourcePosition, sourceCoverID, condition.PredictionTime() ) ) )
		{
			return false;
		}
		if( !( AIActionTarget.Get( targetContext, condition.Target(), false, target, targetPosition, targetCoverID, condition.PredictionTime() ) ) )
		{
			return false;
		}
		targetOptPresent = AIActionTarget.Get( ownerContext, condition.TargetOpt(), false, targetOpt, targetPositionOpt, targetCoverIDOpt, condition.PredictionTime() );
		distanceRange = condition.Distance();
		if( CheckDistanceInternal( ScriptExecutionContext.GetOwner( ownerContext ), sourcePosition, targetPosition, distanceRange, condition, returnVal ) )
		{
			return returnVal;
		}
		ZDiffRange = condition.ZDiff();
		if( CheckZDiffInternal( sourcePosition, targetPosition, ZDiffRange, condition, returnVal ) )
		{
			return returnVal;
		}
		coneAngleRange = condition.ConeAngle();
		if( !( targetOptPresent ) )
		{
			if( CheckAngle2ObjInternal( ScriptExecutionContext.GetOwner( ownerContext ), source, sourcePosition, sourceCoverID, target, targetPosition, targetCoverID, coneAngleRange, condition, returnVal ) )
			{
				return returnVal;
			}
		}
		else
		{
			if( CheckDistanceInternal( ScriptExecutionContext.GetOwner( ownerContext ), sourcePosition, targetPositionOpt, distanceRange, condition, returnVal ) )
			{
				return returnVal;
			}
			if( CheckZDiffInternal( sourcePosition, targetPositionOpt, ZDiffRange, condition, returnVal ) )
			{
				return returnVal;
			}
			if( CheckAngle3ObjInternal( ScriptExecutionContext.GetOwner( ownerContext ), source, sourcePosition, sourceCoverID, target, targetPosition, targetCoverID, targetOpt, targetPositionOpt, targetCoverIDOpt, coneAngleRange, condition, returnVal ) )
			{
				return returnVal;
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AISpatialCond_Record > ) : Bool
	{
		return CheckSpatial( context, context, condition );
	}

	public static function OnCantFindProperCheck( const conditionName : CName )
	{
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIExtendTargetCirclingCond_Record > ) : Bool
	{
		var squadmates : array< weak< Entity > >;
		var squadmateContext : ScriptExecutionContext;
		var circledTgt, destTgt, squadmateTgt : weak< GameObject >;
		var ownerPos, circledTgtPos, destTgtPos, direction, circledTgtToOwnerDir : Vector4;
		var angleMin, angleMax, angle, spreadIncreaseAngle : Float;
		var i : Int32;
		var squadmate : weak< ScriptedPuppet >;
		var coverId : Uint64;
		if( !( AISquadHelper.GetSquadmates( ScriptExecutionContext.GetOwner( context ), squadmates ) ) )
		{
			return condition.Invert();
		}
		if( !( AIActionTarget.Get( context, condition.Target(), false, circledTgt, circledTgtPos, coverId ) ) )
		{
			return condition.Invert();
		}
		if( !( AIActionTarget.Get( context, condition.DestinationTarget(), false, destTgt, destTgtPos, coverId ) ) )
		{
			return condition.Invert();
		}
		ownerPos = ScriptExecutionContext.GetOwner( context ).GetWorldPosition();
		circledTgtToOwnerDir = ownerPos - circledTgtPos;
		spreadIncreaseAngle = condition.SpreadIncreaseAngle();
		angleMax = 0.0;
		angleMin = 0.0;
		for( i = 0; i < squadmates.Size(); i += 1 )
		{
			squadmate = ( ( ScriptedPuppet )( squadmates[ i ] ) );
			if( ( ( ScriptedPuppet.IsActive( squadmate ) && AIHumanComponent.GetScriptContext( squadmate, squadmateContext ) ) && AIActionTarget.GetObject( squadmateContext, condition.Target(), squadmateTgt ) ) && ( squadmateTgt == circledTgt ) )
			{
				direction = squadmate.GetWorldPosition() - circledTgtPos;
				angle = Vector4.GetAngleDegAroundAxis( circledTgtToOwnerDir, direction, circledTgt.GetWorldUp() );
				if( angle > angleMax )
				{
					angleMax = angle;
				}
				if( angle < angleMin )
				{
					angleMin = angle;
				}
			}
		}
		direction = destTgtPos - circledTgtPos;
		angle = Vector4.GetAngleDegAroundAxis( circledTgtToOwnerDir, direction, circledTgt.GetWorldUp() );
		return condition.Invert() != ( ( ( angle - spreadIncreaseAngle ) >= angleMax ) || ( ( angle + spreadIncreaseAngle ) <= angleMin ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIMovementCond_Record > ) : Bool
	{
		var movePoliciesComponent : MovePoliciesComponent;
		var slopeCond : Vector2;
		var incline : Float;
		var movementTypeCond : moveMovementType;
		var distanceRange : Vector2;
		var distance : Float;
		var destination : weak< GameObject >;
		var destinationPosition : Vector4;
		var pathFindingFailed : Bool;
		var pathFindingCond : Int32;
		var lineOfSightFailed : Bool;
		var lineOfSightCond : Int32;
		var constrainedByRestrictedArea : Bool;
		var constrainedByRestrictedAreaCond : Int32;
		var isInIdle : Bool;
		var isMovingCond : Int32;
		var isEvaluated : Int32;
		var isPolicyEvaluated : Bool;
		var isUsingOffMeshLink : Int32;
		var offMeshConnectionType : worldOffMeshConnectionType;
		var offMeshExplorationType : moveExplorationType;
		var isPausedByDynamicCollisionCond : Int32;
		var isPausedByDynamicCollision : Bool;
		var destinationCalculated : Bool;
		var destinationCalculatedCond : Int32;
		var destinationChanged : Bool;
		var destinationChangedCond : Int32;
		var distanceMul : Float;
		distanceMul = 1.0;
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) )
		{
			return false;
		}
		movePoliciesComponent = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ).GetMovePolicesComponent();
		if( !( movePoliciesComponent ) )
		{
			return false;
		}
		isEvaluated = condition.IsEvaluated();
		if( isEvaluated >= 0 )
		{
			isPolicyEvaluated = movePoliciesComponent.IsTopPolicyEvaluated();
			if( isEvaluated == 0 )
			{
				if( isPolicyEvaluated )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( isPolicyEvaluated ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		isMovingCond = condition.IsMoving();
		if( isMovingCond >= 0 )
		{
			isInIdle = movePoliciesComponent.IsInIdle();
			if( isMovingCond == 0 )
			{
				if( !( isInIdle ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( isInIdle )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		lineOfSightCond = condition.LineOfSightFailed();
		if( lineOfSightCond >= 0 )
		{
			lineOfSightFailed = movePoliciesComponent.HasLineOfSightFailed();
			if( lineOfSightCond == 0 )
			{
				if( lineOfSightFailed )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( lineOfSightFailed ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		pathFindingCond = condition.PathFindingFailed();
		if( pathFindingCond >= 0 )
		{
			pathFindingFailed = movePoliciesComponent.IsPathfindingFailed();
			if( pathFindingCond == 0 )
			{
				if( pathFindingFailed )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( pathFindingFailed ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		destinationChangedCond = condition.IsDestinationChanged();
		if( destinationChangedCond >= 0 )
		{
			destinationChanged = movePoliciesComponent.IsDestinationChanged();
			if( destinationChangedCond == 0 )
			{
				if( destinationChanged )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( destinationChanged ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		destinationCalculatedCond = condition.IsDestinationCalculated();
		if( destinationCalculatedCond >= 0 )
		{
			destinationCalculated = movePoliciesComponent.IsDestinationCalculated();
			if( destinationCalculatedCond == 0 )
			{
				if( destinationCalculated )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( destinationCalculated ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		constrainedByRestrictedAreaCond = condition.ConstrainedByRestrictedArea();
		if( constrainedByRestrictedAreaCond >= 0 )
		{
			constrainedByRestrictedArea = movePoliciesComponent.IsConstrainedByRestrictedArea();
			if( constrainedByRestrictedAreaCond == 0 )
			{
				if( constrainedByRestrictedArea )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( constrainedByRestrictedArea ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		isPausedByDynamicCollisionCond = condition.IsPauseByDynamicCollision();
		if( isPausedByDynamicCollisionCond >= 0 )
		{
			isPausedByDynamicCollision = movePoliciesComponent.IsPausedByDynamicCollision();
			if( isPausedByDynamicCollisionCond == 0 )
			{
				if( isPausedByDynamicCollision )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( isPausedByDynamicCollision ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		slopeCond = condition.Slope();
		if( ( slopeCond.X != -1.0 ) || ( slopeCond.Y != -1.0 ) )
		{
			incline = movePoliciesComponent.GetInclineAngle();
			if( ( slopeCond.X != -1.0 ) && ( incline < slopeCond.X ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( slopeCond.Y != -1.0 ) && ( incline > slopeCond.Y ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		distanceRange = condition.DistanceToDestination();
		if( ( distanceRange.X > 0.0 ) || ( distanceRange.Y > 0.0 ) )
		{
			distanceMul = CombatSpaceHelper.GetDistanceMultiplier( ScriptExecutionContext.GetOwner( context ), condition.SpatialHintMults() );
			if( distanceRange.X > 0.0 )
			{
				distanceRange.X *= distanceMul;
			}
			if( distanceRange.Y > 0.0 )
			{
				distanceRange.Y *= distanceMul;
			}
		}
		if( AIActionTarget.Get( context, condition.Destination(), false, destination, destinationPosition ) )
		{
			distance = movePoliciesComponent.GetDistanceToDestination();
			distance = distance - movePoliciesComponent.GetDistanceToDestinationFrom( destinationPosition );
			if( distance < distanceRange.X )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( distance > distanceRange.Y )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		else if( ( distanceRange.X > 0.0 ) || ( distanceRange.Y > 0.0 ) )
		{
			distance = movePoliciesComponent.GetDistanceToDestination();
			if( ( distanceRange.X > 0.0 ) && ( distance < distanceRange.X ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( distanceRange.Y > 0.0 ) && ( distance > distanceRange.Y ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		isUsingOffMeshLink = condition.IsUsingOffMeshLink();
		if( isUsingOffMeshLink >= 0 )
		{
			if( isUsingOffMeshLink == 0 )
			{
				if( movePoliciesComponent.IsOnOffMeshLink() )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( movePoliciesComponent.IsOnOffMeshLink() ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.OffMeshLinkType() != '' )
		{
			offMeshExplorationType = movePoliciesComponent.GetExplorationOffMeshLinkType();
			if( condition.OffMeshLinkType() != EnumValueToName( 'moveExplorationType', ( ( Int32 )( offMeshExplorationType ) ) ) )
			{
				movePoliciesComponent.GetOffMeshLinkType( offMeshConnectionType );
				if( condition.OffMeshLinkType() != EnumValueToName( 'worldOffMeshConnectionType', ( ( Int32 )( offMeshConnectionType ) ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		if( condition.MovementType() != '' )
		{
			movementTypeCond = ( ( moveMovementType )( ( ( Int32 )( EnumValueFromName( 'moveMovementType', condition.MovementType() ) ) ) ) );
			if( !( movePoliciesComponent.GetTopPolicies() ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( movementTypeCond != movePoliciesComponent.GetTopPolicies().GetMovementType() )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIStatPoolCond_Record > ) : Bool
	{
		var obj : weak< GameObject >;
		var percRange : Vector2;
		var statPercValue : Float;
		var isIncreasing : Int32;
		var statPoolMod : StatPoolModifier;
		if( !( condition.StatPool() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), obj ) ) )
		{
			return false;
		}
		percRange = condition.Percentage();
		if( ( percRange.X >= 0.0 ) || ( percRange.Y >= 0.0 ) )
		{
			statPercValue = GameInstance.GetStatPoolsSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetStatPoolValue( obj.GetEntityID(), condition.StatPool().StatPoolType(), true );
			if( ( percRange.X >= 0.0 ) && ( statPercValue < percRange.X ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( percRange.Y >= 0.0 ) && ( statPercValue > percRange.Y ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		isIncreasing = condition.IsIncreasing();
		if( isIncreasing >= 0 )
		{
			if( isIncreasing == 1 )
			{
				GameInstance.GetStatPoolsSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetModifier( obj.GetEntityID(), condition.StatPool().StatPoolType(), gameStatPoolModificationTypes.Regeneration, statPoolMod );
			}
			else if( isIncreasing == 0 )
			{
				GameInstance.GetStatPoolsSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetModifier( obj.GetEntityID(), condition.StatPool().StatPoolType(), gameStatPoolModificationTypes.Decay, statPoolMod );
			}
			if( statPoolMod.valuePerSec <= 0.0 )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIAmmoCountCond_Record > ) : Bool
	{
		var weapon : weak< WeaponObject >;
		var percRange : Vector2;
		var ammoCount : Uint32;
		var ammoPercentage : Float;
		if( !( condition.WeaponSlot() ) )
		{
			return false;
		}
		weapon = ( ( WeaponObject )( GameInstance.GetTransactionSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetItemInSlot( ScriptExecutionContext.GetOwner( context ), condition.WeaponSlot().GetID() ) ) );
		if( !( weapon ) )
		{
			return false;
		}
		ammoCount = WeaponObject.GetMagazineAmmoCount( weapon );
		if( ( condition.Min() >= 0 ) && ( ammoCount < ( ( Uint32 )( condition.Min() ) ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.Max() >= 0 ) && ( ammoCount > ( ( Uint32 )( condition.Max() ) ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		percRange = condition.Percentage();
		ammoPercentage = WeaponObject.GetMagazinePercentage( weapon );
		if( ( percRange.X >= 0.0 ) && ( ammoPercentage < percRange.X ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( percRange.Y >= 0.0 ) && ( ammoPercentage > percRange.Y ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIWeakSpotCond_Record > ) : Bool
	{
		var weakspots : array< weak< WeakspotObject > >;
		var i : Int32;
		if( !( ScriptExecutionContext.GetOwner( context ).IsNPC() ) )
		{
			return false;
		}
		( ( NPCPuppet )( ScriptExecutionContext.GetOwner( context ) ) ).GetWeakspotComponent().GetWeakspots( weakspots );
		if( ( weakspots.Size() > 0 ) && !( condition.Weakspot() ) )
		{
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		for( i = 0; i < weakspots.Size(); i += 1 )
		{
			if( ( weakspots[ i ].GetRecord() == condition.Weakspot() ) && ( condition.IncludeDestroyed() || !( weakspots[ i ].IsDead() ) ) )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AITresspassingCond_Record > ) : Bool
	{
		var target : weak< GameObject >;
		var position : Vector4;
		if( !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.CheckSafeArea() )
		{
			if( !( condition.Target() ) || !( AIActionTarget.GetPosition( context, condition.Target(), position, false ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( GameInstance.GetSafeAreaManager( ScriptExecutionContext.GetOwner( context ).GetGame() ).IsPointInSafeArea( position ) )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
			else
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.Invert() )
		{
			return !( ScriptExecutionContext.GetOwner( context ).IsTargetTresspassingMyZone( target ) );
		}
		return ScriptExecutionContext.GetOwner( context ).IsTargetTresspassingMyZone( target );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIRestrictedMovementAreaCond_Record > ) : Bool
	{
		var position : Vector4;
		if( !( condition.Target() ) || !( AIActionTarget.GetPosition( context, condition.Target(), position, false ) ) )
		{
			return false;
		}
		if( !( GameInstance.GetRestrictMovementAreaManager( ScriptExecutionContext.GetOwner( context ).GetGame() ).HasAssignedRestrictMovementArea( ScriptExecutionContext.GetOwner( context ).GetEntityID() ) ) )
		{
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		if( condition.Invert() )
		{
			return !( GameInstance.GetRestrictMovementAreaManager( ScriptExecutionContext.GetOwner( context ).GetGame() ).IsPointInRestrictMovementArea( ScriptExecutionContext.GetOwner( context ).GetEntityID(), position ) );
		}
		return GameInstance.GetRestrictMovementAreaManager( ScriptExecutionContext.GetOwner( context ).GetGame() ).IsPointInRestrictMovementArea( ScriptExecutionContext.GetOwner( context ).GetEntityID(), position );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AICalculatePathCond_Record > ) : Bool
	{
		var query : AINavigationSystemQuery;
		var result : AINavigationSystemResult;
		var start : AIPositionSpec;
		var end : AIPositionSpec;
		var startWorldPosition, endWorldPosition : WorldPosition;
		var requestID : Uint32;
		var offMeshTags : array< CName >;
		var startPosition, startPositionOffset, endPosition : Vector4;
		var navigationResult : NavigationFindWallResult;
		var navigationPath : NavigationPath;
		var ownerPuppet : NPCPuppet;
		var target : weak< GameObject >;
		var navigationSystem : AINavigationSystem;
		var pathfindingResult : Bool;
		offMeshTags = condition.AllowedOffMeshTags();
		if( ( condition.Distance() <= 0.0 ) && !( condition.Target() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		startPosition = ScriptExecutionContext.GetOwner( context ).GetWorldPosition();
		startPositionOffset = Vector4.Vector3To4( condition.StartPositionOffset() );
		if( !( Vector4.IsZero( startPositionOffset ) ) )
		{
			startPosition += ( Vector4.RotByAngleXY( ScriptExecutionContext.GetOwner( context ).GetWorldForward(), 90.0 ) * startPositionOffset.X );
			startPosition += ( ScriptExecutionContext.GetOwner( context ).GetWorldForward() * startPositionOffset.Y );
			startPosition.Z += startPositionOffset.Z;
		}
		if( condition.Target() )
		{
			AIActionTarget.GetObject( context, condition.Target(), target );
			if( !( AIActionTarget.GetPosition( context, condition.Target(), endPosition, false ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			WorldPosition.SetVector4( startWorldPosition, ScriptExecutionContext.GetOwner( context ).GetWorldPosition() );
			WorldPosition.SetVector4( endWorldPosition, endPosition );
			AIPositionSpec.SetWorldPosition( start, startWorldPosition );
			AIPositionSpec.SetWorldPosition( end, endWorldPosition );
			if( offMeshTags.Size() > 0 )
			{
				query.allowedTags = offMeshTags;
			}
			query.source = start;
			query.target = end;
			navigationSystem = GameInstance.GetAINavigationSystem( ScriptExecutionContext.GetOwner( context ).GetGame() );
			requestID = navigationSystem.StartPathfinding( query );
			pathfindingResult = GameInstance.GetAINavigationSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetResult( requestID, result );
			navigationSystem.StopPathfinding( requestID );
			if( !( pathfindingResult ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( !( result.hasPath ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( condition.CheckDynamicObstacle() )
			{
				ownerPuppet = ( ( NPCPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
				if( ownerPuppet.GetInfluenceComponent().IsLineEmpty( startPosition, endPosition, target ) == gameinfluenceTestLineResult.Fail )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			if( condition.CheckStraightPath() )
			{
				navigationResult = GameInstance.GetAINavigationSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).FindWallInLineForCharacter( startPosition, endPosition, condition.Tolerance(), ScriptExecutionContext.GetOwner( context ) );
				if( navigationResult.isHit )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		else
		{
			endPosition = startPosition + ( Vector4.RotByAngleXY( ScriptExecutionContext.GetOwner( context ).GetWorldForward(), condition.DirectionAngle() ) * condition.Distance() );
			navigationPath = GameInstance.GetAINavigationSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).CalculatePathForCharacter( startPosition, endPosition, condition.Tolerance(), ScriptExecutionContext.GetOwner( context ) );
			if( !( navigationPath ) || ( navigationPath.path.Size() == 0 ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( condition.CheckDynamicObstacle() )
			{
				ownerPuppet = ( ( NPCPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
				if( ownerPuppet.GetInfluenceComponent().IsLineEmpty( startPosition, endPosition ) == gameinfluenceTestLineResult.Fail )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			if( condition.CheckStraightPath() )
			{
				ownerPuppet = ( ( NPCPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
				startPosition.Z += 0.5;
				endPosition.Z += 0.5;
				navigationResult = GameInstance.GetAINavigationSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).FindWallInLineForCharacter( startPosition, endPosition, condition.Tolerance(), ScriptExecutionContext.GetOwner( context ) );
				if( navigationResult.isHit )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AICalculateLineOfSightVector_Record > ) : Bool
	{
		var startPosition : Vector4;
		var startOffset : Vector4;
		var endPosition : Vector4;
		var endOffset : Vector4;
		AIActionTarget.GetPosition( context, condition.StartPosition(), startPosition, false );
		AIActionTarget.GetPosition( context, condition.EndPosition(), endPosition, false );
		startOffset = ( ( Vector4 )( condition.StartPositionOffset() ) );
		endOffset = ( ( Vector4 )( condition.EndPositionOffset() ) );
		if( ( ( Vector4.IsZero( startPosition ) || Vector4.IsZero( endPosition ) ) || startPosition == Vector4.EmptyVector() ) || endPosition == Vector4.EmptyVector() )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( !( GameInstance.GetSenseManager( ScriptExecutionContext.GetOwner( context ).GetGame() ).IsPositionVisible( startPosition + startOffset, endPosition + endOffset, !( condition.IgnoreNonPenetrableObj() ) ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIReactionCond_Record > ) : Bool
	{
		var activeReactionData : AIReactionData;
		var investigateData : stimInvestigateData;
		var ownerPuppet : ScriptedPuppet;
		var characterRecord : Character_Record;
		var stimTypeCount : Int32;
		var stimType : StimType_Record;
		var stimPosition : Vector4;
		var threshold : Float;
		var currentStat : Float;
		var behavior : String;
		var i : Int32;
		ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		characterRecord = TweakDBInterface.GetCharacterRecord( ownerPuppet.GetRecordID() );
		if( condition.Preset() )
		{
			if( characterRecord.ReactionPreset().ReactionGroup() != condition.Preset().ReactionGroup() )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		activeReactionData = ownerPuppet.GetStimReactionComponent().GetActiveReactionData();
		if( !( activeReactionData ) )
		{
			activeReactionData = ownerPuppet.GetStimReactionComponent().GetDesiredReactionData();
		}
		if( condition.InvestigateController() )
		{
			investigateData = activeReactionData.stimInvestigateData;
			if( !( investigateData.investigateController ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.ReactionBehaviorName() != '' )
		{
			behavior = EnumValueToString( "gamedataOutput", ( ( Int32 )( activeReactionData.reactionBehaviorName ) ) );
			if( !( StrContains( behavior, NameToString( condition.ReactionBehaviorName() ) ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.ValidStimPosition() )
		{
			stimPosition = activeReactionData.stimSource;
			if( Vector4.IsZero( stimPosition ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		stimTypeCount = condition.GetStimTypeCount();
		if( stimTypeCount > 0 )
		{
			for( i = 0; i < stimTypeCount; i += 1 )
			{
				stimType = condition.GetStimTypeItem( i );
				if( stimType.Type() != activeReactionData.stimType )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		if( condition.ThresholdValue() )
		{
			switch( condition.ThresholdValue().StatPoolType() )
			{
				case gamedataStatPoolType.Fear:
					currentStat = GameInstance.GetStatPoolsSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetStatPoolValue( ScriptExecutionContext.GetOwner( context ).GetEntityID(), gamedataStatPoolType.Fear, false );
				threshold = characterRecord.ReactionPreset().FearThreshold();
				break;
				default:
					return false;
			}
			if( ( currentStat < threshold ) || ( threshold == 0.0 ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AILookAtCond_Record > ) : Bool
	{
		var target : weak< GameObject >;
		var shootingBlackboard : IBlackboard;
		var value : Int32;
		if( !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return false;
		}
		if( condition.RightArmLookAtActive() != -1 )
		{
			shootingBlackboard = ( ( ScriptedPuppet )( target ) ).GetAIControllerComponent().GetShootingBlackboard();
			if( !( shootingBlackboard ) )
			{
				return false;
			}
			value = shootingBlackboard.GetInt( GetAllBlackboardDefs().AIShooting.rightArmLookAtLimitReached );
			if( value != condition.RightArmLookAtActive() )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIPreviousAttackCond_Record > ) : Bool
	{
		var ownerPuppet : weak< ScriptedPuppet >;
		var attacksToCheck : array< CName >;
		var previousAttackDelay : Float;
		var previousAttackName : CName;
		var i : Int32;
		ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) )
		{
			return false;
		}
		attacksToCheck = condition.PreviousAttackName();
		if( condition.PreviousAttackDirection() > -1 )
		{
			if( ownerPuppet.GetHitReactionComponent().GetAttackDirection() != condition.PreviousAttackDirection() )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		else if( attacksToCheck.Size() == 0 )
		{
			return false;
		}
		previousAttackDelay = EngineTime.ToFloat( GameInstance.GetSimTime( ScriptExecutionContext.GetOwner( context ).GetGame() ) ) - ownerPuppet.GetAIControllerComponent().GetActionBlackboard().GetFloat( GetAllBlackboardDefs().AIAction.ownerLastAttackTimeStamp );
		if( ( condition.TimeWindow() >= 0.0 ) && ( previousAttackDelay > condition.TimeWindow() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		previousAttackName = ownerPuppet.GetAIControllerComponent().GetActionBlackboard().GetName( GetAllBlackboardDefs().AIAction.ownerLastAttackName );
		if( attacksToCheck.Size() > 0 )
		{
			for( i = 0; i < attacksToCheck.Size(); i += 1 )
			{
				if( attacksToCheck[ i ] == 'SubActionInAir' && ownerPuppet.GetPuppetStateBlackboard().GetBool( GetAllBlackboardDefs().PuppetState.InAirAnimation ) )
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
				else if( attacksToCheck[ i ] == previousAttackName )
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
			}
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public static function Check( const context : ScriptExecutionContext, condition : weak< AIBlockCountCond_Record > ) : Bool
	{
		var attacksBlocked : Int32;
		var attacksParried : Int32;
		var ownerPuppet : weak< ScriptedPuppet >;
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) )
		{
			return false;
		}
		ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		attacksBlocked = ownerPuppet.GetHitReactionComponent().GetBlockCount();
		if( ( condition.MinBlockCount() >= 0 ) && ( attacksBlocked < condition.MinBlockCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.MaxBlockCount() >= 0 ) && ( attacksBlocked > condition.MaxBlockCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		attacksParried = ownerPuppet.GetHitReactionComponent().GetParryCount();
		if( ( condition.MinParryCount() >= 0 ) && ( attacksParried < condition.MinParryCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.MaxParryCount() >= 0 ) && ( attacksParried > condition.MaxParryCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.OwnerAttackBlockedCount() >= 0 ) && ( ownerPuppet.GetAIControllerComponent().GetActionBlackboard().GetInt( GetAllBlackboardDefs().AIAction.ownerMeleeAttackBlockedCount ) < condition.OwnerAttackBlockedCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.OwnerAttackParriedCount() >= 0 ) && ( ownerPuppet.GetAIControllerComponent().GetActionBlackboard().GetInt( GetAllBlackboardDefs().AIAction.ownerMeleeAttackParriedCount ) < condition.OwnerAttackParriedCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public static function Check( const context : ScriptExecutionContext, condition : weak< AIOptimalDistanceCond_Record > ) : Bool
	{
		var sourcePosition, targetPosition, vecToTarget : Vector4;
		var distanceRange : Vector2;
		var distanceSquared : Float;
		var ringRecord : weak< AIRingType_Record >;
		var source, target : weak< GameObject >;
		var i, count : Int32;
		var validCheck : Bool;
		if( !( AIActionTarget.Get( context, condition.Source(), false, source, sourcePosition, condition.PredictionTime() ) ) )
		{
			return false;
		}
		if( !( AIActionTarget.Get( context, condition.Target(), false, target, targetPosition, condition.PredictionTime() ) ) )
		{
			return false;
		}
		count = condition.GetCheckRingsCount();
		if( count > 0 )
		{
			for( i = 0; i < count; i += 1 )
			{
				ringRecord = condition.GetCheckRingsItem( i );
				if( AIActionHelper.GetDistanceRangeFromRingType( ringRecord, condition, distanceRange ) )
				{
					validCheck = true;
					break;
				}
			}
		}
		if( !( validCheck ) )
		{
			ringRecord = AIActionHelper.GetLatestActiveRingTypeRecord( ( ( ScriptedPuppet )( source ) ) );
			if( AIActionHelper.GetDistanceRangeFromRingType( ringRecord, condition, distanceRange ) )
			{
				validCheck = true;
			}
		}
		if( validCheck )
		{
			vecToTarget = targetPosition - sourcePosition;
			distanceSquared = Vector4.LengthSquared( vecToTarget );
			if( ( distanceRange.X > 0.0 ) && ( distanceSquared < ( distanceRange.X * distanceRange.X ) ) )
			{
				if( condition.FailWhenCloserThanCurrentRing() )
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( distanceRange.Y > 0.0 ) && ( distanceSquared > ( distanceRange.Y * distanceRange.Y ) ) )
			{
				if( condition.FailWhenFurtherThantCurrentRing() )
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public static function Check( const context : ScriptExecutionContext, condition : weak< AIDodgeCountCond_Record > ) : Bool
	{
		var attacksDodged : Int32;
		var ownerPuppet : weak< ScriptedPuppet >;
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) )
		{
			return false;
		}
		ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		attacksDodged = ownerPuppet.GetHitReactionComponent().GetDodgeCount();
		if( ( condition.MinDodgeCount() >= 0 ) && ( attacksDodged < condition.MinDodgeCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.MaxDodgeCount() >= 0 ) && ( attacksDodged > condition.MaxDodgeCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.OwnerAttackDodgedCount() >= 0 ) && ( ownerPuppet.GetAIControllerComponent().GetActionBlackboard().GetInt( GetAllBlackboardDefs().AIAction.ownerMeleeAttackDodgedCount ) < condition.OwnerAttackDodgedCount() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIIsInActiveCameraCond_Record > ) : Bool
	{
		var target : weak< GameObject >;
		var targetPos : Vector4;
		var coverId : Uint64;
		if( !( AIActionTarget.Get( context, condition.Target(), target, targetPos, coverId ) ) )
		{
			return false;
		}
		if( GameInstance.GetCameraSystem( target.GetGame() ).IsInCameraFrustum( target, condition.Height(), condition.Radius() ) )
		{
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIThrowCond_Record > ) : Bool
	{
		var ownerPuppet : weak< ScriptedPuppet >;
		var target : weak< GameObject >;
		var throwPositions : Vector4;
		var throwAngle : Float;
		var throwStartType : gameGrenadeThrowStartType;
		var weapon : weak< ThrowableWeaponObject >;
		var cm : CoverManager;
		var currentCoverID : Uint64;
		var canThrowGrenade : Bool;
		var exposureMethods : array< AICoverExposureMethod >;
		var grenadeExposureMethods : array< AICoverExposureMethod >;
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) || !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.WeaponSlot() )
		{
			weapon = ( ( ThrowableWeaponObject )( GameInstance.GetTransactionSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetItemInSlot( ScriptExecutionContext.GetOwner( context ), condition.WeaponSlot().GetID() ) ) );
			if( weapon )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
		}
		ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		if( ownerPuppet )
		{
			canThrowGrenade = ownerPuppet.GetAIControllerComponent().CanThrowGrenadeAtTarget( target, throwPositions, throwAngle, throwStartType );
			if( canThrowGrenade )
			{
				cm = GameInstance.GetCoverManager( ownerPuppet.GetGame() );
				if( cm )
				{
					currentCoverID = cm.GetCurrentCover( ownerPuppet );
					if( currentCoverID > ( ( Uint64 )( 0 ) ) )
					{
						if( throwStartType == gameGrenadeThrowStartType.LeftSide )
						{
							exposureMethods.Resize( 6 );
							exposureMethods[ 0 ] = AICoverExposureMethod.Standing_Step_Left;
							exposureMethods[ 1 ] = AICoverExposureMethod.Standing_Lean_Left;
							exposureMethods[ 2 ] = AICoverExposureMethod.Crouching_Step_Left;
							exposureMethods[ 3 ] = AICoverExposureMethod.Crouching_Lean_Left;
							exposureMethods[ 4 ] = AICoverExposureMethod.Standing_Blind_Left;
							exposureMethods[ 5 ] = AICoverExposureMethod.Crouching_Blind_Left;
						}
						else if( throwStartType == gameGrenadeThrowStartType.RightSide )
						{
							exposureMethods.Resize( 6 );
							exposureMethods[ 0 ] = AICoverExposureMethod.Standing_Step_Right;
							exposureMethods[ 1 ] = AICoverExposureMethod.Standing_Lean_Right;
							exposureMethods[ 2 ] = AICoverExposureMethod.Crouching_Step_Right;
							exposureMethods[ 3 ] = AICoverExposureMethod.Crouching_Lean_Right;
							exposureMethods[ 4 ] = AICoverExposureMethod.Standing_Blind_Right;
							exposureMethods[ 5 ] = AICoverExposureMethod.Crouching_Blind_Right;
						}
						else if( throwStartType == gameGrenadeThrowStartType.Top )
						{
							exposureMethods.Resize( 3 );
							exposureMethods[ 0 ] = AICoverExposureMethod.Lean_Over;
							exposureMethods[ 1 ] = AICoverExposureMethod.Stand_Up;
							exposureMethods[ 2 ] = AICoverExposureMethod.Crouching_Blind_Top;
						}
						grenadeExposureMethods = AICoverHelper.GetAvailableExposureSpots( ownerPuppet, currentCoverID, target, exposureMethods, condition.ClearLOSDistanceTolerance() );
						if( grenadeExposureMethods.Size() == 0 )
						{
							canThrowGrenade = false;
						}
					}
					else if( throwStartType == gameGrenadeThrowStartType.Invalid )
					{
						canThrowGrenade = false;
					}
				}
			}
		}
		if( condition.Invert() )
		{
			return !( canThrowGrenade );
		}
		else
		{
			return canThrowGrenade;
		}
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIFriendlyFireCond_Record > ) : Bool
	{
		var ownerPuppet : weak< ScriptedPuppet >;
		var target : weak< GameObject >;
		var secondaryTarget : weak< ScriptedPuppet >;
		var friendlyHostage : Bool;
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) )
		{
			return false;
		}
		if( StatusEffectSystem.ObjectHasStatusEffect( ScriptExecutionContext.GetOwner( context ), T"BaseStatusEffect.DoNotBlockShootingOnFriendlyFire" ) )
		{
			return condition.Invert();
		}
		ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		target = ScriptExecutionContext.GetArgumentObject( context, 'CombatTarget' );
		if( target && target.IsAttached() )
		{
			if( ScriptedPuppet.IsBeingGrappled( target ) )
			{
				secondaryTarget = ( ( weak< weak< ScriptedPuppet > > )( ScriptedPuppet.GetGrappleParent( target ) ) );
				if( secondaryTarget && GameObject.GetAttitudeTowards( ownerPuppet, secondaryTarget ) == EAIAttitude.AIA_Friendly )
				{
					friendlyHostage = true;
				}
			}
			else if( ( GameInstance.GetStatsSystem( ownerPuppet.GetGame() ).GetStatValue( ownerPuppet.GetEntityID(), gamedataStatType.IsAggressive ) <= 0.0 ) && ( GameInstance.GetStatsSystem( ownerPuppet.GetGame() ).GetStatValue( ownerPuppet.GetEntityID(), gamedataStatType.IsReckless ) <= 0.0 ) )
			{
				secondaryTarget = ( ( weak< weak< ScriptedPuppet > > )( ScriptedPuppet.GetGrappleChild( target ) ) );
				if( ( secondaryTarget && ScriptedPuppet.IsActive( secondaryTarget ) ) && GameObject.GetAttitudeTowards( ownerPuppet, secondaryTarget ) == EAIAttitude.AIA_Friendly )
				{
					friendlyHostage = true;
				}
			}
		}
		if( condition.Invert() )
		{
			return !( ownerPuppet.GetAIControllerComponent().IsFriendlyFiring() ) && !( friendlyHostage );
		}
		return ownerPuppet.GetAIControllerComponent().IsFriendlyFiring() || friendlyHostage;
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIWeaponLockedOnTargetCond_Record > ) : Bool
	{
		var weapon : WeaponObject;
		if( !( condition.WeaponSlot() ) )
		{
			return false;
		}
		weapon = ( ( WeaponObject )( GameInstance.GetTransactionSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetItemInSlot( ScriptExecutionContext.GetOwner( context ), condition.WeaponSlot().GetID() ) ) );
		if( !( weapon ) )
		{
			return false;
		}
		if( weapon.IsTargetLocked() )
		{
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	private static function IsAwareOfBeingFlankedByThreat( ownerPuppet : weak< ScriptedPuppet >, const threat : ref< TrackedLocation > ) : Bool
	{
		var threatAsPuppet : ScriptedPuppet;
		var trackedLocation : TrackedLocation;
		if( threat.accuracy > 0.001 )
		{
			return true;
		}
		threatAsPuppet = ( ( ScriptedPuppet )( threat.entity ) );
		if( threatAsPuppet )
		{
			if( threatAsPuppet.IsPlayer() && TargetTrackingExtension.GetTrackedLocation( threatAsPuppet, ownerPuppet, trackedLocation ) )
			{
				if( trackedLocation.accuracy > 0.5 )
				{
					return true;
				}
			}
			if( threatAsPuppet.GetSensesComponent() && threatAsPuppet.GetSensesComponent().IsAgentVisible( ownerPuppet ) )
			{
				return true;
			}
		}
		return false;
	}

	private static function IsAwareOfBeingFlankedByAnyThreat( ownerPuppet : weak< ScriptedPuppet >, const threats : ref< array< TrackedLocation > > ) : Bool
	{
		var i : Int32;
		for( i = 0; i < threats.Size(); i += 1 )
		{
			if( IsAwareOfBeingFlankedByThreat( ownerPuppet, threats[ i ] ) )
			{
				return true;
			}
		}
		return false;
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AICoverCond_Record > ) : Bool
	{
		var coverID : Uint64;
		var currentCoverID : Uint64;
		var target : weak< GameObject >;
		var targetPosition : Vector4;
		var ownerPuppet : weak< ScriptedPuppet >;
		var exposureMethods : array< CName >;
		var coverExposureMethod : CName;
		var threats : array< TrackedLocation >;
		var owner : weak< GameObject >;
		if( !( condition.Cover() ) )
		{
			return false;
		}
		if( !( ScriptExecutionContext.GetOwner( context ).IsPuppet() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Owner(), owner ) ) )
		{
			return false;
		}
		ownerPuppet = ( ( ScriptedPuppet )( owner ) );
		if( !( AIActionTarget.GetCoverID( context, condition.Cover(), currentCoverID, targetPosition ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.DesiredCoverChanged() != -1 )
		{
			AIActionTarget.GetCoverID( context, condition.DesiredCover(), coverID );
			if( condition.DesiredCoverChanged() == 1 )
			{
				if( currentCoverID == coverID )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( currentCoverID != coverID )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( !( GameInstance.GetCoverManager( ownerPuppet.GetGame() ).IsCoverAvailable( currentCoverID, owner ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.Target() && AIActionTarget.Get( context, condition.Target(), false, target, targetPosition ) )
		{
			if( ( condition.MaxCoverToTargetAngle() > 0.0 ) && ( AICoverHelper.GetAbsAngleFromCoverToTargetPosition( ownerPuppet, currentCoverID, targetPosition ) > condition.MaxCoverToTargetAngle() ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( condition.Cover().Type() == gamedataAIActionTarget.CurrentCover && !( AICoverHelper.HasCoverExposureMethods( ownerPuppet, currentCoverID, target, condition.CoverExposureMethods() ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsProtectingHorizontallyAgainstTarget() != -1 )
		{
			if( StatusEffectSystem.ObjectHasStatusEffectWithTag( ownerPuppet, 'Blind' ) )
			{
				threats = GameInstance.GetCoverManager( ownerPuppet.GetGame() ).GetThreatsNotProtectedFrom( currentCoverID, ownerPuppet, 1.0, condition.PredictionTime(), gamedataTrackingMode.BeliefPosition );
			}
			else
			{
				threats = GameInstance.GetCoverManager( ownerPuppet.GetGame() ).GetThreatsNotProtectedFrom( currentCoverID, ownerPuppet, 1.0, condition.PredictionTime(), gamedataTrackingMode.RealPosition );
			}
			if( condition.IsProtectingHorizontallyAgainstTarget() == 0 )
			{
				if( !( IsAwareOfBeingFlankedByAnyThreat( ownerPuppet, threats ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( IsAwareOfBeingFlankedByAnyThreat( ownerPuppet, threats ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( GameInstance.GetCoverManager( ownerPuppet.GetGame() ).GetCoverRemainingHealthPercentage( currentCoverID ) < condition.MinCoverHealth() )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.CoverType() == 0 ) && !( GameInstance.GetCoverManager( ownerPuppet.GetGame() ).IsShootingSpot( currentCoverID ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.CoverType() == 1 ) && !( GameInstance.GetCoverManager( ownerPuppet.GetGame() ).IsCoverRegular( currentCoverID ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.CoverType() == 2 ) && ( !( GameInstance.GetCoverManager( ownerPuppet.GetGame() ).IsCoverRegular( currentCoverID ) ) || GameInstance.GetCoverManager( ownerPuppet.GetGame() ).GetCoverHeight( currentCoverID ) != gameCoverHeight.Low ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.CoverType() == 3 ) && ( !( GameInstance.GetCoverManager( ownerPuppet.GetGame() ).IsCoverRegular( currentCoverID ) ) || GameInstance.GetCoverManager( ownerPuppet.GetGame() ).GetCoverHeight( currentCoverID ) != gameCoverHeight.High ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.IsOwnerExposed() != -1 )
		{
			if( condition.IsOwnerExposed() == 1 )
			{
				if( !( AIActionHelper.IsCurrentlyExposedInCover( ownerPuppet ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( AIActionHelper.IsCurrentlyExposedInCover( ownerPuppet ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsOwnerCrouching() != -1 )
		{
			if( condition.IsOwnerCrouching() == 1 )
			{
				if( !( AIActionHelper.IsCurrentlyCrouching( ownerPuppet ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( AIActionHelper.IsCurrentlyCrouching( ownerPuppet ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.HasAnyLastAvailableExposureMethods() != -1 )
		{
			if( condition.HasAnyLastAvailableExposureMethods() == 1 )
			{
				if( !( AICoverHelper.HasAnyCoverLastAvailableExposureMethod( ownerPuppet ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( AICoverHelper.HasAnyCoverLastAvailableExposureMethod( ownerPuppet ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		coverExposureMethod = AICoverHelper.GetCoverExposureMethod( ownerPuppet );
		if( IsNameValid( coverExposureMethod ) && condition.Cover().Type() == gamedataAIActionTarget.CurrentCover )
		{
			exposureMethods = condition.CheckChosenExposureMethod();
			if( exposureMethods.Size() == 0 )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
			if( !( exposureMethods.Contains( coverExposureMethod ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIGoToCoverCond_Record > ) : Bool
	{
		var target : weak< GameObject >;
		var currentCoverID : Uint64;
		var desiredCoverID : Uint64;
		var coverManager : CoverManager;
		var result : Bool;
		if( !( condition.Target() ) || !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return false;
		}
		if( condition.DesiredCoverChanged() != -1 )
		{
			AIActionTarget.GetCoverID( context, condition.Cover(), currentCoverID );
			AIActionTarget.GetCoverID( context, condition.DesiredCover(), desiredCoverID );
			if( condition.DesiredCoverChanged() == 1 )
			{
				if( currentCoverID == desiredCoverID )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( currentCoverID != desiredCoverID )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		coverManager = GameInstance.GetCoverManager( target.GetGame() );
		if( condition.IsCoverSelected() != -1 )
		{
			if( condition.DesiredCoverChanged() == -1 )
			{
				AIActionTarget.GetCoverID( context, condition.DesiredCover(), desiredCoverID );
			}
			if( condition.IsCoverSelected() == 1 )
			{
				if( ( desiredCoverID == ( ( Uint64 )( 0 ) ) ) || !( coverManager.IsCoverAvailable( desiredCoverID, target ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( desiredCoverID > ( ( Uint64 )( 0 ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsEnteringOrLeavingCover() >= 0 )
		{
			if( condition.IsEnteringOrLeavingCover() == 0 )
			{
				if( coverManager.IsEnteringOrLeavingCover( target ) )
				{
					AIActionTarget.GetCoverID( context, condition.Cover(), currentCoverID );
					if( GameInstance.GetCoverManager( target.GetGame() ).GetCoverHeight( currentCoverID ) != gameCoverHeight.High )
					{
						result = true;
					}
				}
				if( condition.Invert() )
				{
					return result;
				}
				return !( result );
			}
			else if( condition.IsEnteringOrLeavingCover() == 1 )
			{
				if( coverManager.IsEnteringOrLeavingCover( target ) )
				{
					AIActionTarget.GetCoverID( context, condition.Cover(), currentCoverID );
					if( GameInstance.GetCoverManager( target.GetGame() ).GetCoverHeight( currentCoverID ) != gameCoverHeight.High )
					{
						result = true;
					}
				}
				if( condition.Invert() )
				{
					return !( result );
				}
				return result;
			}
			else if( condition.IsEnteringOrLeavingCover() == 2 )
			{
				if( coverManager.GetCoverActionType( target ) == AIUninterruptibleActionType.EnteringCover )
				{
					AIActionTarget.GetCoverID( context, condition.Cover(), currentCoverID );
					if( GameInstance.GetCoverManager( target.GetGame() ).GetCoverHeight( currentCoverID ) != gameCoverHeight.High )
					{
						result = true;
					}
				}
				if( condition.Invert() )
				{
					return !( result );
				}
				return result;
			}
			else
			{
				if( coverManager.GetCoverActionType( target ) == AIUninterruptibleActionType.LeavingCover )
				{
					AIActionTarget.GetCoverID( context, condition.Cover(), currentCoverID );
					if( GameInstance.GetCoverManager( target.GetGame() ).GetCoverHeight( currentCoverID ) != gameCoverHeight.High )
					{
						result = true;
					}
				}
				if( condition.Invert() )
				{
					return !( result );
				}
				return result;
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIValidCoversCond_Record > ) : Bool
	{
		var target : weak< GameObject >;
		var msc : weak< MultiSelectCovers >;
		var currentRing : gamedataAIRingType;
		var limitToRing : weak< AIRingType_Record >;
		var i, j, limitCoverCount : Int32;
		var res : Bool;
		if( !( condition.Target() ) || !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return false;
		}
		msc = ( ( weak< weak< MultiSelectCovers > > )( ScriptExecutionContext.GetArgumentScriptable( context, 'MultiCoverID' ) ) );
		if( !( msc ) )
		{
			return false;
		}
		currentRing = AISquadHelper.GetCurrentSquadRing( ( ( ScriptedPuppet )( target ) ) );
		limitCoverCount = condition.GetLimitToRingsCount();
		if( ( limitCoverCount > 0 ) && condition.CheckCurrentlyActiveRing() )
		{
			for( i = 0; i < limitCoverCount; i += 1 )
			{
				limitToRing = condition.GetLimitToRingsItem( i );
				if( limitToRing.Type() == currentRing )
				{
					res = true;
					break;
				}
			}
			if( !( res ) )
			{
				return false;
			}
		}
		for( i = 0; i < msc.selectedCovers.Size(); i += 1 )
		{
			if( ( condition.CoversWithLOS() == 0 ) && msc.coversUseLOS[ i ] )
			{
				if( msc.coversUseLOS[ i ] )
				{
					continue;
				}
			}
			else if( ( condition.CoversWithLOS() == 1 ) && !( msc.coversUseLOS[ i ] ) )
			{
				continue;
			}
			if( condition.CheckCurrentlyActiveRing() && currentRing != msc.coverRingTypes[ i ] )
			{
				continue;
			}
			else if( limitCoverCount > 0 )
			{
				res = false;
				for( j = 0; j < limitCoverCount; j += 1 )
				{
					limitToRing = condition.GetLimitToRingsItem( j );
					if( limitToRing.Type() == msc.coverRingTypes[ i ] )
					{
						res = true;
						continue;
					}
				}
				if( !( res ) )
				{
					continue;
				}
			}
			if( msc.selectedCovers[ i ] > ( ( Uint64 )( 0 ) ) )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIHitCond_Record > ) : Bool
	{
		var hitReactionComponent : HitReactionComponent;
		var lastHitType : Int32;
		var attackTag : CName;
		var previousHitDelay : Float;
		var cumulatedDamge : Float;
		var target : weak< GameObject >;
		var targetPuppet : weak< ScriptedPuppet >;
		var targetHitCount : Int32;
		if( !( condition.Target() ) || !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return false;
		}
		targetPuppet = ( ( ScriptedPuppet )( target ) );
		if( !( targetPuppet ) )
		{
			return false;
		}
		hitReactionComponent = targetPuppet.GetHitReactionComponent();
		previousHitDelay = EngineTime.ToFloat( GameInstance.GetSimTime( ScriptExecutionContext.GetOwner( context ).GetGame() ) ) - hitReactionComponent.GetLastHitTimeStamp();
		targetHitCount = condition.TargetHitCount();
		if( targetHitCount > 0 )
		{
			if( hitReactionComponent.GetHitCountData( targetHitCount ) < ( EngineTime.ToFloat( GameInstance.GetSimTime( targetPuppet.GetGame() ) ) - condition.HitTimeout() ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		else if( ( hitReactionComponent.GetLastHitTimeStamp() <= 0.0 ) || ( previousHitDelay > condition.HitTimeout() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		lastHitType = hitReactionComponent.GetHitReactionType();
		if( ( condition.MinHitSeverity() > 0 ) && ( lastHitType < condition.MinHitSeverity() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( ( condition.MaxHitSeverity() > 0 ) && ( lastHitType > condition.MaxHitSeverity() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		attackTag = hitReactionComponent.GetAttackTag();
		if( condition.AttackTag() != '' && condition.AttackTag() != attackTag )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.CumulatedDamageThreshold() > 0 )
		{
			cumulatedDamge = targetPuppet.GetHitReactionComponent().GetCumulatedDamage();
			if( cumulatedDamge <= ( ( Float )( condition.CumulatedDamageThreshold() ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( ( condition.HitDirection() > 0 ) && ( condition.HitDirection() != hitReactionComponent.GetHitDirectionToInt() ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AITargetCond_Record > ) : Bool
	{
		var target : weak< GameObject >;
		var trackedLocation : TrackedLocation;
		var trackedLocationSuccess : Bool;
		var currentDetection, minDetection : Float;
		var visibilityCollisionToTargetDist : Float;
		if( !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( condition.IsAlive() >= 0 )
		{
			if( condition.IsAlive() == 0 )
			{
				if( ScriptedPuppet.IsAlive( target ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( ScriptedPuppet.IsAlive( target ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsActive() >= 0 )
		{
			if( condition.IsActive() == 0 )
			{
				if( ScriptedPuppet.IsActive( target ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( ScriptedPuppet.IsActive( target ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		minDetection = condition.MinDetectionValue();
		if( minDetection >= 0.0 )
		{
			currentDetection = ScriptExecutionContext.GetOwner( context ).GetSenses().GetDetection( target.GetEntityID() );
			if( currentDetection < ( minDetection * 100.0 ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		trackedLocationSuccess = TargetTrackingExtension.GetTrackedLocation( context, target, trackedLocation );
		if( condition.MinAccuracyValue() >= 0.0 )
		{
			if( ( ( condition.MinAccuracyValue() == 0.0 ) && !( trackedLocationSuccess ) ) || ( trackedLocation.accuracy < condition.MinAccuracyValue() ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.MinAccuracySharedValue() >= 0.0 )
		{
			if( ( ( condition.MinAccuracySharedValue() == 0.0 ) && !( trackedLocationSuccess ) ) || ( trackedLocation.sharedAccuracy < condition.MinAccuracySharedValue() ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsVisible() >= 0 )
		{
			if( ScriptExecutionContext.GetOwner( context ).GetSenses().IsAgentVisible( target ) )
			{
				if( condition.IsVisible() == 0 )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else
			{
				if( condition.IsVisible() > 0 )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		if( condition.MaxVisibilityToTargetDistance() > 0.0 )
		{
			if( condition.IsCombatTargetVisibleFrom().Type() != gamedataAIAdditionalTraceType.Undefined && ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ).IsHumanoid() )
			{
				visibilityCollisionToTargetDist = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ).GetDistToTraceEndFromPosToMainTrackedObject( AIActionHelper.GetAdditionalTraceTypeValueFromTweakEnum( condition.IsCombatTargetVisibleFrom().Type() ) );
				if( ( visibilityCollisionToTargetDist > condition.MaxVisibilityToTargetDistance() ) && ( visibilityCollisionToTargetDist < 1000000000.0 ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else
			{
				visibilityCollisionToTargetDist = ScriptExecutionContext.GetOwner( context ).GetSenses().GetVisibilityTraceEndToAgentDist( target );
				if( ( visibilityCollisionToTargetDist > condition.MaxVisibilityToTargetDistance() ) && ( visibilityCollisionToTargetDist < 1000000000.0 ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		if( condition.InvalidExpectation() >= 0 )
		{
			if( !( trackedLocationSuccess ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( condition.InvalidExpectation() == 0 )
			{
				if( trackedLocation.invalidExpectation )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( trackedLocation.invalidExpectation ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsMoving() >= 0 )
		{
			if( !( trackedLocationSuccess ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( condition.IsMoving() == 0 )
			{
				if( !( Vector4.IsXYZZero( trackedLocation.speed ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( Vector4.IsXYZZero( trackedLocation.speed ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIStateCond_Record > ) : Bool
	{
		var object : weak< GameObject >;
		if( !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		if( object == ScriptExecutionContext.GetOwner( context ) )
		{
			if( AIActionChecks.CheckOwnerState( ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ), AIActionParams.GetOwnerStatesFromArray( condition.InStates() ), condition.CheckAllTypes() ) )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		else if( AIActionChecks.CheckTargetState( ( ( ScriptedPuppet )( object ) ), AIActionParams.GetTargetStatesFromArray( condition.InStates(), object ), condition.CheckAllTypes() ) )
		{
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIVehicleCond_Record > ) : Bool
	{
		var vehicleRecord : Vehicle_Record;
		var vehicleTags : array< CName >;
		var desiredTags : array< CName >;
		var i : Int32;
		var vehicle : weak< VehicleObject >;
		var currentSpeed : Float;
		var speedRange : Vector2;
		var activePassangers : Int32;
		var activePassangersRange : Vector2;
		var freeSlotCount : Int32;
		var freeSlot : VehicleSeat_Record;
		var activeDriver : Bool;
		if( !( condition.Vehicle() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetVehicleObject( context, condition.Vehicle(), vehicle ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		if( vehicle.IsDestroyed() )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		vehicleRecord = vehicle.GetRecord();
		if( !( vehicleRecord ) )
		{
			return false;
		}
		desiredTags = condition.HasTags();
		vehicleTags = vehicleRecord.Tags();
		for( i = 0; i < desiredTags.Size(); i += 1 )
		{
			if( !( vehicleTags.Contains( desiredTags[ i ] ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		freeSlotCount = condition.GetFreeSlotsCount();
		for( i = 0; i < freeSlotCount; i += 1 )
		{
			freeSlot = condition.GetFreeSlotsItem( i );
			if( !( VehicleComponent.IsSlotAvailable( ScriptExecutionContext.GetOwner( context ).GetGame(), vehicle, freeSlot.SeatName() ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.DriverCheck() >= 0 )
		{
			activeDriver = VehicleComponent.HasActiveDriverMounted( ScriptExecutionContext.GetOwner( context ).GetGame(), vehicle.GetEntityID() );
			if( ( condition.DriverCheck() == 0 ) && activeDriver )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( condition.DriverCheck() == 1 ) && !( activeDriver ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		activePassangersRange = condition.ActivePassangers();
		if( ( activePassangersRange.X > 0.0 ) || ( activePassangersRange.Y > 0.0 ) )
		{
			if( !( VehicleComponent.GetNumberOfActivePassengers( ScriptExecutionContext.GetOwner( context ).GetGame(), vehicle.GetEntityID(), activePassangers ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( activePassangersRange.X > 0.0 ) && ( ( ( Float )( activePassangers ) ) < activePassangersRange.X ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( activePassangersRange.Y > 0.0 ) && ( ( ( Float )( activePassangers ) ) > activePassangersRange.Y ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		speedRange = condition.CurrentSpeed();
		if( ( speedRange.X > 0.0 ) || ( speedRange.Y > 0.0 ) )
		{
			currentSpeed = vehicle.GetBlackboard().GetFloat( GetAllBlackboardDefs().Vehicle.SpeedValue );
			if( ( speedRange.X > 0.0 ) && ( currentSpeed < speedRange.X ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( ( speedRange.Y > 0.0 ) && ( currentSpeed > speedRange.Y ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIDriverCond_Record > ) : Bool
	{
		if( VehicleComponent.IsDriver( ScriptExecutionContext.GetOwner( context ).GetGame(), ScriptExecutionContext.GetOwner( context ).GetEntityID() ) )
		{
			return ( ( condition.Invert() ) ? ( false ) : ( true ) );
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AITargetInUnmountingRangeCond_Record > ) : Bool
	{
		var result : Bool;
		var target : weak< GameObject >;
		var nonPlayerDistanceCheck : Float;
		result = false;
		nonPlayerDistanceCheck = 15.0;
		AIActionTarget.GetObject( context, condition.Target(), target );
		if( target.IsPlayer() )
		{
			if( ScriptExecutionContext.GetOwner( context ).IsPrevention() )
			{
				result = GameInstance.GetPreventionSpawnSystem( target.GetGame() ).IsInUnmountingRange( ( ( Vector3 )( ScriptExecutionContext.GetOwner( context ).GetWorldPosition() ) ) );
			}
			else
			{
				result = GameInstance.GetDynamicSpawnSystem( target.GetGame() ).IsInUnmountingRange( ( ( Vector3 )( ScriptExecutionContext.GetOwner( context ).GetWorldPosition() ) ) );
			}
		}
		else
		{
			result = Vector4.DistanceSquared( target.GetWorldPosition(), ScriptExecutionContext.GetOwner( context ).GetWorldPosition() ) < ( nonPlayerDistanceCheck * nonPlayerDistanceCheck );
		}
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AITargetStandingOnTopOfMovingVehicleCond_Record > ) : Bool
	{
		var result : Bool;
		var target : weak< GameObject >;
		var vehicleBelowID : EntityID;
		var vehicleBelow : weak< VehicleObject >;
		var minSpeedThreshold : Float;
		result = false;
		minSpeedThreshold = 2.0;
		AIActionTarget.GetObject( context, condition.Target(), target );
		if( VehicleComponent.IsMountedToVehicle( ScriptExecutionContext.GetOwner( context ).GetGame(), target ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		vehicleBelowID = ( ( ScriptedPuppet )( target ) ).TryGetVehicleBelow();
		if( !( EntityID.IsDefined( vehicleBelowID ) ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		VehicleComponent.GetVehicleFromID( ScriptExecutionContext.GetOwner( context ).GetGame(), vehicleBelowID, vehicleBelow );
		if( vehicleBelow && ( vehicleBelow.GetCurrentSpeed() > minSpeedThreshold ) )
		{
			result = true;
		}
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIMovingInCirclesCond_Record > ) : Bool
	{
		var result : Bool;
		var i : Int32;
		var object : weak< GameObject >;
		var vehicleObject : weak< VehicleObject >;
		var blackboard : IBlackboard;
		var transformHistoryComponent : TransformHistoryComponent;
		var positionHistory : array< Vector4 >;
		var currentTime : Float;
		var leaveVehicleDelay : Float;
		var timeMargin : Float;
		var timeMarginForDelay : Float;
		var maxDelayTime : Float;
		result = false;
		currentTime = 0.0;
		leaveVehicleDelay = 0.0;
		timeMargin = 1.0;
		timeMarginForDelay = 0.25;
		maxDelayTime = 8.0;
		if( !( condition.Target() ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		if( ( condition.Time() <= 0.0 ) || ( condition.Range() <= 0.0 ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		transformHistoryComponent = ( ( ScriptedPuppet )( object ) ).GetTransformHistoryComponent();
		if( !( transformHistoryComponent ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		if( VehicleComponent.GetVehicle( ScriptExecutionContext.GetOwner( context ).GetGame(), ScriptExecutionContext.GetOwner( context ), vehicleObject ) )
		{
			blackboard = vehicleObject.GetBlackboard();
			if( blackboard )
			{
				leaveVehicleDelay = blackboard.GetFloat( GetAllBlackboardDefs().Vehicle.ChaseTimeDelayToLeaveVehicle );
				if( leaveVehicleDelay <= 0.0 )
				{
					leaveVehicleDelay = RandF() * maxDelayTime;
					blackboard.SetFloat( GetAllBlackboardDefs().Vehicle.ChaseTimeDelayToLeaveVehicle, leaveVehicleDelay );
				}
			}
		}
		while( currentTime <= condition.Time() )
		{
			positionHistory.PushBack( transformHistoryComponent.GetInterpolatedPositionFromHistory( currentTime ) );
			currentTime += timeMargin;
		}
		while( currentTime <= ( condition.Time() + leaveVehicleDelay ) )
		{
			positionHistory.PushBack( transformHistoryComponent.GetInterpolatedPositionFromHistory( currentTime ) );
			currentTime += timeMarginForDelay;
		}
		if( positionHistory.Size() < 2 )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		for( i = 1; i < positionHistory.Size(); i += 1 )
		{
			if( Vector4.Distance( positionHistory[ 0 ], positionHistory[ i ] ) > condition.Range() )
			{
				return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
			}
		}
		result = true;
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIEverPerformedChase_Record > ) : Bool
	{
		var result : Bool;
		var vehicle : weak< VehicleObject >;
		result = false;
		if( !( condition ) || !( condition.Vehicle() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetVehicleObject( context, condition.Vehicle(), vehicle ) ) )
		{
			return false;
		}
		result = vehicle.EverPerformedChase();
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIAssignedVehicleCanReachTargetCond_Record > ) : Bool
	{
		var result : Bool;
		var object : weak< GameObject >;
		var vehicle : weak< VehicleObject >;
		var wheeledVehicle : weak< WheeledObject >;
		result = false;
		if( ( !( condition ) || !( condition.Vehicle() ) ) || !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetVehicleObject( context, condition.Vehicle(), vehicle ) ) )
		{
			return false;
		}
		wheeledVehicle = ( ( weak< weak< WheeledObject > > )( vehicle ) );
		if( !( wheeledVehicle ) )
		{
			return !( condition.Invert() );
		}
		result = wheeledVehicle.HasNavPathToTarget( object.GetEntityID(), condition.Duration(), condition.Invert() );
		return result;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIVehicleInsideInnerAreaOfAreaSpeedLimiter_Record > ) : Bool
	{
		var result : Bool;
		var vehicle : weak< VehicleObject >;
		result = false;
		if( AIActionTarget.GetVehicleObject( context, condition.Vehicle(), vehicle ) )
		{
			result = vehicle.IsVehicleInsideInnerAreaOfAreaSpeedLimiter();
		}
		return result != condition.Invert();
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIAssignedVehicleInPanicDriving_Record > ) : Bool
	{
		var result : Bool;
		var vehicle : weak< VehicleObject >;
		var wheeledVehicle : weak< WheeledObject >;
		result = false;
		if( !( condition ) || !( condition.Vehicle() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetVehicleObject( context, condition.Vehicle(), vehicle ) ) )
		{
			return false;
		}
		wheeledVehicle = ( ( weak< weak< WheeledObject > > )( vehicle ) );
		if( !( wheeledVehicle ) )
		{
			return false;
		}
		result = wheeledVehicle.IsPerformingPanicDriving();
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIAssignedVehicleInRace_Record > ) : Bool
	{
		var result : Bool;
		var vehicle : weak< VehicleObject >;
		var wheeledVehicle : weak< WheeledObject >;
		var racingSystem : RacingSystem;
		result = false;
		if( !( condition ) || !( condition.Vehicle() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetVehicleObject( context, condition.Vehicle(), vehicle ) ) )
		{
			return false;
		}
		wheeledVehicle = ( ( weak< weak< WheeledObject > > )( vehicle ) );
		if( !( wheeledVehicle ) )
		{
			return false;
		}
		racingSystem = GameInstance.GetRacingSystem( ScriptExecutionContext.GetOwner( context ).GetGame() );
		if( !( racingSystem ) )
		{
			return false;
		}
		result = racingSystem.IsAIVehicleRegistered( wheeledVehicle );
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function CheckAbility( const context : ScriptExecutionContext, ability : weak< GameplayAbility_Record > ) : Bool
	{
		var i : Int32;
		var count : Int32;
		var record : IPrereq_Record;
		count = ability.GetPrereqsForUseCount();
		for( i = 0; i < count; i += 1 )
		{
			record = ability.GetPrereqsForUseItem( i );
			if( !( IPrereq.CreatePrereq( record.GetID() ).IsFulfilled( ScriptExecutionContext.GetOwner( context ).GetGame(), ScriptExecutionContext.GetOwner( context ) ) ) )
			{
				return false;
			}
		}
		return true;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIAbilityCond_Record > ) : Bool
	{
		var i, j : Int32;
		var abilitiesCount : Int32;
		var prereqCount : Int32;
		var ability : weak< GameplayAbility_Record >;
		var prereq : weak< IPrereq_Record >;
		var object : weak< GameObject >;
		if( !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		abilitiesCount = condition.GetAbilitiesCount();
		for( i = 0; i < abilitiesCount; i += 1 )
		{
			ability = condition.GetAbilitiesItem( i );
			prereqCount = ability.GetPrereqsForUseCount();
			for( j = 0; j < prereqCount; j += 1 )
			{
				prereq = ability.GetPrereqsForUseItem( j );
				if( !( IPrereq.CreatePrereq( prereq.GetID() ).IsFulfilled( ScriptExecutionContext.GetOwner( context ).GetGame(), object ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public constexpr static function Check( const context : ScriptExecutionContext, condition : weak< AIInTacticPositionCond_Record > ) : Bool
	{
		return false;
	}

	[ profile = "" ]
	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIWorkspotCond_Record > ) : Bool
	{
		var workspotObject : weak< GameObject >;
		var workspotData : WorkspotEntryData;
		var globalRef : GlobalNodeRef;
		var coverManager : CoverManager;
		var inWorkspot : Bool;
		var coverID : Uint64;
		if( condition.WorkspotObj() )
		{
			if( !( AIActionTarget.GetObject( context, condition.WorkspotObj(), workspotObject ) ) )
			{
				return false;
			}
			workspotData = workspotObject.GetFreeWorkspotDataForAIAction( gamedataWorkspotActionType.DeviceInvestigation );
			globalRef = ResolveNodeRef( workspotData.workspotRef, GlobalNodeID.GetRoot() );
			if( !( GlobalNodeRef.IsDefined( globalRef ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		if( condition.IsInWorkspot() != -1 )
		{
			coverManager = GameInstance.GetCoverManager( ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) ).GetGame() );
			if( ( AIActionHelper.IsInWorkspot( ScriptExecutionContext.GetOwner( context ) ) && !( AIActionTarget.GetCurrentCoverID( context, coverID ) ) ) && !( coverManager.IsEnteringOrLeavingCover( ScriptExecutionContext.GetOwner( context ) ) ) )
			{
				inWorkspot = true;
			}
			if( condition.IsInWorkspot() == 0 )
			{
				if( inWorkspot )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else if( !( inWorkspot ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AISecurityCond_Record > ) : Bool
	{
		var ownerPuppet : weak< ScriptedPuppet >;
		var securityAreaType : ESecurityAreaType;
		if( condition.IsConnected() >= 0 )
		{
			if( condition.IsConnected() == 0 )
			{
				if( ScriptExecutionContext.GetOwner( context ).IsConnectedToSecuritySystem() )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else
			{
				if( !( ScriptExecutionContext.GetOwner( context ).IsConnectedToSecuritySystem() ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		if( condition.AreaType() )
		{
			ownerPuppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
			securityAreaType = ( ( ESecurityAreaType )( ( ( Int32 )( EnumValueFromName( 'ESecurityAreaType', condition.AreaType().EnumName() ) ) ) ) );
			if( securityAreaType != ownerPuppet.GetDeterminatedSecurityAreaType() )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIHasWeapon_Record > ) : Bool
	{
		var item : weak< ItemObject >;
		var typeCount : Int32;
		var puppet : ScriptedPuppet;
		var itemRecord : weak< Item_Record >;
		var categoryCount : Int32;
		puppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		item = GameInstance.GetTransactionSystem( puppet.GetGame() ).GetItemInSlot( puppet, T"AttachmentSlots.WeaponRight" );
		if( condition.ItemTag() != '' && !( item.GetItemData().HasTag( condition.ItemTag() ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		itemRecord = TweakDBInterface.GetItemRecord( ItemID.GetTDBID( item.GetItemID() ) );
		typeCount = condition.GetItemTypeCount();
		if( typeCount > 0 )
		{
			if( !( condition.ItemTypeContains( itemRecord.ItemType() ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		categoryCount = condition.GetItemCategoryCount();
		if( categoryCount > 0 )
		{
			if( !( condition.ItemCategoryContains( itemRecord.ItemCategory() ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AISquadCond_Record > ) : Bool
	{
		var squadInterface : PuppetSquadInterface;
		var puppet : ScriptedPuppet;
		var i : Int32;
		var count : Int32;
		puppet = ( ( ScriptedPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		if( !( AISquadHelper.GetSquadBaseInterface( puppet, squadInterface ) ) )
		{
			ScriptExecutionContext.DebugLog( context, 'tweakAI', "AISquadCond_Record: squad interface not found, most likely because gameplay component is overriden by custom in entity!!" );
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		count = condition.GetHasTicketsCount();
		for( i = 0; i < count; i += 1 )
		{
			if( !( squadInterface.HasOrderBySquadAction( condition.GetHasTicketsItem( i ).EnumName(), puppet ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		count = condition.GetTicketsConditionCheckCount();
		for( i = 0; i < count; i += 1 )
		{
			if( !( squadInterface.CheckTicketConditions( condition.GetTicketsConditionCheckItem( i ).EnumName(), puppet ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AICommandCond_Record > ) : Bool
	{
		var object : weak< GameObject >;
		var aiComponent : AIHumanComponent;
		var i, count : Int32;
		if( !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		aiComponent = ( ( ScriptedPuppet )( object ) ).GetAIControllerComponent();
		if( !( aiComponent ) )
		{
			return false;
		}
		count = condition.GetHasCommandsCount();
		for( i = 0; i < count; i += 1 )
		{
			if( !( aiComponent.IsCommandActive( condition.GetHasCommandsItem( i ) ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
			if( AIActionHelper.IsMoveCommand( condition.GetHasCommandsItem( i ) ) )
			{
				if( aiComponent.GetActionBlackboard().GetBool( GetAllBlackboardDefs().AIAction.ignoreInCombatMoveCommand ) && NPCPuppet.IsInCombat( ( ( weak< weak< ScriptedPuppet > > )( object ) ) ) )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		count = condition.GetHasNewOrOverridenCommandsCount();
		for( i = 0; i < count; i += 1 )
		{
			if( !( aiComponent.IsCommandReceivedOrOverriden( condition.GetHasNewOrOverridenCommandsItem( i ) ) ) )
			{
				return ( ( condition.Invert() ) ? ( true ) : ( false ) );
			}
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AINPCTypeCond_Record > ) : Bool
	{
		var object : weak< GameObject >;
		var targetPuppet : weak< ScriptedPuppet >;
		var device : weak< Device >;
		var allowedNPCType : NPCType_Record;
		var visualTag : CName;
		var count : Int32;
		var i : Int32;
		if( !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		targetPuppet = ( ( ScriptedPuppet )( object ) );
		if( ( ( PlayerPuppet )( targetPuppet ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		device = ( ( Device )( object ) );
		if( ( condition.DeviceState() >= 0 ) && device )
		{
			if( device.IsActive() && !( device.GetDevicePS().IsOFF() ) )
			{
				if( condition.DeviceState() == 0 )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
				else
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
			}
			else
			{
				if( condition.DeviceState() == 1 )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
				else
				{
					return ( ( condition.Invert() ) ? ( false ) : ( true ) );
				}
			}
		}
		if( condition.IsFollower() >= 0 )
		{
			if( targetPuppet.GetAIControllerComponent().GetAIRole().GetRoleEnum() == EAIRole.Follower )
			{
				if( condition.IsFollower() == 0 )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
			else
			{
				if( condition.IsFollower() == 1 )
				{
					return ( ( condition.Invert() ) ? ( true ) : ( false ) );
				}
			}
		}
		count = condition.GetAllowedNPCTypesCount();
		for( i = 0; i < count; i += 1 )
		{
			allowedNPCType = condition.GetAllowedNPCTypesItem( i );
			if( allowedNPCType.Type() == gamedataNPCType.Any || allowedNPCType.Type() == targetPuppet.GetNPCType() )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
		}
		count = condition.GetVisualTagsCount();
		for( i = 0; i < count; i += 1 )
		{
			visualTag = condition.GetVisualTagsItem( i );
			if( NPCManager.HasVisualTag( targetPuppet, visualTag ) )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	private static function GetPuppetVelocity( puppet : weak< ScriptedPuppet >, timePeriod : Float ) : Vector4
	{
		if( timePeriod > 0.0 )
		{
			return puppet.GetTransformHistoryComponent().GetVelocity( timePeriod );
		}
		else
		{
			return puppet.GetVelocity();
		}
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AILoSPositionCond_Record > ) : Bool
	{
		var object : weak< GameObject >;
		var aiComponent : AIHumanComponent;
		var result : Bool;
		if( !( condition.Target() ) )
		{
			return true;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return true;
		}
		aiComponent = ( ( ScriptedPuppet )( object ) ).GetAIControllerComponent();
		if( !( aiComponent ) )
		{
			return true;
		}
		result = aiComponent.GetReachedLoSPosition( object.GetEntityID(), object.GetWorldPosition(), condition.Type(), condition.MaxRadiusXY(), condition.MaxRadiusZ(), condition.MaxNotFoundTime() );
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIVelocityCond_Record > ) : Bool
	{
		var object : weak< GameObject >;
		var targetPuppet : weak< ScriptedPuppet >;
		var range : Vector2;
		var sqrRange : Vector2;
		var velocity : Vector4;
		var velocitySqrMag : Float;
		if( !( condition.Target() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.Target(), object ) ) )
		{
			return false;
		}
		targetPuppet = ( ( ScriptedPuppet )( object ) );
		if( !( targetPuppet ) )
		{
			return false;
		}
		range = condition.Range();
		sqrRange.X = range.X * range.X;
		sqrRange.Y = range.Y * range.Y;
		velocity = GetPuppetVelocity( targetPuppet, condition.TimePeriod() );
		velocity.Z = 0.0;
		velocitySqrMag = Vector4.LengthSquared( velocity );
		if( ( ( range.X >= 0.0 ) && ( velocitySqrMag < sqrRange.X ) ) || ( ( range.Y >= 0.0 ) && ( velocitySqrMag > sqrRange.Y ) ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public export static function Check( const context : ScriptExecutionContext, condition : weak< AIVelocityDotCond_Record > ) : Bool
	{
		var positionObject : weak< GameObject >;
		var velocityObject : weak< GameObject >;
		var velocityPuppet : weak< ScriptedPuppet >;
		var velocity : Vector4;
		var dotRange : Vector2;
		var dot : Float;
		if( !( condition.VelocityTarget() ) || !( condition.PositionTarget() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.VelocityTarget(), velocityObject ) ) )
		{
			return false;
		}
		velocityPuppet = ( ( ScriptedPuppet )( velocityObject ) );
		if( !( velocityPuppet ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.PositionTarget(), positionObject ) ) )
		{
			return false;
		}
		dotRange = condition.DotRange();
		velocity = GetPuppetVelocity( velocityPuppet, condition.TimePeriod() );
		velocity = Vector4.Normalize2D( velocity );
		dot = Vector4.Dot2D( velocity, Vector4.Normalize( positionObject.GetWorldPosition() - velocityObject.GetWorldPosition() ) );
		if( ( dot < dotRange.X ) || ( dot > dotRange.Y ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIVelocitiesDotCond_Record > ) : Bool
	{
		var firstObject : weak< GameObject >;
		var firstPuppet : weak< ScriptedPuppet >;
		var firstVelocity : Vector4;
		var firstTimePeriod : Float;
		var secondObject : weak< GameObject >;
		var secondPuppet : weak< ScriptedPuppet >;
		var secondVelocity : Vector4;
		var secondTimePeriod : Float;
		var dotRange : Vector2;
		var dot : Float;
		if( !( condition.FirstTarget() ) || !( condition.SecondTarget() ) )
		{
			return false;
		}
		if( !( AIActionTarget.GetObject( context, condition.FirstTarget(), firstObject ) ) )
		{
			return false;
		}
		firstPuppet = ( ( ScriptedPuppet )( firstObject ) );
		if( !( firstPuppet ) )
		{
			return false;
		}
		firstTimePeriod = condition.FirstTimePeriod();
		if( firstTimePeriod >= 0.0 )
		{
			firstVelocity = GetPuppetVelocity( firstPuppet, condition.FirstTimePeriod() );
			firstVelocity = Vector4.Normalize2D( firstVelocity );
		}
		else
		{
			firstVelocity = firstPuppet.GetWorldForward();
		}
		if( !( AIActionTarget.GetObject( context, condition.SecondTarget(), secondObject ) ) )
		{
			return false;
		}
		secondPuppet = ( ( ScriptedPuppet )( secondObject ) );
		if( !( secondPuppet ) )
		{
			return false;
		}
		secondTimePeriod = condition.SecondTimePeriod();
		if( secondTimePeriod >= 0.0 )
		{
			secondVelocity = GetPuppetVelocity( secondPuppet, condition.SecondTimePeriod() );
			secondVelocity = Vector4.Normalize2D( secondVelocity );
		}
		else
		{
			secondVelocity = secondPuppet.GetWorldForward();
		}
		dotRange = condition.DotRange();
		dot = Vector4.Dot2D( firstVelocity, secondVelocity );
		if( ( dot < dotRange.X ) || ( dot > dotRange.Y ) )
		{
			return ( ( condition.Invert() ) ? ( true ) : ( false ) );
		}
		return ( ( condition.Invert() ) ? ( false ) : ( true ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIIsFromDynamicSpawnSystem_Record > ) : Bool
	{
		var dynamicSpawnSystem : DynamicSpawnSystem;
		var result : Bool;
		dynamicSpawnSystem = GameInstance.GetDynamicSpawnSystem( ScriptExecutionContext.GetOwner( context ).GetGame() );
		result = dynamicSpawnSystem.IsEntityRegistered( ScriptExecutionContext.GetOwner( context ).GetEntityID() );
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIIsFromPreventionSystem_Record > ) : Bool
	{
		var preventionSpawnSystem : PreventionSpawnSystem;
		var result : Bool;
		preventionSpawnSystem = GameInstance.GetPreventionSpawnSystem( ScriptExecutionContext.GetOwner( context ).GetGame() );
		result = preventionSpawnSystem.IsEntityRegistered( ScriptExecutionContext.GetOwner( context ).GetEntityID() );
		if( condition.Invert() )
		{
			return !( result );
		}
		return result;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIIsHeatStage5Active_Record > ) : Bool
	{
		var result : Bool;
		var gi : GameInstance;
		var preventionSystem : PreventionSystem;
		gi = ScriptExecutionContext.GetOwner( context ).GetGame();
		preventionSystem = ( ( PreventionSystem )( GameInstance.GetScriptableSystemsContainer( gi ).Get( 'PreventionSystem' ) ) );
		result = preventionSystem.GetHeatStage() == EPreventionHeatStage.Heat_5;
		if( condition.Invert() )
		{
			return !( result );
		}
		return result;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AITargetInPreventionFreeArea_Record > ) : Bool
	{
		var preventionSpawnSystem : PreventionSpawnSystem;
		var result : Bool;
		var targetObject : weak< GameObject >;
		if( !( AIActionTarget.GetObject( context, condition.Target(), targetObject ) ) )
		{
			return false;
		}
		preventionSpawnSystem = GameInstance.GetPreventionSpawnSystem( ScriptExecutionContext.GetOwner( context ).GetGame() );
		result = preventionSpawnSystem.IsPointInPreventionFreeArea( targetObject.GetWorldPosition() );
		if( condition.Invert() )
		{
			return !( result );
		}
		return result;
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIIsShootingBlockedFromPrevention_Record > ) : Bool
	{
		var result : Bool;
		var puppet : NPCPuppet;
		puppet = ( ( NPCPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		result = false;
		if( puppet )
		{
			result = puppet.IsPrevention() && puppet.GetPreventionSystem().IsShootingFromVehicleBlocked();
		}
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AICanShootInCarChaseCond_Record > ) : Bool
	{
		var ownerMountingInfo : MountingInfo;
		var targetMountingInfo : MountingInfo;
		var ownerID : EntityID;
		var targetID : EntityID;
		var result : Bool;
		var vehicle : weak< VehicleObject >;
		var targetVehicle : weak< VehicleObject >;
		var target : ScriptedPuppet;
		result = false;
		ownerID = ScriptExecutionContext.GetOwner( context ).GetEntityID();
		ownerMountingInfo = GameInstance.GetMountingFacility( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetMountingInfoSingleWithIds( ownerID,  );
		if( !( EntityID.IsDefined( ownerMountingInfo.childId ) ) || !( EntityID.IsDefined( ownerMountingInfo.parentId ) ) )
		{
			return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
		}
		VehicleComponent.GetVehicleFromID( ScriptExecutionContext.GetOwner( context ).GetGame(), ownerMountingInfo.parentId, vehicle );
		target = ( ( ScriptedPuppet )( ScriptExecutionContext.GetArgumentObject( context, 'CombatTarget' ) ) );
		if( target )
		{
			targetID = target.GetEntityID();
			targetMountingInfo = GameInstance.GetMountingFacility( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetMountingInfoSingleWithIds( targetID,  );
			VehicleComponent.GetVehicleFromID( ScriptExecutionContext.GetOwner( context ).GetGame(), targetMountingInfo.parentId, targetVehicle );
		}
		if( vehicle && !( vehicle.IsChasingTarget() ) )
		{
			result = true;
		}
		else if( targetVehicle && !( targetVehicle.IsPlayerDriver() ) )
		{
			result = true;
		}
		else if( ( !( targetVehicle ) && target ) && EntityID.IsDefined( target.TryGetVehicleBelow() ) )
		{
			result = true;
		}
		else if( target && !( target.IsPlayer() ) )
		{
			result = true;
		}
		else if( ownerMountingInfo.slotId.id == VehicleComponent.GetDriverSlotName() )
		{
			result = GameInstance.GetVehicleSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).CanDriverShootInCarChase( ownerMountingInfo.parentId );
		}
		else
		{
			result = GameInstance.GetVehicleSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).CanPassengersShootInCarChase( ownerMountingInfo.parentId );
		}
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	private static function GetDifficultyValue( difficulty : gameDifficulty ) : Int32
	{
		switch( difficulty )
		{
			case gameDifficulty.Story:
				return 1;
			case gameDifficulty.Easy:
				return 2;
			case gameDifficulty.Hard:
				return 3;
			case gameDifficulty.VeryHard:
				return 4;
			default:
				return 0;
		}
	}

	private static function GetPowerDifferentialValue( difficulty : gameEPowerDifferential ) : Int32
	{
		switch( difficulty )
		{
			case gameEPowerDifferential.TRASH:
				return 1;
			case gameEPowerDifferential.EASY:
				return 2;
			case gameEPowerDifferential.NORMAL:
				return 3;
			case gameEPowerDifferential.HARD:
				return 4;
			case gameEPowerDifferential.IMPOSSIBLE:
				return 5;
			default:
				return 0;
		}
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIGameDifficultyCond_Record > ) : Bool
	{
		var result : Bool;
		var currentDifficulty, comparedDifficulty : Int32;
		var comparisonType : EComparisonType;
		currentDifficulty = GetDifficultyValue( GameInstance.GetStatsDataSystem( ScriptExecutionContext.GetOwner( context ).GetGame() ).GetDifficulty() );
		comparedDifficulty = condition.ComparedDifficulty();
		comparisonType = ( ( EComparisonType )( ( ( Int32 )( EnumValueFromName( 'EComparisonType', condition.ComparisonType() ) ) ) ) );
		result = ProcessCompareInt( comparisonType, comparedDifficulty, currentDifficulty );
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AINPCDifficultyCond_Record > ) : Bool
	{
		var result : Bool;
		var currentDifficulty, comparedDifficulty : Int32;
		var comparisonType : EComparisonType;
		var npc : NPCPuppet;
		result = false;
		npc = ( ( NPCPuppet )( ScriptExecutionContext.GetOwner( context ) ) );
		if( npc )
		{
			currentDifficulty = GetPowerDifferentialValue( RPGManager.CalculatePowerDifferential( npc ) );
			comparedDifficulty = condition.ComparedDifficulty();
			comparisonType = ( ( EComparisonType )( ( ( Int32 )( EnumValueFromName( 'EComparisonType', condition.ComparisonType() ) ) ) ) );
			result = ProcessCompareInt( comparisonType, comparedDifficulty, currentDifficulty );
		}
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AINPCRarityCond_Record > ) : Bool
	{
		var result : Bool;
		var target : weak< GameObject >;
		var targetPuppet : ScriptedPuppet;
		var rarity : gamedataNPCRarity;
		if( !( AIActionTarget.GetObject( context, condition.Target(), target ) ) )
		{
			return false;
		}
		targetPuppet = ( ( ScriptedPuppet )( target ) );
		if( !( targetPuppet ) )
		{
			return false;
		}
		rarity = ( ( gamedataNPCRarity )( ( ( Int32 )( EnumValueFromString( "gamedataNPCRarity", condition.Rarity() ) ) ) ) );
		result = rarity == targetPuppet.GetNPCRarity();
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIInArmedVehicleCond_Record > ) : Bool
	{
		var vehicle : weak< VehicleObject >;
		if( VehicleComponent.GetVehicle( ScriptExecutionContext.GetOwner( context ).GetGame(), ScriptExecutionContext.GetOwner( context ).GetEntityID(), vehicle ) )
		{
			if( vehicle.IsArmedVehicle() )
			{
				return ( ( condition.Invert() ) ? ( false ) : ( true ) );
			}
		}
		return ( ( condition.Invert() ) ? ( true ) : ( false ) );
	}

	public static function Check( const context : ScriptExecutionContext, condition : weak< AIPercentageChanceCond_Record > ) : Bool
	{
		var successProbabilityPercent : Int32;
		var result : Bool;
		successProbabilityPercent = condition.SuccessProbability();
		if( successProbabilityPercent == 0 )
		{
			return condition.Invert();
		}
		if( successProbabilityPercent == 100 )
		{
			return !( condition.Invert() );
		}
		result = RandRange( 0, 100 ) < successProbabilityPercent;
		return ( ( condition.Invert() ) ? ( !( result ) ) : ( result ) );
	}

}

