加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
joy_mou.lua 67.60 KB
一键复制 编辑 原始数据 按行查看 历史
该账号已注销 提交于 2024-03-27 11:50 . 2024/3/26/1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
local extension = Package("joy_mou")
extension.extensionName = "newjoy"
Fk:loadTranslationTable{
["joy_mou"] = "欢乐-谋",
["joy_mou2"] = "欢乐谋",
}
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 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.CreateActiveSkill{
name = "joy_mou__qingzheng",
anim_type = "control",
target_num = 1,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
target_filter = function(self, to_select, selected)
local target = Fk:currentRoom():getPlayerById(to_select)
return #selected == 0 and
not target:isKongcheng() and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.tos[1])
local num = math.max(3 - player:getMark("@joy_mou__jianxiong"),0)
local cards ={}
if num > 0 then
local suits = {"diamond","heart","club","spade"}
local choices = room:askForChoices(player, suits, num, num, self.name, "#joy_mou__qingzheng-choice:::"..num,false)
for _, ch in ipairs(choices) do
for _, c in ipairs(player.player_cards[Player.Hand]) do
local suit = Fk:getCardById(c):getSuitString()
if suit == ch 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
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 }
end
if not player.dead then
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-choice"] = "清正:选择 %arg 个花色并弃置所有对应花色的手牌",
["#joy_mou__qingzheng-discard"] = "清正:请选择一种花色的所有牌弃置,总共%arg 次 现在是第%arg2 次",
["#joy_mou__qingzheng-throw"] = "清正:弃置其一种花色的所有手牌",
["@joy_mou__jianxiong"] = "治世",
["getMark"] = "增加一枚标记",
["removeMark"] = "减少一枚标记",
}
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 zhaoyun = General(extension, "joy_mou__zhaoyun", "shu", 4)
local longdan = fk.CreateViewAsSkill{
name = "joy_mou__longdan",
pattern = ".|.|.|.|.|basic",
prompt = "#joy_mou__longdan",
interaction = function()
local names = {}
for _, id in ipairs(Fk:getAllCardIds()) do
local card = Fk:getCardById(id)
if card.type == Card.TypeBasic and not card.is_derived and
((Fk.currentResponsePattern == nil and card.skill:canUse(Self, card)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(card))) then
table.insertIfNeed(names, card.name)
end
end
if #names == 0 then return end
return UI.ComboBox {choices = names}
end,
card_filter = function(self, to_select, selected)
if #selected == 0 then
return Fk:getCardById(to_select).type == Card.TypeBasic
end
if #selected == 1 then return false end
end,
view_as = function(self, cards)
if not self.interaction.data then return end
if #cards ~= 1 then return end
if not table.find(cards, function(id) return Fk:getCardById(id).type == Card.TypeBasic end) then return end
local card = Fk:cloneCard(self.interaction.data)
card:addSubcards(cards)
card.skillName = self.name
return card
end,
before_use = function(self, player, use)
player.room:removePlayerMark(player,"@joy_mou__longdan",1)
if not player.dead then
player:drawCards(1, self.name)
end
end,
enabled_at_play = function(self, player)
return player:getMark("@joy_mou__longdan") > 0
end,
enabled_at_response = function(self, player, response)
return player:getMark("@joy_mou__longdan") > 0
end,
}
local longdan_trigger = fk.CreateTriggerSkill{
name = "#joy_mou__longdan_trigger",
anim_type = "offensive",
events = {fk.GameStart,fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and player:getMark("@joy_mou__longdan") < 3
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
if player:getMark("@joy_mou__longdan") < 3 and not player.dead then
player.room:addPlayerMark(player,"@joy_mou__longdan",1)
end
end
}
local shilve = fk.CreateTriggerSkill{
name = "joy_mou__shilve",
anim_type = "offensive",
events = {fk.CardUsing, fk.CardResponding},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and (data.card.trueName == "slash" or data.card.name == "jink" ) and
table.find(data.card.skillNames, function(name) return string.find(name, "joy_mou__longdan") end) then
local id
if event == fk.CardUsing then
if data.card.trueName == "slash" then
id = data.tos[1][1]
elseif data.card.name == "jink" then
if data.responseToEvent then
id = data.responseToEvent.from --jink
end
end
elseif event == fk.CardResponding then
if data.responseToEvent then
if data.responseToEvent.from == player.id then
id = data.responseToEvent.to
else
id = data.responseToEvent.from
end
end
end
if id ~= nil then
self.cost_data = id
return true
end
end
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#joy_mou__shilve-invoke::"..self.cost_data)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data)
local choices = U.doStrategy(room, player, to, {"joy__shilve-yanqi","joy__shilve-danzhuang"}, {"joy__shilve-yanqi2","joy__shilve-danzhuang2"}, self.name, 1)
local win = true
if choices[1] == "joy__shilve-yanqi" and choices[2] ~= "joy__shilve-yanqi2" then
player:broadcastSkillInvoke("joy_mou__shilve", 2)
local cards = room:getCardsFromPileByRule(".|.|.|.|.|^basic")
if #cards > 0 and not player.dead then
local get = cards[1]
room:obtainCard(player, get, false, fk.ReasonDraw)
end
elseif choices[1] == "joy__shilve-danzhuang" and choices[2] ~= "joy__shilve-danzhuang2" and player:getMark("@joy_mou__longdan") < 3 then
player:broadcastSkillInvoke("joy_mou__shilve", 3)
room:addPlayerMark(player,"@joy_mou__longdan",1)
else
win = false
player:broadcastSkillInvoke("joy_mou__shilve", 4)
end
end,
}
longdan:addRelatedSkill(longdan_trigger)
zhaoyun:addSkill(longdan)
zhaoyun:addSkill(shilve)
Fk:loadTranslationTable{
["joy_mou__zhaoyun"] = "谋赵云",
["joy_mou__longdan"] = "龙胆",
[":joy_mou__longdan"] = "剩余可用X次(X初始为1且最大为3,每名角色回合结束后X加1),你可以将一张基本牌当做任意基本牌使用或打出,若如此做,你摸一张牌。",
["@joy_mou__longdan"] = "龙胆",
["#joy_mou__longdan_trigger"] = "龙胆",
["#joy_mou__longdan"] = "龙胆:你可以将一张基本牌当任意基本牌使用或打出",
["joy_mou__shilve"] = "识略",
[":joy_mou__shilve"] = "当你发动〖龙胆〗使用或打出【杀】,【闪】时,你可与对方进行谋奕:"..
"<br>①偃旗息鼓:获得一张非基本牌;"..
"<br>②胆壮心雄:增加1次〖龙胆〗次数。",
["#joy_mou__shilve-invoke"] = "是否发动〖识略〗与 %dest 进行谋奕?",
["joy__shilve-yanqi"] = "偃旗息鼓",
[":joy__shilve-yanqi"] = "获得一张非基本牌",
["joy__shilve-danzhuang"] = "胆壮心雄",
[":joy__shilve-danzhuang"] = "增加1次〖龙胆〗次数。",
["joy__shilve-yanqi2"] = "偃旗息鼓",
[":joy__shilve-yanqi2"] = "防止对方获得一张非基本牌",
["joy__shilve-danzhuang2"] = "胆壮心雄",
[":joy__shilve-danzhuang2"] = "防止对方增加1次〖龙胆〗次数。"
}
local lvmeng = General(extension, "joy_mou__lvmeng", "wu", 4)
local duojing = fk.CreateActiveSkill{
name = "joy_mou__duojing",
anim_type = "control",
card_num = 0,
min_target_num = 1,
max_target_num = 1,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) < 2
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected)
return to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.tos[1])
local choices = U.doStrategy(room, player, to, {"joy__duojing-xiuyang","joy__duojing-baiyi"}, {"joy__duojing-xiuyang2","joy__duojing-baiyi2"}, self.name, 1)
local win = true
if choices[1] == "joy__duojing-xiuyang" and choices[2] ~= "joy__duojing-xiuyang2" then
player:broadcastSkillInvoke("joy_mou__shilve", 2)
if not to:isNude() then
room:doIndicate(player.id, {to.id})
local card = room:askForCardChosen(player, to, "he", self.name)
room:obtainCard(player, card, false, fk.ReasonPrey)
end
if not player.dead then
player.room:recover({
who = player,
num = 1,
recoverBy = player,
skillName = self.name
})
end
local n = player.maxHp - player.hp
if not player.dead and n > 0 and room:askForSkillInvoke(player,self.name,".","#joy_mou__duojing-zhiheng:::"..n) then
player:drawCards(n,self.name)
if not player.dead then
room:askForDiscard(player,n,n)
end
end
elseif choices[1] == "joy__duojing-baiyi" and choices[2] ~= "joy__duojing-baiyi2" then
room:addPlayerMark(to, fk.MarkArmorNullified)
room:useVirtualCard("slash", nil, player, to, self.name,true)
room:removePlayerMark(to, fk.MarkArmorNullified)
room:addPlayerMark(player, MarkEnum.SlashResidue.."-turn")
room:setPlayerMark(player,"joy__keji-turn",1)
end
end,
}
lvmeng:addSkill("joy__keji")
lvmeng:addSkill(duojing)
Fk:loadTranslationTable{
["joy_mou__lvmeng"] = "谋吕蒙",
["joy_mou__duojing"] = "夺荆",
[":joy_mou__duojing"] = "出牌阶段限两次,你可以与一名其他角色进行“谋弈”:"..
"<br>①休养生息:获得目标角色一张牌并回复一点体力,然后你可以摸X张牌,并弃置等量的牌。(X为已损失体力值)"..
"<br>②白衣渡江:视为对目标使用一张不计次数且无视距离和防具的【杀】,然后本回合可额外使用一次【杀】,且使用或打出过的【杀】不影响〖克己〗。",
["joy__duojing-xiuyang"] = "休养生息",
[":joy__duojing-xiuyang"] = "获得目标角色一张牌并回复一点体力,然后你可以摸X张牌,并弃置等量的牌。(X为已损失体力值)",
["joy__duojing-baiyi"] = "白衣渡江",
[":joy__duojing-baiyi"] = "视为对目标使用一张不计次数且无视距离和防具的【杀】,然后本回合可额外使用一次【杀】,且使用或打出过的【杀】不影响〖克己〗。",
["joy__duojing-xiuyang2"] = "休养生息",
[":joy__duojing-xiuyang2"] = "防止对方获得你的一张牌并回复一点体力,然后其可以摸X张牌,并弃置等量的牌。(X为已损失体力值)",
["joy__duojing-baiyi2"] = "白衣渡江",
[":joy__duojing-baiyi2"] = "视为对方对你使用一张不计次数且无视距离和防具的【杀】,然后其本回合可额外使用一次【杀】,且使用或打出过的【杀】不影响〖克己〗。",
["#joy_mou__duojing-zhiheng"] = "夺荆:你可以摸 %arg 张牌,然后弃置等量张牌",
}
local mouyuanshao = General(extension, "joy_mou__yuanshao", "qun", 4)
local mou__luanji = fk.CreateViewAsSkill{
name = "joy_mou__luanji",
anim_type = "offensive",
pattern = "archery_attack",
prompt = "#mou__luanji-viewas",
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected)
return #selected < 2 and Fk:currentRoom():getCardArea(to_select) ~= Player.Equip
end,
view_as = function(self, cards)
if #cards == 2 then
local archery_attack = Fk:cloneCard("archery_attack")
archery_attack:addSubcards(cards)
return archery_attack
end
end,
}
local mou__luanji_trigger = fk.CreateTriggerSkill{
name = "#joy_mou__luanji_trigger",
anim_type = "drawcard",
events = {fk.CardResponding,fk.Damage},
can_trigger = function(self, event, target, player, data)
if event == fk.CardResponding and player:hasSkill(mou__luanji) and player:getMark("joy_mou__luanjidraw-turn") < 3 and data.card.name == "jink" then
return data.responseToEvent and
data.responseToEvent.card.name =="archery_attack"
elseif player:hasSkill(mou__luanji) and player:getMark("joy_mou__luanjidiscard-turn") < 3 and data.card then
return target == player and
data.card.name =="archery_attack" and not data.to.dead and not data.to:isNude()
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.CardResponding then return true end
local room = player.room
return room:askForSkillInvoke(player,self.name,".","#joy_mou__luanjidiscard::"..data.to.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.CardResponding and not player.dead then
player:broadcastSkillInvoke(mou__luanji.name)
player:drawCards(1, self.name)
room:addPlayerMark(player,"joy_mou__luanjidraw-turn",1)
else
local card = room:askForCardChosen(player,data.to,"he",self.name,"#joy_mou__luanjidiscardchosen")
if card > 0 then
room:throwCard(card,self.name,data.to,player)
room:addPlayerMark(player,"joy_mou__luanjidiscard-turn",1)
end
end
end,
}
local mou__xueyi = fk.CreateTriggerSkill{
name = "joy_mou__xueyi$",
anim_type = "drawcard",
events = {fk.TargetSpecified},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target == player and player:usedSkillTimes(self.name) < 2 and
data.to ~= player.id and player.room:getPlayerById(data.to).kingdom == "qun"
end,
on_use = function(self, event, target, player, data)
player:drawCards(1, self.name)
end,
}
local mou__xueyi_maxcards = fk.CreateMaxCardsSkill{
name = "#joy_mou__xueyi_maxcards",
correct_func = function(self, player)
if player:hasSkill(mou__xueyi) then
local hmax = 0
for _, p in ipairs(Fk:currentRoom().alive_players) do
if p.kingdom == "qun" then
hmax = hmax + 1
end
end
return hmax *2
else
return 0
end
end,
}
mou__luanji:addRelatedSkill(mou__luanji_trigger)
mou__xueyi:addRelatedSkill(mou__xueyi_maxcards)
mouyuanshao:addSkill(mou__luanji)
mouyuanshao:addSkill(mou__xueyi)
Fk:loadTranslationTable{
["joy_mou__yuanshao"] = "谋袁绍",
["joy_mou__luanji"] = "乱击",
[":joy_mou__luanji"] = "出牌阶段限一次,你可以将两张手牌当【万箭齐发】使用;"..
"<br>当其他角色打出【闪】响应【万箭齐发】时,你摸一张牌(每回合你以此法至多获得三张牌)。"..
"<br>当有角色受到你的【万箭齐发】造成的伤害后,你可以弃置其一张牌(每回合限3次)。",
["joy_mou__xueyi"] = "血裔",
[":joy_mou__xueyi"] = "主公技,锁定技,你的手牌上限+2X(X为群势力角色数);"..
"当你使用牌指定其他群势力角色为目标后,你摸一张牌(每回合你以此法至多获得两张牌)。",
["#joy_mou__luanjidiscard"] = "乱击:你可以弃置 %dest 一张牌",
["#joy_mou__luanjidiscardchosen"] = "乱击:选择一张牌弃置之",
["#joy_mou__luanji_trigger"] = "乱击",
["$joy_mou__luanji1"] = " ",
["$joy_mou__luanji2"] = " ",
["$joy_mou__xueyi1"] = " ",
["$joy_mou__xueyi2"] = " ",
["~joy_mou__yuanshao"] = " ",
}
local mouyujin = General(extension, "joy_mou__yujin", "wei", 4)
local jieyue = fk.CreateTriggerSkill{
name = "joy_mou__jieyue",
anim_type = "control",
events = {fk.EventPhaseStart},
can_trigger = function (self, event, target, player, data)
return player:hasSkill(self) and target == player and player.phase == Player.Start
end,
on_cost = function(self, event, target, player, data)
local _, dat = player.room:askForUseActiveSkill(player, "joy_mou__jieyue_active", "#joy_mou__jieyue-invoke", true)
if dat then
self.cost_data = dat
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local targetid = self.cost_data.targets
local choice = self.cost_data.interaction
local junling = false
local target = room:getPlayerById(targetid[1])
if not target.dead then
room:drawCards(target,1,self.name)
end
if target.dead or player.dead then return false end
if choice == "joy__jieyue1" then
local to = room:askForChoosePlayers(player,table.map(room.alive_players, Util.IdMapper),1,1,"#joy__jieyue1-choose",self.name,false)
if #to > 0 then
if room:askForSkillInvoke(target,self.name,data,"#joy__junling1::"..to[1]) then
room:damage({
from = target,
to = room:getPlayerById(to[1]),
damage = 1,
skillName = self.name,
})
junling = true
end
end
elseif choice == "joy__jieyue2" then
if room:askForSkillInvoke(target,self.name,data,"#joy__junling2") then
local cards1 = target.player_cards[Player.Hand]
local cards2 = target.player_cards[Player.Equip]
if #cards1 > 0 then
room:throwCard(table.random(cards1),self.name,target)
end
if #cards2 > 0 then
room:throwCard(table.random(cards2),self.name,target)
end
junling = true
end
elseif choice == "joy__jieyue3" then
if room:askForSkillInvoke(target,self.name,data,"#joy__junling3") then
room:setPlayerMark(target,"@@joy__jieyuerecover-turn",1)
junling = true
end
elseif choice == "joy__jieyue4" then
if room:askForSkillInvoke(target,self.name,data,"#joy__junling4") then
room:setPlayerMark(target,"@@joy__jieyuecard-turn",1)
room:addPlayerMark(target, MarkEnum.UncompulsoryInvalidity .. "-turn")
junling = true
end
end
if not junling and not player.dead then
player:drawCards(3,self.name)
room:setPlayerMark(target,"@@joy__jieyuedamage-turn",1)
elseif not player.dead then
player:drawCards(1,self.name)
end
end,
}
local jieyue_active = fk.CreateActiveSkill{
name = "joy_mou__jieyue_active",
card_num = 0,
target_num = 1,
interaction = function()
return UI.ComboBox {choices = {"joy__jieyue1","joy__jieyue2","joy__jieyue3","joy__jieyue4"}}
end,
card_filter = Util.FalseFunc,
target_filter = function (self,to_select)
return to_select ~= Self.id
end
}
local jieyue_trigger = fk.CreateTriggerSkill{
name = "#joy_mou__jieyue_trigger",
mute = true,
events = {fk.PreHpRecover,fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if event == fk.PreHpRecover then
return player == target and target:getMark("@@joy__jieyuerecover-turn") > 0
elseif event == fk.DamageInflicted then
return player == target and target:getMark("@@joy__jieyuedamage-turn") > 0
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
if event == fk.PreHpRecover then
return true
elseif event == fk.DamageInflicted then
data.damage = data.damage + 1
end
end,
}
local jieyue_prohibit = fk.CreateProhibitSkill{
name = "#joy__jieyue_prohibit",
prohibit_use = function(self, player, card)
if player:getMark("@@joy__jieyuecard-turn") > 0 then
local cardlist = Card:getIdList(card)
return #cardlist > 0 and table.every(cardlist, function(id)
return table.contains(player:getCardIds(Player.Hand), id)
end)
end
end,
prohibit_response = function(self, player, card)
if player:getMark("@@joy__jieyuecard-turn") > 0 then
local cardlist = Card:getIdList(card)
return #cardlist > 0 and table.every(cardlist, function(id)
return table.contains(player:getCardIds(Player.Hand), id)
end)
end
end,
}
local xiayuan = fk.CreateTriggerSkill{
name = "joy_mou__xiayuan",
anim_type = "support",
events = {fk.EnterDying},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target ~= player and not player:isNude() and
player:usedSkillTimes(self.name, Player.HistoryRound) == 0
end,
on_cost = function(self, event, target, player, data)
local cards = player.room:askForDiscard(player, 1, 2, true, self.name, true, ".", "#joy_mou__xiayuan-invoke::"..target.id)
if #cards > 0 then
self.cost_data = #cards
return true
end
end,
on_use = function(self, event, target, player, data)
local n = self.cost_data
if target:isWounded() then
player.room:recover({
who = target,
num = math.min(target.maxHp - target.hp,n),
recoverBy = player,
skillName = self.name
})
end
end,
}
jieyue:addRelatedSkill(jieyue_trigger)
jieyue:addRelatedSkill(jieyue_prohibit)
Fk:addSkill(jieyue_active)
mouyujin:addSkill(jieyue)
mouyujin:addSkill(xiayuan)
Fk:loadTranslationTable{
["joy_mou__yujin"] = "谋于禁",
["joy_mou__jieyue"] = "节钺",
[":joy_mou__jieyue"] = "准备阶段,你可以令一名其他角色摸一张牌,然后令其执行一次“军令”。"..
"<br>若其执行,你摸一张牌;"..
"<br>若其不执行,你摸三张牌,然后其本回合受到的伤害+1."..
"<font color='grey'><br><b>军令一:</b>对你指定的一名角色造成1点伤害。<br><b>军令二:</b>随机弃置一张手牌和一张装备牌。<br><b>军令三:</b>本回合不能恢复体力。<br><b>军令四:</b>本回合不能使用或打出手牌且所有非锁定技失效。",
["joy_mou__xiayuan"] = "狭援",
[":joy_mou__xiayuan"] = "每轮限一次,其他角色濒死时,你可以弃置至多两张牌,令其回复等同于弃置牌数的体力。",
["joy_mou__jieyue_active"] = "军令",
["#joy_mou__jieyue-invoke"] = "节钺:你可以令一名其他角色选择是否执行军令",
["#joy__jieyue1-choose"] = "军令一:选择你想让执行军令角色造成伤害的目标。",
["joy__jieyue1"] = "军令一:对你指定的一名角色造成1点伤害。",
["joy__jieyue2"] = "军令二:随机弃置一张手牌和一张装备牌。",
["joy__jieyue3"] = "军令三:本回合不能恢复体力。",
["joy__jieyue4"] = "军令四:本回合不能使用或打出手牌且所有非锁定技失效。",
["#joy__junling1"] = "是否执行军令:对 %dest 造成1点伤害",
["#joy__junling2"] = "是否执行军令:随机弃置一张手牌和装备牌 ",
["#joy__junling3"] = "是否执行军令:本回合不能恢复体力",
["#joy__junling4"] = "是否执行军令:本回合不能使用或打出手牌且所有非锁定技失效 ",
["#joy_mou__xiayuan-invoke"] = "狭援:你可以弃置至多两张牌,令 %dest 回复等同于弃置数的体力",
["#joy_mou__jieyue_trigger"] = "节钺",
["#joy__jieyue_prohibit"] = "节钺",
["@@joy__jieyuerecover-turn"] = "军令三",
["@@joy__jieyuecard-turn"] = "军令四",
["@@joy__jieyuedamage-turn"] = "受伤+1",
}
local mou__xuhuang = General:new(extension, "joy_mou__xuhuang", "wei", 4, 4)
local mou__duanliang = fk.CreateActiveSkill{
name = "joy_mou__duanliang",
anim_type = "control",
mute = true,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) < 2
end,
card_num = 0,
card_filter = function() return false end,
target_num = 1,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.tos[1])
local id1
if not player.dead then
id1 = player:drawCards(1,self.name)
end
room:notifySkillInvoked(player, self.name)
player:broadcastSkillInvoke(self.name, 1)
local choices = U.doStrategy(room, player, to, {"mou__duanliang-weicheng","mou__duanliang-jinjun"}, {"mou__duanliang-tuji","mou__duanliang-shoucheng"}, self.name, 1)
if choices[1] == "mou__duanliang-weicheng" and choices[2] ~= "mou__duanliang-tuji" then
player:broadcastSkillInvoke(self.name, 2)
local use
if #id1 > 0 and table.every(id1, function(id) return table.contains(player:getCardIds("h"), id) end) then
local card = Fk:cloneCard("supply_shortage")
card.skillName = self.name
card:addSubcard(id1[1])
if U.canUseCardTo(room, player, to, card, false) then
room:useVirtualCard("supply_shortage", {id1[1]}, player, to, self.name, true)
use = true
end
end
if not use and not to:isNude() then
local id = room:askForCardChosen(player, to, "he", self.name)
room:obtainCard(player, id, false, fk.ReasonPrey)
end
elseif choices[1] == "mou__duanliang-jinjun" and choices[2] ~= "mou__duanliang-shoucheng" then
player:broadcastSkillInvoke(self.name, 3)
room:useVirtualCard("duel", nil, player, to, self.name)
else
player:broadcastSkillInvoke(self.name, 4)
end
end,
}
mou__xuhuang:addSkill(mou__duanliang)
local mou__shipo = fk.CreateTriggerSkill{
name = "joy_mou__shipo",
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.Finish then
return table.find(player.room:getOtherPlayers(player), function (p) return p.hp < player.hp or p:hasDelayedTrick("supply_shortage") end)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local targets1 = table.filter(player.room.alive_players, function (p) return p.hp < player.hp end)
local targets2 = table.filter(player.room:getOtherPlayers(player), function (p) return p:hasDelayedTrick("supply_shortage") end)
local choices = {}
if #targets1 > 0 then table.insert(choices, "mou__shipo_choice1") end
if #targets2 > 0 then table.insert(choices, "mou__shipo_choice2") end
local choice = room:askForChoice(player, choices, self.name, "#mou__shipo-choose")
local targets = {}
if choice == "mou__shipo_choice2" then
targets = targets2
else
local tos = room:askForChoosePlayers(player, table.map(targets1, Util.IdMapper), 1, 1, "#mou__shipo-choose", self.name, false)
targets = {room:getPlayerById(tos[1])}
end
for _, to in ipairs(targets) do
if player.dead then break end
local card = room:askForCard(to, 1, 1, false, self.name, true, ".", "#mou__shipo-give::"..player.id)
if #card > 0 then
local get = card[1]
room:obtainCard(player, get, false, fk.ReasonGive)
if room:getCardArea(get) == Card.PlayerHand and room:getCardOwner(get) == player then
local tos = room:askForChoosePlayers(player, table.map(room:getOtherPlayers(player), Util.IdMapper), 1, 1, "#mou__shipo-present:::"..Fk:getCardById(get):toLogString(), self.name, true)
if #tos > 0 then
room:obtainCard(tos[1], get, false, fk.ReasonGive)
end
end
else
room:damage { from = player, to = to, damage = 1, skillName = self.name }
end
end
end,
}
mou__xuhuang:addSkill(mou__shipo)
Fk:loadTranslationTable{
["joy_mou__xuhuang"] = "谋徐晃",
["joy_mou__duanliang"] = "断粮",
[":joy_mou__duanliang"] = "出牌阶段限两次,你可以摸一张牌并与一名其他角色进行一次“谋弈”:<br>围城断粮,你将此牌当做无距离限制的【兵粮寸断】对其使用,若无法使用改为你获得其一张牌;<br>擂鼓进军,你视为对其使用一张【决斗】。",
["joy_mou__shipo"] = "势迫",
[":joy_mou__shipo"] = "结束阶段,你可以令一名体力值小于你的角色或所有判定区里有【兵粮寸断】的其他角色选择一项:1.交给你一张手牌,且你可以将此牌交给一名其他角色;2.受到1点伤害。",
["$joy_mou__duanliang1"] = " ",
["$joy_mou__duanliang2"] = " ",
["$joy_mou__duanliang3"] = " ",
["$joy_mou__duanliang4"] = " ",
["$joy_mou__shipo1"] = " ",
["$joy_mou__shipo2"] = " ",
["~joy_mou__xuhuang"] = " ",
}
local joymou__simayi = General(extension, "joy_mou__simayi", "wei", 3)
local pingliao = fk.CreateTriggerSkill{
name = "joy__pingliao",
anim_type = "control",
events = {fk.CardUsing},
can_trigger = function(self, event, target, player, data)
return player == target and player:hasSkill(self) and data.card.trueName == "slash"
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local targets = table.filter(room:getAlivePlayers(), function (p)
return player:inMyAttackRange(p)
end)
room:doIndicate(player.id, table.map(targets, Util.IdMapper))
local tos = TargetGroup:getRealTargets(data.tos)
local drawcard = false
local targets2 = {}
for _, p in ipairs(targets) do
local card = room:askForResponse(p, self.name, ".|.|heart,diamond|.|.|basic", "#joy__pingliao-ask:" .. player.id, true)
if card then
room:responseCard{
from = p.id,
card = card
}
if not table.contains(tos, p.id) then
drawcard = true
end
elseif table.contains(tos, p.id) then
table.insert(targets2, p)
end
end
for _, p in ipairs(targets2) do
room:setPlayerMark(p, "@@joy__pingliao-turn", 1)
end
if player.dead then return false end
if drawcard then
player:drawCards(2, self.name)
room:addPlayerMark(player, MarkEnum.SlashResidue .. "-phase")
end
end,
}
local pingliao_prohibit = fk.CreateProhibitSkill{
name = "#joy__pingliao_prohibit",
prohibit_use = function(self, player, card)
if player:getMark("@@joy__pingliao-turn") > 0 then
local subcards = card:isVirtual() and card.subcards or {card.id}
return #subcards > 0 and table.every(subcards, function(id)
return table.contains(player:getCardIds(Player.Hand), id)
end)
end
end,
prohibit_response = function(self, player, card)
if player:getMark("@@joy__pingliao-turn") > 0 then
local subcards = card:isVirtual() and card.subcards or {card.id}
return #subcards > 0 and table.every(subcards, function(id)
return table.contains(player:getCardIds(Player.Hand), id)
end)
end
end,
}
local quanmou = fk.CreateActiveSkill{
name = "joy__quanmou",
anim_type = "switch",
switch_skill_name = "joy__quanmou",
card_num = 0,
target_num = 1,
prompt = function ()
return Self:getSwitchSkillState("joy__quanmou", false) == fk.SwitchYang and "#joy__quanmou-Yang" or "#joy__quanmou-Yin"
end,
can_use = Util.TrueFunc,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected, selected_cards)
if #selected == 0 and not table.contains(U.getMark(Self, "joy__quanmou_targets-phase"), to_select) then
local target = Fk:currentRoom():getPlayerById(to_select)
return not target:isNude() and Self:inMyAttackRange(target)
end
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local mark = U.getMark(player, "joy__quanmou_targets-phase")
table.insert(mark, target.id)
room:setPlayerMark(player, "joy__quanmou_targets-phase", mark)
local isYang = player:getSwitchSkillState(self.name, true) == fk.SwitchYang
local from_name = "joy_mou__simayi"
local to_name = "joy_mou__simayi"
if isYang then
to_name = "joy_mou2__simayi"
else
from_name = "joy_mou2__simayi"
end
if player.general == from_name then
player.general = to_name
room:broadcastProperty(player, "general")
end
if player.deputyGeneral == from_name then
player.deputyGeneral = to_name
room:broadcastProperty(player, "deputyGeneral")
end
local card = room:askForCard(target, 1, 1, true, self.name, false, ".", "#joy__quanmou-give::"..player.id)
room:obtainCard(player.id, card[1], false, fk.ReasonGive, target.id)
if player.dead or target.dead then return false end
room:setPlayerMark(target, "@joy__quanmou-phase", isYang and "yang" or "yin")
local mark_name = "joy__quanmou_" .. (isYang and "yang" or "yin") .. "-phase"
mark = U.getMark(player, mark_name)
table.insert(mark, target.id)
room:setPlayerMark(player, mark_name, mark)
end,
}
local quanmou_delay = fk.CreateTriggerSkill{
name = "#joy__quanmou_delay",
events = {fk.DamageCaused, fk.Damage,fk.GameStart},
mute = true,
can_trigger = function(self, event, target, player, data)
local isYang = player:getSwitchSkillState(self.name, false) == fk.SwitchYang
if event == fk.GameStart and ((isYang and player.general == "joy_mou2__simayi") or (not isYang and player.general == "joy_mou__simayi")) then return true end
if player.dead or player.phase ~= Player.Play or player ~= target then return false end
if event == fk.DamageCaused then
return table.contains(U.getMark(player, "joy__quanmou_yang-phase"), data.to.id)
elseif event == fk.Damage then
return table.contains(U.getMark(player, "joy__quanmou_yin-phase"), data.to.id)
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.GameStart then
local isYang = player:getSwitchSkillState(self.name, false) == fk.SwitchYang
local from_name = "joy_mou2__simayi"
local to_name = "joy_mou2__simayi"
if isYang then
to_name = "joy_mou__simayi"
else
from_name = "joy_mou__simayi"
end
if player.general == from_name then
player:broadcastSkillInvoke("joy__quanmou")
room:notifySkillInvoked(player, "joy__quanmou")
player.general = to_name
room:broadcastProperty(player, "general")
end
if player.deputyGeneral == from_name then
player:broadcastSkillInvoke("joy__quanmou")
room:notifySkillInvoked(player, "joy__quanmou")
player.deputyGeneral = to_name
room:broadcastProperty(player, "deputyGeneral")
end
else
room:doIndicate(player.id, {data.to.id})
room:setPlayerMark(data.to, "@joy__quanmou-phase", 0)
if event == fk.DamageCaused then
local mark = U.getMark(player, "joy__quanmou_yang-phase")
table.removeOne(mark, data.to.id)
room:setPlayerMark(player, "joy__quanmou_yang-phase", mark)
room:notifySkillInvoked(player, "joy__quanmou", "defensive")
if player:getSwitchSkillState("joy__quanmou", false) == fk.SwitchYang then
player:broadcastSkillInvoke("joy__quanmou")
end
return true
elseif event == fk.Damage then
local mark = U.getMark(player, "joy__quanmou_yin-phase")
table.removeOne(mark, data.to.id)
room:setPlayerMark(player, "joy__quanmou_yin-phase", mark)
room:notifySkillInvoked(player, "joy__quanmou", "offensive")
if player:getSwitchSkillState("joy__quanmou", false) == fk.SwitchYin then
player:broadcastSkillInvoke("joy__quanmou")
end
local targets = table.filter(room.alive_players, function (p)
return p ~= player and p ~= data.to
end)
if #targets == 0 then return false end
targets = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 3, "#joy__quanmou-damage", "joy__quanmou")
if #targets == 0 then return false end
room:sortPlayersByAction(targets)
for _, id in ipairs(targets) do
local p = room:getPlayerById(id)
if not p.dead then
room:damage{
from = player,
to = p,
damage = 1,
skillName = "joy__quanmou",
}
end
end
end
end
end,
}
pingliao:addRelatedSkill(pingliao_prohibit)
quanmou:addRelatedSkill(quanmou_delay)
joymou__simayi:addSkill(pingliao)
joymou__simayi:addSkill(quanmou)
local joymou2__simayi = General(extension, "joy_mou2__simayi", "wei", 3)
joymou2__simayi.hidden = true
joymou2__simayi:addSkill("joy__pingliao")
joymou2__simayi:addSkill("joy__quanmou")
Fk:loadTranslationTable{
["joy_mou__simayi"] = "谋司马懿",
["#joy_mou__simayi"] = "韬谋韫势",
["joy__pingliao"] = "平辽",
[":joy__pingliao"] = "锁定技,<font color='red'>当你使用【杀】指定目标时,不公开指定的目标(暂时无法生效)。</font>"..
"你攻击范围内的其他角色依次选择是否打出一张红色基本牌。"..
"若此【杀】的目标未打出基本牌,其本回合无法使用或打出手牌;若有至少一名非目标打出基本牌,你摸两张牌且此阶段使用【杀】的次数上限+1。",
["joy__quanmou"] = "权谋",
[":joy__quanmou"] = "转换技,出牌阶段每名角色限一次,你可以令攻击范围内的一名其他角色交给你一张牌,"..
"阳:防止你此阶段下次对其造成的伤害;阴:你此阶段下次对其造成伤害后,可以对至多三名该角色外的其他角色各造成1点伤害。",
["#joy__pingliao-ask"] = "平辽:%src 使用了一张【杀】,你可以打出一张红色基本牌",
["@@joy__pingliao-turn"] = "平辽",
["#joy__quanmou-Yang"] = "发动 权谋(阳),选择攻击范围内的一名角色",
["#joy__quanmou-Yin"] = "发动 权谋(阴),选择攻击范围内的一名角色",
["#joy__quanmou-give"] = "权谋:选择一张牌交给 %dest ",
["@joy__quanmou-phase"] = "权谋",
["#joy__quanmou_delay"] = "权谋",
["#joy__quanmou-damage"] = "权谋:你可以选择1-3名角色,对这些角色各造成1点伤害",
--阳形态
["$joy__pingliao1"] = "烽烟起大荒,戎军远役,问不臣者谁?",
["$joy__pingliao2"] = "挥斥千军之贲,长驱万里之远。",
["$joy__quanmou1"] = "洛水为誓,皇天为证,吾意不在刀兵。",
["$joy__quanmou2"] = "以谋代战,攻形不以力,攻心不以勇。",
["~joy_mou__simayi"] = "以权谋而立者,必失大义于千秋……",
--阴形态
["joy_mou2__simayi"] = "谋司马懿",
["#joy_mou2__simayi"] = "韬谋韫势",
["$joy__pingliao_joy_mou2__simayi1"] = "率土之滨皆为王臣,辽土亦居普天之下。",
["$joy__pingliao_joy_mou2__simayi2"] = "青云远上,寒锋试刃,北雁当寄红翎。",
["$joy__quanmou_joy_mou2__simayi1"] = "鸿门之宴虽歇,会稽之胆尚悬,孤岂姬、项之辈?",
["$joy__quanmou_joy_mou2__simayi2"] = "昔藏青锋于沧海,今潮落,可现兵!",
["~joy_mou2__simayi"] = "人立中流,非已力可向,实大势所迫……",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化