edit slots by dropping Charisma/Relic Hunter

This commit is contained in:
Zerino 2024-11-13 12:25:39 -03:00
parent c3c105f670
commit a9c31630f0

View File

@ -1177,6 +1177,33 @@ function resetSlotSymbols()
updateSlotSymbols()
end
function modifySlot(newSlot, cardPosition)
local slotSnaps = {}
local snaps = self.getSnapPoints()
for i, snap in ipairs(snaps) do
if inArea(snap.position, MAIN_PLAY_AREA) then
table.insert(slotSnaps, snap)
end
end
cardPosition.x = tonumber(string.format("%.3f", cardPosition.x))
cardPosition.z = tonumber(string.format("%.3f", cardPosition.z))
for snapId, snap in ipairs(slotSnaps) do
local snapPosX = tonumber(string.format("%.3f", snap.position.x))
local snapPosZ = tonumber(string.format("%.3f", snap.position.z))
if snapPosX == cardPosition.x and snapPosZ == cardPosition.z then
slotData[snapId] = newSlot
if Player[playerColor].seated then
printToColor(newSlot .. " slot added to player mat", playerColor, Color.fromString(playerColor))
else
local hostColor = Player.getPlayers()[1].color
printToColor(newSlot .. " slot added to player mat", hostColor, Color.fromString(hostColor))
end
end
end
updateSave()
updateSlotSymbols()
end
---------------------------------------------------------
-- playermat token spawning
---------------------------------------------------------
@ -1255,6 +1282,11 @@ function onCollisionEnter(collisionInfo)
-- main uses spawning
if inArea(localCardPos, MAIN_PLAY_AREA) and (md.type == "Asset" or md.type == "Event") then
spawnTokensOrShowHelper(object)
if md.id == "02158" or id == "01694" then
modifySlot("Ally", localCardPos)
elseif md.id == "02157" or id == "01695" then
modifySlot("Accessory", localCardPos)
end
end
-- encounter types / committed skill cards in the threat area