
WhatsNext:AddConditionalStatement("Is Player",{
	category = "Unit State",
	test = function(checkTable) 
		return UnitIsPlayer(tostring(checkTable.unit))
	end,
	text = function(checkTable) 
		return tostring(checkTable.unit) .. " is a player character."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	}
})

WhatsNext:AddConditionalStatement("Are Enemies",{
	category = "Unit State",
	test = function(checkTable) 
		return UnitIsEnemy(tostring(checkTable.unit1),tostring(checkTable.unit2))
	end,
	text = function(checkTable) 
		return tostring(checkTable.unit1) .. " and " .. tostring(checkTable.unit2) .. " are enemies."
	end,
	arguments = {
		unit1 = {type = "dropdown", default = "player", possibleValues = WhatsNext.valueLists.unitAny},
		unit2 = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	}
})

WhatsNext:AddConditionalStatement("Is Named",{
	category = "Unit State",
	test = function(checkTable) 
		return UnitName(tostring(checkTable.unit)) == tostring(checkTable.name)
	end,
	text = function(checkTable) 
		return tostring(checkTable.unit) .. " is named " .. tostring(checkTable.name) .. "."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
		name = {type = "text", default = ""}
	}
})

WhatsNext:AddConditionalStatement("Attackable Target",{
	category = "Unit State",
	test = function(checkTable) 
		return UnitName(tostring(checkTable.unit2)) and UnitCanAttack(tostring(checkTable.unit1),tostring(checkTable.unit2))
	end,
	text = function(checkTable) 
		return tostring(checkTable.unit1) .. " can attack " .. tostring(checkTable.unit2) .. "."
	end,
	arguments = {
		unit1 = {type = "dropdown", default = "player", possibleValues = WhatsNext.valueLists.unitAny},
		unit2 = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	}
})

WhatsNext:AddConditionalStatement("Unit Is Unit",{
	category = "Unit State",
	test = function(checkTable)
		return UnitExists(checkTable.unit1) and UnitExists(checkTable.unit2) and UnitIsUnit(checkTable.unit1,checkTable.unit2)
	end,
	text = function(checkTable)
		return tostring(checkTable.unit1) .. " is the same unit as " .. tostring(checkTable.unit2) .. "."
	end,
	arguments = {
		unit1 = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
		unit2 = {type = "dropdown", default = "player", possibleValues = WhatsNext.valueLists.unitAny},
	},
})

WhatsNext:AddConditionalStatement("Unit Exists",{
	category = "Unit State",
	test = function(checkTable)
		return UnitExists(checkTable.unit)
	end,
	text = function(checkTable)
			return tostring(checkTable.unit) .. " exists."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	},
})
WhatsNext:AddConditionalStatement("Unit Visible",{
	category = "Unit State",
	test = function(checkTable)
		return UnitIsVisible(checkTable.unit)
	end,
	text = function(checkTable)
			return tostring(checkTable.unit) .. " is visible."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	},
})

WhatsNext:AddConditionalStatement("Unit Tapped By Player",{
	category = "Unit State",
	test = function(checkTable)
		return UnitIsTappedByPlayer(checkTable.unit)
	end,
	text = function(checkTable)
			return tostring(checkTable.unit) .. " is tapped by player."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	},
})

WhatsNext:AddConditionalStatement("Unit Tapped",{
	category = "Unit State",
	test = function(checkTable)
		return UnitIsTapped(checkTable.unit) and not UnitIsTappedByPlayer(checkTable.unit)
	end,
	text = function(checkTable)
			return tostring(checkTable.unit) .. " is tapped by a different player."
	end,
	arguments = {
		unit = {type = "dropdown", default = "target", possibleValues = WhatsNext.valueLists.unitAny},
	},
})



