bugfix (#229)
- 为需要无视描述的请求添加-tmp标签(……) - 修改铁索相关描述 - 修复了可以通过取消目标以跳过exclusive_targets的bug - 修复了观星只控顶时还有底部标签的bug - 修复了没有correct_func时的报错 - 修复了一个人且未分胜负时无限循环的bug - 将AOE的函数调到了Util内方便其他DIY快速调用 - 将AskForAddTarget转正 - 主动技添加modTargetFilter,负责重新定义目标(借刀摆烂了) - 游戏模式添加countInFunc(room),负责检测本局游戏是否可以纳入胜率统计(默认true) --------- Co-authored-by: Nyutanislavsky <nyutanislavsky@qq.com>
This commit is contained in:
parent
21fee5537a
commit
7fd39264ee
|
@ -551,6 +551,12 @@ function updateSelectedTargets(playerid, selected) {
|
||||||
[card, id, selected_targets]
|
[card, id, selected_targets]
|
||||||
));
|
));
|
||||||
photo.selectable = ret;
|
photo.selectable = ret;
|
||||||
|
if (roomScene.extra_data instanceof Object) {
|
||||||
|
const exclusived = roomScene.extra_data.exclusive_targets;
|
||||||
|
if (exclusived instanceof Array) {
|
||||||
|
if (exclusived.indexOf(id) === -1) photo.selectable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
okButton.enabled = JSON.parse(Backend.callLuaFunction(
|
okButton.enabled = JSON.parse(Backend.callLuaFunction(
|
||||||
|
@ -834,11 +840,17 @@ callbacks["AskForGuanxing"] = (jsonData) => {
|
||||||
box.areaCapacities = [max_bottom_cards];
|
box.areaCapacities = [max_bottom_cards];
|
||||||
box.areaLimits = [min_bottom_cards];
|
box.areaLimits = [min_bottom_cards];
|
||||||
box.areaNames = [Backend.translate(bottom_area_name)];
|
box.areaNames = [Backend.translate(bottom_area_name)];
|
||||||
|
} else {
|
||||||
|
if (max_bottom_cards === 0) {
|
||||||
|
box.areaCapacities = [max_top_cards];
|
||||||
|
box.areaLimits = [min_top_cards];
|
||||||
|
box.areaNames = [Backend.translate(top_area_name)];
|
||||||
} else {
|
} else {
|
||||||
box.areaCapacities = [max_top_cards, max_bottom_cards];
|
box.areaCapacities = [max_top_cards, max_bottom_cards];
|
||||||
box.areaLimits = [min_top_cards, min_bottom_cards];
|
box.areaLimits = [min_top_cards, min_bottom_cards];
|
||||||
box.areaNames = [Backend.translate(top_area_name), Backend.translate(bottom_area_name)];
|
box.areaNames = [Backend.translate(top_area_name), Backend.translate(bottom_area_name)];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
box.cards = cards;
|
box.cards = cards;
|
||||||
box.arrangeCards();
|
box.arrangeCards();
|
||||||
box.accepted.connect(() => {
|
box.accepted.connect(() => {
|
||||||
|
@ -906,7 +918,7 @@ callbacks["AskForChoice"] = (jsonData) => {
|
||||||
box.skill_name = skill_name;
|
box.skill_name = skill_name;
|
||||||
box.all_options = all_choices;
|
box.all_options = all_choices;
|
||||||
box.accepted.connect(() => {
|
box.accepted.connect(() => {
|
||||||
replyToServer(choices[box.result]);
|
replyToServer(all_choices[box.result]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ MetroButton {
|
||||||
box.options = choices;
|
box.options = choices;
|
||||||
box.all_options = all_choices;
|
box.all_options = all_choices;
|
||||||
box.accepted.connect(() => {
|
box.accepted.connect(() => {
|
||||||
answer = choices[box.result];
|
answer = all_choices[box.result];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,8 +276,8 @@ Fk:loadTranslationTable{
|
||||||
["phase_finish"] = "结束阶段",
|
["phase_finish"] = "结束阶段",
|
||||||
|
|
||||||
["chained"] = "横置",
|
["chained"] = "横置",
|
||||||
["un-chained"] = "竖置",
|
["un-chained"] = "重置",
|
||||||
["reset-general"] = "重置",
|
["reset-general"] = "复原",
|
||||||
|
|
||||||
["yang"] = "阳",
|
["yang"] = "阳",
|
||||||
["yin"] = "阴",
|
["yin"] = "阴",
|
||||||
|
@ -391,7 +391,6 @@ Fk:loadTranslationTable{
|
||||||
["#GuanxingResult"] = "%from 的观星结果为 %arg 上 %arg2 下",
|
["#GuanxingResult"] = "%from 的观星结果为 %arg 上 %arg2 下",
|
||||||
["#ChainStateChange"] = "%from %arg 了武将牌",
|
["#ChainStateChange"] = "%from %arg 了武将牌",
|
||||||
["#ChainDamage"] = "%from 处于连环状态,将受到传导的伤害",
|
["#ChainDamage"] = "%from 处于连环状态,将受到传导的伤害",
|
||||||
["#ResetGeneral"] = "%from 复原了武将牌",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- card footnote
|
-- card footnote
|
||||||
|
|
|
@ -61,4 +61,10 @@ function GameMode:surrenderFunc(playedTime)
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param room Room @ 游戏房间
|
||||||
|
---@return boolean
|
||||||
|
function GameMode:countInFunc(room)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
return GameMode
|
return GameMode
|
||||||
|
|
|
@ -50,6 +50,17 @@ function ActiveSkill:targetFilter(to_select, selected, selected_cards, card)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Determine whether a target can be selected by this skill(in modifying targets)
|
||||||
|
--- only used in skill of players
|
||||||
|
---@param to_select integer @ id of the target
|
||||||
|
---@param selected integer[] @ ids of selected targets
|
||||||
|
---@param user integer @ id of the userdata
|
||||||
|
---@param card Card @ helper
|
||||||
|
---@param distance_limited boolean @ is limited by distance
|
||||||
|
function ActiveSkill:modTargetFilter(to_select, selected, user, card, distance_limited)
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
function ActiveSkill:getMinTargetNum()
|
function ActiveSkill:getMinTargetNum()
|
||||||
local ret
|
local ret
|
||||||
if self.target_num then ret = self.target_num
|
if self.target_num then ret = self.target_num
|
||||||
|
|
|
@ -35,13 +35,15 @@ function UsableSkill:withinTimesLimit(player, scope, card, card_name, to)
|
||||||
if skill:bypassTimesCheck(player, self, scope, card, to) then return true end
|
if skill:bypassTimesCheck(player, self, scope, card, to) then return true end
|
||||||
end
|
end
|
||||||
card_name = card_name or card.trueName
|
card_name = card_name or card.trueName
|
||||||
|
local temp_suf = table.simpleClone(MarkEnum.TempMarkSuffix)
|
||||||
|
table.insert(temp_suf, "-tmp")
|
||||||
return player:usedCardTimes(card_name, scope) < self:getMaxUseTime(player, scope, card, to) or
|
return player:usedCardTimes(card_name, scope) < self:getMaxUseTime(player, scope, card, to) or
|
||||||
(player:getMark(MarkEnum.BypassTimesLimit) ~= 0 or
|
(player:getMark(MarkEnum.BypassTimesLimit) ~= 0 or
|
||||||
table.find(MarkEnum.TempMarkSuffix, function(s)
|
table.find(temp_suf, function(s)
|
||||||
return player:getMark(MarkEnum.BypassTimesLimit .. s) ~= 0
|
return player:getMark(MarkEnum.BypassTimesLimit .. s) ~= 0
|
||||||
end)) or
|
end)) or
|
||||||
(to:getMark(MarkEnum.BypassTimesLimitTo) ~= 0 or
|
(to:getMark(MarkEnum.BypassTimesLimitTo) ~= 0 or
|
||||||
table.find(MarkEnum.TempMarkSuffix, function(s)
|
table.find(temp_suf, function(s)
|
||||||
return to:getMark(MarkEnum.BypassTimesLimitTo .. s) ~= 0
|
return to:getMark(MarkEnum.BypassTimesLimitTo .. s) ~= 0
|
||||||
end))
|
end))
|
||||||
end
|
end
|
||||||
|
@ -55,13 +57,15 @@ function UsableSkill:withinDistanceLimit(player, isattack, card, to)
|
||||||
for _, skill in ipairs(status_skills) do
|
for _, skill in ipairs(status_skills) do
|
||||||
if skill:bypassDistancesCheck(player, self, card, to) then return true end
|
if skill:bypassDistancesCheck(player, self, card, to) then return true end
|
||||||
end
|
end
|
||||||
|
local temp_suf = table.simpleClone(MarkEnum.TempMarkSuffix)
|
||||||
|
table.insert(temp_suf, "-tmp")
|
||||||
return isattack and player:inMyAttackRange(to, self:getDistanceLimit(player, card, to)) or player:distanceTo(to) <= self:getDistanceLimit(player, card, to) or
|
return isattack and player:inMyAttackRange(to, self:getDistanceLimit(player, card, to)) or player:distanceTo(to) <= self:getDistanceLimit(player, card, to) or
|
||||||
(player:getMark(MarkEnum.BypassDistancesLimit) ~= 0 or
|
(player:getMark(MarkEnum.BypassDistancesLimit) ~= 0 or
|
||||||
table.find(MarkEnum.TempMarkSuffix, function(s)
|
table.find(temp_suf, function(s)
|
||||||
return player:getMark(MarkEnum.BypassDistancesLimit .. s) ~= 0
|
return player:getMark(MarkEnum.BypassDistancesLimit .. s) ~= 0
|
||||||
end)) or
|
end)) or
|
||||||
(to:getMark(MarkEnum.BypassDistancesLimitTo) ~= 0 or
|
(to:getMark(MarkEnum.BypassDistancesLimitTo) ~= 0 or
|
||||||
table.find(MarkEnum.TempMarkSuffix, function(s)
|
table.find(temp_suf, function(s)
|
||||||
return to:getMark(MarkEnum.BypassDistancesLimitTo .. s) ~= 0
|
return to:getMark(MarkEnum.BypassDistancesLimitTo .. s) ~= 0
|
||||||
end))
|
end))
|
||||||
end
|
end
|
||||||
|
|
|
@ -103,6 +103,47 @@ Util.NameMapper = function(e) return e.name end
|
||||||
Util.Name2GeneralMapper = function(e) return Fk.generals[e] end
|
Util.Name2GeneralMapper = function(e) return Fk.generals[e] end
|
||||||
Util.Name2SkillMapper = function(e) return Fk.skills[e] end
|
Util.Name2SkillMapper = function(e) return Fk.skills[e] end
|
||||||
|
|
||||||
|
-- for card preset
|
||||||
|
Util.GlobalCanUse = function(self, player, card)
|
||||||
|
local room = Fk:currentRoom()
|
||||||
|
for _, p in ipairs(room.alive_players) do
|
||||||
|
if not (card and player:isProhibited(p, card)) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Util.AoeCanUse = function(self, player, card)
|
||||||
|
local room = Fk:currentRoom()
|
||||||
|
for _, p in ipairs(room.alive_players) do
|
||||||
|
if p ~= player and not (card and player:isProhibited(p, card)) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Util.GlobalOnUse = function(self, room, cardUseEvent)
|
||||||
|
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
|
||||||
|
cardUseEvent.tos = {}
|
||||||
|
for _, player in ipairs(room:getAlivePlayers()) do
|
||||||
|
if not room:getPlayerById(cardUseEvent.from):isProhibited(player, cardUseEvent.card) then
|
||||||
|
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Util.AoeOnUse = function(self, room, cardUseEvent)
|
||||||
|
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
|
||||||
|
cardUseEvent.tos = {}
|
||||||
|
for _, player in ipairs(room:getOtherPlayers(room:getPlayerById(cardUseEvent.from))) do
|
||||||
|
if not room:getPlayerById(cardUseEvent.from):isProhibited(player, cardUseEvent.card) then
|
||||||
|
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@generic T
|
---@generic T
|
||||||
---@param self T[]
|
---@param self T[]
|
||||||
---@return T[]
|
---@return T[]
|
||||||
|
|
|
@ -170,6 +170,7 @@ end
|
||||||
---@field public about_to_effect fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean|nil
|
---@field public about_to_effect fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean|nil
|
||||||
---@field public on_effect fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean|nil
|
---@field public on_effect fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean|nil
|
||||||
---@field public on_nullified fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean|nil
|
---@field public on_nullified fun(self: ActiveSkill, room: Room, cardEffectEvent: CardEffectEvent): boolean|nil
|
||||||
|
---@field public mod_target_filter fun(self: ActiveSkill, to_select: integer, selected: integer[], user: integer, card: Card, distance_limited: boolean): boolean|nil
|
||||||
---@field public prompt fun(self: ActiveSkill, selected: integer[], selected_cards: integer[]): string
|
---@field public prompt fun(self: ActiveSkill, selected: integer[], selected_cards: integer[]): string
|
||||||
|
|
||||||
---@param spec ActiveSkillSpec
|
---@param spec ActiveSkillSpec
|
||||||
|
@ -186,6 +187,7 @@ function fk.CreateActiveSkill(spec)
|
||||||
end
|
end
|
||||||
if spec.card_filter then skill.cardFilter = spec.card_filter end
|
if spec.card_filter then skill.cardFilter = spec.card_filter end
|
||||||
if spec.target_filter then skill.targetFilter = spec.target_filter end
|
if spec.target_filter then skill.targetFilter = spec.target_filter end
|
||||||
|
if spec.mod_target_filter then skill.modTargetFilter = spec.mod_target_filter end
|
||||||
if spec.feasible then
|
if spec.feasible then
|
||||||
print(spec.name .. ": feasible is deprecated. Use target_num and card_num instead.")
|
print(spec.name .. ": feasible is deprecated. Use target_num and card_num instead.")
|
||||||
skill.feasible = spec.feasible
|
skill.feasible = spec.feasible
|
||||||
|
@ -274,7 +276,7 @@ end
|
||||||
---@return DistanceSkill
|
---@return DistanceSkill
|
||||||
function fk.CreateDistanceSkill(spec)
|
function fk.CreateDistanceSkill(spec)
|
||||||
assert(type(spec.name) == "string")
|
assert(type(spec.name) == "string")
|
||||||
assert(type(spec.correct_func) == "function")
|
assert(type(spec.correct_func) == "function" or type(spec.fixed_func) == "function")
|
||||||
|
|
||||||
local skill = DistanceSkill:new(spec.name)
|
local skill = DistanceSkill:new(spec.name)
|
||||||
readStatusSpecToSkill(skill, spec)
|
readStatusSpecToSkill(skill, spec)
|
||||||
|
@ -556,5 +558,9 @@ function fk.CreateGameMode(spec)
|
||||||
assert(type(spec.surrender_func) == "function")
|
assert(type(spec.surrender_func) == "function")
|
||||||
ret.surrenderFunc = spec.surrender_func
|
ret.surrenderFunc = spec.surrender_func
|
||||||
end
|
end
|
||||||
|
if spec.is_counted then
|
||||||
|
assert(type(spec.is_counted) == "function")
|
||||||
|
ret.countInFunc = spec.is_counted
|
||||||
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
|
@ -155,7 +155,7 @@ GameEvent.functions[GameEvent.Round] = function(self)
|
||||||
GameEvent(GameEvent.Turn):exec()
|
GameEvent(GameEvent.Turn):exec()
|
||||||
if room.game_finished then break end
|
if room.game_finished then break end
|
||||||
room.current = room.current:getNextAlive()
|
room.current = room.current:getNextAlive()
|
||||||
until p.seat > p:getNextAlive().seat
|
until p.seat >= p:getNextAlive().seat
|
||||||
|
|
||||||
logic:trigger(fk.RoundEnd, p)
|
logic:trigger(fk.RoundEnd, p)
|
||||||
end
|
end
|
||||||
|
|
|
@ -105,23 +105,7 @@ function GameLogic:chooseGenerals()
|
||||||
end
|
end
|
||||||
|
|
||||||
room:setPlayerGeneral(lord, lord_general, true)
|
room:setPlayerGeneral(lord, lord_general, true)
|
||||||
if lord.kingdom == "god" or Fk.generals[lord_general].subkingdom then
|
room:askForChooseKingdom({lord})
|
||||||
local allKingdoms = {}
|
|
||||||
if lord.kingdom == "god" then
|
|
||||||
allKingdoms = table.simpleClone(Fk.kingdoms)
|
|
||||||
|
|
||||||
local exceptedKingdoms = { "god" }
|
|
||||||
for _, kingdom in ipairs(exceptedKingdoms) do
|
|
||||||
table.removeOne(allKingdoms, kingdom)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
local curGeneral = Fk.generals[lord_general]
|
|
||||||
allKingdoms = { curGeneral.kingdom, curGeneral.subkingdom }
|
|
||||||
end
|
|
||||||
|
|
||||||
lord.kingdom = room:askForChoice(lord, allKingdoms, "AskForKingdom", "#ChooseInitialKingdom")
|
|
||||||
room:broadcastProperty(lord, "kingdom")
|
|
||||||
end
|
|
||||||
room:broadcastProperty(lord, "general")
|
room:broadcastProperty(lord, "general")
|
||||||
room:setDeputyGeneral(lord, deputy)
|
room:setDeputyGeneral(lord, deputy)
|
||||||
room:broadcastProperty(lord, "deputyGeneral")
|
room:broadcastProperty(lord, "deputyGeneral")
|
||||||
|
|
|
@ -19,18 +19,18 @@ MarkEnum.MinusMaxCards = "MinusMaxCards"
|
||||||
--于本回合内减少标记值数量的手牌上限
|
--于本回合内减少标记值数量的手牌上限
|
||||||
MarkEnum.MinusMaxCardsInTurn = "MinusMaxCards-turn"
|
MarkEnum.MinusMaxCardsInTurn = "MinusMaxCards-turn"
|
||||||
|
|
||||||
--使用牌无次数限制,可带清除标记后缀
|
---使用牌无次数限制,可带清除标记后缀(-tmp为请求专用)
|
||||||
MarkEnum.BypassTimesLimit = "BypassTimesLimit"
|
MarkEnum.BypassTimesLimit = "BypassTimesLimit"
|
||||||
--使用牌无距离限制,可带清除标记后缀
|
---使用牌无距离限制,可带清除标记后缀(-tmp为请求专用)
|
||||||
MarkEnum.BypassDistancesLimit = "BypassDistancesLimit"
|
MarkEnum.BypassDistancesLimit = "BypassDistancesLimit"
|
||||||
--对其使用牌无次数限制,可带清除标记后缀
|
---对其使用牌无次数限制,可带清除标记后缀
|
||||||
MarkEnum.BypassTimesLimitTo = "BypassTimesLimitTo"
|
MarkEnum.BypassTimesLimitTo = "BypassTimesLimitTo"
|
||||||
--对其使用牌无距离限制,可带清除标记后缀
|
---对其使用牌无距离限制,可带清除标记后缀
|
||||||
MarkEnum.BypassDistancesLimitTo = "BypassDistancesLimitTo"
|
MarkEnum.BypassDistancesLimitTo = "BypassDistancesLimitTo"
|
||||||
--非锁定技失效,可带清除标记后缀
|
---非锁定技失效,可带清除标记后缀
|
||||||
MarkEnum.UncompulsoryInvalidity = "UncompulsoryInvalidity"
|
MarkEnum.UncompulsoryInvalidity = "UncompulsoryInvalidity"
|
||||||
|
|
||||||
--各种清除标记后缀
|
---各种清除标记后缀
|
||||||
MarkEnum.TempMarkSuffix = { "-phase", "-turn", "-round" }
|
MarkEnum.TempMarkSuffix = { "-phase", "-turn", "-round" }
|
||||||
|
|
||||||
---卡牌标记版本的清除标记后缀
|
---卡牌标记版本的清除标记后缀
|
||||||
|
|
|
@ -1453,6 +1453,60 @@ function Room:askForSkillInvoke(player, skill_name, data, prompt)
|
||||||
return invoked
|
return invoked
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--枚举法为使用牌重选目标(无距离限制)
|
||||||
|
---@param player ServerPlayer @ 执行的玩家
|
||||||
|
---@param targets ServerPlayer[] @ 可选的目标范围
|
||||||
|
---@param num integer @ 可选的目标数
|
||||||
|
---@param can_minus boolean @ 是否可减少
|
||||||
|
---@param distance_limited boolean @ 是否受距离限制
|
||||||
|
---@param prompt string @ 提示信息
|
||||||
|
---@param skillName string @ 技能名
|
||||||
|
---@param data CardUseStruct @ 使用数据
|
||||||
|
function Room:askForAddTarget(player, targets, num, can_minus, distance_limited, prompt, skillName, data)
|
||||||
|
num = num or 1
|
||||||
|
can_minus = can_minus or false
|
||||||
|
prompt = prompt or ""
|
||||||
|
skillName = skillName or ""
|
||||||
|
local room = player.room
|
||||||
|
local tos = {}
|
||||||
|
local orig_tos = table.simpleClone(AimGroup:getAllTargets(data.tos))
|
||||||
|
if can_minus and #orig_tos > 1 then --默认不允许减目标至0
|
||||||
|
tos = table.map(table.filter(targets, function(p)
|
||||||
|
return table.contains(AimGroup:getAllTargets(data.tos), p.id) end), Util.IdMapper)
|
||||||
|
end
|
||||||
|
for _, p in ipairs(targets) do
|
||||||
|
if not table.contains(AimGroup:getAllTargets(data.tos), p.id) and not room:getPlayerById(data.from):isProhibited(p, data.card) then
|
||||||
|
if data.card.skill:modTargetFilter(p.id, orig_tos, player.id, data.card, distance_limited) then
|
||||||
|
table.insertIfNeed(tos, p.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #tos > 0 then
|
||||||
|
tos = room:askForChoosePlayers(player, tos, 1, num, prompt, skillName, true)
|
||||||
|
--借刀……!
|
||||||
|
if data.card.name ~= "collateral" then
|
||||||
|
return tos
|
||||||
|
else
|
||||||
|
local result = {}
|
||||||
|
for _, id in ipairs(tos) do
|
||||||
|
local to = room:getPlayerById(id)
|
||||||
|
local target = room:askForChoosePlayers(player, table.map(table.filter(room:getOtherPlayers(player), function(v)
|
||||||
|
return to:inMyAttackRange(v) end), function(p) return p.id end), 1, 1,
|
||||||
|
"#collateral-choose::"..to.id..":"..data.card:toLogString(), "collateral_skill", true)
|
||||||
|
if #target > 0 then
|
||||||
|
table.insert(result, {id, target[1]})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if #result > 0 then
|
||||||
|
return result
|
||||||
|
else
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
-- TODO: guanxing type
|
-- TODO: guanxing type
|
||||||
--- 询问玩家对若干牌进行观星。
|
--- 询问玩家对若干牌进行观星。
|
||||||
---
|
---
|
||||||
|
@ -1462,7 +1516,7 @@ end
|
||||||
---@param top_limit integer[]|nil @ 置于牌堆顶的牌的限制(下限,上限),不填写则不限
|
---@param top_limit integer[]|nil @ 置于牌堆顶的牌的限制(下限,上限),不填写则不限
|
||||||
---@param bottom_limit integer[]|nil @ 置于牌堆底的牌的限制(下限,上限),不填写则不限
|
---@param bottom_limit integer[]|nil @ 置于牌堆底的牌的限制(下限,上限),不填写则不限
|
||||||
---@param customNotify string|null @ 自定义读条操作提示
|
---@param customNotify string|null @ 自定义读条操作提示
|
||||||
--@param prompt string|null @ 观星框的标题(暂时雪藏)
|
---param prompt string|null @ 观星框的标题(暂时雪藏)
|
||||||
---@param noPut boolean|null @ 是否进行放置牌操作
|
---@param noPut boolean|null @ 是否进行放置牌操作
|
||||||
---@param areaNames string[]|null @ 左侧提示信息
|
---@param areaNames string[]|null @ 左侧提示信息
|
||||||
---@return table<"top"|"bottom", integer[]>
|
---@return table<"top"|"bottom", integer[]>
|
||||||
|
@ -1666,10 +1720,10 @@ function Room:askForUseCard(player, card_name, pattern, prompt, cancelable, extr
|
||||||
|
|
||||||
if extra_data then
|
if extra_data then
|
||||||
if extra_data.bypass_distances then
|
if extra_data.bypass_distances then
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit, 1)
|
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit .. "-tmp", 1)
|
||||||
end
|
end
|
||||||
if extra_data.bypass_times then
|
if extra_data.bypass_times == nil or extra_data.bypass_times then
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit, 1)
|
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit .. "-tmp", 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local command = "AskForUseCard"
|
local command = "AskForUseCard"
|
||||||
|
@ -1689,8 +1743,8 @@ function Room:askForUseCard(player, card_name, pattern, prompt, cancelable, extr
|
||||||
self.logic:trigger(fk.AskForCardUse, player, askForUseCardData)
|
self.logic:trigger(fk.AskForCardUse, player, askForUseCardData)
|
||||||
|
|
||||||
if askForUseCardData.result and type(askForUseCardData.result) == 'table' then
|
if askForUseCardData.result and type(askForUseCardData.result) == 'table' then
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit, 0)
|
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit .. "-tmp", 0)
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit, 0)
|
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit .. "-tmp", 0)
|
||||||
return askForUseCardData.result
|
return askForUseCardData.result
|
||||||
else
|
else
|
||||||
local data = {card_name, pattern, prompt, cancelable, extra_data}
|
local data = {card_name, pattern, prompt, cancelable, extra_data}
|
||||||
|
@ -1700,13 +1754,13 @@ function Room:askForUseCard(player, card_name, pattern, prompt, cancelable, extr
|
||||||
Fk.currentResponsePattern = nil
|
Fk.currentResponsePattern = nil
|
||||||
|
|
||||||
if result ~= "" then
|
if result ~= "" then
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit, 0)
|
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit .. "-tmp", 0)
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit, 0)
|
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit .. "-tmp", 0)
|
||||||
return self:handleUseCardReply(player, result)
|
return self:handleUseCardReply(player, result)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit, 0)
|
player.room:setPlayerMark(player, MarkEnum.BypassDistancesLimit .. "-tmp", 0)
|
||||||
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit, 0)
|
player.room:setPlayerMark(player, MarkEnum.BypassTimesLimit .. "-tmp", 0)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2970,10 +3024,6 @@ end
|
||||||
|
|
||||||
---@param room Room
|
---@param room Room
|
||||||
local function shouldUpdateWinRate(room)
|
local function shouldUpdateWinRate(room)
|
||||||
if room.settings.gameMode == "heg_mode" then return false end
|
|
||||||
if room.settings.gameMode == "aaa_role_mode" and #room.players < 5 then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if room.settings.enableFreeAssign then
|
if room.settings.enableFreeAssign then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -2983,7 +3033,7 @@ local function shouldUpdateWinRate(room)
|
||||||
for _, p in ipairs(room.players) do
|
for _, p in ipairs(room.players) do
|
||||||
if p.id < 0 then return false end
|
if p.id < 0 then return false end
|
||||||
end
|
end
|
||||||
return true
|
return Fk.game_modes[room.settings.gameMode]:countInFunc(room)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- 结束一局游戏。
|
--- 结束一局游戏。
|
||||||
|
|
|
@ -661,8 +661,9 @@ end
|
||||||
|
|
||||||
function ServerPlayer:reset()
|
function ServerPlayer:reset()
|
||||||
self.room:sendLog{
|
self.room:sendLog{
|
||||||
type = "#ResetGeneral",
|
type = "#ChainStateChange",
|
||||||
from = self.id,
|
from = self.id,
|
||||||
|
arg = "reset-general"
|
||||||
}
|
}
|
||||||
self:setChainState(false)
|
self:setChainState(false)
|
||||||
if not self.faceup then self:turnOver() end
|
if not self.faceup then self:turnOver() end
|
||||||
|
|
|
@ -9,6 +9,7 @@ local thunderSlashSkill = fk.CreateActiveSkill{
|
||||||
max_phase_use_time = 1,
|
max_phase_use_time = 1,
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
can_use = slash.skill.canUse,
|
can_use = slash.skill.canUse,
|
||||||
|
mod_target_filter = slash.skill.modTargetFilter,
|
||||||
target_filter = slash.skill.targetFilter,
|
target_filter = slash.skill.targetFilter,
|
||||||
on_effect = function(self, room, effect)
|
on_effect = function(self, room, effect)
|
||||||
local to = effect.to
|
local to = effect.to
|
||||||
|
@ -47,6 +48,7 @@ local fireSlashSkill = fk.CreateActiveSkill{
|
||||||
max_phase_use_time = 1,
|
max_phase_use_time = 1,
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
can_use = slash.skill.canUse,
|
can_use = slash.skill.canUse,
|
||||||
|
mod_target_filter = slash.skill.modTargetFilter,
|
||||||
target_filter = slash.skill.targetFilter,
|
target_filter = slash.skill.targetFilter,
|
||||||
on_effect = function(self, room, effect)
|
on_effect = function(self, room, effect)
|
||||||
local to = effect.to
|
local to = effect.to
|
||||||
|
@ -79,8 +81,14 @@ extension:addCards{
|
||||||
local analepticSkill = fk.CreateActiveSkill{
|
local analepticSkill = fk.CreateActiveSkill{
|
||||||
name = "analeptic_skill",
|
name = "analeptic_skill",
|
||||||
max_turn_use_time = 1,
|
max_turn_use_time = 1,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return self:withinTimesLimit(Fk:currentRoom():getPlayerById(to_select), Player.HistoryTurn, card, "analeptic", Fk:currentRoom():getPlayerById(to_select)) and
|
||||||
|
not table.find(Fk:currentRoom().players, function(p)
|
||||||
|
return p.dying
|
||||||
|
end)
|
||||||
|
end,
|
||||||
can_use = function(self, player, card)
|
can_use = function(self, player, card)
|
||||||
return self:withinTimesLimit(player, Player.HistoryTurn, card, "analeptic", player)
|
return self:modTargetFilter(player.id, Util.DummyTable, player.id, 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
|
||||||
|
@ -171,6 +179,9 @@ local ironChainCardSkill = fk.CreateActiveSkill{
|
||||||
name = "iron_chain_skill",
|
name = "iron_chain_skill",
|
||||||
min_target_num = 1,
|
min_target_num = 1,
|
||||||
max_target_num = 2,
|
max_target_num = 2,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
target_filter = function() return true end,
|
target_filter = function() return true end,
|
||||||
on_effect = function(self, room, cardEffectEvent)
|
on_effect = function(self, room, cardEffectEvent)
|
||||||
local to = room:getPlayerById(cardEffectEvent.to)
|
local to = room:getPlayerById(cardEffectEvent.to)
|
||||||
|
@ -196,9 +207,12 @@ extension:addCards{
|
||||||
local fireAttackSkill = fk.CreateActiveSkill{
|
local fireAttackSkill = fk.CreateActiveSkill{
|
||||||
name = "fire_attack_skill",
|
name = "fire_attack_skill",
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
target_filter = function(self, to_select)
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
return not Fk:currentRoom():getPlayerById(to_select):isKongcheng()
|
return not Fk:currentRoom():getPlayerById(to_select):isKongcheng()
|
||||||
end,
|
end,
|
||||||
|
target_filter = function(self, to_select)
|
||||||
|
return self:modTargetFilter(to_select)
|
||||||
|
end,
|
||||||
on_effect = function(self, room, cardEffectEvent)
|
on_effect = function(self, room, cardEffectEvent)
|
||||||
local from = room:getPlayerById(cardEffectEvent.from)
|
local from = room:getPlayerById(cardEffectEvent.from)
|
||||||
local to = room:getPlayerById(cardEffectEvent.to)
|
local to = room:getPlayerById(cardEffectEvent.to)
|
||||||
|
|
|
@ -362,6 +362,7 @@ heg = fk.CreateGameMode{
|
||||||
maxPlayer = 8,
|
maxPlayer = 8,
|
||||||
rule = heg_rule,
|
rule = heg_rule,
|
||||||
logic = heg_getlogic,
|
logic = heg_getlogic,
|
||||||
|
countInFunc = Util.FalseFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
Fk:loadTranslationTable{
|
Fk:loadTranslationTable{
|
||||||
|
|
|
@ -52,7 +52,7 @@ Fk:loadTranslationTable{
|
||||||
|
|
||||||
["xuchu"] = "许褚",
|
["xuchu"] = "许褚",
|
||||||
["~xuchu"] = "冷,好冷啊……",
|
["~xuchu"] = "冷,好冷啊……",
|
||||||
["$luoyi1"] = "破!",
|
["$luoyi1"] = "脱!",
|
||||||
["$luoyi2"] = "谁来与我大战三百回合?",
|
["$luoyi2"] = "谁来与我大战三百回合?",
|
||||||
["luoyi"] = "裸衣",
|
["luoyi"] = "裸衣",
|
||||||
[":luoyi"] = "摸牌阶段,你可以少摸一张牌,若如此做,本回合你使用【杀】或【决斗】对目标角色造成伤害时,此伤害+1。",
|
[":luoyi"] = "摸牌阶段,你可以少摸一张牌,若如此做,本回合你使用【杀】或【决斗】对目标角色造成伤害时,此伤害+1。",
|
||||||
|
|
|
@ -1075,6 +1075,9 @@ local role_mode = fk.CreateGameMode{
|
||||||
name = "aaa_role_mode", -- just to let it at the top of list
|
name = "aaa_role_mode", -- just to let it at the top of list
|
||||||
minPlayer = 2,
|
minPlayer = 2,
|
||||||
maxPlayer = 8,
|
maxPlayer = 8,
|
||||||
|
countInFunc = function(self, room)
|
||||||
|
return #room.players >= 5
|
||||||
|
end,
|
||||||
surrender_func = function(self, playedTime)
|
surrender_func = function(self, playedTime)
|
||||||
local roleCheck = false
|
local roleCheck = false
|
||||||
local roleText = ""
|
local roleText = ""
|
||||||
|
|
|
@ -16,7 +16,7 @@ Fk:loadTranslationTable{
|
||||||
["diamond"] = "方块",
|
["diamond"] = "方块",
|
||||||
["suit"] = "花色",
|
["suit"] = "花色",
|
||||||
["color"] = "颜色",
|
["color"] = "颜色",
|
||||||
["figure"] = "点数",
|
["number"] = "点数",
|
||||||
|
|
||||||
["basic_char"] = "基",
|
["basic_char"] = "基",
|
||||||
["trick_char"] = "锦",
|
["trick_char"] = "锦",
|
||||||
|
|
|
@ -3,46 +3,6 @@
|
||||||
local extension = Package:new("standard_cards", Package.CardPack)
|
local extension = Package:new("standard_cards", Package.CardPack)
|
||||||
extension.metadata = require "packages.standard_cards.metadata"
|
extension.metadata = require "packages.standard_cards.metadata"
|
||||||
|
|
||||||
local global_can_use = function(self, player, card)
|
|
||||||
local room = Fk:currentRoom()
|
|
||||||
for _, p in ipairs(room.alive_players) do
|
|
||||||
if not (card and player:isProhibited(p, card)) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local aoe_can_use = function(self, player, card)
|
|
||||||
local room = Fk:currentRoom()
|
|
||||||
for _, p in ipairs(room.alive_players) do
|
|
||||||
if p ~= player and not (card and player:isProhibited(p, card)) then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local global_on_use = function(self, room, cardUseEvent)
|
|
||||||
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
|
|
||||||
cardUseEvent.tos = {}
|
|
||||||
for _, player in ipairs(room:getAlivePlayers()) do
|
|
||||||
if not room:getPlayerById(cardUseEvent.from):isProhibited(player, cardUseEvent.card) then
|
|
||||||
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local aoe_on_use = function(self, room, cardUseEvent)
|
|
||||||
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
|
|
||||||
cardUseEvent.tos = {}
|
|
||||||
for _, player in ipairs(room:getOtherPlayers(room:getPlayerById(cardUseEvent.from))) do
|
|
||||||
if not room:getPlayerById(cardUseEvent.from):isProhibited(player, cardUseEvent.card) then
|
|
||||||
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local slashSkill = fk.CreateActiveSkill{
|
local slashSkill = fk.CreateActiveSkill{
|
||||||
name = "slash_skill",
|
name = "slash_skill",
|
||||||
max_phase_use_time = 1,
|
max_phase_use_time = 1,
|
||||||
|
@ -53,10 +13,15 @@ local slashSkill = fk.CreateActiveSkill{
|
||||||
return self:withinTimesLimit(player, Player.HistoryPhase, card, "slash", p)
|
return self:withinTimesLimit(player, Player.HistoryPhase, card, "slash", p)
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
|
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, true, card, player))
|
||||||
|
end,
|
||||||
target_filter = function(self, to_select, selected, _, card)
|
target_filter = function(self, to_select, selected, _, card)
|
||||||
if #selected < self:getMaxTargetNum(Self, card) then
|
if #selected < self:getMaxTargetNum(Self, card) then
|
||||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||||
return Self ~= player and self:withinDistanceLimit(Self, true, card, player) and
|
return self:modTargetFilter(to_select, selected, Self.id, true, card) and
|
||||||
(#selected > 0 or self:withinTimesLimit(Self, Player.HistoryPhase, card, "slash", player))
|
(#selected > 0 or self:withinTimesLimit(Self, Player.HistoryPhase, card, "slash", player))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
@ -158,6 +123,12 @@ extension:addCards({
|
||||||
|
|
||||||
local peachSkill = fk.CreateActiveSkill{
|
local peachSkill = fk.CreateActiveSkill{
|
||||||
name = "peach_skill",
|
name = "peach_skill",
|
||||||
|
mod_target_filter = function(self, to_select)
|
||||||
|
return Fk:currentRoom():getPlayerById(to_select):isWounded() and
|
||||||
|
not table.find(Fk:currentRoom().players, function(p)
|
||||||
|
return p.dying
|
||||||
|
end)
|
||||||
|
end,
|
||||||
can_use = function(self, player)
|
can_use = function(self, player)
|
||||||
return player:isWounded()
|
return player:isWounded()
|
||||||
end,
|
end,
|
||||||
|
@ -201,10 +172,13 @@ extension:addCards({
|
||||||
local dismantlementSkill = fk.CreateActiveSkill{
|
local dismantlementSkill = fk.CreateActiveSkill{
|
||||||
name = "dismantlement_skill",
|
name = "dismantlement_skill",
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user)
|
||||||
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||||
|
return Fk:currentRoom():getPlayerById(user) ~= player and not player:isAllNude()
|
||||||
|
end,
|
||||||
target_filter = function(self, to_select, selected)
|
target_filter = function(self, to_select, selected)
|
||||||
if #selected < self:getMaxTargetNum(Self) then
|
if #selected < self:getMaxTargetNum(Self) then
|
||||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
return self:modTargetFilter(to_select, selected, Self.id)
|
||||||
return Self ~= player and not player:isAllNude()
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_effect = function(self, room, effect)
|
on_effect = function(self, room, effect)
|
||||||
|
@ -236,13 +210,14 @@ extension:addCards({
|
||||||
local snatchSkill = fk.CreateActiveSkill{
|
local snatchSkill = fk.CreateActiveSkill{
|
||||||
name = "snatch_skill",
|
name = "snatch_skill",
|
||||||
distance_limit = 1,
|
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 (player:isAllNude() or (distance_limited and not self:withinDistanceLimit(from, true, card, player)))
|
||||||
|
end,
|
||||||
target_filter = function(self, to_select, selected, _, card)
|
target_filter = function(self, to_select, selected, _, card)
|
||||||
if #selected == 0 then
|
if #selected == 0 then
|
||||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
return self:modTargetFilter(to_select, selected, Self.id, card, true)
|
||||||
return
|
|
||||||
Self ~= player and
|
|
||||||
self:withinDistanceLimit(Self, false, card, player) and -- for no distance limit for snatch
|
|
||||||
not player:isAllNude()
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
|
@ -272,10 +247,12 @@ extension:addCards({
|
||||||
|
|
||||||
local duelSkill = fk.CreateActiveSkill{
|
local duelSkill = fk.CreateActiveSkill{
|
||||||
name = "duel_skill",
|
name = "duel_skill",
|
||||||
|
mod_target_filter = function(self, to_select, selected, user)
|
||||||
|
return user ~= to_select
|
||||||
|
end,
|
||||||
target_filter = function(self, to_select, selected)
|
target_filter = function(self, to_select, selected)
|
||||||
if #selected == 0 then
|
if #selected == 0 then
|
||||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
return self:modTargetFilter(to_select, selected, Self.id)
|
||||||
return Self ~= player
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
target_num = 1,
|
target_num = 1,
|
||||||
|
@ -355,6 +332,10 @@ extension:addCards({
|
||||||
|
|
||||||
local collateralSkill = fk.CreateActiveSkill{
|
local collateralSkill = fk.CreateActiveSkill{
|
||||||
name = "collateral_skill",
|
name = "collateral_skill",
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||||
|
return user ~= player.id and player:getEquipment(Card.SubtypeWeapon)
|
||||||
|
end,
|
||||||
target_filter = function(self, to_select, selected)
|
target_filter = function(self, to_select, selected)
|
||||||
local player = Fk:currentRoom():getPlayerById(to_select)
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
||||||
if #selected == 0 then
|
if #selected == 0 then
|
||||||
|
@ -399,6 +380,9 @@ extension:addCards({
|
||||||
|
|
||||||
local exNihiloSkill = fk.CreateActiveSkill{
|
local exNihiloSkill = fk.CreateActiveSkill{
|
||||||
name = "ex_nihilo_skill",
|
name = "ex_nihilo_skill",
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return true
|
||||||
|
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 } }
|
||||||
|
@ -453,8 +437,11 @@ extension:addCards({
|
||||||
|
|
||||||
local savageAssaultSkill = fk.CreateActiveSkill{
|
local savageAssaultSkill = fk.CreateActiveSkill{
|
||||||
name = "savage_assault_skill",
|
name = "savage_assault_skill",
|
||||||
can_use = aoe_can_use,
|
can_use = Util.AoeCanUse,
|
||||||
on_use = aoe_on_use,
|
on_use = Util.AoeOnUse,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return user ~= to_select
|
||||||
|
end,
|
||||||
on_effect = function(self, room, effect)
|
on_effect = function(self, room, effect)
|
||||||
local cardResponded = room:askForResponse(room:getPlayerById(effect.to), 'slash', nil, nil, false, nil, effect)
|
local cardResponded = room:askForResponse(room:getPlayerById(effect.to), 'slash', nil, nil, false, nil, effect)
|
||||||
|
|
||||||
|
@ -493,8 +480,11 @@ extension:addCards({
|
||||||
|
|
||||||
local archeryAttackSkill = fk.CreateActiveSkill{
|
local archeryAttackSkill = fk.CreateActiveSkill{
|
||||||
name = "archery_attack_skill",
|
name = "archery_attack_skill",
|
||||||
can_use = aoe_can_use,
|
can_use = Util.AoeCanUse,
|
||||||
on_use = aoe_on_use,
|
on_use = Util.AoeOnUse,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return user ~= to_select
|
||||||
|
end,
|
||||||
on_effect = function(self, room, effect)
|
on_effect = function(self, room, effect)
|
||||||
local cardResponded = room:askForResponse(room:getPlayerById(effect.to), 'jink', nil, nil, false, nil, effect)
|
local cardResponded = room:askForResponse(room:getPlayerById(effect.to), 'jink', nil, nil, false, nil, effect)
|
||||||
|
|
||||||
|
@ -531,8 +521,11 @@ extension:addCards({
|
||||||
|
|
||||||
local godSalvationSkill = fk.CreateActiveSkill{
|
local godSalvationSkill = fk.CreateActiveSkill{
|
||||||
name = "god_salvation_skill",
|
name = "god_salvation_skill",
|
||||||
can_use = global_can_use,
|
can_use = Util.GlobalCanUse,
|
||||||
on_use = global_on_use,
|
on_use = Util.GlobalOnUse,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
about_to_effect = function(self, room, effect)
|
about_to_effect = function(self, room, effect)
|
||||||
if not room:getPlayerById(effect.to):isWounded() then
|
if not room:getPlayerById(effect.to):isWounded() then
|
||||||
return true
|
return true
|
||||||
|
@ -566,8 +559,11 @@ extension:addCards({
|
||||||
|
|
||||||
local amazingGraceSkill = fk.CreateActiveSkill{
|
local amazingGraceSkill = fk.CreateActiveSkill{
|
||||||
name = "amazing_grace_skill",
|
name = "amazing_grace_skill",
|
||||||
can_use = global_can_use,
|
can_use = Util.GlobalCanUse,
|
||||||
on_use = global_on_use,
|
on_use = Util.GlobalOnUse,
|
||||||
|
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
on_effect = function(self, room, effect)
|
on_effect = function(self, room, effect)
|
||||||
local to = room:getPlayerById(effect.to)
|
local to = room:getPlayerById(effect.to)
|
||||||
if not (effect.extra_data and effect.extra_data.AGFilled) then
|
if not (effect.extra_data and effect.extra_data.AGFilled) then
|
||||||
|
|
Loading…
Reference in New Issue