2022-03-31 05:29:23 +00:00
|
|
|
local extension = Package:new("standard_cards", Package.CardPack)
|
|
|
|
extension.metadata = require "packages.standard_cards.metadata"
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
local slashSkill = fk.CreateActiveSkill{
|
|
|
|
name = "slash_skill",
|
2023-01-29 10:11:41 +00:00
|
|
|
max_phase_use_time = 1,
|
|
|
|
target_num = 1,
|
2022-12-20 04:51:54 +00:00
|
|
|
can_use = function(self, player)
|
2023-01-29 10:11:41 +00:00
|
|
|
return player:usedCardTimes("slash", Player.HistoryPhase) < self:getMaxUseTime(Self, Player.HistoryPhase)
|
2022-12-20 04:51:54 +00:00
|
|
|
end,
|
2023-02-21 05:44:24 +00:00
|
|
|
target_filter = function(self, to_select, selected, _, card)
|
|
|
|
if #selected < self:getMaxTargetNum(Self, card) then
|
2022-12-18 04:52:52 +00:00
|
|
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
2022-12-20 04:51:54 +00:00
|
|
|
return Self ~= player and Self:inMyAttackRange(player)
|
2022-12-18 04:52:52 +00:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = effect.to
|
|
|
|
local from = effect.from
|
2023-02-26 08:51:29 +00:00
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
room:damage({
|
2023-02-15 11:54:35 +00:00
|
|
|
from = room:getPlayerById(from),
|
|
|
|
to = room:getPlayerById(to),
|
2023-01-21 16:49:11 +00:00
|
|
|
card = effect.card,
|
2023-03-14 12:48:08 +00:00
|
|
|
damage = 1 + (effect.additionalDamage or 0),
|
2022-12-20 04:51:54 +00:00
|
|
|
damageType = fk.NormalDamage,
|
|
|
|
skillName = self.name
|
|
|
|
})
|
2022-12-18 04:52:52 +00:00
|
|
|
end
|
|
|
|
}
|
2022-03-31 05:29:23 +00:00
|
|
|
local slash = fk.CreateBasicCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "slash",
|
|
|
|
number = 7,
|
|
|
|
suit = Card.Spade,
|
2022-12-18 04:52:52 +00:00
|
|
|
skill = slashSkill,
|
2022-04-30 07:27:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
|
|
|
slash,
|
|
|
|
slash:clone(Card.Spade, 8),
|
|
|
|
slash:clone(Card.Spade, 8),
|
|
|
|
slash:clone(Card.Spade, 9),
|
|
|
|
slash:clone(Card.Spade, 9),
|
|
|
|
slash:clone(Card.Spade, 10),
|
|
|
|
slash:clone(Card.Spade, 10),
|
|
|
|
|
|
|
|
slash:clone(Card.Club, 2),
|
|
|
|
slash:clone(Card.Club, 3),
|
|
|
|
slash:clone(Card.Club, 4),
|
|
|
|
slash:clone(Card.Club, 5),
|
|
|
|
slash:clone(Card.Club, 6),
|
|
|
|
slash:clone(Card.Club, 7),
|
|
|
|
slash:clone(Card.Club, 8),
|
|
|
|
slash:clone(Card.Club, 8),
|
|
|
|
slash:clone(Card.Club, 9),
|
|
|
|
slash:clone(Card.Club, 9),
|
|
|
|
slash:clone(Card.Club, 10),
|
|
|
|
slash:clone(Card.Club, 10),
|
|
|
|
slash:clone(Card.Club, 11),
|
|
|
|
slash:clone(Card.Club, 11),
|
|
|
|
|
|
|
|
slash:clone(Card.Heart, 10),
|
|
|
|
slash:clone(Card.Heart, 10),
|
|
|
|
slash:clone(Card.Heart, 11),
|
|
|
|
|
|
|
|
slash:clone(Card.Diamond, 6),
|
|
|
|
slash:clone(Card.Diamond, 7),
|
|
|
|
slash:clone(Card.Diamond, 8),
|
|
|
|
slash:clone(Card.Diamond, 9),
|
|
|
|
slash:clone(Card.Diamond, 10),
|
|
|
|
slash:clone(Card.Diamond, 13),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
local jinkSkill = fk.CreateActiveSkill{
|
|
|
|
name = "jink_skill",
|
2022-12-18 13:19:35 +00:00
|
|
|
can_use = function()
|
|
|
|
return false
|
|
|
|
end,
|
2022-12-18 04:52:52 +00:00
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
if effect.responseToEvent then
|
|
|
|
effect.responseToEvent.isCancellOut = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local jink = fk.CreateBasicCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "jink",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 2,
|
2022-12-18 04:52:52 +00:00
|
|
|
skill = jinkSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
jink,
|
|
|
|
jink:clone(Card.Heart, 2),
|
|
|
|
jink:clone(Card.Heart, 13),
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
jink:clone(Card.Diamond, 2),
|
|
|
|
jink:clone(Card.Diamond, 2),
|
|
|
|
jink:clone(Card.Diamond, 3),
|
|
|
|
jink:clone(Card.Diamond, 4),
|
|
|
|
jink:clone(Card.Diamond, 5),
|
|
|
|
jink:clone(Card.Diamond, 6),
|
|
|
|
jink:clone(Card.Diamond, 7),
|
|
|
|
jink:clone(Card.Diamond, 8),
|
|
|
|
jink:clone(Card.Diamond, 9),
|
|
|
|
jink:clone(Card.Diamond, 10),
|
|
|
|
jink:clone(Card.Diamond, 11),
|
|
|
|
jink:clone(Card.Diamond, 11),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 04:51:54 +00:00
|
|
|
local peachSkill = fk.CreateActiveSkill{
|
|
|
|
name = "peach_skill",
|
|
|
|
can_use = function(self, player)
|
|
|
|
return player:isWounded()
|
|
|
|
end,
|
2022-12-20 10:40:17 +00:00
|
|
|
on_use = function(self, room, use)
|
|
|
|
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then
|
|
|
|
use.tos = { { use.from } }
|
|
|
|
end
|
|
|
|
end,
|
2022-12-20 04:51:54 +00:00
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = effect.to
|
|
|
|
local from = effect.from
|
2023-02-26 08:51:29 +00:00
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
room:recover({
|
2023-02-15 11:54:35 +00:00
|
|
|
who = room:getPlayerById(to),
|
2022-12-20 04:51:54 +00:00
|
|
|
num = 1,
|
|
|
|
recoverBy = from,
|
|
|
|
skillName = self.name
|
2022-12-20 13:15:49 +00:00
|
|
|
})
|
2022-12-20 04:51:54 +00:00
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local peach = fk.CreateBasicCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "peach",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 3,
|
2022-12-20 04:51:54 +00:00
|
|
|
skill = peachSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
peach,
|
|
|
|
peach:clone(Card.Heart, 4),
|
|
|
|
peach:clone(Card.Heart, 6),
|
|
|
|
peach:clone(Card.Heart, 7),
|
|
|
|
peach:clone(Card.Heart, 8),
|
|
|
|
peach:clone(Card.Heart, 9),
|
|
|
|
peach:clone(Card.Heart, 12),
|
|
|
|
peach:clone(Card.Heart, 12),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local dismantlementSkill = fk.CreateActiveSkill{
|
|
|
|
name = "dismantlement_skill",
|
2023-01-29 10:11:41 +00:00
|
|
|
target_num = 1,
|
2022-12-20 13:15:49 +00:00
|
|
|
target_filter = function(self, to_select, selected)
|
2023-02-26 07:01:14 +00:00
|
|
|
if #selected < self:getMaxTargetNum(Self) then
|
2022-12-20 13:15:49 +00:00
|
|
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
|
|
|
return Self ~= player and not player:isAllNude()
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = room:getPlayerById(effect.to)
|
2023-01-29 10:11:41 +00:00
|
|
|
if to:isAllNude() then return end
|
2022-12-20 13:15:49 +00:00
|
|
|
local from = room:getPlayerById(effect.from)
|
|
|
|
local cid = room:askForCardChosen(
|
|
|
|
from,
|
|
|
|
to,
|
|
|
|
"hej",
|
|
|
|
self.name
|
|
|
|
)
|
|
|
|
|
|
|
|
room:throwCard(cid, self.name, to, from)
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local dismantlement = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "dismantlement",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 3,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = dismantlementSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
dismantlement,
|
|
|
|
dismantlement:clone(Card.Spade, 4),
|
|
|
|
dismantlement:clone(Card.Spade, 12),
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
dismantlement:clone(Card.Club, 3),
|
|
|
|
dismantlement:clone(Card.Club, 4),
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
dismantlement:clone(Card.Heart, 12),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-09-14 05:01:10 +00:00
|
|
|
local snatchSkill = fk.CreateActiveSkill{
|
|
|
|
name = "snatch_skill",
|
2023-01-29 10:11:41 +00:00
|
|
|
distance_limit = 1,
|
2022-09-14 05:01:10 +00:00
|
|
|
target_filter = function(self, to_select, selected)
|
|
|
|
if #selected == 0 then
|
|
|
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
2023-01-29 10:11:41 +00:00
|
|
|
return Self ~= player and Self:distanceTo(player) <= self:getDistanceLimit(Self)
|
2022-09-14 05:01:10 +00:00
|
|
|
and not player:isAllNude()
|
|
|
|
end
|
|
|
|
end,
|
2023-02-26 07:01:14 +00:00
|
|
|
target_num = 1,
|
2022-09-14 05:01:10 +00:00
|
|
|
on_effect = function(self, room, effect)
|
2022-12-18 04:52:52 +00:00
|
|
|
local to = effect.to
|
2022-09-14 05:01:10 +00:00
|
|
|
local from = effect.from
|
|
|
|
local cid = room:askForCardChosen(
|
|
|
|
room:getPlayerById(from),
|
|
|
|
room:getPlayerById(to),
|
|
|
|
"hej",
|
2022-12-20 13:15:49 +00:00
|
|
|
self.name
|
2022-09-14 05:01:10 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
room:obtainCard(from, cid)
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local snatch = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "snatch",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 3,
|
2022-09-14 05:01:10 +00:00
|
|
|
skill = snatchSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
snatch,
|
|
|
|
snatch:clone(Card.Spade, 4),
|
|
|
|
snatch:clone(Card.Spade, 11),
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
snatch:clone(Card.Diamond, 3),
|
|
|
|
snatch:clone(Card.Diamond, 4),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local duelSkill = fk.CreateActiveSkill{
|
|
|
|
name = "duel_skill",
|
|
|
|
target_filter = function(self, to_select, selected)
|
|
|
|
if #selected == 0 then
|
|
|
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
|
|
|
return Self ~= player
|
|
|
|
end
|
|
|
|
end,
|
2023-02-26 07:01:14 +00:00
|
|
|
target_num = 1,
|
2022-12-20 13:15:49 +00:00
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = room:getPlayerById(effect.to)
|
|
|
|
local from = room:getPlayerById(effect.from)
|
|
|
|
local responsers = { to, from }
|
|
|
|
local currentTurn = 1
|
|
|
|
local currentResponser = to
|
|
|
|
|
|
|
|
while currentResponser:isAlive() do
|
|
|
|
if effect.disresponsive or table.contains(effect.disresponsiveList or {}, currentResponser.id) then
|
|
|
|
break
|
|
|
|
end
|
|
|
|
|
2023-03-05 17:07:54 +00:00
|
|
|
local loopTimes = 1
|
|
|
|
if effect.fixedResponseTimes then
|
|
|
|
local canFix = currentResponser == to
|
|
|
|
if effect.fixedAddTimesResponsors then
|
|
|
|
canFix = table.contains(effect.fixedAddTimesResponsors, currentResponser.id)
|
|
|
|
end
|
|
|
|
|
|
|
|
if canFix then
|
|
|
|
if type(effect.fixedResponseTimes) == 'table' then
|
|
|
|
loopTimes = effect.fixedResponseTimes["slash"] or 1
|
|
|
|
elseif type(effect.fixedResponseTimes) == 'number' then
|
|
|
|
loopTimes = effect.fixedResponseTimes
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local cardResponded
|
|
|
|
for i = 1, loopTimes do
|
|
|
|
cardResponded = room:askForResponse(currentResponser, 'slash')
|
|
|
|
if cardResponded then
|
|
|
|
room:responseCard({
|
|
|
|
from = currentResponser.id,
|
|
|
|
card = cardResponded,
|
|
|
|
responseToEvent = effect,
|
|
|
|
})
|
|
|
|
else
|
|
|
|
break
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if not cardResponded then
|
2022-12-20 13:15:49 +00:00
|
|
|
break
|
|
|
|
end
|
|
|
|
|
|
|
|
currentTurn = currentTurn % 2 + 1
|
|
|
|
currentResponser = responsers[currentTurn]
|
|
|
|
end
|
|
|
|
|
|
|
|
if currentResponser:isAlive() then
|
|
|
|
room:damage({
|
2023-02-15 11:54:35 +00:00
|
|
|
from = responsers[currentTurn % 2 + 1],
|
|
|
|
to = currentResponser,
|
2023-01-21 16:49:11 +00:00
|
|
|
card = effect.card,
|
2023-03-14 12:48:08 +00:00
|
|
|
damage = 1 + (effect.additionalDamage or 0),
|
2022-12-20 13:15:49 +00:00
|
|
|
damageType = fk.NormalDamage,
|
|
|
|
skillName = self.name,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local duel = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "duel",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 1,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = duelSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
duel,
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
duel:clone(Card.Club, 1),
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
duel:clone(Card.Diamond, 1),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local collateralSkill = fk.CreateActiveSkill{
|
|
|
|
name = "collateral_skill",
|
|
|
|
target_filter = function(self, to_select, selected)
|
|
|
|
local player = Fk:currentRoom():getPlayerById(to_select)
|
|
|
|
if #selected == 0 then
|
|
|
|
return Self ~= player and player:getEquipment(Card.SubtypeWeapon)
|
|
|
|
elseif #selected == 1 then
|
|
|
|
return Fk:currentRoom():getPlayerById(selected[1]):inMyAttackRange(player)
|
|
|
|
end
|
|
|
|
end,
|
2023-02-26 07:01:14 +00:00
|
|
|
target_num = 2,
|
2022-12-20 13:15:49 +00:00
|
|
|
on_use = function(self, room, cardUseEvent)
|
|
|
|
cardUseEvent.tos = { { cardUseEvent.tos[1][1], cardUseEvent.tos[2][1] } }
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
2023-01-16 11:13:07 +00:00
|
|
|
local use = room:askForUseCard(
|
|
|
|
room:getPlayerById(effect.to),
|
|
|
|
"slash", nil, nil, nil, { must_targets = effect.subTargets }
|
|
|
|
)
|
2022-12-20 13:15:49 +00:00
|
|
|
|
2023-01-16 11:13:07 +00:00
|
|
|
if use then
|
|
|
|
room:useCard(use)
|
2022-12-20 13:15:49 +00:00
|
|
|
else
|
|
|
|
room:obtainCard(effect.from, room:getPlayerById(effect.to):getEquipment(Card.SubtypeWeapon), true, fk.ReasonGive)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local collateral = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "collateral",
|
|
|
|
suit = Card.Club,
|
|
|
|
number = 12,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = collateralSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
collateral,
|
|
|
|
collateral:clone(Card.Club, 13),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
local exNihiloSkill = fk.CreateActiveSkill{
|
|
|
|
name = "ex_nihilo_skill",
|
|
|
|
on_use = function(self, room, cardUseEvent)
|
|
|
|
if not cardUseEvent.tos or #TargetGroup:getRealTargets(cardUseEvent.tos) == 0 then
|
|
|
|
cardUseEvent.tos = { { cardUseEvent.from } }
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, cardEffectEvent)
|
2022-12-18 04:52:52 +00:00
|
|
|
room:drawCards(room:getPlayerById(cardEffectEvent.to), 2, "ex_nihilo")
|
2022-04-30 07:27:56 +00:00
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local exNihilo = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "ex_nihilo",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 7,
|
|
|
|
skill = exNihiloSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
exNihilo,
|
|
|
|
exNihilo:clone(Card.Heart, 8),
|
|
|
|
exNihilo:clone(Card.Heart, 9),
|
|
|
|
exNihilo:clone(Card.Heart, 11),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-18 04:52:52 +00:00
|
|
|
local nullificationSkill = fk.CreateActiveSkill{
|
|
|
|
name = "nullification_skill",
|
2022-12-20 04:51:54 +00:00
|
|
|
can_use = function()
|
|
|
|
return false
|
|
|
|
end,
|
2022-12-18 04:52:52 +00:00
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
if effect.responseToEvent then
|
|
|
|
effect.responseToEvent.isCancellOut = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local nullification = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "nullification",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 11,
|
2022-12-18 04:52:52 +00:00
|
|
|
skill = nullificationSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
nullification,
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
nullification:clone(Card.Club, 12),
|
|
|
|
nullification:clone(Card.Club, 13),
|
2022-04-08 10:39:58 +00:00
|
|
|
|
2022-04-30 07:27:56 +00:00
|
|
|
nullification:clone(Card.Diamond, 12),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local savageAssaultSkill = fk.CreateActiveSkill{
|
|
|
|
name = "savage_assault_skill",
|
|
|
|
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
|
|
|
|
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
2023-01-16 11:13:07 +00:00
|
|
|
local cardResponded = nil
|
2022-12-20 13:15:49 +00:00
|
|
|
if not (effect.disresponsive or table.contains(effect.disresponsiveList or {}, effect.to)) then
|
2023-01-16 11:13:07 +00:00
|
|
|
cardResponded = room:askForResponse(room:getPlayerById(effect.to), 'slash')
|
2022-12-20 13:15:49 +00:00
|
|
|
end
|
|
|
|
|
2023-01-16 11:13:07 +00:00
|
|
|
if cardResponded then
|
2022-12-20 13:15:49 +00:00
|
|
|
room:responseCard({
|
|
|
|
from = effect.to,
|
2023-01-16 11:13:07 +00:00
|
|
|
card = cardResponded,
|
2022-12-20 13:15:49 +00:00
|
|
|
responseToEvent = effect,
|
|
|
|
})
|
|
|
|
else
|
|
|
|
room:damage({
|
2023-02-15 11:54:35 +00:00
|
|
|
from = room:getPlayerById(effect.from),
|
|
|
|
to = room:getPlayerById(effect.to),
|
2023-01-21 16:49:11 +00:00
|
|
|
card = effect.card,
|
2023-03-14 12:48:08 +00:00
|
|
|
damage = 1 + (effect.additionalDamage or 0),
|
2022-12-20 13:15:49 +00:00
|
|
|
damageType = fk.NormalDamage,
|
|
|
|
skillName = self.name,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local savageAssault = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "savage_assault",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 7,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = savageAssaultSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
savageAssault,
|
|
|
|
savageAssault:clone(Card.Spade, 13),
|
|
|
|
savageAssault:clone(Card.Club, 7),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local archeryAttackSkill = fk.CreateActiveSkill{
|
|
|
|
name = "archery_attack_skill",
|
|
|
|
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
|
|
|
|
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
2023-01-16 11:13:07 +00:00
|
|
|
local cardResponded = nil
|
2022-12-20 13:15:49 +00:00
|
|
|
if not (effect.disresponsive or table.contains(effect.disresponsiveList or {}, effect.to)) then
|
2023-01-16 11:13:07 +00:00
|
|
|
cardResponded = room:askForResponse(room:getPlayerById(effect.to), 'jink')
|
2022-12-20 13:15:49 +00:00
|
|
|
end
|
|
|
|
|
2023-01-16 11:13:07 +00:00
|
|
|
if cardResponded then
|
2022-12-20 13:15:49 +00:00
|
|
|
room:responseCard({
|
|
|
|
from = effect.to,
|
2023-01-16 11:13:07 +00:00
|
|
|
card = cardResponded,
|
2022-12-20 13:15:49 +00:00
|
|
|
responseToEvent = effect,
|
|
|
|
})
|
|
|
|
else
|
|
|
|
room:damage({
|
2023-02-15 11:54:35 +00:00
|
|
|
from = room:getPlayerById(effect.from),
|
|
|
|
to = room:getPlayerById(effect.to),
|
2023-01-21 16:49:11 +00:00
|
|
|
card = effect.card,
|
2023-03-14 12:48:08 +00:00
|
|
|
damage = 1 + (effect.additionalDamage or 0),
|
2022-12-20 13:15:49 +00:00
|
|
|
damageType = fk.NormalDamage,
|
|
|
|
skillName = self.name,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local archeryAttack = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "archery_attack",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 1,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = archeryAttackSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
archeryAttack,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local godSalvationSkill = fk.CreateActiveSkill{
|
|
|
|
name = "god_salvation_skill",
|
|
|
|
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
|
|
|
|
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
2023-02-15 11:54:35 +00:00
|
|
|
about_to_effect = function(self, room, effect)
|
|
|
|
if not room:getPlayerById(effect.to):isWounded() then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
2022-12-20 13:15:49 +00:00
|
|
|
room:recover({
|
2023-02-15 11:54:35 +00:00
|
|
|
who = room:getPlayerById(effect.to),
|
2022-12-20 13:15:49 +00:00
|
|
|
num = 1,
|
|
|
|
skillName = self.name,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local godSalvation = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "god_salvation",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 1,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = godSalvationSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
godSalvation,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 13:15:49 +00:00
|
|
|
local amazingGraceSkill = fk.CreateActiveSkill{
|
|
|
|
name = "amazing_grace_skill",
|
|
|
|
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
|
|
|
|
TargetGroup:pushTargets(cardUseEvent.tos, player.id)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
2023-03-14 12:48:08 +00:00
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = room:getPlayerById(effect.to)
|
|
|
|
if not (effect.extra_data and effect.extra_data.AGFilled) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
local chosen = room:askForAG(to, effect.extra_data.AGFilled, false, self.name)
|
|
|
|
room:takeAG(to, chosen, room.players)
|
|
|
|
room:obtainCard(effect.to, chosen, true, fk.ReasonPrey)
|
|
|
|
table.removeOne(effect.extra_data.AGFilled, chosen)
|
2022-12-20 13:15:49 +00:00
|
|
|
end
|
|
|
|
}
|
2023-03-14 12:48:08 +00:00
|
|
|
|
|
|
|
local amazingGraceAction = fk.CreateTriggerSkill{
|
|
|
|
name = "amazing_grace_action",
|
|
|
|
global = true,
|
|
|
|
priority = { [fk.BeforeCardUseEffect] = 0, [fk.CardUseFinished] = 10 }, -- game rule
|
|
|
|
refresh_events = { fk.BeforeCardUseEffect, fk.CardUseFinished },
|
|
|
|
can_refresh = function(self, event, target, player, data)
|
|
|
|
local frameFilled = data.extra_data and data.extra_data.AGFilled
|
|
|
|
if event == fk.BeforeCardUseEffect then
|
|
|
|
return data.card.trueName == 'amazing_grace' and not frameFilled
|
|
|
|
else
|
|
|
|
return frameFilled
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_refresh = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
if event == fk.BeforeCardUseEffect then
|
|
|
|
local toDisplay = room:getNCards(#TargetGroup:getRealTargets(data.tos))
|
|
|
|
room:moveCards({
|
|
|
|
ids = toDisplay,
|
|
|
|
toArea = Card.Processing,
|
|
|
|
moveReason = fk.ReasonPut,
|
|
|
|
})
|
|
|
|
|
|
|
|
table.forEach(room.players, function(p)
|
|
|
|
room:fillAG(p, toDisplay)
|
|
|
|
end)
|
|
|
|
|
|
|
|
data.extra_data = data.extra_data or {}
|
|
|
|
data.extra_data.AGFilled = toDisplay
|
|
|
|
else
|
|
|
|
table.forEach(room.players, function(p)
|
|
|
|
room:closeAG(p)
|
|
|
|
end)
|
|
|
|
|
|
|
|
if data.extra_data and data.extra_data.AGFilled then
|
|
|
|
local toDiscard = table.filter(data.extra_data.AGFilled, function(id)
|
|
|
|
return room:getCardArea(id) == Card.Processing
|
|
|
|
end)
|
|
|
|
|
|
|
|
if #toDiscard > 0 then
|
|
|
|
room:moveCards({
|
|
|
|
ids = toDiscard,
|
|
|
|
toArea = Card.DiscardPile,
|
|
|
|
moveReason = fk.ReasonPutIntoDiscardPile,
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
data.extra_data.AGFilled = nil
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(amazingGraceAction)
|
|
|
|
|
2022-04-08 10:39:58 +00:00
|
|
|
local amazingGrace = fk.CreateTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "amazing_grace",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 3,
|
2022-12-20 13:15:49 +00:00
|
|
|
skill = amazingGraceSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
amazingGrace,
|
|
|
|
amazingGrace:clone(Card.Heart, 4),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 10:40:17 +00:00
|
|
|
local lightningSkill = fk.CreateActiveSkill{
|
|
|
|
name = "lightning_skill",
|
|
|
|
can_use = function(self, player)
|
2023-01-29 10:11:41 +00:00
|
|
|
return not Self:hasDelayedTrick("lightning")
|
2022-12-20 10:40:17 +00:00
|
|
|
end,
|
|
|
|
on_use = function(self, room, use)
|
|
|
|
if not use.tos or #TargetGroup:getRealTargets(use.tos) == 0 then
|
|
|
|
use.tos = { { use.from } }
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = room:getPlayerById(effect.to)
|
|
|
|
local judge = {
|
|
|
|
who = to,
|
|
|
|
reason = "lightning",
|
2023-01-29 10:11:41 +00:00
|
|
|
pattern = ".|2~9|spade",
|
2022-12-20 10:40:17 +00:00
|
|
|
}
|
|
|
|
room:judge(judge)
|
|
|
|
local result = judge.card
|
|
|
|
if result.suit == Card.Spade and result.number >= 2 and result.number <= 9 then
|
|
|
|
room:damage{
|
2023-02-15 11:54:35 +00:00
|
|
|
to = to,
|
2022-12-20 10:40:17 +00:00
|
|
|
damage = 3,
|
2023-01-21 16:49:11 +00:00
|
|
|
card = effect.card,
|
2022-12-20 10:40:17 +00:00
|
|
|
damageType = fk.ThunderDamage,
|
|
|
|
skillName = self.name,
|
|
|
|
}
|
|
|
|
|
|
|
|
room:moveCards{
|
|
|
|
ids = { effect.cardId },
|
|
|
|
toArea = Card.DiscardPile,
|
|
|
|
moveReason = fk.ReasonPutIntoDiscardPile
|
|
|
|
}
|
|
|
|
else
|
|
|
|
self:onNullified(room, effect)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_nullified = function(self, room, effect)
|
|
|
|
local to = room:getPlayerById(effect.to)
|
2023-03-09 04:19:16 +00:00
|
|
|
local nextp = to
|
2023-03-04 17:28:59 +00:00
|
|
|
repeat
|
2023-03-09 04:19:16 +00:00
|
|
|
nextp = nextp:getNextAlive()
|
2023-03-04 17:28:59 +00:00
|
|
|
if nextp == to then return end
|
|
|
|
until not nextp:hasDelayedTrick("lightning")
|
|
|
|
|
2022-12-20 10:40:17 +00:00
|
|
|
room:moveCards{
|
2023-01-16 11:13:07 +00:00
|
|
|
ids = room:getSubcardsByRule(effect.card, { Card.Processing }),
|
2022-12-20 10:40:17 +00:00
|
|
|
to = nextp.id,
|
|
|
|
toArea = Card.PlayerJudge,
|
|
|
|
moveReason = fk.ReasonPut
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local lightning = fk.CreateDelayedTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "lightning",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 1,
|
2022-12-20 10:40:17 +00:00
|
|
|
skill = lightningSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
lightning,
|
|
|
|
lightning:clone(Card.Heart, 12),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2022-12-20 10:40:17 +00:00
|
|
|
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
|
2023-01-29 10:11:41 +00:00
|
|
|
return not player:hasDelayedTrick("indulgence")
|
2022-12-20 10:40:17 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
end,
|
2023-02-26 07:01:14 +00:00
|
|
|
target_num = 1,
|
2022-12-20 10:40:17 +00:00
|
|
|
on_effect = function(self, room, effect)
|
|
|
|
local to = room:getPlayerById(effect.to)
|
|
|
|
local judge = {
|
|
|
|
who = to,
|
|
|
|
reason = "indulgence",
|
2023-01-29 10:11:41 +00:00
|
|
|
pattern = ".|.|spade,club,diamond",
|
2022-12-20 10:40:17 +00:00
|
|
|
}
|
|
|
|
room:judge(judge)
|
|
|
|
local result = judge.card
|
|
|
|
if result.suit ~= Card.Heart then
|
|
|
|
to:skip(Player.Play)
|
|
|
|
end
|
|
|
|
self:onNullified(room, effect)
|
|
|
|
end,
|
|
|
|
on_nullified = function(self, room, effect)
|
|
|
|
room:moveCards{
|
2023-01-16 11:13:07 +00:00
|
|
|
ids = room:getSubcardsByRule(effect.card, { Card.Processing }),
|
2022-12-20 10:40:17 +00:00
|
|
|
toArea = Card.DiscardPile,
|
|
|
|
moveReason = fk.ReasonPutIntoDiscardPile
|
|
|
|
}
|
|
|
|
end,
|
|
|
|
}
|
2022-04-08 10:39:58 +00:00
|
|
|
local indulgence = fk.CreateDelayedTrickCard{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "indulgence",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 6,
|
2022-12-20 10:40:17 +00:00
|
|
|
skill = indulgenceSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
indulgence,
|
|
|
|
indulgence:clone(Card.Club, 6),
|
|
|
|
indulgence:clone(Card.Heart, 6),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local crossbowAudio = fk.CreateTriggerSkill{
|
|
|
|
name = "#crossbowAudio",
|
|
|
|
refresh_events = {fk.CardUsing},
|
|
|
|
can_refresh = function(self, event, target, player, data)
|
|
|
|
return target == player and player:hasSkill(self.name) and
|
2023-03-07 02:21:56 +00:00
|
|
|
data.card.trueName == "slash" and
|
2023-02-21 05:44:24 +00:00
|
|
|
player:usedCardTimes("slash") > 1
|
|
|
|
end,
|
|
|
|
on_refresh = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
room:broadcastPlaySound("./packages/standard_cards/audio/card/crossbow")
|
|
|
|
room:setEmotion(player, "./packages/standard_cards/image/anim/crossbow")
|
|
|
|
end,
|
|
|
|
}
|
2023-02-15 13:20:40 +00:00
|
|
|
local crossbowSkill = fk.CreateTargetModSkill{
|
|
|
|
name = "#crossbow_skill",
|
|
|
|
attached_equip = "crossbow",
|
|
|
|
residue_func = function(self, player, skill, scope)
|
2023-03-07 02:21:56 +00:00
|
|
|
if player:hasSkill(self.name) and skill.trueName == "slash_skill"
|
2023-02-15 13:20:40 +00:00
|
|
|
and scope == Player.HistoryPhase then
|
|
|
|
return 999
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
}
|
2023-02-21 05:44:24 +00:00
|
|
|
crossbowSkill:addRelatedSkill(crossbowAudio)
|
2023-02-15 13:20:40 +00:00
|
|
|
Fk:addSkill(crossbowSkill)
|
|
|
|
|
2022-04-08 10:39:58 +00:00
|
|
|
local crossbow = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "crossbow",
|
|
|
|
suit = Card.Club,
|
|
|
|
number = 1,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 1,
|
2023-02-15 13:20:40 +00:00
|
|
|
equip_skill = crossbowSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
crossbow,
|
|
|
|
crossbow:clone(Card.Diamond, 1),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-03-20 12:49:23 +00:00
|
|
|
fk.MarkArmorNullified = "mark__armor_nullified"
|
|
|
|
|
|
|
|
local armorInvalidity = fk.CreateInvaliditySkill {
|
|
|
|
name = "armor_invalidity_skill",
|
|
|
|
global = true,
|
|
|
|
invalidity_func = function(self, from, skill)
|
|
|
|
return
|
|
|
|
from:getMark(fk.MarkArmorNullified) > 0 and
|
|
|
|
from:getEquipment(Card.SubtypeArmor) ~= nil and
|
|
|
|
skill.attached_equip == Fk:getCardById(from:getEquipment(Card.SubtypeArmor)).name
|
|
|
|
end
|
|
|
|
}
|
|
|
|
Fk:addSkill(armorInvalidity)
|
|
|
|
|
|
|
|
local qingGangSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#qinggang_sword_skill",
|
|
|
|
attached_equip = "qinggang_sword",
|
|
|
|
frequency = Skill.Compulsory,
|
|
|
|
events = { fk.TargetSpecified },
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
return target == player and player:hasSkill(self.name) and
|
|
|
|
data.card and data.card.trueName == "slash"
|
|
|
|
end,
|
|
|
|
on_use = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
room:addPlayerMark(room:getPlayerById(data.to), fk.MarkArmorNullified)
|
|
|
|
|
|
|
|
data.extra_data = data.extra_data or {}
|
|
|
|
data.extra_data.qinggangNullified = data.extra_data.qinggangNullified or {}
|
|
|
|
data.extra_data.qinggangNullified[tostring(data.to)] = (data.extra_data.qinggangNullified[tostring(data.to)] or 0) + 1
|
|
|
|
end,
|
|
|
|
|
|
|
|
refresh_events = { fk.CardUseFinished },
|
|
|
|
can_refresh = function(self, event, target, player, data)
|
|
|
|
return data.extra_data and data.extra_data.qinggangNullified
|
|
|
|
end,
|
|
|
|
on_refresh = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
for key, num in pairs(data.extra_data.qinggangNullified) do
|
|
|
|
local p = room:getPlayerById(tonumber(key))
|
|
|
|
if p:getMark(fk.MarkArmorNullified) > 0 then
|
|
|
|
room:removePlayerMark(p, fk.MarkArmorNullified, num)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
data.qinggangNullified = nil
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(qingGangSkill)
|
|
|
|
|
2022-04-08 10:39:58 +00:00
|
|
|
local qingGang = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "qinggang_sword",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 6,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 2,
|
2023-03-20 12:49:23 +00:00
|
|
|
equip_skill = qingGangSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
qingGang,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local iceSwordSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#ice_sword_skill",
|
|
|
|
attached_equip = "ice_sword",
|
|
|
|
events = {fk.DamageCaused},
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
2023-03-20 12:28:25 +00:00
|
|
|
return target == player and player:hasSkill(self.name) and (not data.chain) and
|
2023-03-07 02:21:56 +00:00
|
|
|
data.card and data.card.trueName == "slash" and not data.to:isNude()
|
2023-02-21 05:44:24 +00:00
|
|
|
end,
|
|
|
|
on_use = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
local to = data.to
|
|
|
|
for i = 1, 2 do
|
|
|
|
if to:isNude() then break end
|
|
|
|
local card = room:askForCardChosen(player, to, "he", self.name)
|
|
|
|
room:throwCard(card, self.name, to, player)
|
|
|
|
end
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
}
|
|
|
|
Fk:addSkill(iceSwordSkill)
|
|
|
|
|
2022-04-08 10:39:58 +00:00
|
|
|
local iceSword = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "ice_sword",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 2,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 2,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = iceSwordSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
iceSword,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local doubleSwordsSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#double_swords_skill",
|
|
|
|
attached_equip = "double_swords",
|
|
|
|
events = {fk.TargetSpecified},
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
return target == player and player:hasSkill(self.name) and
|
2023-03-07 02:21:56 +00:00
|
|
|
data.card and data.card.trueName == "slash" and
|
2023-02-21 05:44:24 +00:00
|
|
|
(player.room:getPlayerById(data.to).gender ~= player.gender)
|
|
|
|
end,
|
|
|
|
on_use = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
local to = player.room:getPlayerById(data.to)
|
|
|
|
local result = room:askForDiscard(to, 1, 1, false, self.name, true)
|
|
|
|
if #result == 0 then
|
|
|
|
player:drawCards(1, self.name)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(doubleSwordsSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local doubleSwords = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "double_swords",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 2,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 2,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = doubleSwordsSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
doubleSwords,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local bladeSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#blade_skill",
|
|
|
|
attached_equip = "blade",
|
|
|
|
events = {fk.CardUseFinished},
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
if not player:hasSkill(self.name) then return end
|
|
|
|
local use = data ---@type CardUseStruct
|
2023-03-07 02:21:56 +00:00
|
|
|
if use.card.name == "jink" and use.toCard and use.toCard.trueName == "slash" then
|
2023-02-21 05:44:24 +00:00
|
|
|
local effect = use.responseToEvent
|
|
|
|
return effect.from == player.id
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_cost = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
local use = room:askForUseCard(player, "slash", nil, "#blade_slash:" .. target.id,
|
|
|
|
true, { must_targets = {target.id} })
|
|
|
|
if use then
|
|
|
|
self.cost_data = use
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_use = function(self, event, target, player, data)
|
|
|
|
player.room:useCard(self.cost_data)
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(bladeSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local blade = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "blade",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 5,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 3,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = bladeSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
blade,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local spearSkill = fk.CreateViewAsSkill{
|
|
|
|
name = "spear_skill",
|
|
|
|
attached_equip = "spear",
|
|
|
|
pattern = "slash",
|
|
|
|
card_filter = function(self, to_select, selected)
|
|
|
|
if #selected == 2 then return false end
|
2023-02-26 07:01:14 +00:00
|
|
|
return Fk:currentRoom():getCardArea(to_select) ~= Player.Equip
|
2023-02-21 05:44:24 +00:00
|
|
|
end,
|
|
|
|
view_as = function(self, cards)
|
|
|
|
if #cards ~= 2 then
|
|
|
|
return nil
|
|
|
|
end
|
|
|
|
local c = Fk:cloneCard("slash")
|
2023-04-02 04:56:29 +00:00
|
|
|
c.skillName = "spear"
|
2023-02-21 05:44:24 +00:00
|
|
|
c:addSubcards(cards)
|
|
|
|
return c
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(spearSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local spear = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "spear",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 12,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 3,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = spearSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
spear,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local axeSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#axe_skill",
|
|
|
|
attached_equip = "axe",
|
2023-03-05 17:07:54 +00:00
|
|
|
events = {fk.CardEffectCancelledOut},
|
2023-02-21 05:44:24 +00:00
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
if not player:hasSkill(self.name) then return end
|
|
|
|
local effect = data ---@type CardEffectEvent
|
2023-03-07 02:21:56 +00:00
|
|
|
return effect.card.trueName == "slash" and effect.from == player.id
|
2023-02-21 05:44:24 +00:00
|
|
|
end,
|
|
|
|
on_cost = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
local ret = room:askForDiscard(player, 2, 2, true, self.name, true)
|
|
|
|
if #ret > 0 then return true end
|
|
|
|
end,
|
|
|
|
on_use = function() return true end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(axeSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local axe = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "axe",
|
|
|
|
suit = Card.Diamond,
|
|
|
|
number = 5,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 3,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = axeSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
axe,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local halberdAudio = fk.CreateTriggerSkill{
|
|
|
|
name = "#halberdAudio",
|
|
|
|
refresh_events = {fk.CardUsing},
|
|
|
|
can_refresh = function(self, event, target, player, data)
|
|
|
|
return target == player and player:hasSkill(self.name) and
|
2023-03-07 02:21:56 +00:00
|
|
|
data.card.trueName == "slash" and #TargetGroup:getRealTargets(data.tos) > 1
|
2023-02-21 05:44:24 +00:00
|
|
|
end,
|
|
|
|
on_refresh = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
room:broadcastPlaySound("./packages/standard_cards/audio/card/halberd")
|
|
|
|
room:setEmotion(player, "./packages/standard_cards/image/anim/halberd")
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
local halberdSkill = fk.CreateTargetModSkill{
|
|
|
|
name = "#halberd_skill",
|
|
|
|
attached_equip = "halberd",
|
|
|
|
extra_target_func = function(self, player, skill, card)
|
2023-03-07 02:21:56 +00:00
|
|
|
if player:hasSkill(self.name) and skill.trueName == "slash_skill"
|
2023-02-21 05:44:24 +00:00
|
|
|
and #player:getCardIds(Player.Hand) == 1
|
|
|
|
and player:getCardIds(Player.Hand)[1] == card.id then
|
|
|
|
return 2
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
halberdSkill:addRelatedSkill(halberdAudio)
|
|
|
|
Fk:addSkill(halberdSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local halberd = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "halberd",
|
|
|
|
suit = Card.Diamond,
|
|
|
|
number = 12,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 4,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = halberdSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
halberd,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local kylinBowSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#kylin_bow_skill",
|
|
|
|
attached_equip = "kylin_bow",
|
|
|
|
events = {fk.DamageCaused},
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
local ret = target == player and player:hasSkill(self.name) and
|
2023-03-20 12:28:25 +00:00
|
|
|
data.card and data.card.trueName == "slash" and (not data.chain)
|
2023-02-21 05:44:24 +00:00
|
|
|
if ret then
|
|
|
|
---@type ServerPlayer
|
|
|
|
local to = data.to
|
|
|
|
return to:getEquipment(Card.SubtypeDefensiveRide) or
|
|
|
|
to:getEquipment(Card.SubtypeOffensiveRide)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
on_use = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
local to = data.to
|
|
|
|
local ride_tab = {}
|
|
|
|
if to:getEquipment(Card.SubtypeDefensiveRide) then
|
|
|
|
table.insert(ride_tab, "+1")
|
|
|
|
end
|
|
|
|
if to:getEquipment(Card.SubtypeOffensiveRide) then
|
|
|
|
table.insert(ride_tab, "-1")
|
|
|
|
end
|
|
|
|
if #ride_tab == 0 then return end
|
|
|
|
local choice = room:askForChoice(player, ride_tab, self.name)
|
|
|
|
if choice == "+1" then
|
|
|
|
room:throwCard(to:getEquipment(Card.SubtypeDefensiveRide), self.name, to, player)
|
|
|
|
else
|
|
|
|
room:throwCard(to:getEquipment(Card.SubtypeOffensiveRide), self.name, to, player)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
Fk:addSkill(kylinBowSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local kylinBow = fk.CreateWeapon{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "kylin_bow",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 5,
|
2022-12-20 04:51:54 +00:00
|
|
|
attack_range = 5,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = kylinBowSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
kylinBow,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-03-05 17:07:54 +00:00
|
|
|
local eightDiagramSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#eight_diagram_skill",
|
|
|
|
attached_equip = "eight_diagram",
|
|
|
|
events = {fk.AskForCardUse, fk.AskForCardResponse},
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
return target == player and player:hasSkill(self.name) and
|
2023-03-20 12:49:23 +00:00
|
|
|
(data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none")))
|
2023-03-05 17:07:54 +00:00
|
|
|
end,
|
|
|
|
on_use = function(self, event, target, player, data)
|
|
|
|
local room = player.room
|
|
|
|
local judgeData = {
|
|
|
|
who = player,
|
|
|
|
reason = self.name,
|
|
|
|
pattern = ".|.|heart,diamond",
|
|
|
|
}
|
|
|
|
room:judge(judgeData)
|
|
|
|
|
|
|
|
if judgeData.card.color == Card.Red then
|
|
|
|
if event == fk.AskForCardUse then
|
|
|
|
data.result = {
|
|
|
|
from = player.id,
|
|
|
|
card = Fk:cloneCard('jink'),
|
|
|
|
}
|
2023-04-02 04:56:29 +00:00
|
|
|
data.result.card.skillName = "eight_diagram"
|
2023-03-05 17:07:54 +00:00
|
|
|
|
|
|
|
if data.eventData then
|
|
|
|
data.result.toCard = data.eventData.toCard
|
|
|
|
data.result.responseToEvent = data.eventData.responseToEvent
|
|
|
|
end
|
|
|
|
else
|
|
|
|
data.result = Fk:cloneCard('jink')
|
2023-04-02 04:56:29 +00:00
|
|
|
data.result.skillName = "eight_diagram"
|
2023-03-05 17:07:54 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
Fk:addSkill(eightDiagramSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local eightDiagram = fk.CreateArmor{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "eight_diagram",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 2,
|
2023-03-05 17:07:54 +00:00
|
|
|
equip_skill = eightDiagramSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
eightDiagram,
|
|
|
|
eightDiagram:clone(Card.Club, 2),
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-02-21 05:44:24 +00:00
|
|
|
local niohShieldSkill = fk.CreateTriggerSkill{
|
|
|
|
name = "#nioh_shield_skill",
|
|
|
|
attached_equip = "nioh_shield",
|
|
|
|
frequency = Skill.Compulsory,
|
|
|
|
events = {fk.PreCardEffect},
|
|
|
|
can_trigger = function(self, event, target, player, data)
|
|
|
|
local effect = data ---@type CardEffectEvent
|
|
|
|
return player.id == effect.to and player:hasSkill(self.name) and
|
2023-03-07 02:21:56 +00:00
|
|
|
effect.card.trueName == "slash" and effect.card.color == Card.Black
|
2023-02-21 05:44:24 +00:00
|
|
|
end,
|
|
|
|
on_use = function() return true end,
|
|
|
|
}
|
|
|
|
Fk:addSkill(niohShieldSkill)
|
2022-04-08 10:39:58 +00:00
|
|
|
local niohShield = fk.CreateArmor{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "nioh_shield",
|
|
|
|
suit = Card.Club,
|
|
|
|
number = 2,
|
2023-02-21 05:44:24 +00:00
|
|
|
equip_skill = niohShieldSkill,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
niohShield,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
2023-01-04 06:21:29 +00:00
|
|
|
local horseSkill = fk.CreateDistanceSkill{
|
|
|
|
name = "horse_skill",
|
|
|
|
global = true,
|
|
|
|
correct_func = function(self, from, to)
|
|
|
|
local ret = 0
|
|
|
|
if from:getEquipment(Card.SubtypeOffensiveRide) then
|
|
|
|
ret = ret - 1
|
|
|
|
end
|
|
|
|
if to:getEquipment(Card.SubtypeDefensiveRide) then
|
|
|
|
ret = ret + 1
|
|
|
|
end
|
|
|
|
return ret
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
if not Fk.skills["horse_skill"] then
|
|
|
|
Fk:addSkill(horseSkill)
|
|
|
|
end
|
|
|
|
|
2022-04-08 10:39:58 +00:00
|
|
|
local diLu = fk.CreateDefensiveRide{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "dilu",
|
|
|
|
suit = Card.Club,
|
|
|
|
number = 5,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
diLu,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
local jueYing = fk.CreateDefensiveRide{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "jueying",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 5,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
jueYing,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
local zhuaHuangFeiDian = fk.CreateDefensiveRide{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "zhuahuangfeidian",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 13,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
zhuaHuangFeiDian,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
local chiTu = fk.CreateOffensiveRide{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "chitu",
|
|
|
|
suit = Card.Heart,
|
|
|
|
number = 5,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
chiTu,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
local daYuan = fk.CreateOffensiveRide{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "dayuan",
|
|
|
|
suit = Card.Spade,
|
|
|
|
number = 13,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
daYuan,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
local ziXing = fk.CreateOffensiveRide{
|
2022-04-30 07:27:56 +00:00
|
|
|
name = "zixing",
|
2023-02-15 11:54:35 +00:00
|
|
|
suit = Card.Diamond,
|
|
|
|
number = 13,
|
2022-04-08 10:39:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
extension:addCards({
|
2022-04-30 07:27:56 +00:00
|
|
|
ziXing,
|
2022-04-08 10:39:58 +00:00
|
|
|
})
|
2022-03-31 05:29:23 +00:00
|
|
|
|
2023-02-27 02:23:48 +00:00
|
|
|
dofile "packages/standard_cards/i18n/init.lua"
|
|
|
|
|
2022-03-31 05:29:23 +00:00
|
|
|
return extension
|