mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-15 19:22:25 +08:00
fix bugs (#171)
This commit is contained in:
parent
23762e1600
commit
5ad2f870d5
|
@ -928,7 +928,11 @@ callbacks["AskForUseActiveSkill"] = function(jsonData) {
|
|||
|
||||
roomScene.respond_play = false;
|
||||
roomScene.state = "responding";
|
||||
roomScene.responding_card = ".";
|
||||
|
||||
if (JSON.parse(Backend.callLuaFunction('GetSkillData', [skill_name])).isViewAsSkill) {
|
||||
roomScene.responding_card = ".";
|
||||
}
|
||||
|
||||
roomScene.autoPending = true;
|
||||
roomScene.extra_data = extra_data;
|
||||
// dashboard.startPending(skill_name);
|
||||
|
|
|
@ -296,6 +296,7 @@ function GetSkillData(skill_name)
|
|||
freq = freq,
|
||||
frequency = frequency,
|
||||
switchSkillName = skill.switchSkillName,
|
||||
isViewAsSkill = skill:isInstanceOf(ViewAsSkill),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -73,6 +73,11 @@ function Card:initialize(name, suit, number, color)
|
|||
self.suit = suit or Card.NoSuit
|
||||
self.number = number or 0
|
||||
|
||||
if string.sub(name, 1, 1) == "&" then
|
||||
self.name = string.sub(name, 2, #name)
|
||||
self.is_derived = true
|
||||
end
|
||||
|
||||
local name_splited = name:split("__")
|
||||
self.trueName = name_splited[#name_splited]
|
||||
|
||||
|
@ -96,11 +101,6 @@ function Card:initialize(name, suit, number, color)
|
|||
self._skillName = ""
|
||||
self.skillNames = {}
|
||||
self.mark = {}
|
||||
|
||||
if string.sub(name, 1, 1) == "&" then
|
||||
self.name = string.sub(name, 2, #name)
|
||||
self.is_derived = true
|
||||
end
|
||||
end
|
||||
|
||||
function Card:__index(k)
|
||||
|
|
|
@ -20,7 +20,7 @@ GameEvent.functions[GameEvent.Judge] = function(self)
|
|||
from = who.id,
|
||||
card = {data.card.id},
|
||||
}
|
||||
self:moveCardTo(data.card, Card.Processing, nil, fk.ReasonPut)
|
||||
self:moveCardTo(data.card, Card.Processing, nil, fk.ReasonJudge)
|
||||
|
||||
self.logic:trigger(fk.AskForRetrial, who, data)
|
||||
self.logic:trigger(fk.FinishRetrial, who, data)
|
||||
|
@ -46,7 +46,7 @@ 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.ReasonPutIntoDiscardPile)
|
||||
self:moveCardTo(data.card, Card.DiscardPile, nil, fk.ReasonJudge)
|
||||
end
|
||||
if not self.interrupted then return end
|
||||
|
||||
|
|
|
@ -2010,6 +2010,8 @@ function Room:doCardUseEffect(cardUseEvent)
|
|||
cardEffectEvent.additionalRecover = curAimEvent.additionalRecover
|
||||
|
||||
if curAimEvent.disresponsiveList then
|
||||
cardEffectEvent.disresponsiveList = cardEffectEvent.disresponsiveList or {}
|
||||
|
||||
for _, disresponsivePlayer in ipairs(curAimEvent.disresponsiveList) do
|
||||
if not table.contains(cardEffectEvent.disresponsiveList, disresponsivePlayer) then
|
||||
table.insert(cardEffectEvent.disresponsiveList, disresponsivePlayer)
|
||||
|
@ -2018,9 +2020,11 @@ function Room:doCardUseEffect(cardUseEvent)
|
|||
end
|
||||
|
||||
if curAimEvent.unoffsetableList then
|
||||
cardEffectEvent.unoffsetableList = cardEffectEvent.unoffsetableList or {}
|
||||
|
||||
for _, unoffsetablePlayer in ipairs(curAimEvent.unoffsetableList) do
|
||||
if not table.contains(cardEffectEvent.unoffsetablePlayer, unoffsetablePlayer) then
|
||||
table.insert(cardEffectEvent.unoffsetablePlayer, unoffsetablePlayer)
|
||||
if not table.contains(cardEffectEvent.unoffsetableList, unoffsetablePlayer) then
|
||||
table.insert(cardEffectEvent.unoffsetableList, unoffsetablePlayer)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -2114,6 +2118,7 @@ function Room:handleCardEffect(event, cardEffectEvent)
|
|||
if
|
||||
s.pattern and
|
||||
Exppattern:Parse("nullification"):matchExp(s.pattern) and
|
||||
not (s.enabledAtResponse and not s:enabledAtResponse(p)) and
|
||||
not (
|
||||
table.contains(cardEffectEvent.disresponsiveList or {}, p.id) or
|
||||
table.contains(cardEffectEvent.unoffsetableList or {}, p.id)
|
||||
|
|
|
@ -181,6 +181,7 @@ fk.ReasonPrey = 7
|
|||
fk.ReasonExchange = 8
|
||||
fk.ReasonUse = 9
|
||||
fk.ReasonResonpse = 10
|
||||
fk.ReasonJudge = 11
|
||||
|
||||
---@class PindianStruct
|
||||
---@field public from ServerPlayer
|
||||
|
|
|
@ -300,7 +300,7 @@ local supplyShortageSkill = fk.CreateActiveSkill{
|
|||
room:moveCards{
|
||||
ids = room:getSubcardsByRule(effect.card, { Card.Processing }),
|
||||
toArea = Card.DiscardPile,
|
||||
moveReason = fk.ReasonPutIntoDiscardPile
|
||||
moveReason = fk.ReasonUse
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -75,6 +75,14 @@ GameRule = fk.CreateTriggerSkill{
|
|||
prompt = "#AskForPeachesSelf:::" .. tostring(1 - dyingPlayer.hp)
|
||||
end
|
||||
|
||||
local cardNames = pattern:split(",")
|
||||
for _, cardName in ipairs(cardNames) do
|
||||
local cardCloned = Fk:cloneCard(cardName)
|
||||
if player:prohibitUse(cardCloned) or player:isProhibited(dyingPlayer, cardCloned) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local peach_use = room:askForUseCard(player, "peach", pattern, prompt)
|
||||
if not peach_use then break end
|
||||
peach_use.tos = { {dyingPlayer.id} }
|
||||
|
|
|
@ -652,7 +652,7 @@ local lightningSkill = fk.CreateActiveSkill{
|
|||
room:moveCards{
|
||||
ids = { effect.cardId },
|
||||
toArea = Card.DiscardPile,
|
||||
moveReason = fk.ReasonPutIntoDiscardPile
|
||||
moveReason = fk.ReasonUse
|
||||
}
|
||||
else
|
||||
self:onNullified(room, effect)
|
||||
|
@ -720,7 +720,7 @@ local indulgenceSkill = fk.CreateActiveSkill{
|
|||
room:moveCards{
|
||||
ids = room:getSubcardsByRule(effect.card, { Card.Processing }),
|
||||
toArea = Card.DiscardPile,
|
||||
moveReason = fk.ReasonPutIntoDiscardPile
|
||||
moveReason = fk.ReasonUse
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
@ -920,6 +920,7 @@ local bladeSkill = fk.CreateTriggerSkill{
|
|||
local use = room:askForUseCard(player, "slash", nil, "#blade_slash:" .. target.id,
|
||||
true, { must_targets = {target.id} })
|
||||
if use then
|
||||
use.extraUse = true
|
||||
self.cost_data = use
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user