加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
joy_mobile.lua 40.82 KB
一键复制 编辑 原始数据 按行查看 历史
5i-wanna-to-be-the666 提交于 2024-11-06 16:55 . 5
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
local extension = Package("joy_mobile")
extension.extensionName = "joym"
Fk:loadTranslationTable{
["joy_mobile"] = "欢乐-手杀改",
}
local U = require "packages/utility/utility"
-- 手杀武将上修改的武将
local joy_mouhuanggai = General(extension, "joy_mou__huanggai", "wu", 4)
local joy_mou__kurou = fk.CreateActiveSkill{
name = "joy_mou__kurou",
anim_type = "negative",
card_num = 0,
card_filter = Util.FalseFunc,
target_num = 0,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:loseHp(player, 1, self.name)
if player.dead then return end
room:addPlayerMark(player, "@joy_mou__kurou")
room:broadcastProperty(player, "MaxCards")
room:changeMaxHp(player, 1)
end
}
local joy_mou__kurou_maxcards = fk.CreateMaxCardsSkill{
name = "#joy_mou__kurou_maxcards",
correct_func = function(self, player)
return player:getMark("@joy_mou__kurou")
end,
}
joy_mou__kurou:addRelatedSkill(joy_mou__kurou_maxcards)
local joy_mou__kurou_delay = fk.CreateTriggerSkill{
name = "#joy_mou__kurou_delay",
frequency = Skill.Compulsory,
mute = true,
events = {fk.TurnStart, fk.HpRecover},
can_trigger = function(self, event, target, player, data)
if event == fk.TurnStart then
return player == target and player:getMark("@joy_mou__kurou") > 0
else
return player == target and player:hasSkill(joy_mou__kurou)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnStart then
local n = player:getMark("@joy_mou__kurou")
room:setPlayerMark(player, "@joy_mou__kurou", 0)
room:broadcastProperty(player, "MaxCards")
room:changeMaxHp(player, -n)
else
room:notifySkillInvoked(player, "joy_mou__kurou", "special")
player:setSkillUseHistory("joy_mou__kurou", 0, Player.HistoryPhase)
end
end,
}
joy_mou__kurou:addRelatedSkill(joy_mou__kurou_delay)
joy_mouhuanggai:addSkill(joy_mou__kurou)
local joy_mou__zhaxiang= fk.CreateTriggerSkill{
name = "joy_mou__zhaxiang",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.HpLost, fk.PreCardUse, fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event == fk.HpLost then
return true
elseif event == fk.TurnEnd then
return player:isWounded()
else
return data.card.trueName == "slash" and player:getMark("joy_mou__zhaxiang-turn") < ((player:getLostHp() + 1) // 2)
end
end
end,
on_trigger = function(self, event, target, player, data)
local num = (event == fk.HpLost) and data.num or 1
for i = 1, num do
self:doCost(event, target, player, data)
if player.dead then break end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.HpLost then
player:drawCards(3)
elseif event == fk.TurnEnd then
local x = (player:getLostHp() + 1) // 2
player:drawCards(x)
else
data.extraUse = true
data.disresponsiveList = table.map(player.room.alive_players, Util.IdMapper)
end
end,
refresh_events = {fk.CardUsing, fk.HpChanged, fk.MaxHpChanged, fk.EventAcquireSkill, fk.TurnStart},
can_refresh = function(self, event, target, player, data)
if player:hasSkill(self, true) then
if event == fk.CardUsing then
return target == player and data.card.trueName == "slash"
elseif event == fk.EventAcquireSkill then
return target == player and data == self and player.room:getTag("RoundCount")
elseif event == fk.TurnStart then
return true
else
return target == player
end
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.CardUsing then
room:addPlayerMark(player, "joy_mou__zhaxiang-turn")
elseif event == fk.EventAcquireSkill then
room:setPlayerMark(player, "joy_mou__zhaxiang-turn", #room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
local use = e.data[1]
return use.from == player.id and use.card.trueName == "slash"
end, Player.HistoryTurn))
end
local x = (player:getLostHp() + 1) // 2
local used = player:getMark("joy_mou__zhaxiang-turn")
room:setPlayerMark(player, "@joy_mou__zhaxiang-turn", used.."/"..x)
end,
}
local joy_mou__zhaxiang_targetmod = fk.CreateTargetModSkill{
name = "#joy_mou__zhaxiang_targetmod",
bypass_times = function(self, player, skill, scope, card)
return card and card.trueName == "slash" and player:hasSkill("joy_mou__zhaxiang")
and player:getMark("joy_mou__zhaxiang-turn") < ((player:getLostHp() + 1) // 2)
end,
bypass_distances = function(self, player, skill, card)
return card and card.trueName == "slash" and player:hasSkill("joy_mou__zhaxiang")
and player:getMark("joy_mou__zhaxiang-turn") < ((player:getLostHp() + 1) // 2)
end,
}
joy_mou__zhaxiang:addRelatedSkill(joy_mou__zhaxiang_targetmod)
joy_mouhuanggai:addSkill(joy_mou__zhaxiang)
Fk:loadTranslationTable{
["joy_mou"] = "欢乐谋",
["joy_mou__huanggai"] = "谋黄盖",
["joy_mou__kurou"] = "苦肉",
[":joy_mou__kurou"] = "出牌阶段限一次,你可以失去一点体力并令体力上限和手牌上限增加1点直到下回合开始。当你回复体力后,此技能视为未发动。",
["@joy_mou__kurou"] = "苦肉",
["#joy_mou__kurou_delay"] = "苦肉",
["joy_mou__zhaxiang"] = "诈降",
[":joy_mou__zhaxiang"] = "锁定技,①每当你失去一点体力后,摸三张牌;②回合结束时,你摸X张牌;③每回合你使用的前X张【杀】无距离和次数限制且无法响应(X为你已损失的体力值的一半,向上取整)。",
["@joy_mou__zhaxiang-turn"] = "诈降",
}
local machao = General:new(extension, "joy_mou__machao", "shu", 4)
local joy__yuma = fk.CreateTriggerSkill{
name = "joy__yuma",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return end
for _, move in ipairs(data) do
if move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerEquip and (Fk:getCardById(info.cardId).sub_type == Card.SubtypeDefensiveRide or Fk:getCardById(info.cardId).sub_type == Card.SubtypeOffensiveRide) then
return true
end
end
end
end
end,
on_trigger = function(self, event, target, player, data)
local n = 0
for _, move in ipairs(data) do
if move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerEquip and (Fk:getCardById(info.cardId).sub_type == Card.SubtypeDefensiveRide or Fk:getCardById(info.cardId).sub_type == Card.SubtypeOffensiveRide) then
n = n + 1
end
end
end
end
for _ = 1, n do
if not player:hasSkill(self) then break end
self:doCost(event, target, player, data)
end
end,
on_use = function(self, event, target, player, data)
player:drawCards(2, self.name)
end,
}
local joy__yuma_distance = fk.CreateDistanceSkill{
name = "#joy__yuma_distance",
correct_func = function(self, from, to)
if from:hasSkill(joy__yuma) then
return -1
end
end,
}
joy__yuma:addRelatedSkill(joy__yuma_distance)
machao:addSkill(joy__yuma)
local tieji = fk.CreateTriggerSkill{
name = "joy_mou__tieji",
anim_type = "offensive",
events = {fk.TargetSpecified},
mute = true,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.to ~= player.id and
data.card.trueName == "slash"
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke("mou__tieji", 1)
local to = room:getPlayerById(data.to)
data.disresponsive = true
room:addPlayerMark(to, "@@tieji-turn")
room:addPlayerMark(to, MarkEnum.UncompulsoryInvalidity .. "-turn")
local choices = U.doStrategy(room, player, to, {"tieji-zhiqu","tieji-raozheng"}, {"tieji-chuzheng","tieji-huwei"}, self.name, 1)
local win = true
if choices[1] == "tieji-zhiqu" and choices[2] ~= "tieji-chuzheng" then
player:broadcastSkillInvoke("mou__tieji", 2)
if not to:isNude() then
local card = room:askForCardChosen(player, to, "he", self.name)
room:obtainCard(player, card, false, fk.ReasonPrey)
end
elseif choices[1] == "tieji-raozheng" and choices[2] ~= "tieji-huwei" then
player:broadcastSkillInvoke("mou__tieji", 3)
player:drawCards(2, self.name)
else
win = false
player:broadcastSkillInvoke("mou__tieji", 4)
end
if win then
room:addPlayerMark(player, MarkEnum.SlashResidue.."-turn")
if not player:isKongcheng() and #room:askForDiscard(player, 1, 1, false, self.name, true, ".", "#joy_mou__tieji-discard") > 0 then
local ids = room:getCardsFromPileByRule("slash")
if #ids > 0 then
room:moveCardTo(ids, Card.PlayerHand, player, fk.ReasonPrey, self.name)
end
end
end
end,
}
machao:addSkill(tieji)
Fk:loadTranslationTable{
["joy_mou__machao"] = "谋马超",
["#joy_mou__machao"] = "阻戎负勇",
["joy__yuma"] = "驭马",
[":joy__yuma"] = "锁定技,你计算与其他角色距离-1;每当你失去装备区一张坐骑牌后,你摸两张牌。",
["joy_mou__tieji"] = "铁骑",
[":joy_mou__tieji"] = "每当你使用【杀】指定其他角色为目标后,你可令其不能响应此【杀】,且所有非锁定技失效直到回合结束。然后你与其进行谋弈:①“直取敌营”,你获得其一张牌;②“扰阵疲敌”,你摸两张牌。若你谋奕成功,本回合使用【杀】上次数限+1,且可以弃置一张手牌,获得一张【杀】。",
["#joy_mou__tieji-discard"] = "铁骑:可以弃置一张手牌,获得一张【杀】",
}
local mouhuangzhong = General(extension, "joy_mou__huangzhong", "shu", 4)
local mouliegongFilter = fk.CreateFilterSkill{
name = "#joy_mou__liegong_filter",
card_filter = function(self, card, player)
return card.trueName == "slash" and
card.name ~= "slash" and
not player:getEquipment(Card.SubtypeWeapon) and
player:hasSkill(self) and
table.contains(player.player_cards[Player.Hand], card.id)
end,
view_as = function(self, card, player)
local c = Fk:cloneCard("slash", card.suit, card.number)
c.skillName = "joy_mou__liegong"
return c
end,
}
local mouliegongProhibit = fk.CreateProhibitSkill{
name = "#joy_mou__liegong_prohibit",
prohibit_use = function(self, player, card)
if Fk.currentResponsePattern ~= "jink" or card.name ~= "jink" or player:getMark("joy_mou__liegong") == 0 then
return false
end
if table.contains(player:getMark("joy_mou__liegong"), card:getSuitString(true)) then
return true
end
end,
}
local mouliegong = fk.CreateTriggerSkill{
name = "joy_mou__liegong",
anim_type = "offensive",
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and
data.card.trueName == "slash" and
#AimGroup:getAllTargets(data.tos) == 1 and
player:getMark("@joy_mouliegongRecord") ~= 0
end,
on_use = function(self, event, target, player, data)
local room = player.room
local logic = room.logic
local cardUseEvent = logic:getCurrentEvent().parent
cardUseEvent.liegong_used = true
local to = room:getPlayerById(data.to)
local suits = player:getMark("@joy_mouliegongRecord")
room:setPlayerMark(to, self.name, suits)
if #suits > 1 then
local cards = room:getNCards(#suits - 1)
room:moveCardTo(cards, Card.Processing)
data.additionalDamage = data.additionalDamage or 0
for _, id in ipairs(cards) do
if table.contains(suits, Fk:getCardById(id):getSuitString(true)) then
room:setCardEmotion(id, "judgegood")
data.additionalDamage = data.additionalDamage + 1
else
room:setCardEmotion(id, "judgebad")
end
room:delay(200)
end
if not player.dead then
room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonPrey, self.name)
end
end
end,
refresh_events = {fk.TargetConfirmed, fk.CardUsing, fk.CardUseFinished},
can_refresh = function(self, event, target, player, data)
if not (target == player and player:hasSkill(self)) then return end
local room = player.room
if event == fk.CardUseFinished then
return room.logic:getCurrentEvent().liegong_used
else
return data.card.suit ~= Card.NoSuit
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.CardUseFinished then
room:setPlayerMark(player, "@joy_mouliegongRecord", 0)
for _, p in ipairs(room:getAlivePlayers()) do
room:setPlayerMark(p, "joy_mou__liegong", 0)
end
else
local suit = data.card:getSuitString(true)
local record = type(player:getMark("@joy_mouliegongRecord")) == "table" and player:getMark("@joy_mouliegongRecord") or {}
table.insertIfNeed(record, suit)
room:setPlayerMark(player, "@joy_mouliegongRecord", record)
end
end,
}
mouliegong:addRelatedSkill(mouliegongFilter)
mouliegong:addRelatedSkill(mouliegongProhibit)
mouhuangzhong:addSkill(mouliegong)
Fk:loadTranslationTable{
["joy_mou__huangzhong"] = "谋黄忠",
["#joy_mou__huangzhong"] = "没金铩羽",
["joy_mou__liegong"] = "烈弓",
[":joy_mou__liegong"] = "若你未装备武器,你的【杀】只能当作普通【杀】使用或打出。"
.. "你使用牌时或成为其他角色使用牌的目标后,若此牌的花色未被“烈弓”记录,"
.. "则记录此种花色。当你使用【杀】指定唯一目标后,你可以亮出并获得牌堆顶的X张牌"
.. "(X为你记录的花色数-1,且至少为0),然后每有一张牌花色与“烈弓”记录的"
.. "花色相同,你令此【杀】伤害+1,且其不能使用“烈弓”记录花色的牌响应此"
.. "【杀】。若如此做,此【杀】结算结束后,清除“烈弓”记录的花色。",
["@joy_mouliegongRecord"] = "烈弓",
["#joy_mou__liegong_filter"] = "烈弓",
}
local liubei = General(extension, "joy_mou__liubei", "shu", 4)
local rende = fk.CreateViewAsSkill{
pattern = ".",
name = "joy_mou__rende",
interaction = function()
local choices = {}
if Self:getMark("@joy_mou__rende") > 1 and Self:getMark("joy_mou__rende_vs-turn") == 0 then
for _, name in ipairs(U.getAllCardNames("bt")) do
local card = Fk:cloneCard(name)
if (Fk.currentResponsePattern == nil and Self:canUse(card)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(card)) then
if (card.type == Card.TypeBasic and Self:getMark("@joy_mou__rende") > 1)
or (card:isCommonTrick() and Self:getMark("@joy_mou__rende") > 2) then
table.insertIfNeed(choices, card.name)
end
end
end
end
return UI.ComboBox {choices = choices}
end,
view_as = function(self)
if not self.interaction.data then return nil end
local c = Fk:cloneCard(self.interaction.data)
c.skillName = self.name
return c
end,
before_use = function(self, player, use)
local room = player.room
room:removePlayerMark(player, "@joy_mou__rende", use.card.type == Card.TypeBasic and 2 or 3)
room:setPlayerMark(player, "joy_mou__rende_used-turn", 1)
end,
enabled_at_play = function(self, player)
return player:getMark("@joy_mou__rende") > 1 and player:getMark("joy_mou__rende_prohibit-turn") == 0
and player:getMark("joy_mou__rende_used-turn") == 0
end,
enabled_at_response = function (self, player, response)
return player:getMark("@joy_mou__rende") > 1 and player:getMark("joy_mou__rende_prohibit-turn") == 0
and player:getMark("joy_mou__rende_used-turn") == 0
end,
}
-- FIXME : use skill_card to connet activeSkill and viewasSkill
local rende_give = fk.CreateActiveSkill{
name = "joy_mou__rende&",
main_skill = rende,
prompt = "#joy_mou__rende-give",
target_num = 1,
min_card_num = 1,
card_filter = Util.TrueFunc,
target_filter = function(self, to_select, selected, selected_cards)
return #selected == 0 and to_select ~= Self.id and #selected_cards > 0
and Fk:currentRoom():getPlayerById(to_select):getMark("joy_mou__rende_target-phase") == 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
room:setPlayerMark(target, "joy_mou__rende_target-phase", 1)
room:setPlayerMark(target, "joy_mou__rende_target", 1)
room:moveCardTo(effect.cards, Player.Hand, target, fk.ReasonGive, self.name, nil, false, player.id)
if player.dead then return end
room:setPlayerMark(player, "@joy_mou__rende", math.min(10, player:getMark("@joy_mou__rende") + #effect.cards))
end,
can_use = function (self, player, card)
return player:getMark("joy_mou__rende_prohibit-turn") == 0
end,
}
local rende_trigger = fk.CreateTriggerSkill{
name = "#joy_mou__rende_trigger",
mute = true,
main_skill = rende,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(rende) and target == player and player.phase == Player.Play and player:getMark("@joy_mou__rende") < 10
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke("joy_mou__rende")
room:setPlayerMark(player, "@joy_mou__rende", math.min(10, player:getMark("@joy_mou__rende") + 3))
end,
}
rende:addRelatedSkill(rende_give)
rende:addRelatedSkill(rende_trigger)
liubei:addSkill(rende)
local zhangwu = fk.CreateActiveSkill{
name = "joy_mou__zhangwu",
anim_type = "control",
frequency = Skill.Limited,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
card_num = 0,
card_filter = function() return false end,
target_num = 0,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local x = math.min(3, (room:getTag("RoundCount") - 1))
if x > 0 then
for _, p in ipairs(room:getOtherPlayers(player)) do
if player.dead then break end
if not p.dead and p:getMark("joy_mou__rende_target") > 0 and not p:isNude() then
local cards = (#p:getCardIds("he") < x) and p:getCardIds("he") or
room:askForCard(p, x, x, true, self.name, false, ".", "#mou__zhangwu-give::"..player.id..":"..x)
if #cards > 0 then
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(cards)
room:obtainCard(player, dummy, false, fk.ReasonGive)
end
end
end
end
if not player.dead and player:isWounded() then
room:recover { num = math.min(3,player.maxHp-player.hp), skillName = self.name, who = player, recoverBy = player}
end
room:setPlayerMark(player, "joy_mou__rende_prohibit-turn", 1)
end,
}
liubei:addSkill(zhangwu)
local joy_mou__jijiang = fk.CreateTriggerSkill{
name = "joy_mou__jijiang$",
anim_type = "offensive",
events = {fk.EventPhaseEnd},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Play then
local players = player.room.alive_players
return #players > 2 and table.find(players, function(p) return p ~= player and p.kingdom == "shu" end)
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local success, dat = room:askForUseActiveSkill(player, "joy_mou__jijiang_choose", "#joy_mou__jijiang-promot", true, nil, true)
if success and dat then
self.cost_data = dat.targets
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local victim = room:getPlayerById(self.cost_data[1])
local bro = room:getPlayerById(self.cost_data[2])
room:doIndicate(player.id, {bro.id})
local choices = {"joy_mou__jijiang_skip"}
if not bro:prohibitUse(Fk:cloneCard("slash")) and not bro:isProhibited(victim, Fk:cloneCard("slash")) then
table.insert(choices, 1, "joy_mou__jijiang_slash:"..victim.id)
end
if room:askForChoice(bro, choices, self.name) == "joy_mou__jijiang_skip" then
room:setPlayerMark(bro, "@@joy_mou__jijiang_skip", 1)
else
room:useVirtualCard("slash", nil, bro, victim, self.name, true)
end
end,
}
local joy_mou__jijiang_choose = fk.CreateActiveSkill{
name = "joy_mou__jijiang_choose",
card_num = 0,
target_num = 2,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected)
if #selected > 1 or to_select == Self.id then return false end
if #selected == 0 then
return true
else
local victim = Fk:currentRoom():getPlayerById(selected[1])
local bro = Fk:currentRoom():getPlayerById(to_select)
return bro.kingdom == "shu" and bro:inMyAttackRange(victim)
end
end,
}
Fk:addSkill(joy_mou__jijiang_choose)
local joy_mou__jijiang_delay = fk.CreateTriggerSkill{
name = "#joy_mou__jijiang_delay",
events = {fk.EventPhaseChanging},
priority = 10,
mute = true,
can_trigger = function(self, event, target, player, data)
return target:getMark("@@joy_mou__jijiang_skip") > 0 and data.to == Player.Play
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
player.room:setPlayerMark(target, "@@joy_mou__jijiang_skip", 0)
target:skip(Player.Play)
return true
end,
}
joy_mou__jijiang:addRelatedSkill(joy_mou__jijiang_delay)
liubei:addSkill(joy_mou__jijiang)
Fk:loadTranslationTable{
["joy_mou__liubei"] = "谋刘备",
["#joy_mou__liubei"] = "雄才盖世",
["joy_mou__rende"] = "仁德",
[":joy_mou__rende"] = "①出牌阶段开始时,你获得3个“仁”标记;②出牌阶段,你可以将任意张牌交给一名本阶段未以此法获得牌的其他角色,获得等量的“仁”标记(至多拥有10个)。③每回合限一次,每当你需要使用或打出基本牌/普通锦囊牌时,你可以移去2/3个“仁”标记视为使用或打出之。",
["@joy_mou__rende"] = "仁",
["joy_mou__rende&"] = "仁德",
["#joy_mou__rende-give"] = "仁德:将任意张牌交给一名本阶段未以此法获得牌的其他角色,获得等量的“仁”标记",
[":joy_mou__rende&"] = "出牌阶段,你可以将任意张牌交给一名本阶段未以此法获得牌的其他角色,获得等量的“仁”标记(至多拥有10个)。",
["joy_mou__zhangwu"] = "章武",
[":joy_mou__zhangwu"] = "限定技,出牌阶段,你可以令〖仁德〗选择过的所有角色依次交给你X张牌(X为游戏轮数-1,至多为3),然后你回复3点体力,无法发动〖仁德〗直到回合结束。",
["joy_mou__jijiang"] = "激将",
[":joy_mou__jijiang"] = "主公技,出牌阶段结束时,你可以选择一名其他角色,然后令一名攻击范围内含有其的其他蜀势力角色选择一项:"..
"1.视为对其使用一张【杀】;2.跳过下一个出牌阶段。",
["@@joy_mou__jijiang_skip"] = "激将",
["#joy_mou__jijiang-promot"] = "激将:先选择【杀】的目标,再选需要响应“激将”的蜀势力角色",
["joy_mou__jijiang_slash"] = "视为对 %src 使用一张【杀】",
["joy_mou__jijiang_skip"] = "跳过下一个出牌阶段",
["joy_mou__jijiang_choose"] = "激将",
}
local caocao = General(extension, "joy_mou__caocao", "wei", 4)
local mou__jianxiong = fk.CreateTriggerSkill{
name = "joy_mou__jianxiong",
anim_type = "masochism",
events = {fk.Damaged},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and ((data.card and target.room:getCardArea(data.card) == Card.Processing) or 2 - player:getMark("@joy_mou__jianxiong") > 0)
end,
on_use = function(self, event, target, player, data)
if data.card and target.room:getCardArea(data.card) == Card.Processing then
player.room:obtainCard(player.id, data.card, true, fk.ReasonJustMove)
end
local num = 2 - player:getMark("@joy_mou__jianxiong")
if num > 0 then
player:drawCards(num, self.name)
end
local choices = {"getMark"}
local n = "#joy_mou__jianxiong-getMark"
if player:getMark("@joy_mou__jianxiong") ~= 0 then
table.insert(choices,"removeMark")
n = "#joy_mou__jianxiong-choose"
end
if player.room:askForSkillInvoke(player, self.name, nil, n) then
local choice = player.room:askForChoice(player,choices,self.name)
if choice == "getMark" then
player.room:addPlayerMark(player, "@joy_mou__jianxiong", 1)
else
player.room:removePlayerMark(player, "@joy_mou__jianxiong", 1)
end
end
end,
}
local mou__jianxiong_gamestart = fk.CreateTriggerSkill{
name = "#joy_mou__jianxiong_gamestart",
events = {fk.GameStart},
can_trigger = function(self, event, target, player, data)
return player:hasSkill("joy_mou__jianxiong")
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke("joy_mou__jianxiong")
local choice = room:askForChoice(player, {"0", "1", "2"}, "joy_mou__jianxiong", "#joy_mou__jianxiong-choice")
room:addPlayerMark(player, "@joy_mou__jianxiong", tonumber(choice))
end,
}
local mou__qingzheng = fk.CreateTriggerSkill{
name = "joy_mou__qingzheng",
anim_type = "control",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Play then
local num = math.max(3 - player:getMark("@joy_mou__jianxiong"),0)
local suits = {}
for _, id in ipairs(player.player_cards[Player.Hand]) do
local suit = Fk:getCardById(id).suit
if suit ~= Card.NoSuit then
table.insertIfNeed(suits, suit)
end
end
return not player:isKongcheng() and #suits >= num
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = table.filter(room:getOtherPlayers(player), function(p) return not p:isKongcheng() end)
if #targets > 0 then
local to = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#joy_mou__qingzheng-choose", self.name, true)
if #to > 0 then
self.cost_data = to[1]
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = player.room:getPlayerById(self.cost_data)
local num = math.max(3 - player:getMark("@joy_mou__jianxiong"),0)
local suits = {}
for _, id in ipairs(player.player_cards[Player.Hand]) do
local suit = Fk:getCardById(id):getSuitString()
if suit ~= Card.NoSuit then
table.insertIfNeed(suits, suit)
end
end
local cards ={}
for i = 1, num, 1 do
local choice = room:askForChoice(player, suits, self.name, "#joy_mou__qingzheng-discard:::".. num ..":" ..i)
table.removeOne(suits, choice)
for _, c in ipairs(player.player_cards[Player.Hand]) do
local suit = Fk:getCardById(c):getSuitString()
if suit == choice then
table.insertIfNeed(cards, c)
end
end
end
cards = table.filter(cards, function (id)
return not player:prohibitDiscard(Fk:getCardById(id))
end)
if #cards > 0 then
room:throwCard(cards, self.name, player)
end
if player.dead then return end
local cids = to.player_cards[Player.Hand]
local id1 = room:askForCardChosen(player, to, { card_data = { { "$Hand", cids } } }, self.name, "#joy_mou__qingzheng-throw")
local cards1 = table.filter(cids, function(id) return Fk:getCardById(id).suit == Fk:getCardById(id1).suit end)
room:throwCard(cards1, self.name, to, player)
if #cards > #cards1 and not to.dead then
room:damage{ from = player, to = to, damage = 1, skillName = self.name }
local choices = {"getMark"}
local n = "#joy_mou__jianxiong-getMark"
if player:getMark("@joy_mou__jianxiong") ~= 0 then
table.insert(choices,"removeMark")
n = "#joy_mou__jianxiong-choose"
end
if player.room:askForSkillInvoke(player, self.name, nil, n) then
local choice = player.room:askForChoice(player,choices,self.name)
if choice == "getMark" then
player.room:addPlayerMark(player, "@joy_mou__jianxiong", 1)
else
player.room:removePlayerMark(player, "@joy_mou__jianxiong", 1)
end
end
end
end,
}
mou__jianxiong:addRelatedSkill(mou__jianxiong_gamestart)
caocao:addSkill(mou__jianxiong)
caocao:addSkill(mou__qingzheng)
caocao:addSkill("mou__hujia")
Fk:loadTranslationTable{
["joy_mou__caocao"] = "谋曹操",
["#joy_mou__caocao"] = "魏武大帝",
["joy_mou__jianxiong"] = "奸雄",
["#joy_mou__jianxiong_gamestart"] = "奸雄",
[":joy_mou__jianxiong"] = "游戏开始时,你可以获得至多两枚“治世”标记。当你受到伤害后,你可以获得对你造成伤害的牌并摸2-X张牌,然后你可以增减1枚“治世”。"..
"(X为“治世”的数量)。",
["joy_mou__qingzheng"] = "清正",
[":joy_mou__qingzheng"] = "出牌阶段开始时,你可以选择一名有手牌的其他角色,你弃置3-X(X为你的“治世”标记数)种花色的所有手牌,然后观看其手牌并选择一种"..
"花色的牌,其弃置所有该花色的手牌。若如此做且其弃置的手牌小于你以此法弃置的牌数,你对其造成1点伤害,然后你可以增减一枚“治世”。",
["#joy_mou__jianxiong-choose"] = "是否选择增减一枚“治世”标记?",
["#joy_mou__jianxiong-getMark"] = "是否增加一枚“治世”标记?",
["#joy_mou__jianxiong-choice"] = "奸雄:请选择要获得的“治世”标记数量。",
["#joy_mou__qingzheng-choose"] = "清正:你可以发动“清正”选择一名有手牌的其他角色",
["#joy_mou__qingzheng-discard"] = "清正:请选择一种花色的所有牌弃置,总共%arg 次 现在是第%arg2 次",
["#joy_mou__qingzheng-throw"] = "清正:弃置其一种花色的所有手牌",
["@joy_mou__jianxiong"] = "治世",
["getMark"] = "增加一枚标记",
["removeMark"] = "减少一枚标记",
}
local joy_godTaishici = General(extension, "joy_godTaishici", "god", 4)
Fk:loadTranslationTable{
["joy_godtaishici"] = "神太史慈",
["#joy_godtaishici"] = "义信天武",
["joy_illustrator:joy_godTaishici"] = "枭瞳",
["~joy_godtaishici"] = "魂归……天地……",
["$joy_godtaishici_win_audio"] = "执此神弓,恭行天罚!",
}
local joy_godtaishici_win = fk.CreateActiveSkill{ name = "godtaishici_win_audio" }
joy_godtaishici_win.package = extension
Fk:addSkill(joy_godtaishici_win)
local joy_dulie = fk.CreateTriggerSkill{
name = "joy_dulie",
events = {fk.TargetConfirming, fk.EnterDying},
anim_type = "defensive",
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if event == fk.TargetConfirming then
return target == player and player:hasSkill(self) and data.card.trueName == "slash"
elseif event == fk.EnterDying then
return target == player and player:hasSkill(self)
end
return false
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TargetConfirming then
local judge = {
who = player,
reason = self.name,
pattern = ".|.|heart",
}
room:judge(judge)
if judge.card.suit == Card.Heart then
AimGroup:cancelTarget(data, player.id)
return true
end
elseif event == fk.EnterDying then
room:recover(player, player:getMark("@@powei_wei"))
end
end,
}
Fk:loadTranslationTable{
["joy_dulie"] = "笃烈",
[":joy_dulie"] = "锁定技,当你成为【杀】的目标时,你判定,若结果为<font color='red'>♥</font>,取消之。",
["$joy_dulie1"] = "素来言出必践,成吾信义昭彰!",
["$joy_dulie2"] = "小信如若不成,大信将以何立?",
}
joy_godTaishici:addSkill(joy_dulie)
local joy_chongwei = fk.CreateTriggerSkill{
name = "joy_chongwei",
events = {fk.GameStart, fk.TurnStart, fk.Damaged},
frequency = Skill.Quest,
mute = true,
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then
return false
end
if event == fk.GameStart then
return true
elseif event == fk.TurnStart then
return target == player or target:getMark("@@chongwei_wei") > 0
elseif event == fk.Damaged then
return target:getMark("@@chongwei_wei") > 0
end
return false
end,
on_cost = function(self, event, target, player, data)
self.cost_data = nil
if event == fk.TurnStart and target:getMark("@@chongwei_wei") > 0 then
local room = player.room
local choices = { "Cancel" }
if target.hp <= player.hp and target ~= player and target:getHandcardNum() > 0 then
table.insert(choices, 1, "joy_chongwei_prey")
end
if table.find(player:getCardIds(Player.Hand), function(id)
return not player:prohibitDiscard(Fk:getCardById(id))
end) then
table.insert(choices, 1, "joy_chongwei_damage")
end
if #choices == 1 then
return false
end
local choice = room:askForChoice(player, choices, self.name)
if choice == "Cancel" then
return false
end
if choice == "joy_chongwei_damage" then
local cardIds = room:askForDiscard(player, 1, 1, false, self.name, true, nil, "#joy_chongwei-damage::" .. target.id, true)
if #cardIds == 0 then
return false
end
self.cost_data = cardIds[1]
else
self.cost_data = choice
end
end
return true
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.GameStart then
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name, 1)
for _, p in ipairs(room:getOtherPlayers(player)) do
room:setPlayerMark(p, "@@chongwei_wei", 1)
end
elseif event == fk.TurnStart then
if target == player then
for _, p in ipairs(room:getAlivePlayers()) do
if p:getMark("@@chongwei_wei") > 0 then
room:removePlayerMark(p, "@@chongwei_wei")
local nextPlayer = p:getNextAlive()
if nextPlayer == player then
nextPlayer = player:getNextAlive()
end
room:addPlayerMark(nextPlayer, "@@chongwei_wei")
end
end
end
if type(self.cost_data) == "number" then
room:notifySkillInvoked(player, self.name, "offensive")
player:broadcastSkillInvoke(self.name, 1)
room:throwCard({ self.cost_data }, self.name, player, player)
room:damage({
from = player,
to = target,
damage = 1,
damageType = fk.NormalDamage,
skillName = self.name,
})
elseif self.cost_data == "joy_chongwei_prey" then
room:notifySkillInvoked(player, self.name, "control")
player:broadcastSkillInvoke(self.name, 1)
local cardId = room:askForCardChosen(player, target, "h", self.name)
room:obtainCard(player, cardId, false, fk.ReasonPrey)
end
elseif event == fk.Damaged then
room:setPlayerMark(target, "@@chongwei_wei", 0)
end
end,
}
Fk:loadTranslationTable{
["joy_chongwei"] = "重围",
[":joy_chongwei"] = "游戏开始时,你令所有其他角色获得“围”标记;回合开始时,你令所有拥有“围”标记的角色将“围”标记移动至下家"..
"(若下家为你,则改为移动至你的下家);有“围”标记的角色受到伤害后,移去其“围”标记;有“围”的角色的回合开始时,你可以选择一项并令"..
"你于本回合内视为处于其攻击范围内:1.弃置一张手牌,对其造成1点伤害;2.若其体力值不大于你,你获得其一张手牌。",
["@@chongwei_wei"] = "围",
["joy_chongwei_damage"] = "弃一张手牌对其造成1点伤害",
["joy_chongwei_prey"] = "获得其1张手牌",
["#joy_chongwei-damage"] = "重围:你可以弃置一张手牌,对 %dest 造成1点伤害",
["$joy_chongwei1"] = "君且城中等候,待吾探敌虚实。",
["$joy_chongwei2"] = "弓马骑射洒热血,突破重围显英豪!",
}
joy_godTaishici:addSkill(joy_chongwei)
local joy_powei = fk.CreateTriggerSkill{
name = "joy_powei",
events = {fk.TurnEnd},
frequency = Skill.Wake,
can_trigger = function(self, event, target, player, data)
if event == fk.TurnEnd then
local room = player.room
local noWeiMark = true
for _, p in ipairs(room:getAllPlayers()) do
if p:getMark("@@powei_wei") > 0 then
noWeiMark = false
break
end
end
if noWeiMark and target == player and player:hasSkill(self) and player:getMark("joy_powei_wake") == 0 then
return true
end
end
return false
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:notifySkillInvoked(player, self.name)
room:doSuperLightbox(player, "joy_powei")
room:handleAddLoseSkills(player, "joy_shenzhuo")
room:setPlayerMark(player, "joy_powei_wake", 1)
local removedWeiMarks = 0
for _, p in ipairs(room:getAllPlayers()) do
if p:getMark("@@powei_wei") == 0 then
removedWeiMarks = removedWeiMarks + 1
end
end
if removedWeiMarks > 0 then
player:drawCards(removedWeiMarks, self.name)
end
end,
}
Fk:loadTranslationTable{
["joy_powei"] = "破围",
[":joy_powei"] = "觉醒技,每回合结束时,若场上没有“围”标记,你获得“神著”(锁定技,回合开始时,你从牌堆获得一张【杀】。你使用非转化且非虚拟的【杀】结算后,选择一项:1.摸一张牌,本回合使用【杀】次数+1;2.摸三张牌,本回合不能再使用【杀】。摸X张牌(X为本轮被移去的“围”标记数)。",
}
joy_godTaishici:addSkill(joy_powei)
local joy_shenzhuo = fk.CreateTriggerSkill{
name = "joy_shenzhuo",
events = {fk.TurnStart, fk.CardUseFinished},
anim_type = "drawcard",
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if event == fk.TurnStart then
-- 回合开始时触发
return target == player and player:hasSkill(self)
elseif event == fk.CardUseFinished then
-- 使用非转化且非虚拟的【杀】后触发
return target == player and player:hasSkill(self) and data.card.trueName == "slash" and not data.card:isVirtual()
end
return false
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnStart then
-- 回合开始时,玩家获得一张【杀】
player:drawCards(1, "slash")
elseif event == fk.CardUseFinished then
-- 使用非转化且非虚拟的【杀】后,选择效果
local choice = room:askForChoice(player, { "shenzhuo_drawOne", "shenzhuo_drawThree" }, self.name)
if choice == "shenzhuo_drawOne" then
player:drawCards(1, self.name)
room:addPlayerMark(player, "shenzhuo-turn") -- 增加【杀】使用次数
else
player:drawCards(3, self.name)
room:setPlayerMark(player, "@shenzhuo_debuff-turn", "shenzhuo_debuff") -- 本回合不能再使用【杀】
end
end
end,
}
Fk:loadTranslationTable{
["joy_shenzhuo"] = "神著",
[":joy_shenzhuo"] = "锁定技,回合开始时,你从牌堆获得一张【杀】。你使用非转化且非虚拟的【杀】结算后,选择一项:1.摸一张牌,本回合使用【杀】次数+1;2.摸三张牌,本回合不能再使用【杀】。",
["joy_shenzhuo_drawOne"] = "摸1张牌,可以继续出杀",
["joy_shenzhuo_drawThree"] = "摸3张牌,本回合不能出杀",
["@shenzhuo_debuff-turn"] = "神著",
["joy_shenzhuo_debuff"] = "不能出杀",
["$joy_shenzhuo1"] = "力引强弓百斤,矢除贯手著棼!",
["$joy_shenzhuo2"] = "箭既已在弦上,吾又岂能不发!",
}
local joy_shenzhuoBuff = fk.CreateTargetModSkill{
name = "#joy_shenzhuo-buff",
residue_func = function(self, player, skill, scope)
if skill.trueName == "slash_skill" and scope == Player.HistoryPhase then
return player:getMark("shenzhuo-turn")
end
end,
}
local joy_shenzhuoDebuff = fk.CreateProhibitSkill{
name = "#joy_shenzhuo_prohibit",
prohibit_use = function(self, player, card)
return player:getMark("@shenzhuo_debuff-turn") ~= 0 and card.trueName == "slash"
end,
}
joy_shenzhuo:addRelatedSkill(joy_shenzhuoBuff)
joy_shenzhuo:addRelatedSkill(joy_shenzhuoDebuff)
joy_godTaishici:addRelatedSkill(joy_shenzhuo)
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化