mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
a433b1a9ed
- 实装了by_user用以检定“使用牌造成伤害” - 实装Fk.lords以快速查找主公武将 - 添加moveMark以在移动后(前一刻)赋予标记 - 实装-inarea后缀,移动后若不在对应区域会被立即移除 - 为system_enum补全注释 - 内置神将映射 - 修复了小乔转酒杀导致二连击的bug - 修复了askForCardsChosen烧条后不自动抓取的bug --------- Co-authored-by: Nyutanislavsky <nyutanislavsky@qq.com>
36 lines
1.1 KiB
Lua
36 lines
1.1 KiB
Lua
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
Fk:addPoxiMethod{
|
|
name = "AskForCardsChosen",
|
|
card_filter = function(to_select, selected, data, extra_data)
|
|
return #selected < extra_data.max
|
|
end,
|
|
feasible = function(selected, data, extra_data)
|
|
return #selected >= extra_data.min and #selected <= extra_data.max
|
|
end,
|
|
prompt = function(data, extra_data)
|
|
if extra_data.prompt then
|
|
return extra_data.prompt
|
|
else
|
|
local ret = Fk:translate("#AskForChooseCards")
|
|
ret = ret:gsub("%%1", Fk:translate(extra_data.skillName or "AskForCardsChosen"))
|
|
ret = ret:gsub("%%2", Fk:translate(extra_data.min))
|
|
ret = ret:gsub("%%3", Fk:translate(extra_data.max))
|
|
return ret .. ":" ..extra_data.to
|
|
end
|
|
end,
|
|
default_choice = function(data, extra_data)
|
|
local ret = {}
|
|
for _, pile in ipairs(data) do
|
|
local cards = pile[2]
|
|
local lim = extra_data.min - #ret
|
|
if #cards > lim then
|
|
table.insertTable(ret, table.random(cards, lim))
|
|
break
|
|
end
|
|
table.insertTable(ret, cards)
|
|
end
|
|
return ret
|
|
end
|
|
}
|