mirror of
https://github.com/Qsgs-Fans/FreeKill.git
synced 2024-11-15 19:22:25 +08:00
card fix (#251)
1、补充默认自己为目标的卡牌的prohibit判定; 2、将有同名延迟锦囊时不能成为该锦囊的目标移动到prohibit判定里; 3、补充延迟锦囊牌及装备牌的mod_target_filter; 4、修正濒死求桃逻辑,必须所有牌名均不能使用才跳过询问
This commit is contained in:
parent
64127bffb6
commit
4284336825
|
@ -834,7 +834,8 @@ function Player:isProhibited(to, card)
|
|||
return true
|
||||
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
|
||||
end
|
||||
|
||||
|
|
|
@ -440,8 +440,11 @@ local defaultCardSkill = fk.CreateActiveSkill{
|
|||
|
||||
local defaultEquipSkill = fk.CreateActiveSkill{
|
||||
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)
|
||||
return #player:getAvailableEquipSlots(card.sub_type) > 0
|
||||
return self:modTargetFilter(player.id, {}, player.id, card, true) and not player:isProhibited(player, card)
|
||||
end,
|
||||
on_use = function(self, room, use)
|
||||
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then
|
||||
|
|
|
@ -250,15 +250,13 @@ extension:addCards{
|
|||
local supplyShortageSkill = fk.CreateActiveSkill{
|
||||
name = "supply_shortage_skill",
|
||||
distance_limit = 1,
|
||||
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||
local from = Fk:currentRoom():getPlayerById(user)
|
||||
return from ~= player and not (distance_limited and not self:withinDistanceLimit(from, false, card, player))
|
||||
end,
|
||||
target_filter = function(self, to_select, selected, _, card)
|
||||
if #selected == 0 then
|
||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||
if Self ~= player then
|
||||
return not player:hasDelayedTrick("supply_shortage") and
|
||||
self:withinDistanceLimit(Self, false, card, player)
|
||||
end
|
||||
end
|
||||
return false
|
||||
return #selected == 0 and self:modTargetFilter(to_select, selected, Self.id, card, true)
|
||||
end,
|
||||
target_num = 1,
|
||||
on_effect = function(self, room, effect)
|
||||
|
|
|
@ -40,22 +40,20 @@ GameRule = fk.CreateTriggerSkill{
|
|||
[fk.AskForPeaches] = function()
|
||||
local dyingPlayer = room:getPlayerById(data.who)
|
||||
while dyingPlayer.hp < 1 do
|
||||
local pattern = "peach"
|
||||
local cardNames = {"peach"}
|
||||
local prompt = "#AskForPeaches:" .. dyingPlayer.id .. "::" .. tostring(1 - dyingPlayer.hp)
|
||||
if player == dyingPlayer then
|
||||
pattern = pattern .. ",analeptic"
|
||||
table.insert(cardNames, "analeptic")
|
||||
prompt = "#AskForPeachesSelf:::" .. tostring(1 - dyingPlayer.hp)
|
||||
end
|
||||
|
||||
local cardNames = pattern:split(",")
|
||||
for _, cardName in ipairs(cardNames) do
|
||||
cardNames = table.filter(cardNames, function (cardName)
|
||||
local cardCloned = Fk:cloneCard(cardName)
|
||||
if player:prohibitUse(cardCloned) or player:isProhibited(dyingPlayer, cardCloned) then
|
||||
return
|
||||
end
|
||||
end
|
||||
return not (player:prohibitUse(cardCloned) or player:isProhibited(dyingPlayer, cardCloned))
|
||||
end)
|
||||
if #cardNames == 0 then return 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
|
||||
peach_use.tos = { {dyingPlayer.id} }
|
||||
if peach_use.card.trueName == "analeptic" then
|
||||
|
|
|
@ -129,8 +129,8 @@ local peachSkill = fk.CreateActiveSkill{
|
|||
return p.dying
|
||||
end)
|
||||
end,
|
||||
can_use = function(self, player)
|
||||
return player:isWounded()
|
||||
can_use = function(self, player, card)
|
||||
return player:isWounded() and not player:isProhibited(player, card)
|
||||
end,
|
||||
on_use = function(self, room, use)
|
||||
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)
|
||||
return true
|
||||
end,
|
||||
can_use = function(self, player, card)
|
||||
return not player:isProhibited(player, card)
|
||||
end,
|
||||
on_use = function(self, room, cardUseEvent)
|
||||
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
|
||||
cardUseEvent.tos = { { cardUseEvent.from } }
|
||||
|
@ -647,8 +650,11 @@ extension:addCards({
|
|||
|
||||
local lightningSkill = fk.CreateActiveSkill{
|
||||
name = "lightning_skill",
|
||||
can_use = function(self, player)
|
||||
return not (Self:hasDelayedTrick("lightning") or table.contains(player.sealedSlots, Player.JudgeSlot))
|
||||
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||
return true
|
||||
end,
|
||||
can_use = function(self, player, card)
|
||||
return not player:isProhibited(player, card)
|
||||
end,
|
||||
on_use = function(self, room, use)
|
||||
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then
|
||||
|
@ -717,14 +723,11 @@ extension:addCards({
|
|||
|
||||
local indulgenceSkill = fk.CreateActiveSkill{
|
||||
name = "indulgence_skill",
|
||||
target_filter = function(self, to_select, selected)
|
||||
if #selected == 0 then
|
||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||
if Self ~= player then
|
||||
return not player:hasDelayedTrick("indulgence")
|
||||
end
|
||||
end
|
||||
return false
|
||||
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||
return user ~= to_select
|
||||
end,
|
||||
target_filter = function(self, to_select, selected, _, card)
|
||||
return #selected == 0 and self:modTargetFilter(to_select, selected, Self.id, card, true)
|
||||
end,
|
||||
target_num = 1,
|
||||
on_effect = function(self, room, effect)
|
||||
|
|
Loading…
Reference in New Issue
Block a user