Merge pull request #962 from argonui/kohaku
Kohaku: Fixed color for Bless Curse Manager messages
This commit is contained in:
commit
b47d4f4fd5
@ -175,11 +175,10 @@ function doRemove(color)
|
||||
end
|
||||
end
|
||||
|
||||
broadcastToColor("Removed " .. count.Bless .. " Bless and " .. count.Curse .. " Curse tokens from the chaos bag.",
|
||||
color, "White")
|
||||
broadcastToColor(
|
||||
"Removed " .. removeTakenTokens("Bless") .. " Bless and " .. removeTakenTokens("Curse") .. " Curse tokens from play.",
|
||||
color, "White")
|
||||
broadcastToColor("Removed " .. count.Bless .. " Bless and " ..
|
||||
count.Curse .. " Curse tokens from the chaos bag.", color, "White")
|
||||
broadcastToColor("Removed " .. removeTakenTokens("Bless") .. " Bless and " ..
|
||||
removeTakenTokens("Curse") .. " Curse tokens from play.", color, "White")
|
||||
|
||||
resetTables()
|
||||
updateButtonLabels()
|
||||
@ -214,16 +213,21 @@ function clickCurse(_, color, isRightClick)
|
||||
callFunctions("Curse", isRightClick)
|
||||
end
|
||||
|
||||
function callFunctions(type, isRightClick)
|
||||
function callFunctions(tokenType, isRightClick)
|
||||
if not chaosBagApi.canTouchChaosTokens() then return end
|
||||
|
||||
if isRightClick then
|
||||
removeToken(type)
|
||||
removeToken(tokenType)
|
||||
else
|
||||
addToken(type)
|
||||
addToken(tokenType)
|
||||
end
|
||||
end
|
||||
|
||||
function callFunctionFromApi(params)
|
||||
playerColor = params.playerColor or Player.getSeatedPlayers()[1]
|
||||
callFunctions(params.tokenType, params.remove)
|
||||
end
|
||||
|
||||
---------------------------------------------------------
|
||||
-- called functions
|
||||
---------------------------------------------------------
|
||||
|
@ -57,15 +57,17 @@ do
|
||||
end
|
||||
|
||||
-- adds bless / curse to the chaos bag
|
||||
---@param type string Type of chaos token ("Bless" or "Curse")
|
||||
BlessCurseManagerApi.addToken = function(type)
|
||||
getManager().call("addToken", type)
|
||||
---@param tokenType string Type of chaos token ("Bless" or "Curse")
|
||||
---@param playerColor? string Color of the triggering player
|
||||
BlessCurseManagerApi.addToken = function(tokenType, playerColor)
|
||||
getManager().call("callFunctionFromApi", { tokenType = tokenType, playerColor = playerColor, remove = false })
|
||||
end
|
||||
|
||||
-- removes bless / curse from the chaos bag
|
||||
---@param type string Type of chaos token ("Bless" or "Curse")
|
||||
BlessCurseManagerApi.removeToken = function(type)
|
||||
getManager().call("removeToken", type)
|
||||
---@param tokenType string Type of chaos token ("Bless" or "Curse")
|
||||
---@param playerColor? string Color of the triggering player
|
||||
BlessCurseManagerApi.removeToken = function(tokenType, playerColor)
|
||||
getManager().call("callFunctionFromApi", { tokenType = tokenType, playerColor = playerColor, remove = true })
|
||||
end
|
||||
|
||||
BlessCurseManagerApi.getBlessCurseInBag = function()
|
||||
|
@ -45,19 +45,19 @@ function shutOff()
|
||||
end
|
||||
end
|
||||
|
||||
function addTokenToBag(_, _, tokenType)
|
||||
function addTokenToBag(player, _, tokenType)
|
||||
if not updated then return end
|
||||
blessCurseManagerApi.addToken(tokenType)
|
||||
blessCurseManagerApi.addToken(tokenType, player.color)
|
||||
updated = false
|
||||
Wait.frames(maybeUpdateButtonState, 2)
|
||||
end
|
||||
|
||||
function removeAndExtraAction()
|
||||
function removeAndExtraAction(player)
|
||||
if not updated then return end
|
||||
blessCurseManagerApi.removeToken("Bless")
|
||||
blessCurseManagerApi.removeToken("Bless")
|
||||
blessCurseManagerApi.removeToken("Curse")
|
||||
blessCurseManagerApi.removeToken("Curse")
|
||||
blessCurseManagerApi.removeToken("Bless", player.color)
|
||||
blessCurseManagerApi.removeToken("Bless", player.color)
|
||||
blessCurseManagerApi.removeToken("Curse", player.color)
|
||||
blessCurseManagerApi.removeToken("Curse", player.color)
|
||||
updated = false
|
||||
Wait.frames(maybeUpdateButtonState, 2)
|
||||
|
||||
@ -89,9 +89,9 @@ function removeAndExtraAction()
|
||||
tokenManagerApi.spawnToken(emptyPos + Vector(0, 0.7, 0), "universalActionAbility", rotation, callbackName, callbackParams)
|
||||
end
|
||||
|
||||
function elderSignAbility()
|
||||
blessCurseManagerApi.addToken("Bless")
|
||||
blessCurseManagerApi.addToken("Curse")
|
||||
function elderSignAbility(player)
|
||||
blessCurseManagerApi.addToken("Bless", player.color)
|
||||
blessCurseManagerApi.addToken("Curse", player.color)
|
||||
updated = false
|
||||
Wait.frames(maybeUpdateButtonState, 2)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user