updated message
This commit is contained in:
parent
b5482b55dd
commit
8b217ea702
@ -368,6 +368,8 @@ function removeOneUse(playerColor, hoveredObject)
|
||||
else
|
||||
tokenName = "Clue"
|
||||
end
|
||||
elseif targetObject.memo == "resourceCounter" then
|
||||
tokenName = "Resource Counter"
|
||||
else
|
||||
tokenName = titleCase(targetObject.memo)
|
||||
end
|
||||
@ -378,12 +380,11 @@ function removeOneUse(playerColor, hoveredObject)
|
||||
|
||||
-- construct feedback message
|
||||
local playerName = getColoredName(playerColor)
|
||||
local article = getArticle(tokenName)
|
||||
local cardInfo = ""
|
||||
if cardName and cardName ~= "" then
|
||||
cardInfo = " from " .. cardName
|
||||
end
|
||||
broadcastToAll(playerName .. " removed" .. article .. tokenName .. cardInfo .. ".", "White")
|
||||
broadcastToAll(playerName .. " removed a token (" .. tokenName .. ")".. cardInfo .. ".", "White")
|
||||
|
||||
local discardForMatColor = getColorToDiscardFor(hoveredObject, playerColor)
|
||||
playermatApi.discardListOfObjects(discardForMatColor, { targetObject })
|
||||
@ -566,13 +567,6 @@ function titleCase(str)
|
||||
return first:upper() .. rest:lower()
|
||||
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
|
||||
function getFirstSeatedPlayer()
|
||||
for _, color in ipairs(getSeatedPlayers()) do
|
||||
|
Loading…
Reference in New Issue
Block a user