【杀】的residue_func无效bug
【顺手牵羊】的distance_limit_func无效bug
重铸的moveReason调整为置入弃牌堆

---------

Signed-off-by: Mechanel <nyutanislavsky@qq.com>
This commit is contained in:
Nyutanislavsky 2023-04-18 12:57:09 +08:00 committed by GitHub
parent 9876dd15c7
commit ba8aae852d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 11 deletions

View File

@ -210,6 +210,8 @@ Fk:loadTranslationTable{
["$UninstallEquip"] = "%from 卸载了 %card",
["#ShowCard"] = "%from 展示了牌 %card",
["#Recast"] = "%from 重铸了 %card",
["#RecastBySkill"] = "%from 发动了 “%arg” 重铸了 %card",
-- phase
["#PhaseSkipped"] = "%from 跳过了 %arg",

View File

@ -26,7 +26,8 @@ end
--- Determine whether the skill can be used in playing phase
---@param player Player
function ActiveSkill:canUse(player)
---@param card Card @ helper
function ActiveSkill:canUse(player, card)
return true
end

View File

@ -5,18 +5,22 @@ local TargetModSkill = StatusSkill:subclass("TargetModSkill")
---@param player Player
---@param card_skill ActiveSkill
---@param scope integer
---@param card Card
function TargetModSkill:getResidueNum(player, card_skill, scope, card)
return 0
end
---@param player Player
---@param card_skill ActiveSkill
---@param card Card
function TargetModSkill:getDistanceLimit(player, card_skill, card)
return 0
end
---@param player Player
---@param card_skill ActiveSkill
---@param card Card
function TargetModSkill:getExtraTargetNum(player, card_skill, card)
return 0
end

View File

@ -145,9 +145,9 @@ function fk.CreateTriggerSkill(spec)
end
---@class ActiveSkillSpec: UsableSkillSpec
---@field public can_use fun(self: ActiveSkill, player: Player): boolean
---@field public can_use fun(self: ActiveSkill, player: Player, card: Card): boolean
---@field public card_filter fun(self: ActiveSkill, to_select: integer, selected: integer[], selected_targets: integer[]): boolean
---@field public target_filter fun(self: ActiveSkill, to_select: integer, selected: integer[], selected_cards: integer[]): boolean
---@field public target_filter fun(self: ActiveSkill, to_select: integer, selected: integer[], selected_cards: integer[], card: Card): boolean
---@field public feasible fun(self: ActiveSkill, selected: integer[], selected_cards: integer[]): boolean
---@field public on_use fun(self: ActiveSkill, room: Room, cardUseEvent: CardUseStruct): boolean
---@field public about_to_effect fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean
@ -286,9 +286,9 @@ function fk.CreateMaxCardsSkill(spec)
end
---@class TargetModSpec: StatusSkillSpec
---@field public residue_func fun(self: TargetModSkill, player: Player, skill: ActiveSkill, scope: integer)
---@field public distance_limit_func fun(self: TargetModSkill, player: Player, skill: ActiveSkill)
---@field public extra_target_func fun(self: TargetModSkill, player: Player, skill: ActiveSkill)
---@field public residue_func fun(self: TargetModSkill, player: Player, skill: ActiveSkill, scope: integer, card: Card)
---@field public distance_limit_func fun(self: TargetModSkill, player: Player, skill: ActiveSkill, card: Card)
---@field public extra_target_func fun(self: TargetModSkill, player: Player, skill: ActiveSkill, card: Card)
---@param spec TargetModSpec
---@return TargetModSkill

View File

@ -198,7 +198,18 @@ local recast = fk.CreateActiveSkill{
target_num = 0,
on_use = function(self, room, effect)
local from = room:getPlayerById(effect.from)
room:throwCard(effect.cards, self.name, from)
room:moveCards({
ids = effect.cards,
from = effect.from,
toArea = Card.DiscardPile,
skillName = "recast",
moveReason = fk.ReasonPutIntoDiscardPile,
})
room:sendLog{
type = "#Recast",
from = effect.from,
card = effect.cards,
}
room:drawCards(from, #effect.cards, self.name)
end
}

View File

@ -7,8 +7,8 @@ local slashSkill = fk.CreateActiveSkill{
name = "slash_skill",
max_phase_use_time = 1,
target_num = 1,
can_use = function(self, player)
return player:usedCardTimes("slash", Player.HistoryPhase) < self:getMaxUseTime(Self, Player.HistoryPhase)
can_use = function(self, player, card)
return player:usedCardTimes("slash", Player.HistoryPhase) < self:getMaxUseTime(Self, Player.HistoryPhase, card)
end,
target_filter = function(self, to_select, selected, _, card)
if #selected < self:getMaxTargetNum(Self, card) then
@ -199,10 +199,10 @@ extension:addCards({
local snatchSkill = fk.CreateActiveSkill{
name = "snatch_skill",
distance_limit = 1,
target_filter = function(self, to_select, selected)
target_filter = function(self, to_select, selected, _, card)
if #selected == 0 then
local player = Fk:currentRoom():getPlayerById(to_select)
return Self ~= player and Self:distanceTo(player) <= self:getDistanceLimit(Self)
return Self ~= player and Self:distanceTo(player) <= self:getDistanceLimit(Self, card) -- for no distance limit for snatch
and not player:isAllNude()
end
end,