CardPrompt

This commit is contained in:
YoumuKon 2024-04-26 18:37:07 +08:00
parent 766e93378e
commit 27bdfe9afc
2 changed files with 20 additions and 0 deletions

View File

@ -724,6 +724,10 @@ function updateSelectedTargets(playerid, selected) {
}
}
}
const prompt = lcall("CardPrompt", card, selected_targets);
if (prompt !== "") {
roomScene.setPrompt(Util.processPrompt(prompt));
}
} else {
all_photos.forEach(photo => {
photo.state = "normal";

View File

@ -382,6 +382,22 @@ function CardFeasible(card, selected_targets)
return ret
end
---@param card string | integer
---@param selected_targets integer[] @ ids of selected players
function CardPrompt(card, selected_targets)
local c ---@type Card
local selected_cards
if type(card) == "number" then
c = Fk:getCardById(card)
selected_cards = {card}
else
local t = json.decode(card)
return ActiveSkillPrompt(t.skill, t.subcards, selected_targets)
end
return ActiveSkillPrompt(c.skill, selected_cards, selected_targets)
end
-- Handle skills
function GetSkillData(skill_name)