mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-16 11:42:45 +08:00
7f718503bd
- 复活角色 - 将cancelable全改为默认true - move私有牌堆的未知牌时不再显示错误 - 处理区牌增加大多数脚注 - 装备栏有宝物时压缩间距 - 使用虚拟牌时处理区有虚拟名字 - 带详细描述的选择框 - 武将一览界面显示技能语音、胜利语音、死亡语音
71 lines
1.8 KiB
Lua
71 lines
1.8 KiB
Lua
-- SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
GameEvent.functions[GameEvent.Judge] = function(self)
|
|
local data = table.unpack(self.data)
|
|
local self = self.room
|
|
local who = data.who
|
|
self.logic:trigger(fk.StartJudge, who, data)
|
|
data.card = data.card or Fk:getCardById(self:getNCards(1)[1])
|
|
|
|
if data.reason ~= "" then
|
|
self:sendLog{
|
|
type = "#StartJudgeReason",
|
|
from = who.id,
|
|
arg = data.reason,
|
|
}
|
|
end
|
|
|
|
self:sendLog{
|
|
type = "#InitialJudge",
|
|
from = who.id,
|
|
card = {data.card.id},
|
|
}
|
|
self:moveCardTo(data.card, Card.Processing, nil, fk.ReasonJudge)
|
|
self:sendFootnote({ data.card.id }, {
|
|
type = "##JudgeCard",
|
|
arg = data.reason,
|
|
})
|
|
|
|
self.logic:trigger(fk.AskForRetrial, who, data)
|
|
self.logic:trigger(fk.FinishRetrial, who, data)
|
|
Fk:filterCard(data.card.id, who, data)
|
|
self:sendLog{
|
|
type = "#JudgeResult",
|
|
from = who.id,
|
|
card = {data.card.id},
|
|
}
|
|
self:sendFootnote({ data.card.id }, {
|
|
type = "##JudgeCard",
|
|
arg = data.reason,
|
|
})
|
|
|
|
if data.pattern then
|
|
self:delay(400);
|
|
self:setCardEmotion(data.card.id, data.card:matchPattern(data.pattern) and "judgegood" or "judgebad")
|
|
self:delay(900);
|
|
end
|
|
|
|
if self.logic:trigger(fk.FinishJudge, who, data) then
|
|
self.logic:breakEvent()
|
|
end
|
|
end
|
|
|
|
GameEvent.cleaners[GameEvent.Judge] = function(self)
|
|
local data = table.unpack(self.data)
|
|
local self = self.room
|
|
if (self.interrupted or not data.skipDrop) and self:getCardArea(data.card.id) == Card.Processing then
|
|
self:moveCardTo(data.card, Card.DiscardPile, nil, fk.ReasonJudge)
|
|
end
|
|
if not self.interrupted then return end
|
|
|
|
-- prohibit access to judge.card
|
|
setmetatable(data, {
|
|
__index = function(self, key)
|
|
if key == "card" then
|
|
error("__manuallyBreak")
|
|
end
|
|
return rawget(self, key)
|
|
end
|
|
})
|
|
end
|