some bugfixes
This commit is contained in:
parent
198716174f
commit
abd4fc5f26
@ -285,7 +285,7 @@ function tidyPlayerMatCoroutine()
|
|||||||
if i < 5 then
|
if i < 5 then
|
||||||
objList = playmatApi.searchAroundPlaymat(COLORS[i])
|
objList = playmatApi.searchAroundPlaymat(COLORS[i])
|
||||||
else
|
else
|
||||||
objList = searchLib.inArea({ -2, 2, 10 }, _, { 55, 1, 13.5 })
|
objList = searchLib.inArea({ -2, 2, 10 }, { 0, 270, 0 }, { 55, 1, 13.5 })
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, obj in ipairs(objList) do
|
for _, obj in ipairs(objList) do
|
||||||
|
@ -209,18 +209,13 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
|||||||
return
|
return
|
||||||
elseif hoveredObject.type == "Card" then
|
elseif hoveredObject.type == "Card" then
|
||||||
cardName = hoveredObject.getName()
|
cardName = hoveredObject.getName()
|
||||||
|
local searchResult = searchLib.onObject(hoveredObject, "isClue")
|
||||||
|
|
||||||
for _, v in ipairs(searchLib.onObject(hoveredObject)) do
|
if #searchResult == 0 then
|
||||||
local obj = v.hit_object
|
|
||||||
if obj.memo == "clueDoom" and obj.is_face_down == false then
|
|
||||||
clue = obj
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if clue == nil then
|
|
||||||
broadcastToColor("This card does not have any clues on it.", playerColor, "Yellow")
|
broadcastToColor("This card does not have any clues on it.", playerColor, "Yellow")
|
||||||
return
|
return
|
||||||
|
else
|
||||||
|
clue = searchResult[1]
|
||||||
end
|
end
|
||||||
elseif hoveredObject.memo == "clueDoom" then
|
elseif hoveredObject.memo == "clueDoom" then
|
||||||
if hoveredObject.is_face_down then
|
if hoveredObject.is_face_down then
|
||||||
@ -228,11 +223,10 @@ function takeClueFromLocation(playerColor, hoveredObject)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, obj in ipairs(searchLib.belowPosition(hoveredObject.getPosition(), "isCard")) do
|
local searchResult = searchLib.belowPosition(hoveredObject.getPosition(), "isCard")
|
||||||
if obj.type == "Card" then
|
|
||||||
cardName = obj.getName()
|
if #searchResult ~= 0 then
|
||||||
break
|
cardName = searchResult[1].getName()
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
broadcastToColor("Hover a clue or card with clues and try again.", playerColor, "Yellow")
|
broadcastToColor("Hover a clue or card with clues and try again.", playerColor, "Yellow")
|
||||||
|
@ -298,7 +298,6 @@ function doUpkeepFromHotkey(color)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function doUpkeep(_, clickedByColor, isRightClick)
|
function doUpkeep(_, clickedByColor, isRightClick)
|
||||||
-- right-click allow color changing
|
|
||||||
if isRightClick then
|
if isRightClick then
|
||||||
changeColor(clickedByColor)
|
changeColor(clickedByColor)
|
||||||
return
|
return
|
||||||
|
@ -45,7 +45,7 @@ do
|
|||||||
-- searches the area on an object
|
-- searches the area on an object
|
||||||
SearchLib.onObject = function(obj, filter)
|
SearchLib.onObject = function(obj, filter)
|
||||||
pos = obj.getPosition()
|
pos = obj.getPosition()
|
||||||
size = obj.getBounds().size
|
size = obj.getBounds().size:setAt("y", 1)
|
||||||
return returnSearchResult(pos, _, size, filter)
|
return returnSearchResult(pos, _, size, filter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user