1、补充默认自己为目标的卡牌的prohibit判定;
2、将有同名延迟锦囊时不能成为该锦囊的目标移动到prohibit判定里;
3、补充延迟锦囊牌及装备牌的mod_target_filter;
4、修正濒死求桃逻辑,必须所有牌名均不能使用才跳过询问
This commit is contained in:
xxyheaven 2023-08-13 12:34:36 +08:00 committed by GitHub
parent 64127bffb6
commit 4284336825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 31 deletions

View File

@ -834,7 +834,8 @@ function Player:isProhibited(to, card)
return true return true
end end
if card.sub_type == Card.SubtypeDelayedTrick and table.contains(to.sealedSlots, Player.JudgeSlot) then if card.sub_type == Card.SubtypeDelayedTrick and
(table.contains(to.sealedSlots, Player.JudgeSlot) or to:hasDelayedTrick(card.name)) then
return true return true
end end

View File

@ -440,8 +440,11 @@ local defaultCardSkill = fk.CreateActiveSkill{
local defaultEquipSkill = fk.CreateActiveSkill{ local defaultEquipSkill = fk.CreateActiveSkill{
name = "default_equip_skill", name = "default_equip_skill",
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
return #Fk:currentRoom():getPlayerById(to_select):getAvailableEquipSlots(card.sub_type) > 0
end,
can_use = function(self, player, card) can_use = function(self, player, card)
return #player:getAvailableEquipSlots(card.sub_type) > 0 return self:modTargetFilter(player.id, {}, player.id, card, true) and not player:isProhibited(player, card)
end, end,
on_use = function(self, room, use) on_use = function(self, room, use)
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then

View File

@ -250,15 +250,13 @@ extension:addCards{
local supplyShortageSkill = fk.CreateActiveSkill{ local supplyShortageSkill = fk.CreateActiveSkill{
name = "supply_shortage_skill", name = "supply_shortage_skill",
distance_limit = 1, distance_limit = 1,
target_filter = function(self, to_select, selected, _, card) mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
if #selected == 0 then
local player = Fk:currentRoom():getPlayerById(to_select) local player = Fk:currentRoom():getPlayerById(to_select)
if Self ~= player then local from = Fk:currentRoom():getPlayerById(user)
return not player:hasDelayedTrick("supply_shortage") and return from ~= player and not (distance_limited and not self:withinDistanceLimit(from, false, card, player))
self:withinDistanceLimit(Self, false, card, player) end,
end target_filter = function(self, to_select, selected, _, card)
end return #selected == 0 and self:modTargetFilter(to_select, selected, Self.id, card, true)
return false
end, end,
target_num = 1, target_num = 1,
on_effect = function(self, room, effect) on_effect = function(self, room, effect)

View File

@ -40,22 +40,20 @@ GameRule = fk.CreateTriggerSkill{
[fk.AskForPeaches] = function() [fk.AskForPeaches] = function()
local dyingPlayer = room:getPlayerById(data.who) local dyingPlayer = room:getPlayerById(data.who)
while dyingPlayer.hp < 1 do while dyingPlayer.hp < 1 do
local pattern = "peach" local cardNames = {"peach"}
local prompt = "#AskForPeaches:" .. dyingPlayer.id .. "::" .. tostring(1 - dyingPlayer.hp) local prompt = "#AskForPeaches:" .. dyingPlayer.id .. "::" .. tostring(1 - dyingPlayer.hp)
if player == dyingPlayer then if player == dyingPlayer then
pattern = pattern .. ",analeptic" table.insert(cardNames, "analeptic")
prompt = "#AskForPeachesSelf:::" .. tostring(1 - dyingPlayer.hp) prompt = "#AskForPeachesSelf:::" .. tostring(1 - dyingPlayer.hp)
end end
local cardNames = pattern:split(",") cardNames = table.filter(cardNames, function (cardName)
for _, cardName in ipairs(cardNames) do
local cardCloned = Fk:cloneCard(cardName) local cardCloned = Fk:cloneCard(cardName)
if player:prohibitUse(cardCloned) or player:isProhibited(dyingPlayer, cardCloned) then return not (player:prohibitUse(cardCloned) or player:isProhibited(dyingPlayer, cardCloned))
return end)
end if #cardNames == 0 then return end
end
local peach_use = room:askForUseCard(player, "peach", pattern, prompt) local peach_use = room:askForUseCard(player, "peach", table.concat(cardNames, ",") , prompt)
if not peach_use then break end if not peach_use then break end
peach_use.tos = { {dyingPlayer.id} } peach_use.tos = { {dyingPlayer.id} }
if peach_use.card.trueName == "analeptic" then if peach_use.card.trueName == "analeptic" then

View File

@ -129,8 +129,8 @@ local peachSkill = fk.CreateActiveSkill{
return p.dying return p.dying
end) end)
end, end,
can_use = function(self, player) can_use = function(self, player, card)
return player:isWounded() return player:isWounded() and not player:isProhibited(player, card)
end, end,
on_use = function(self, room, use) on_use = function(self, room, use)
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then
@ -383,6 +383,9 @@ local exNihiloSkill = fk.CreateActiveSkill{
mod_target_filter = function(self, to_select, selected, user, card, distance_limited) mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
return true return true
end, end,
can_use = function(self, player, card)
return not player:isProhibited(player, card)
end,
on_use = function(self, room, cardUseEvent) on_use = function(self, room, cardUseEvent)
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
cardUseEvent.tos = { { cardUseEvent.from } } cardUseEvent.tos = { { cardUseEvent.from } }
@ -647,8 +650,11 @@ extension:addCards({
local lightningSkill = fk.CreateActiveSkill{ local lightningSkill = fk.CreateActiveSkill{
name = "lightning_skill", name = "lightning_skill",
can_use = function(self, player) mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
return not (Self:hasDelayedTrick("lightning") or table.contains(player.sealedSlots, Player.JudgeSlot)) return true
end,
can_use = function(self, player, card)
return not player:isProhibited(player, card)
end, end,
on_use = function(self, room, use) on_use = function(self, room, use)
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then
@ -717,14 +723,11 @@ extension:addCards({
local indulgenceSkill = fk.CreateActiveSkill{ local indulgenceSkill = fk.CreateActiveSkill{
name = "indulgence_skill", name = "indulgence_skill",
target_filter = function(self, to_select, selected) mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
if #selected == 0 then return user ~= to_select
local player = Fk:currentRoom():getPlayerById(to_select) end,
if Self ~= player then target_filter = function(self, to_select, selected, _, card)
return not player:hasDelayedTrick("indulgence") return #selected == 0 and self:modTargetFilter(to_select, selected, Self.id, card, true)
end
end
return false
end, end,
target_num = 1, target_num = 1,
on_effect = function(self, room, effect) on_effect = function(self, room, effect)