updated message
This commit is contained in:
parent
b5482b55dd
commit
8b217ea702
@ -368,6 +368,8 @@ function removeOneUse(playerColor, hoveredObject)
|
|||||||
else
|
else
|
||||||
tokenName = "Clue"
|
tokenName = "Clue"
|
||||||
end
|
end
|
||||||
|
elseif targetObject.memo == "resourceCounter" then
|
||||||
|
tokenName = "Resource Counter"
|
||||||
else
|
else
|
||||||
tokenName = titleCase(targetObject.memo)
|
tokenName = titleCase(targetObject.memo)
|
||||||
end
|
end
|
||||||
@ -378,12 +380,11 @@ function removeOneUse(playerColor, hoveredObject)
|
|||||||
|
|
||||||
-- construct feedback message
|
-- construct feedback message
|
||||||
local playerName = getColoredName(playerColor)
|
local playerName = getColoredName(playerColor)
|
||||||
local article = getArticle(tokenName)
|
|
||||||
local cardInfo = ""
|
local cardInfo = ""
|
||||||
if cardName and cardName ~= "" then
|
if cardName and cardName ~= "" then
|
||||||
cardInfo = " from " .. cardName
|
cardInfo = " from " .. cardName
|
||||||
end
|
end
|
||||||
broadcastToAll(playerName .. " removed" .. article .. tokenName .. cardInfo .. ".", "White")
|
broadcastToAll(playerName .. " removed a token (" .. tokenName .. ")".. cardInfo .. ".", "White")
|
||||||
|
|
||||||
local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)
|
local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)
|
||||||
playermatApi.discardListOfObjects(discardForMatColor, { targetObject })
|
playermatApi.discardListOfObjects(discardForMatColor, { targetObject })
|
||||||
@ -566,13 +567,6 @@ function titleCase(str)
|
|||||||
return first:upper() .. rest:lower()
|
return first:upper() .. rest:lower()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- gets the proper article (disregarding silent "h")
|
|
||||||
function getArticle(str)
|
|
||||||
local vowels = { a = true, e = true, i = true, o = true, u = true }
|
|
||||||
local firstLetter = string.lower(str:sub(1, 1))
|
|
||||||
return vowels[firstLetter] and " an " or " a "
|
|
||||||
end
|
|
||||||
|
|
||||||
-- returns the color of the first seated player
|
-- returns the color of the first seated player
|
||||||
function getFirstSeatedPlayer()
|
function getFirstSeatedPlayer()
|
||||||
for _, color in ipairs(getSeatedPlayers()) do
|
for _, color in ipairs(getSeatedPlayers()) do
|
||||||
|
Loading…
Reference in New Issue
Block a user