加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fengqi_standard.lua 117.21 KB
一键复制 编辑 原始数据 按行查看 历史
RalphR 提交于 2024-12-24 09:46 . 合法性判断还是有问题
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039
local extension = Package("fengqi_standard")
extension.extensionName = "aaa_fengqi"
local U = require "packages/utility/utility"
--local RUtil = require "packages/rfenghou/utility/rfenghou_util"
Fk:loadTranslationTable{
["fengqi_standard"] = "标准",
}
local caocao = General(extension, "efengqi__caocao", "wei", 4)
local efengqi__jianxiong_card_skill = fk.CreateActiveSkill{
name = "efengqi__jianxiong_card_skill",
target_num = 1,
mod_target_filter = function(_, to_select, _, _, _, _)
return true
end,
target_filter = function(self, to_select, selected, _, card)
if #selected < self:getMaxTargetNum(Self, card) then
return self:modTargetFilter(to_select, selected, Self.id, card)
end
end,
on_effect = function(self, room, effect)
local from = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.to)
if not to.dead then
room:damage({
from = from,
to = to,
card = effect.card,
damage = 1,
skillName = Fk:cloneCard(effect.card.name).skill.name
})
end
end,
}
efengqi__jianxiong_card_skill.cardSkill = true
local jianxiong = fk.CreateTriggerSkill{
name = "efengqi__jianxiong",
anim_type = "masochism",
events = {fk.Damaged, fk.TargetConfirmed},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event == fk.Damaged then return true end
return data.from and data.from ~= player.id and data.card:isCommonTrick()
end
end,
on_cost = function (self, event, target, player, data)
if event == fk.Damaged then
return player.room:askForSkillInvoke(player, self.name, data, "#efengqi__jianxiong-get")
else
return player.room:askForSkillInvoke(player, self.name, data, "#efengqi__jianxiong-trick:::"..data.card:toLogString())
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.Damaged then
if data.card and U.hasFullRealCard(room, data.card) then
room:obtainCard(player.id, data.card, true, fk.ReasonJustMove)
end
if not player.dead then
player:drawCards(1, self.name)
end
else
data.extra_data = data.extra_data or {}
data.extra_data.efengqi__jianxiongTos = data.extra_data.efengqi__jianxiongTos or {}
table.insertIfNeed(data.extra_data.efengqi__jianxiongTos, player.id)
end
end,
refresh_events = {fk.PreCardEffect},
can_refresh = function(self, event, target, player, data)
return data.to == player.id and
data.extra_data and data.extra_data.efengqi__jianxiongTos and table.contains(data.extra_data.efengqi__jianxiongTos, data.to)
end,
on_refresh = function(self, event, target, player, data)
local card = data.card:clone()
local c = table.simpleClone(data.card)
for k, v in pairs(c) do
card[k] = v
end
card.skill = efengqi__jianxiong_card_skill
data.card = card
end,
}
caocao:addSkill(jianxiong)
local zhujiu = fk.CreateTriggerSkill{
name = "efengqi__zhujiu",
anim_type = "support",
events = {fk.TurnStart},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
return not player:isNude() and table.find(player.room.alive_players, function (p) return p.hp == 1 end)
end
end,
on_cost = function (self, event, target, player, data)
local _,dat = player.room:askForUseActiveSkill(player, "efengqi__zhujiu_active", "#efengqi__zhujiu", true)
if dat then
player.room:sortPlayersByAction(dat.targets)
self.cost_data = {tos = dat.targets, cards = dat.cards}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:throwCard(self.cost_data.cards, self.name, player, player)
for _, to in ipairs(table.map(self.cost_data.tos, Util.Id2PlayerMapper)) do
if not to.dead then
room:recover { num = 1, skillName = self.name, who = to, recoverBy = player }
end
end
end,
}
caocao:addSkill(zhujiu)
local zhujiu_active = fk.CreateActiveSkill{
name = "efengqi__zhujiu_active",
min_target_num = 1,
card_filter = function(self, to_select, selected)
return Fk:getCardById(to_select).suit == Card.Club and not Self:prohibitDiscard(Fk:getCardById(to_select))
end,
target_filter = function(self, to_select, selected, selected_cards)
local to = Fk:currentRoom():getPlayerById(to_select)
return #selected < #selected_cards and to.hp == 1 and to:isWounded()
end,
}
Fk:addSkill(zhujiu_active)
local weiwu = fk.CreateTriggerSkill{
name = "efengqi__weiwu$",
events = {fk.TurnEnd},
on_use = function(self, event, target, player, data)
local room = player.room
local skills = room:getTag("efengqi__weiwu_skills")
if skills == nil then
skills = {}
for _, gname in ipairs(Fk.lords) do
local g = Fk.generals[gname]
if Fk:canUseGeneral(gname) then
for _, s in ipairs(g:getSkillNameList(true)) do
if Fk.skills[s].lordSkill then
table.insert(skills, s)
end
end
end
end
room:setTag("efengqi__weiwu_skills", skills)
end
skills = table.filter(skills, function(s) return not player:hasSkill(s, true) end)
if #skills == 0 or room:askForChoice(player, {"#efengqi__weiwu_lord", "#efengqi__weiwu_change"}, self.name) == "#efengqi__weiwu_change" then
local p = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper),
1, 1, "#efengqi__weiwu-choose", self.name, false)[1]
local victim = room:getPlayerById(p)
local kingdoms = table.simpleClone(Fk.kingdoms)
table.removeOne(kingdoms, victim.kingdom)
local choice = room:askForChoice(player, kingdoms, self.name, nil, false, Fk.kingdoms)
room:changeKingdom(victim, choice, true)
else
local result = room:askForChoice(player, table.random(skills, 3), self.name, nil, true)
room:handleAddLoseSkills(player, result)
end
end,
}
caocao:addSkill(weiwu)
Fk:loadTranslationTable{
["efengqi__caocao"] = "曹操",
["#efengqi__caocao"] = "魏武帝",
["designer:efengqi__caocao"] = "伶伶",
["illustrator:efengqi__caocao"] = "",
["efengqi__jianxiong"] = "奸雄",
[":efengqi__jianxiong"] = "当你受到伤害后,你可以获得对你造成伤害的牌并摸一张牌。当你成为其他角色的普通锦囊牌的目标后,你可以将效果改为对你造成1点伤害。",
["#efengqi__jianxiong-get"] = "奸雄:你可以获得对你造成伤害的牌并摸一张牌",
["#efengqi__jianxiong-trick"] = "奸雄:你可以将%arg对你效果改为造成1点伤害",
["efengqi__zhujiu"] = "煮酒",
[":efengqi__zhujiu"] = "回合开始时,你可以弃置任意张♣牌,令等量名体力为1的角色各回复1点体力。",
["#efengqi__zhujiu"] = "煮酒:你可以弃置任意张♣牌,令等量名体力为1的角色各回复1点体力",
["efengqi__zhujiu_active"] = "煮酒",
["efengqi__weiwu"] = "魏武",
[":efengqi__weiwu"] = "主公技,回合结束时,你可以选择:1.发现一个主公技;2.变更一名角色势力。",
["#efengqi__weiwu_lord"] = "发现一个主公技",
["#efengqi__weiwu_change"] = "变更一名角色势力",
["#efengqi__weiwu-choose"] = "魏武,选择一名角色,变更其势力",
["$efengqi__jianxiong1"] = "燕雀,安知鸿鹄之志!",
["$efengqi__jianxiong2"] = "夫英雄者,胸怀大志,腹有良谋!",
["~efengqi__caocao"] = "霸业未成!未成啊!",
}
local simayi = General(extension, "efengqi__simayi", "wei", 4)
local fankui = fk.CreateTriggerSkill{
name = "efengqi__fankui",
anim_type = "masochism",
events = {fk.Damaged},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.from and not data.from.dead and not data.from:isNude()
end,
on_trigger = function(self, event, target, player, data)
self.cancel_cost = false
for i = 1, data.damage do
if i > 1 and (self.cancel_cost or data.from.dead or data.from:isNude() or not player:hasSkill(self)) then break end
self:doCost(event, target, player, data)
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
if room:askForSkillInvoke(player, self.name, data, "#efengqi__fankui-invoke::"..data.from.id) then
self.cost_data = {tos = {data.from.id}}
return true
end
self.cancel_cost = true
end,
on_use = function(self, event, target, player, data)
local room = player.room
local cid = room:askForCardChosen(player, data.from, "he", self.name)
room:obtainCard(player, cid, false, fk.ReasonPrey, player.id, self.name)
local card = Fk:getCardById(cid)
if not player.dead and table.contains(player:getCardIds("h"), cid) and card.type == Card.TypeEquip then
local targets = table.filter(room.alive_players, function (p) return p:canUseTo(card, p) end)
if #targets == 0 then return false end
local tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
"#efengqi__fankui-use:::"..card:toLogString(), self.name, true)
if #tos > 0 then
room:useCard{from = tos[1], tos = {tos}, card = card}
end
end
end
}
simayi:addSkill(fankui)
local guicai = fk.CreateTriggerSkill{
name = "efengqi__guicai",
anim_type = "control",
events = {fk.AskForRetrial},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self)
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = table.filter(room.alive_players, function (p) return not p:isNude() end)
if #targets == 0 then return false end
local tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
"#efengqi__guicai-choose::"..target.id..":"..data.reason..":"..data.card:toLogString(), self.name, true)
if #tos > 0 then
self.cost_data = {tos = tos}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data.tos[1])
local cid = room:askForCardChosen(player, to, "he", self.name)
local card = Fk:getCardById(cid)
room:delay(300)
room:moveCards{
ids = {cid},
from = to.id,
toArea = Card.Processing,
moveReason = fk.ReasonResonpse,
skillName = self.name,
proposer = player.id,
}
room:sendFootnote({cid}, {
type = "##ResponsePlayCard",
from = player.id,
})
local oldJudge = data.card
data.card = card
room:sendLog{
type = "#ChangedJudge",
from = player.id,
to = { data.who.id },
arg2 = card:toLogString(),
arg = self.name,
}
Fk:filterCard(data.card.id, data.who, data)
room:delay(500)
room:moveCards{
ids = { oldJudge:getEffectiveId() },
toArea = Card.DiscardPile,
moveReason = fk.ReasonJudge,
skillName = self.name,
}
if not to.dead and not player.dead and room:askForSkillInvoke(to, self.name, nil, "#efengqi__guicai-damage:"..player.id) then
room:doIndicate(to.id, {player.id})
room:damage { from = to, to = player, damage = 1, skillName = self.name }
end
end,
}
simayi:addSkill(guicai)
Fk:loadTranslationTable{
["efengqi__simayi"] = "司马懿",
["#efengqi__simayi"] = "狼顾之鬼",
["designer:efengqi__simayi"] = "食马者",
["illustrator:efengqi__simayi"] = "木美人",
["efengqi__fankui"] = "反馈",
[":efengqi__fankui"] = "每当你受到1点伤害后,可以获得伤害来源一张牌;若为装备牌,你可以令一名角色使用之。",
["#efengqi__fankui-invoke"] = "反馈:你可以获得 %dest 一张牌!",
["#efengqi__fankui-use"] = "反馈:你可以令一名角色使用 %arg!",
["efengqi__guicai"] = "鬼才",
[":efengqi__guicai"] = "当一名角色的判定牌生效前,你可以打出一名角色一张牌替代之,然后其可以对你造成1点伤害。",
["#efengqi__guicai-choose"] = "鬼才:你可以打出一名角色的一张牌代替 %dest 进行“%arg”判定的判定牌%arg2",
["#efengqi__guicai-damage"] = "鬼才:你可以对 %src 造成1点伤害",
["$efengqi__guicai1"] = "天命难违?哈哈哈哈哈……",
["$efengqi__guicai2"] = "才通天地,逆天改命!",
["$efengqi__fankui1"] = "哼,自作孽不可活!",
["$efengqi__fankui2"] = "哼,正中下怀!",
["~efengqi__simayi"] = "我的气数,就到这里了么?",
}
local guojia = General(extension, "efengqi__guojia", "wei", 3)
local tiandu = fk.CreateTriggerSkill{
name = "efengqi__tiandu",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.FinishJudge},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self)
end,
on_use = function(self, event, target, player, data)
player.room:damage{
to = player,
damage = 1,
skillName = self.name,
isVirtualDMG = true,
}
end,
}
guojia:addSkill(tiandu)
local yiji = fk.CreateTriggerSkill{
name = "efengqi__yiji",
anim_type = "masochism",
events = {fk.Damaged, fk.Death},
can_trigger = function (self, event, target, player, data)
return target == player and player:hasSkill(self, false, true)
end,
on_trigger = function(self, event, target, player, data)
local num = event == fk.Damaged and data.damage or 1
self.cancel_cost = false
for _ = 1, num do
if self.cancel_cost or not player:hasSkill(self, false, true) then break end
self:doCost(event, target, player, data)
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
if room:askForSkillInvoke(player, self.name, data) then
return true
end
self.cancel_cost = true
end,
on_use = function(self, event, target, player, data)
local room = player.room
local choices = room:askForChoices(player, {"efengqi__yiji_watch", "draw2", "efengqi__yiji_give"}, 2, 2, self.name, nil, false)
if table.contains(choices, "efengqi__yiji_watch") then
room:askForGuanxing(player, room:getNCards(2), nil, nil, self.name)
end
if table.contains(choices, "draw2") then
player:drawCards(2, self.name)
end
if table.contains(choices, "efengqi__yiji_give") then
local num = math.min(2, #player:getCardIds("he"))
if num > 0 then
room:askForYiji(player, player:getCardIds("he"), room:getOtherPlayers(player), self.name, num, num)
end
end
end,
}
guojia:addSkill(yiji)
Fk:loadTranslationTable{
["efengqi__guojia"] = "郭嘉",
["#efengqi__guojia"] = "",
["designer:efengqi__guojia"] = "屑",
["illustrator:efengqi__guojia"] = "云涯",
["efengqi__tiandu"] = "天妒",
[":efengqi__tiandu"] = "锁定技,当你的判定牌生效后,你视为受到过1点伤害。",
["efengqi__yiji"] = "遗计",
[":efengqi__yiji"] = "当你受到1点伤害后或死亡时,你可以执行不同的两项:1.卜算2;2.摸两张牌;3.分配两张牌。",
["efengqi__yiji_watch"] = "卜算2",
["efengqi__yiji_give"] = "分配两张牌",
["$efengqi__tiandu1"] = "那,就这样吧。",
["$efengqi__tiandu2"] = "天意如此。",
["$efengqi__yiji1"] = "锦囊妙策,终定社稷。",
["$efengqi__yiji2"] = "依此计行,辽东可定。",
["~efengqi__guojia"] = "咳,咳咳咳。",
}
local zhenji = General(extension, "efengqi__zhenji", "wei", 3, 3, General.Female)
local luoshen = fk.CreateTriggerSkill{
name = "efengqi__luoshen",
anim_type = "drawcard",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Card.PlayerHand then
return true
end
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local judge = {
who = player,
reason = self.name,
pattern = ".|.|spade,club",
skipDrop = true,
}
room:judge(judge)
if player.dead or not judge.card then return end
if judge.card.color == Card.Black then
if room:getCardArea(judge.card) == Card.Processing then
local to = player
local tos = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 1, 1,
"#efengqi__luoshen-give:::"..judge.card:toLogString(), self.name, true)
if #tos > 0 then
to = room:getPlayerById(tos[1])
end
room:obtainCard(to, judge.card, true, fk.ReasonGive, player.id, self.name,
to == player and "@@efengqi__luoshen-inhand-turn" or nil)
end
else
room:invalidateSkill(player, self.name, "-turn")
if room:getCardArea(judge.card) == Card.Processing then
room:moveCardTo(judge.card, Card.DiscardPile, nil, fk.ReasonJudge)
end
end
end,
}
local luoshen_maxcards = fk.CreateMaxCardsSkill{
name = "#efengqi__luoshen_maxcards",
exclude_from = function(self, player, card)
return card:getMark("@@efengqi__luoshen-inhand-turn") > 0
end,
}
luoshen:addRelatedSkill(luoshen_maxcards)
zhenji:addSkill(luoshen)
local qingguo = fk.CreateTriggerSkill{
name = "efengqi__qingguo",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.EventPhaseChanging},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player:getMark("efengqi__qingguo-turn") < 3 then
return data.to > 1 and data.to < 8
end
end,
on_use = function(self, event, target, player, data)
player.room:addPlayerMark(player, "efengqi__qingguo-turn", 1)
player:drawCards(1, self.name)
return true
end,
}
zhenji:addSkill(qingguo)
Fk:loadTranslationTable{
["efengqi__zhenji"] = "甄姬",
["#efengqi__zhenji"] = "",
["designer:efengqi__zhenji"] = "屑",
["illustrator:efengqi__zhenji"] = "官方",
["efengqi__luoshen"] = "洛神",
[":efengqi__luoshen"] = "当你获得牌后,你可以进行一次判定。若结果为黑,你分配之,若不为黑则本回合此技能失效。你以此获得的牌本回合不计上限。",
["#efengqi__luoshen-give"] = "洛神:令一名角色获得%arg,点取消给自己",
["@@efengqi__luoshen-inhand-turn"] = "洛神",
["efengqi__qingguo"] = "倾国",
[":efengqi__qingguo"] = "锁定技,你的前三个阶段改为摸一张牌。",
["$efengqi__luoshen1"] = "髣髴兮若轻云之蔽月。",
["$efengqi__luoshen2"] = "飘飖兮若流风之回雪。",
["$efengqi__qingguo1"] = "凌波微步,罗袜生尘。",
["$efengqi__qingguo2"] = "体迅飞凫,飘忽若神。",
["~efengqi__zhenji"] = "悼良会之永绝兮,哀一逝而异乡。",
}
local zhangliao = General(extension, "efengqi__zhangliao", "wei", 4)
local tuxi = fk.CreateTriggerSkill{
name = "efengqi__tuxi",
anim_type = "control",
events = {fk.BeforeDrawCard},
can_trigger = function(self, event, target, player, data)
return data.who == player and player:hasSkill(self) and data.num > 0 and
table.find(player.room:getOtherPlayers(player, false), function(p) return not p:isKongcheng() end)
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = table.map(table.filter(room:getOtherPlayers(player, false), function(p)
return not p:isKongcheng() end), Util.IdMapper)
local tos = room:askForChoosePlayers(player, targets, 1, data.num, "#efengqi__tuxi-choose:::"..data.num, self.name, true)
if #tos > 0 then
room:sortPlayersByAction(tos)
self.cost_data = {tos = tos}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local tos = table.map(self.cost_data.tos, Util.Id2PlayerMapper)
for _, to in ipairs(tos) do
if not (to.dead or to:isKongcheng()) then
local c = room:askForCardChosen(player, to, "h", self.name)
room:obtainCard(player, c, false, fk.ReasonPrey)
if player.dead then break end
end
end
data.num = data.num - #tos
if data.num == 0 and room:getBanner("@@efengqi__tuxi") ~= 1 then
local turnEvent = room.logic:getCurrentEvent():findParent(GameEvent.Turn)
if turnEvent then
room:doIndicate(player.id, table.map(room.alive_players, Util.IdMapper))
room:setBanner("@@efengqi__tuxi", 1)
for _, p in ipairs(room.alive_players) do
p:filterHandcards()
end
turnEvent:addCleaner(function()
room:setBanner("@@efengqi__tuxi", 0)
for _, p in ipairs(room.alive_players) do
p:filterHandcards()
end
end)
end
end
end,
}
local tuxi_filter = fk.CreateFilterSkill{
name = "#efengqi__tuxi_filter",
card_filter = function(self, card, player)
return player and table.contains(player:getCardIds("h"), card.id) and card.trueName== "jink"
and Fk:currentRoom():getBanner("@@efengqi__tuxi") == 1
end,
view_as = function(self, card)
local c = Fk:cloneCard("thunder__slash", card.suit, card.number)
c.skillName = "efengqi__tuxi"
return c
end,
}
tuxi:addRelatedSkill(tuxi_filter)
zhangliao:addSkill(tuxi)
Fk:loadTranslationTable{
["efengqi__zhangliao"] = "张辽",
["#efengqi__zhangliao"] = "",
["designer:efengqi__zhangliao"] = "屑",
["illustrator:efengqi__zhangliao"] = "鬼画府",
["efengqi__tuxi"] = "突袭",
[":efengqi__tuxi"] = "当你摸牌时,可以少摸任意张,获得等量角色各一张手牌。若因此没有摸牌,本回合所有角色的【闪】视为雷【杀】。",
["#efengqi__tuxi-choose"] = "突袭:你可以少摸至多%arg张牌,获得等量其他角色各一张手牌",
["#efengqi__tuxi_filter"] = "突袭",
["@@efengqi__tuxi"] = "突袭:闪视为雷杀",
["$efengqi__tuxi1"] = "快马突袭,占尽先机!",
["$efengqi__tuxi2"] = "马似飞影,枪如霹雳!",
["~efengqi__zhangliao"] = "被敌人占了先机,呃。",
}
local xuchu = General(extension, "efengqi__xuchu", "wei", 4)
local luoyi = fk.CreateTriggerSkill{
name = 'efengqi__luoyi',
anim_type = "offensive",
events = {fk.DrawNCards},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.n > 0
end,
on_use = function(self, event, target, player, data)
data.n = data.n - 1
player.room:addPlayerMark(player, "@@efengqi__luoyi", 1)
end,
refresh_events = {fk.EventPhaseStart},
can_refresh = function(self, event, target, player, data)
return target == player and player.phase == Player.RoundStart
end,
on_refresh = function(self, event, target, player, data)
player.room:setPlayerMark(player, "@@efengqi__luoyi", 0)
end,
}
local luoyi_trigger = fk.CreateTriggerSkill{
name = "#efengqi__luoyi_trigger",
mute = true,
events = {fk.DamageCaused},
can_trigger = function(self, event, target, player, data)
return target == player and not data.chain and data.card and
((player:getMark("@@efengqi__luoyi") > 0 and (data.card.trueName == "slash" or data.card.name == "duel")) or
(player:hasSkill(luoyi) and #player:getCardIds("e") == 0 and data.card.name == "slash"))
end,
on_cost = function(self, event, target, player, data)
return true
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke("efengqi__luoyi")
room:notifySkillInvoked(player, "efengqi__luoyi")
if player:getMark("@@efengqi__luoyi") > 0 and (data.card.trueName == "slash" or data.card.name == "duel") then
data.damage = data.damage + 1
end
if player:hasSkill(luoyi) and #player:getCardIds("e") == 0 and data.card.name == "slash" then
data.damage = data.damage + 1
end
end,
}
luoyi:addRelatedSkill(luoyi_trigger)
xuchu:addSkill(luoyi)
local nuzhan = fk.CreateTriggerSkill{
name = "efengqi__jizhan",
anim_type = "offensive",
events = {fk.AfterSkillEffect},
can_trigger = function(self, _, target, player, data)
local slash = Fk:cloneCard 'slash'
return player:hasSkill(self) and player.phase == Player.NotActive and
target and target ~= player and
player.room.logic:getCurrentEvent().n_caefengqi__jizhan and
not player:prohibitUse(slash) and
not player:isProhibited(target, slash)
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "#efengqi__jizhan-invoke::"..target.id)
end,
on_use = function(self, _, target, player, data)
local room = player.room
local slash = Fk:cloneCard 'slash'
slash.skillName = self.name
room:useCard {
from = player.id,
tos = { { target.id } },
card = slash,
additionalDamage = target:isWounded() and 0 or 1,
disresponsiveList = table.map(room.alive_players, Util.IdMapper),
extraUse = true,
}
end,
refresh_events = {fk.AfterSkillEffect},
can_refresh = function(self, _, target, player, data)
return player:hasSkill(self) and player.phase == Player.NotActive and
target and target ~= player and
target:hasSkill(data) and data.visible and
not player.room.logic:getCurrentEvent().efengqi__jizhan_counted
end,
on_refresh = function(self, _, target, _, _)
local room = target.room
local cur = room.logic:getCurrentEvent()
cur.efengqi__jizhan_counted = true
room:addPlayerMark(target, "@efengqi__jizhan-turn", 1)
if (target:getMark("@efengqi__jizhan-turn") % 6 == 0) then
cur.n_caefengqi__jizhan = true
end
end,
}
xuchu:addSkill(nuzhan)
Fk:loadTranslationTable{
["efengqi__xuchu"] = "许褚",
["designer:efengqi__xuchu"] = "notify",
["efengqi__luoyi"] = '裸衣',
["@@efengqi__luoyi"] = '裸衣',
[':efengqi__luoyi'] = '摸牌阶段,你可以少摸一张牌,若如此做,直到你的下回合开始,' ..
'你使用的【杀】或【决斗】造成的伤害+1;若你装备区里没有牌,你的普通【杀】' ..
'造成的伤害+1。',
["#efengqi__luoyi_trigger"] = '裸衣',
["efengqi__jizhan"] = "急斩",
["@efengqi__jizhan-turn"] = "急斩",
["#efengqi__jizhan-invoke"] = "急斩: 现在你可以视为对 %dest 使用一张强中的【杀】,可能有加伤",
[":efengqi__jizhan"] = "你的回合外,当其他角色于一回合内每发动六次技能后," ..
"你可以视为对其使用了一张不可响应的【杀】;若其未受伤,此【杀】伤害基数+1。" ..
'<br /><font color="red">(注:由于判断发动技能的相关机制尚不完善,请不要汇报关于技能发动次数统计的bug)</font>',
["$efengqi__jizhan"] = "纳命来!",
["$efengqi__luoyi1"] = "过来打一架,对,就是你!",
["$efengqi__luoyi2"] = "废话少说,放马过来吧!",
["~efengqi__xuchu"] = "丞相,末将尽力了!",
}
local xiahoudun = General(extension, "efengqi__xiahoudun", "wei", 4)
local ganglie = fk.CreateTriggerSkill{
name = "efengqi__ganglie",
anim_type = "offensive",
events = {fk.EventPhaseStart},
can_trigger = function (self, event, target, player, data)
return target.phase == Player.Finish and player:hasSkill(self)
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local targets = {}
room.logic:getActualDamageEvents(1, function(e) table.insertIfNeed(targets, e.data[1].to) end)
targets = table.filter(targets, function(p) return not p.dead and not p:isKongcheng() end)
if #targets > 0 then
local tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 99999, "#efengqi__ganglie-choose", self.name, true)
if #tos > 0 then
room:sortPlayersByAction(tos)
self.cost_data = {tos = tos}
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local tos = table.map(self.cost_data.tos, Util.Id2PlayerMapper)
for _, to in ipairs(tos) do
if not to:isKongcheng() then
local cid = room:askForCardChosen(player, to, "h", self.name)
room:throwCard(cid, self.name, to, player)
end
if player.dead then return end
end
if table.contains(tos, player) then
tos = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 1, 1, "#efengqi__ganglie-damage", self.name, false)
if #tos > 0 then
room:damage { from = player, to = room:getPlayerById(tos[1]), damage = 1, skillName = self.name }
end
else
local judge = {
who = player,
reason = "floating_thunder",
pattern = ".|.|spade",
}
room:judge(judge)
if judge.card.suit == Card.Spade and not player.dead then
room:damage{
to = player,
damage = 1,
damageType = fk.ThunderDamage,
skillName = self.name,
}
end
end
end,
}
xiahoudun:addSkill(ganglie)
local danqi = fk.CreateTriggerSkill{
name = "efengqi__danqi",
anim_type = "offensive",
events = {fk.FinishJudge},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) and data.card.color ~= Card.NoColor then
return data.card.color == Card.Red or (#(player.room:getBanner("@$CenterArea") or {}) > 0
or table.find(player.room.alive_players, function(p) return #p:getCardIds("ej") > 0
end))
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
if data.card.color == Card.Red then
local tos = player.room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 1, 1, "#efengqi__danqi-damage", self.name, true)
if #tos > 0 then
self.cost_data = {tos = tos}
return true
end
else
if room:askForSkillInvoke(player, self.name, data, "#efengqi__danqi-invoke") then
self.cost_data = {}
local targets = table.filter(room.alive_players, function (p) return #p:getCardIds("ej") > 0 end)
if #targets > 0 then
local tos = room:askForChoosePlayers(player, table.map(player.room.alive_players, Util.IdMapper), 1, 1, "#efengqi__danqi-throw", self.name, true)
if #tos > 0 then
self.cost_data.tos = tos
end
end
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if data.card.color == Card.Red then
room:damage { from = player, to = room:getPlayerById(self.cost_data.tos[1]), damage = 1, skillName = self.name }
else
if self.cost_data.tos then
local to = room:getPlayerById(self.cost_data.tos[1])
if #to:getCardIds("ej") > 0 then
local cid = room:askForCardChosen(player, to, "ej", self.name)
room:throwCard(cid, self.name, to, player)
end
else
local cards = room:getBanner("@$CenterArea") or {}
if #cards > 0 then
local card = room:askForCardChosen(player, player, { card_data = { { self.name, cards } } }, self.name, "$ChooseCard")
room:obtainCard(player, card, true, fk.ReasonJustMove, player.id, self.name)
end
end
end
end,
}
danqi.CenterArea = true
xiahoudun:addSkill(danqi)
Fk:loadTranslationTable{
["efengqi__xiahoudun"] = "夏侯惇",
["#efengqi__xiahoudun"] = "",
["illustrator:efengqi__xiahoudun"] = "",
["designer:efengqi__xiahoudun"] = "老猫&楚萱",
["efengqi__ganglie"] = "刚烈",
[":efengqi__ganglie"] = "一名角色的结束阶段,你可以弃置任意名本回合受到过伤害的角色各一张手牌,若含你,你对一名角色造成1点伤害,否则,你进行【浮雷】判定。",
["#efengqi__ganglie-choose"] = "刚烈:你可以弃置本回合受到过伤害的角色各一张手牌",
["#efengqi__ganglie-damage"] = "刚烈:请造成1点伤害",
["efengqi__danqi"] = "啖弃",
[":efengqi__danqi"] = "当你的判定牌生效后,若结果为:红色,你可以分配1点伤害;黑色,你可以弃置场上一张牌或获得中央区一张牌。",
["#efengqi__danqi-damage"] = "啖弃:选择一名角色,对其造成1点伤害",
["#efengqi__danqi-invoke"] = "啖弃:你可以弃置场上一张牌或获得中央区一张牌",
["#efengqi__danqi-throw"] = "啖弃:你可以选择一名角色,弃置其场上一张牌。不选则改为你获得中央区一张牌",
}
local lidian = General(extension, "efengqi__lidian", "wei", 3)
local xunxun = fk.CreateTriggerSkill{
name = "efengqi__xunxun",
anim_type = "control",
events = {fk.BeforeDrawCard},
can_trigger = function(self, event, target, player, data)
return target:getHandcardNum() == player:getHandcardNum() and player:hasSkill(self)
and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(target, self.name, data, "#efengqi__xunxun-invoke:"..player.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:askForGuanxing(player, room:getNCards(4), nil, nil, self.name)
end,
}
lidian:addSkill(xunxun)
local wangxi = fk.CreateTriggerSkill{
name = "efengqi__wangxi",
events = {fk.Damage, fk.Damaged},
mute = true,
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.from and data.from ~= data.to and not data.to.dead and not data.from.dead
and not table.contains(player:getTableMark("efengqi__wangxi-turn"), event)
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(self.name)
room:addTableMark(player, "efengqi__wangxi-turn", event)
local to = (event == fk.Damage and data.to or data.from)
room:notifySkillInvoked(player, self.name, event == fk.Damaged and "masochism" or "drawcard", to and {to.id})
player:drawCards(2, self.name)
if not player.dead and not player:isNude() and to and not to.dead and to ~= player then
local card = room:askForCard(player, 1, 1, true, self.name, false, ".", "#efengqi__wangxi-give:"..to.id)
if #card > 0 then
room:moveCardTo(card, Card.PlayerHand, to, fk.ReasonGive, self.name, nil, false, player.id)
end
end
end,
refresh_events = {fk.EnterDying},
can_refresh = function (self, event, target, player, data)
return target == player
end,
on_refresh = function (self, event, target, player, data)
player.room:addTableMark(player, "efengqi__wangxi-turn", 0)
end,
}
lidian:addSkill(wangxi)
Fk:loadTranslationTable{
["efengqi__lidian"] = "李典",
["#efengqi__lidian"] = "深明大义",
["illustrator:efengqi__lidian"] = "张帅",
["designer:efengqi__lidian"] = "屑",
["efengqi__xunxun"] = "恂恂",
[":efengqi__xunxun"] = "每回合限一次,手牌数与你相同的角色摸牌时,其可以令你卜算4。",
["#efengqi__xunxun-invoke"] = "恂恂:你可以令 %src 卜算4张牌。",
["efengqi__wangxi"] = "忘隙",
[":efengqi__wangxi"] = "每回合各限一次,当你对其他角色造成或受到其他角色造成的伤害后,可以摸两张牌并交给对方一张牌;当你进入濒死状态时,"..
"此技能视为未发动。",
["#efengqi__wangxi-give"] = "忘隙:请交给 %src 一张牌。",
["$efengqi__xunxun1"] = "众将死战,非我之功。",
["$efengqi__xunxun2"] = "爱兵如子,胜乃可全。",
["$efengqi__wangxi1"] = "大丈夫,何拘小节。",
["$efengqi__wangxi2"] = "前尘往事,莫再提起。",
["~efengqi__lidian"] = "报国杀敌,虽死犹荣……",
}
local liubei = General(extension, "efengqi__liubei", "han", 4)
local juyi = fk.CreateViewAsSkill{
name = "efengqi__juyi",
prompt = "#efengqi__juyi-use",
pattern = ".|.|.|.|.|basic",
interaction = function(self)
local all_names = Self:getTableMark("@$efengqi__juyi")
local names = U.getViewAsCardNames(Self, self.name, all_names)
if #names > 0 then
return U.CardNameBox { choices = names }
end
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
if not self.interaction.data then return nil end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = self.name
return card
end,
before_use = function(self, player, use)
local room = player.room
local mark = table.filter(player:getTableMark("@$efengqi__juyi"), function (name)
return Fk:cloneCard(name).trueName ~= use.card.trueName
end)
room:setPlayerMark(player, "@$efengqi__juyi", #mark > 0 and mark or 0)
room:askForYiji(player, player:getCardIds("he"), room:getOtherPlayers(player, false), self.name, 2, 999, "#efengqi__juyi-rende")
end,
enabled_at_play = function(self, player)
return #player:getCardIds("he") > 1
and table.find(Fk:currentRoom().alive_players, function (p) return p ~= player end)
end,
enabled_at_response = function(self, player, response)
return not response and #player:getCardIds("he") > 1
and table.find(Fk:currentRoom().alive_players, function (p) return p ~= player end)
end,
on_acquire = function (self, player)
local room = player.room
room:setPlayerMark(player, "@$efengqi__juyi", U.getAllCardNames("b"))
for _, p in ipairs(room:getOtherPlayers(player, false)) do
room:handleAddLoseSkills(p, "efengqi__juyi_other&", nil, false, true)
end
end,
on_lose = function (self, player)
local room = player.room
room:setPlayerMark(player, "@$efengqi__juyi", 0)
if table.find(room.alive_players, function (p)
return p:hasSkill(self, true)
end) then return end
for _, p in ipairs(room.alive_players) do
room:handleAddLoseSkills(p, "-efengqi__juyi_other&", nil, false, true)
end
end,
}
local efengqi__juyi_trigger = fk.CreateTriggerSkill{
name = "#efengqi__juyi_trigger",
refresh_events = {fk.RoundStart},
can_refresh = function(self, event, target, player, data)
return player:hasSkill(juyi, true)
end,
on_refresh = function(self, event, target, player, data)
player.room:setPlayerMark(player, "@$efengqi__juyi", U.getAllCardNames("b"))
end,
}
juyi:addRelatedSkill(efengqi__juyi_trigger)
liubei:addSkill(juyi)
local efengqi__juyi_other = fk.CreateViewAsSkill{
name = "efengqi__juyi_other&",
prompt = "#efengqi__juyi-other",
pattern = ".|.|.|.|.|basic",
interaction = function(self)
local all_names = {}
for _, p in ipairs(Fk:currentRoom().alive_players) do
if p ~= Self and p:hasSkill(juyi) then
table.insertTableIfNeed(all_names, p:getTableMark("@$efengqi__juyi"))
end
end
local names = U.getViewAsCardNames(Self, self.name, all_names)
if #names > 0 then
return U.CardNameBox { choices = names }
end
end,
card_filter = function (self, to_select, selected)
return #selected < 3 and (#selected == 0 or table.every(selected, function (id)
return Fk:getCardById(id).color == Fk:getCardById(to_select).color
end))
end,
view_as = function(self, cards)
if not self.interaction.data or #cards ~= 3 then return nil end
local card = Fk:cloneCard(self.interaction.data)
card:setMark(self.name, cards)
card.skillName = self.name
return card
end,
before_use = function(self, player, use)
local room = player.room
local cards = use.card:getMark(self.name)
if cards == 0 then return "" end
local targets = table.filter(room.alive_players, function (p)
return p ~= player and p:hasSkill(juyi, true) and table.find(p:getTableMark("@$efengqi__juyi"), function (name)
return Fk:cloneCard(name).trueName == use.card.trueName
end)
end)
if #targets == 0 then return "" end
local to = #targets == 1 and targets[1] or room:getPlayerById(
room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "", juyi.name, false)[1]
)
local mark = table.filter(to:getTableMark("@$efengqi__juyi"), function (name)
return Fk:cloneCard(name).trueName ~= use.card.trueName
end)
room:setPlayerMark(to, "@$efengqi__juyi", #mark > 0 and mark or 0)
room:obtainCard(to, cards, false, fk.ReasonGive, player.id, juyi.name)
end,
enabled_at_play = function(self, player)
return #player:getCardIds("he") > 2
and table.find(Fk:currentRoom().alive_players, function (p)
return p ~= player and p:hasSkill(juyi) and p:getMark("@$efengqi__juyi") ~= 0
end)
end,
enabled_at_response = function(self, player, response)
return not response and Fk.currentResponsePattern and #player:getCardIds("he") > 2
and table.find(Fk:currentRoom().alive_players, function (p)
return p ~= player and p:hasSkill(juyi) and table.find(p:getTableMark("@$efengqi__juyi"), function (name)
return Exppattern:Parse(Fk.currentResponsePattern):matchExp(name)
end)
end)
end,
}
Fk:addSkill(efengqi__juyi_other)
local efengqi__shourong = fk.CreateTriggerSkill{
name = "efengqi__shourong$",
anim_type = "support",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return player ~= target and target.phase == Player.Play and player:hasSkill(self) and not player.chained
end,
on_cost = function(self, event, target, player, data)
self.cost_data = {tos = {target.id}}
return player.room:askForSkillInvoke(player, self.name, nil, "#efengqi__shourong-invoke:"..target.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
player:setChainState(true)
if target.dead then return end
local ids = room:getCardsFromPileByRule(".|.|.|.|.|weapon")
if #ids > 0 then
room:obtainCard(target, ids, true, fk.ReasonJustMove, target.id, self.name)
if target.dead then return end
end
if target.kingdom == "han" then
ids = room:getCardsFromPileByRule(".|.|.|.|.|basic")
if #ids > 0 then
room:obtainCard(target, ids, true, fk.ReasonJustMove, target.id, self.name)
end
elseif target.kingdom == "shu" then
room:recover { num = 1, skillName = self.name, who = target, recoverBy = player }
end
end,
}
liubei:addSkill(efengqi__shourong)
Fk:loadTranslationTable{
["efengqi__liubei"] = "刘备",
["#efengqi__liubei"] = "王道英风",
["illustrator:efengqi__liubei"] = "DH",
["designer:efengqi__liubei"] = "太师&永乐",
["efengqi__juyi"] = "聚义",
[":efengqi__juyi"] = "每轮每种牌名限一次,你可以分配至少两张牌,视为使用一张基本牌;其他角色可以交给你三张同色牌视为使用一张基本牌。",
["#efengqi__juyi-use"] = "你可以分配至少两张牌,视为使用一张基本牌",
["efengqi__juyi_other&"] = "聚义",
[":efengqi__juyi_other&"] = "每轮每种牌名限一次,你可以将三张同色牌交给有“聚义”的角色,视为使用一张基本牌",
["#efengqi__juyi-other"] = "选择你要视为使用的基本牌,将三张同色牌交给有“聚义”的角色",
["@$efengqi__juyi"] = "聚义",
["#efengqi__juyi-rende"] = "聚义:请分配至少两张牌",
["efengqi__shourong"] = "授戎",
[":efengqi__shourong"] = "主公技,其他角色出牌阶段开始时,你可以横置,令其获得弃牌堆一张武器牌,若为汉势力角色,额外获得一张基本牌,若为蜀势力角色,回复1点体力。",
["#efengqi__shourong-invoke"] = "授戎:你可以横置,令 %src 获得弃牌堆一张武器牌(可能没有),若其为汉、蜀角色额外获得收益",
["$efengqi__juyi1"] = "同心同德,救困扶危!",
["$efengqi__juyi2"] = "施仁布泽,乃我大汉立国之本!",
["$efengqi__shourong1"] = "哪位将军,替我拿下此贼!",
["$efengqi__shourong2"] = "欺我军无人乎!",
["~efengqi__liubei"] = "汉室未兴,祖宗未耀,朕实不忍此时西去……",
}
local guanyu = General(extension, "efengqi__guanyu", "han", 5)
local wusheng = fk.CreateViewAsSkill{
name = "efengqi__wusheng",
pattern = "slash",
anim_type = "offensive",
prompt = "#efengqi__wusheng",
card_filter = function(self, to_select, selected)
return #selected == 0
end,
view_as = function(self, cards)
local card = Fk:cloneCard("slash")
if #cards == 1 then
card:addSubcards(cards)
end
card.skillName = self.name
return card
end,
before_use = function(self, player, use)
use.extra_data = use.extra_data or {}
if #use.card.subcards == 0 then
local room = player.room
local targets = table.filter(room:getOtherPlayers(player), function(p)
return table.find(p:getCardIds("he"), function (id)
local card = Fk:cloneCard("slash", Fk:getCardById(id).suit, Fk:getCardById(id).number)
card.skillName = self.name
if use.tos then
return not player:prohibitUse(card)
else
return not player:prohibitResponse(card)
end
end) ~= nil
end)
if #targets == 0 then return self.name end
local to = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#efengqi__wusheng-choose", self.name, false)
to = room:getPlayerById(to[1])
local cards = table.filter(to:getCardIds("he"), function (id)
local card = Fk:cloneCard("slash", Fk:getCardById(id).suit, Fk:getCardById(id).number)
card.skillName = self.name
if use.tos then
return not player:prohibitUse(card)
else
return not player:prohibitResponse(card)
end
end)
use.extra_data.efengqi__wusheng_to = to.id
if #cards == 1 then
use.card:addSubcard(cards[1])
else
local card_data = {}
local data = {
to = to.id,
skillName = self.name,
prompt = "#efengqi__wusheng-card::"..to.id,
}
local visible_data = {}
local cards_data = table.filter(to:getCardIds("h"), function (id)
return table.contains(cards, id)
end)
if #cards_data > 0 then
table.insert(card_data, {"$Hand", cards_data})
for _, id in ipairs(cards_data) do
if not player:cardVisible(id) then
visible_data[tostring(id)] = false
end
end
if next(visible_data) == nil then visible_data = nil end
data.visible_data = visible_data
end
cards_data = table.filter(to:getCardIds("e"), function (id)
return table.contains(cards, id)
end)
if #cards_data > 0 then
table.insert(card_data, {"$Equip", cards_data})
end
local ret = room:askForPoxi(player, self.name, card_data, data, false)
use.card:addSubcards(ret)
end
end
end,
after_use = function (self, player, use)
local room = player.room
if player.dead or player:isNude() then return end
if use.extra_data and use.extra_data.efengqi__wusheng_to then
local to = room:getPlayerById(use.extra_data.efengqi__wusheng_to)
if to.dead or to == player then return end
local card = room:askForCard(player, 1, 1, true, self.name, true, ".|.|heart,diamond", "#efengqi__wusheng-give::"..to.id)
if #card > 0 then
room:moveCardTo(card, Card.PlayerHand, to, fk.ReasonGive, self.name, nil, false, player.id)
if to:isWounded() and not to.dead then
room:recover{
who = to,
num = 1,
recoverBy = player,
skillName = self.name,
}
end
end
end
end,
enabled_at_play = function(self, player)
return table.find(Fk:currentRoom().alive_players, function (p)
return not p:isNude()
end)
end,
enabled_at_response = function (self, player, response)
return table.find(Fk:currentRoom().alive_players, function (p)
return not p:isNude()
end)
end,
}
Fk:addPoxiMethod{
name = "efengqi__wusheng",
prompt = function (data, extra_data)
return extra_data.prompt
end,
card_filter = function (to_select, selected, data, extra_data)
return #selected == 0
end,
feasible = function(selected, data)
return #selected == 1
end,
default_choice = function(data)
if not data then return {} end
local cids = data[2][1]
return cids
end,
}
guanyu:addSkill(wusheng)
Fk:loadTranslationTable{
["efengqi__guanyu"] = "关羽",
["#efengqi__guanyu"] = "美髯公",
["illustrator:efengqi__guanyu"] = "凡果",
["designer:efengqi__guanyu"] = "胖即是胖",
["efengqi__wusheng"] = "武圣",
[":efengqi__wusheng"] = "你可以将一名角色的一张牌当【杀】使用或打出,然后你可以交给其一张红色牌并令其回复1点体力。",
["#efengqi__wusheng"] = "武圣:将一名角色的一张牌当【杀】使用或打出<br>(先选择此【杀】的目标,然后选择你的牌或选择转化牌的角色)",
["#efengqi__wusheng-choose"] = "武圣:选择一名角色的一张牌用以转化",
["#efengqi__wusheng-card"] = "武圣:选择 %dest 的一张牌",
["#efengqi__wusheng-give"] = "武圣:是否交给 %dest 一张牌并令其回复1点体力?",
["$efengqi__wusheng1"] = "刀锋所向,战无不克!",
["$efengqi__wusheng2"] = "逆贼,哪里走!",
["~efengqi__guanyu"] = "桃园一拜,恩义常在……",
}
local zhangfei = General(extension, "efengqi__zhangfei", "han", 4)
local paoxiao = fk.CreateTriggerSkill{
name = "efengqi__paoxiao",
anim_type = "offensive",
frequency = Skill.Compulsory,
events = {fk.CardUsing},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player:getMark("@@efengqi__paoxiao") > 0 and data.card.trueName == "slash"
end,
on_use = function(self, event, target, player, data)
player.room:setPlayerMark(player, "@@efengqi__paoxiao", 0)
data.additionalDamage = (data.additionalDamage or 0) + 1
if not data.extraUse then
player:addCardUseHistory(data.card.trueName, -1)
data.extraUse = true
end
end,
on_lose = function (self, player, is_death)
player.room:setPlayerMark(player, "@@efengqi__paoxiao", 0)
end,
}
local paoxiao_delay = fk.CreateTriggerSkill{
name = "#efengqi__paoxiao_delay",
mute = true,
frequency = Skill.Compulsory,
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(paoxiao)
end,
on_trigger = function(self, event, target, player, data)
player.room:setPlayerMark(player, "@@efengqi__paoxiao", data.card.type == Card.TypeBasic and 1 or 0)
end,
}
local paoxiao_targetmod = fk.CreateTargetModSkill{
name = "#efengqi__paoxiao_targetmod",
bypass_times = function(self, player, skill, scope)
return player:hasSkill(paoxiao) and skill.trueName == "slash_skill" and player:getMark("@@efengqi__paoxiao") > 0 and scope == Player.HistoryPhase
end,
bypass_distances = function(self, player, skill)
return player:hasSkill(paoxiao) and skill.trueName == "slash_skill" and player:getMark("@@efengqi__paoxiao") > 0
end,
}
paoxiao:addRelatedSkill(paoxiao_targetmod)
paoxiao:addRelatedSkill(paoxiao_delay)
zhangfei:addSkill(paoxiao)
Fk:loadTranslationTable{
["efengqi__zhangfei"] = "张飞",
["#efengqi__zhangfei"] = "",
["illustrator:efengqi__zhangfei"] = "",
["designer:efengqi__zhangfei"] = "",
["efengqi__paoxiao"] = "咆哮",
[":efengqi__paoxiao"] = "锁定技,若你使用的上一张牌是基本牌,你使用【杀】无距离和次数限制且造成的伤害+1。",
["@@efengqi__paoxiao"] = "咆哮!",
["#efengqi__paoxiao_delay"] = "咆哮",
["$efengqi__paoxiao1"] = "喝啊!",
["$efengqi__paoxiao2"] = "今,必斩汝马下!",
["~efengqi__zhangfei"] = "桃园一拜,此生…无憾……",
}
local zhugeliang = General(extension, "efengqi__zhugeliang", "han", 3)
local dawu = fk.CreateTriggerSkill{
name = "efengqi__guanxing_dawu",
anim_type = "defensive",
events = {fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
return target == player and data.damageType ~= fk.ThunderDamage
and player:getMark("@@efengqi__guanxing_dawu-turn") ~= 0
end,
on_cost = Util.TrueFunc,
on_use = Util.TrueFunc,
refresh_events = {fk.TurnStart},
can_refresh = function(self, event, target, player, data)
return player:getMark("@efengqi__guanxing_dawu") ~= 0
end,
on_refresh = function(self, event, target, player, data)
local mark = {}
for _, num in ipairs(player:getMark("@efengqi__guanxing_dawu")) do
if num == 1 then
player.room:setPlayerMark(player, "@@efengqi__guanxing_dawu-turn", 1)
else
table.insert(mark, num - 1)
end
end
player.room:setPlayerMark(player, "@efengqi__guanxing_dawu", #mark > 0 and mark or 0)
end,
}
local guanxing = fk.CreateTriggerSkill{
name = "efengqi__guanxing",
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_use = function(self, event, target, player, data)
local room = player.room
local result = room:askForGuanxing(player, room:getNCards(5), nil, nil, self.name)
local num = #result.bottom
local tos = room:askForChoosePlayers(player, table.map(room:getOtherPlayers(player, false), Util.IdMapper), 1, 1,
"#efengqi__guanxing-choose:::"..num, self.name, true)
if #tos > 0 then
room.logic:addTriggerSkill(dawu)
local to = room:getPlayerById(tos[1])
if num == 0 then
room:setPlayerMark(to, "@@efengqi__guanxing_dawu-turn", 1)
else
local mark = to:getTableMark("@efengqi__guanxing_dawu")
if table.insertIfNeed(mark, num) then
room:setPlayerMark(to, "@efengqi__guanxing_dawu", mark)
end
end
end
end,
}
zhugeliang:addSkill(guanxing)
local kongcheng = fk.CreateTriggerSkill{
name = "efengqi__kongcheng",
events = {fk.AskForCardUse, fk.AskForCardResponse, fk.FinishJudge},
frequency = Skill.Compulsory,
anim_type = "defensive",
can_trigger = function(self, event, target, player, data)
if event ~= fk.FinishJudge then
if target == player and player:hasSkill(self) and not player:isFakeSkill(self) and
(data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink"))) then
local skill = Fk.skills["#eight_diagram_skill"]
return skill and not player:hasSkill(skill, true) and skill:isEffectable(player)
end
else
return player:isKongcheng() and target == player and player.room:getCardArea(data.card) == Card.Processing
and data.reason == "eight_diagram" and data.extra_data and data.extra_data.efengqi__kongchengJudge
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.FinishJudge then
local tos = player.room:askForChoosePlayers(player, table.map(player.room.alive_players, Util.IdMapper), 1, 1,
"#efengqi__kongcheng-give:::"..data.card:toLogString(), self.name, true)
if #tos > 0 then
self.cost_data = {tos = tos}
return true
end
else
self.cost_data = nil
return player.room:askForSkillInvoke(player, "#eight_diagram_skill", data)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event ~= fk.FinishJudge then
local judgeData = {
who = player,
reason = "eight_diagram",
pattern = ".|.|heart,diamond",
extra_data = {efengqi__kongchengJudge = true},
}
room:judge(judgeData)
if judgeData.card.color == Card.Red then
local card = Fk:cloneCard("jink")
card.skillName = "eight_diagram"
card.skillName = self.name
if event == fk.AskForCardUse then
if player:prohibitUse(card) then return false end
data.result = {
from = player.id,
card = card,
}
if data.eventData then
data.result.toCard = data.eventData.toCard
data.result.responseToEvent = data.eventData.responseToEvent
end
else
if player:prohibitResponse(card) then return false end
data.result = card
end
return true
end
else
room:obtainCard(room:getPlayerById(self.cost_data.tos[1]), data.card, true, fk.ReasonPrey, player.id, self.name)
end
end
}
zhugeliang:addSkill(kongcheng)
zhugeliang:addRelatedSkill(dawu)
Fk:loadTranslationTable{
["efengqi__zhugeliang"] = "诸葛亮",
["#efengqi__zhugeliang"] = "云霄一羽",
["illustrator:efengqi__zhugeliang"] = "官方",
["designer:efengqi__zhugeliang"] = "yyuaN",
["efengqi__guanxing"] = "观星",
[":efengqi__guanxing"] = "准备阶段,你可以观看牌堆顶五张牌,将这些牌以任意顺序放回牌堆顶或牌堆底,然后可以令一名其他角色于此后第X个回合内获得“大雾”效果(X为置底牌数)",
["#efengqi__guanxing-choose"] = "观星:可以令一名其他角色于此后第 %arg 个回合内获得“大雾”",
["@@efengqi__guanxing_dawu-turn"] = "大雾:生效",
["@efengqi__guanxing_dawu"] = "大雾:",
["efengqi__kongcheng"] = "空城",
[":efengqi__kongcheng"] = "你视为装备【八卦阵】,若你没有手牌,你可以令一名角色获得因此判定的判定牌。",
["#efengqi__kongcheng-give"] = "空城:你可以令一名角色获得判定牌%arg",
["efengqi__guanxing_dawu"] = "大雾",
[":efengqi__guanxing_dawu"] = "若你有“大雾”标记,每当你受到不为雷电伤害的伤害时,防止此伤害。",
["$efengqi__guanxing1"] = "观今夜天象,知天下大事。",
["$efengqi__guanxing2"] = "知天易,逆天难。",
["$efengqi__kongcheng1"] = "(悠扬的琴音)",
["$efengqi__kongcheng2"] = "(低沉的琴音)",
["$efengqi__guanxing_dawu1"] = "此计可保你一时平安。",
["$efengqi__guanxing_dawu2"] = "此非万全之策,唯惧天雷。",
}
local machao = General(extension, "efengqi__machao", "han", 4)
local tieji = fk.CreateTriggerSkill{
name = "efengqi__tieji",
anim_type = "offensive",
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.card.is_damage_card and #AimGroup:getAllTargets(data.tos) == 1
end,
on_use = function(self, event, target, player, data)
local room = player.room
local judge = {
who = player,
reason = self.name,
pattern = ".",
}
room:judge(judge)
local to = room:getPlayerById(data.to)
local suit = judge.card:getSuitString()
if to.dead then return end
local all_choices = {"efengqi__tieji2", "efengqi__tieji3"}
if #room:askForDiscard(to, 1, 1, true, self.name, true, ".|.|"..judge.card:getSuitString(),
"#efengqi__tieji-discard:::"..suit) > 0 then
if not to.dead then
local choice = room:askForChoice(to, all_choices, self.name)
table.removeOne(all_choices, choice)
if choice == "efengqi__tieji2" then
room:setPlayerMark(to, "@@efengqi__tieji_basic-phase", 1)
elseif choice == "efengqi__tieji3" then
room:setPlayerMark(to, "@@efengqi__tieji_skill-turn", 1)
room:addPlayerMark(to, MarkEnum.UncompulsoryInvalidity.."-turn", 1)
end
end
else
room:setPlayerMark(to, "@@efengqi__tieji_basic-phase", 1)
room:setPlayerMark(to, "@@efengqi__tieji_skill-turn", 1)
room:addPlayerMark(to, MarkEnum.UncompulsoryInvalidity.."-turn", 1)
end
if player.dead then return end
if #all_choices == 1 then
if room:askForSkillInvoke(player, self.name, nil, "#efengqi__tieji-draw") then
if all_choices[1] == "efengqi__tieji2" then
room:setPlayerMark(player, "@@efengqi__tieji_basic-phase", 1)
elseif all_choices[1] == "efengqi__tieji3" then
room:setPlayerMark(player, "@@efengqi__tieji_skill-turn", 1)
room:addPlayerMark(player, MarkEnum.UncompulsoryInvalidity.."-turn", 1)
end
player:drawCards(3, self.name)
end
elseif #room:askForDiscard(player, 1, 1, true, self.name, true, ".|.|"..judge.card:getSuitString(),
"#efengqi__tieji-draw") > 0 then
if player.dead then return end
player:drawCards(3, self.name)
end
end,
}
local tieji_prohibit = fk.CreateProhibitSkill{
name = "#efengqi__tieji_prohibit",
prohibit_use = function(self, player, card)
return player:getMark("@@efengqi__tieji_basic-phase") > 0 and card.type == Card.TypeBasic
end,
}
tieji:addRelatedSkill(tieji_prohibit)
machao:addSkill("mashu")
machao:addSkill(tieji)
Fk:loadTranslationTable{
["efengqi__machao"] = "马超",
["#efengqi__machao"] = "一骑当千",
["illustrator:efengqi__machao"] = "刘小狼",
["designer:efengqi__machao"] = "屑",
["efengqi__tieji"] = "铁骑",
[":efengqi__tieji"] = "当你使用伤害牌指定唯一目标后,你可以进行一次判定,其执行两项:1.弃置一张同花色牌;2.本阶段无法使用基本牌;"..
"3.本回合非锁定技失效。然后你可以执行剩余项,摸三张牌。",
["#efengqi__tieji-discard"] = "铁骑:弃置一张%arg牌,否则本回合无法使用基本牌且非锁定技失效!",
["efengqi__tieji2"] = "本阶段无法使用基本牌",
["efengqi__tieji3"] = "本回合非锁定技失效",
["@@efengqi__tieji_basic-phase"] = "禁止使用基本牌",
["@@efengqi__tieji_skill-turn"] = "非锁定技失效",
["#efengqi__tieji-draw"] = "铁骑:是否执行剩余项,摸三张牌?",
["$efengqi__tieji1"] = "目标敌阵,全军突击!",
["$efengqi__tieji2"] = "敌人阵型已乱,随我杀!",
["~efengqi__machao"] = "请将我,葬在西凉……",
}
local huangyueying = General(extension, "efengqi__huangyueying", "han", 3, 3, General.Female)
local jizhi = fk.CreateTriggerSkill{
name = "efengqi__jizhi",
events = {fk.CardUsing},
anim_type = "drawcard",
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and player == target and data.card.type == Card.TypeTrick
--and table.find(player.room.alive_players, function (p)
-- return not table.contains(player:getTableMark("efengqi__jizhi-turn"), p.id)
--end)
end,
on_cost = function (self, event, target, player, data)
local targets = table.filter(player.room.alive_players, function (p)
return not table.contains(player:getTableMark("efengqi__jizhi-turn"), p.id)
end)
local tos = player.room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#efengqi__jizhi-choose", self.name, true)
if #tos > 0 then
self.cost_data = {tos = tos}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data.tos[1])
to:drawCards(1, self.name)
if to ~= player and not player.dead and not to:isNude() then
local cards = room:askForCard(to, 1, 1, true, self.name, true, ".", "#efengqi__jizhi-give:"..player.id)
if #cards > 0 then
room:addTableMark(player, "efengqi__jizhi-turn", to.id)
room:obtainCard(player, cards, false, fk.ReasonGive, to.id, self.name)
end
end
end,
}
huangyueying:addSkill(jizhi)
local cangji = fk.CreateTriggerSkill{
name = "efengqi__cangji",
anim_type = "drawcard",
events = {fk.GameStart},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local ids = {}
for _, name in ipairs({"ex_nihilo", "eight_diagram"}) do
local ret = room:getCardsFromPileByRule(name)[1]
if not ret then
local suit, num = Card.Spade, 1
for cardName, card in pairs(Fk.all_card_types) do
if cardName == name then
suit = card.suit
num = card.number
break
end
end
ret = room:printCard(name, suit, num).id
room:setCardMark(Fk:getCardById(ret), MarkEnum.DestructIntoDiscard, 1)
end
table.insert(ids, ret)
end
room:obtainCard(player, ids, true, fk.ReasonJustMove, player.id, self.name)
end,
refresh_events = {fk.DrawInitialCards},
can_refresh = function (self, event, target, player, data)
return player:hasSkill(self) and target == player
end,
on_refresh = function (self, event, target, player, data)
data.num = math.max(data.num - 2, 0)
end,
}
huangyueying:addSkill(cangji)
Fk:loadTranslationTable{
["efengqi__huangyueying"] = "黄月英",
["#efengqi__huangyueying"] = "",
["illustrator:efengqi__huangyueying"] = "光域",
["designer:efengqi__huangyueying"] = "zzcclll朱苦力",
["efengqi__jizhi"] = "集智",
[":efengqi__jizhi"] = "你使用锦囊牌时,你可以令一名角色摸一张牌,若不为你,其可以交给你一张牌,令你本回合不能以此法选择该角色。",
["#efengqi__jizhi-choose"] = "集智:你可以令一名角色摸一张牌,其可以交给你一张牌",
["#efengqi__jizhi-give"] = "集智:你可以交给 %src 一张牌",
["efengqi__cangji"] = "藏机",
[":efengqi__cangji"] = "锁定技,你的初始手牌-2;游戏开始时,你获得一张【八卦阵】与【无中生有】。",
["$efengqi__jizhi1"] = "得上通,智集心。",
["$efengqi__jizhi2"] = "集万千才智,致巧趣鲜用。",
["$efengqi__cangji1"] = "哼哼~",
["$efengqi__cangji2"] = "哼~",
["~efengqi__huangyueying"] = "亮……",
}
local zhaoyun = General(extension, "efengqi__zhaoyun", "han", 4)
local qizhen = fk.CreateViewAsSkill{
name = "efengqi__qizhen",
anim_type = "offensive",
pattern = ".|.|.|.|.|basic",
prompt = "#efengqi__qizhen",
interaction = function(self)
local all_choices = U.getAllCardNames("b")
local choices = U.getViewAsCardNames(Self, self.name, all_choices)
if #choices > 0 then
return U.CardNameBox { choices = choices, all_choices = all_choices }
end
end,
card_filter = function(self, to_select, selected)
return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeBasic and self.interaction.data
and Fk:cloneCard(self.interaction.data).trueName ~= Fk:getCardById(to_select).trueName
end,
view_as = function(self, cards)
if #cards ~= 1 or not self.interaction.data then return nil end
local c = Fk:cloneCard(self.interaction.data)
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
before_use = function(self, player, use)
local room = player.room
if player:usedSkillTimes(self.name, Player.HistoryTurn) == 1 then
room:setPlayerMark(player, "@$efengqi__qizhen-turn", {use.card.trueName, Fk:getCardById(use.card.subcards[1]).trueName})
end
end,
enabled_at_play = function(self, player)
return true
end,
enabled_at_response = function (self, player, response)
return not player:isKongcheng()
end,
}
local qizhen_trigger = fk.CreateTriggerSkill{
name = "#efengqi__qizhen_trigger",
events = {fk.TurnEnd},
anim_type = "control",
can_trigger = function(self, event, target, player, data)
return player:getMark("@$efengqi__qizhen-turn") ~= 0 and not player.room.current.dead
and player:getHandcardNum() ~= player.room.current:getHandcardNum()
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local mark = player:getMark("@$efengqi__qizhen-turn")
local current = room.current
local all_choices = table.filter(U.getAllCardNames("b"), function (name)
return not table.contains(mark, Fk:cloneCard(name).trueName)
end)
local choices = table.filter(all_choices, function (name)
local card = Fk:cloneCard(name)
card.skillName = qizhen.name
if not player:prohibitUse(card) and not player:isProhibited(current, card) then
if card.trueName == "peach" then -- FIXME: stupid peach target filter
return current:isWounded()
else
return player:canUse(card, {bypass_distances = true, bypass_times = true})
and card.skill:modTargetFilter(current.id, {}, player.id, card, false)
end
end
end)
if #choices == 0 then return end
choices = U.askForChooseCardNames(room, player, choices, 1, 1, qizhen.name,
"#efengqi__qizhen-card::"..current.id..":"..current:getHandcardNum(), all_choices, true)
if #choices > 0 then
local num = player:getHandcardNum() - current:getHandcardNum()
if num > 0 then
room:askForDiscard(player, num, num, false, qizhen.name, false)
elseif num < 0 then
player:drawCards(-num, qizhen.name)
end
room:useVirtualCard(choices[1], nil, player, current, qizhen.name, true)
end
end,
}
qizhen:addRelatedSkill(qizhen_trigger)
zhaoyun:addSkill(qizhen)
Fk:loadTranslationTable{
["efengqi__zhaoyun"] = "赵云",
["#efengqi__zhaoyun"] = "虎威将军",
["illustrator:efengqi__zhaoyun"] = "",
["designer:efengqi__zhaoyun"] = "Romantic",
["efengqi__qizhen"] = "旂阵",
[":efengqi__qizhen"] = "你可以将一张基本牌当另一张基本牌使用或打出,若为本回合首次发动,你可以于回合结束时将手牌调整至与当前回合角色相同"..
"并视为对其使用第三种基本牌。",
["#efengqi__qizhen"] = "旂阵:可以将一张基本牌当另一张基本牌使用或打出",
["#efengqi__qizhen_trigger"] = "旂阵",
["#efengqi__qizhen-card"] = "旂阵:你可以将手牌调整至%arg张,并视为对%dest使用第三种基本牌",
["@$efengqi__qizhen-turn"] = "旂阵",
["$efengqi__qizhen1"] = "为将者,自当尽忠尽职。",
["$efengqi__qizhen2"] = "一人一枪一匹马,疆场尽驰骋。",
["~efengqi__zhaoyun"] = "你们谁…还敢再上……",
}
local yijik = General(extension, "efengqi__yijik", "han", 3)
local jiyuan = fk.CreateViewAsSkill{
name = "efengqi__jiyuan",
anim_type = "support",
pattern = ".|.|.|.|.|basic",
prompt = "#efengqi__jiyuan",
times = function(self)
return 3 - Self:usedSkillTimes(self.name, Player.HistoryRound)
end,
interaction = function(self)
local all_names = U.getAllCardNames("b")
local names = U.getViewAsCardNames(Self, self.name, all_names, nil, Self:getTableMark("efengqi__jiyuan-phase"))
if #names > 0 then
return U.CardNameBox { choices = names, all_choices = all_names }
end
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
if #cards ~= 0 or not self.interaction.data then return end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = self.name
return card
end,
before_use = function(self, player, use)
local room = player.room
room:broadcastPlaySound("./packages/standard_cards/audio/card/"..(player.gender == General.Male and "male" or "female")..
"/"..use.card.name)
room:broadcastPlaySound("./packages/maneuvering/audio/card/"..(player.gender == General.Male and "male" or "female")..
"/"..use.card.name)
if use.tos then
room:doIndicate(player.id, TargetGroup:getRealTargets(use.tos))
end
local to = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 1, 1,
"#efengqi__jiyuan-choose", self.name, false)
to = room:getPlayerById(to[1])
to:drawCards(1, self.name)
if to.dead then return self.name end
local cardResponded = room:askForResponse(to, self.name, ".|.|.|.|"..use.card.name,
"#efengqi__jiyuan-ask:"..player.id.."::"..use.card.name, true)
if cardResponded then
room:responseCard({
from = to.id,
card = cardResponded,
skipDrop = true,
})
use.card = cardResponded
return
end
room:addTableMark(player, "efengqi__jiyuan-phase", use.card.name)
return self.name
end,
enabled_at_play = function (self, player)
return player:usedSkillTimes(self.name, Player.HistoryRound) < 3
end,
enabled_at_response = function(self, player, response)
return not response and player:usedSkillTimes(self.name, Player.HistoryRound) < 3
end,
}
local jiyuan_prohibit = fk.CreateProhibitSkill{
name = "#efengqi__jiyuan_prohibit",
prohibit_use = function(self, player, card)
return table.contains(player:getTableMark("efengqi__jiyuan-phase"), card.name)
end,
}
jiyuan:addRelatedSkill(jiyuan_prohibit)
yijik:addSkill(jiyuan)
Fk:loadTranslationTable{
["efengqi__yijik"] = "伊籍",
["#efengqi__yijik"] = "",
["illustrator:efengqi__yijik"] = "凝聚永恒",
["designer:efengqi__yijik"] = "屑&柠檬",
["efengqi__jijie"] = "机捷",
[":efengqi__jijie"] = "牌堆底的牌对你可见。你摸牌时,或后,可以将之置于牌堆顶。",--省事了
["efengqi__jiyuan"] = "急援",
[":efengqi__jiyuan"] = "每轮限三次,当你需要使用基本牌时,可以令一名角色摸一张牌,然后其选择一项:1.代替你使用此牌;2.本阶段你不能使用所需牌。",
["#efengqi__jiyuan"] = "急援:声明你要使用的基本牌和目标,然后令一名角色摸一张牌,其替你使用此牌或你本阶段不能使用此牌",
["#efengqi__jiyuan-choose"] = "急援:令一名角色摸一张牌,其替你使用此牌或你本阶段不能使用此牌",
["#efengqi__jiyuan-ask"] = "急援:是否替 %src 使用一张【%arg】?",
["$efengqi__jijie1"] = "一拜一起,未足为劳。",
["$efengqi__jijie2"] = "识言观行,方能雍容风议。",
["$efengqi__jiyuan1"] = "公若辞,必遭蔡瑁之害矣。",
["$efengqi__jiyuan2"] = "形势危急,还请速行。",
["~efengqi__yijik"] = "未能,救得刘公脱险……",
}
local lvbu = General(extension, "efengqi__lvbu", "han", 5)
--[[
local wushuang = fk.CreateTriggerSkill{
name = "efengqi__wushuang",
anim_type = "offensive",
frequency = Skill.Compulsory,
events = {fk.TargetSpecified, fk.TargetConfirmed},
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if event == fk.TargetSpecified then
return target == player and table.contains({ "slash", "duel" }, data.card.trueName)
else
return data.to == player.id and data.card.trueName == "duel"
end
end,
on_use = function(self, event, target, player, data)
data.fixedResponseTimes = data.fixedResponseTimes or {}
if data.card.trueName == "slash" then
data.fixedResponseTimes["jink"] = 2
else
data.fixedResponseTimes["slash"] = 2
data.fixedAddTimesResponsors = data.fixedAddTimesResponsors or {}
table.insert(data.fixedAddTimesResponsors, (event == fk.TargetSpecified and data.to or data.from))
end
end,
}
lvbu:addSkill(wushuang)
local efengqi__linwu = fk.CreateTriggerSkill{
name = "efengqi__linwu",
anim_type = "offensive",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Play then
return not player:prohibitUse(Fk:cloneCard("duel")) and table.find(player.room.alive_players, function(p)
return not p:isNude()
end)
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local card = Fk:cloneCard("duel")
card.skillName = self.name
-- 未知子卡时按无色卡检测合法性
local targets = table.filter(room:getOtherPlayers(player, false), function (p)
return not player:isProhibited(p, card)
end)
if #targets == 0 then return false end
local max_num = card.skill:getMaxTargetNum(player, card)
local tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, max_num, "#efengqi__linwu-choose", self.name, true)
if #tos > 0 then
self.cost_data = {tos = tos}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local tos = table.map(self.cost_data.tos, Util.Id2PlayerMapper)
local moves = {}
local subcards = {}
for _, p in ipairs(room:getAlivePlayers()) do
if not p:isNude() then
local cid = room:askForCardChosen(player, p, "he", self.name)
table.insert(subcards, cid)
table.insert(moves, {
from = p.id,
ids = {cid},
toArea = Card.Processing,
moveReason = fk.ReasonUse,
skillName = self.name,
proposer = player.id,
})
end
end
if #moves == 0 then return end
room:moveCards(table.unpack(moves))
subcards = table.filter(subcards, function (id)
return room:getCardArea(id) == Card.Processing
end)
room:useVirtualCard("duel", subcards, player, tos, self.name)
end,
}
local efengqi__linwu_delay = fk.CreateTriggerSkill{
name = "#efengqi__linwu_delay",
mute = true,
events = { fk.AskForCardResponse },
can_trigger = function (self, event, target, player, data)
if target == player and not player.dead and data.cardName == "slash" then
local effect = data.eventData
if effect and table.contains(effect.card.skillNames, "efengqi__linwu") then
return table.find(effect.card.subcards, function (id)
return player.room:getCardArea(id) == Card.Processing
end)
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local effect = data.eventData
local avil_cards = table.filter(effect.card.subcards, function (id)
if room:getCardArea(id) == Card.Processing then
local c = Fk:cloneCard("slash")
c.skillName = "efengqi__linwu"
c:addSubcard(id)
return not player:prohibitResponse(c)
end
end)
if #avil_cards > 0 and room:askForSkillInvoke(player, self.name, nil, "#efengqi__linwu-ask") then
local cid = room:askForCardChosen(player, player, { card_data = { { self.name, avil_cards } } }, self.name, "#efengqi__linwu-card")
self.cost_data = cid
return true
end
end,
on_use = function(self, event, target, player, data)
local c = Fk:cloneCard("slash")
c.skillName = "efengqi__linwu"
c:addSubcard(self.cost_data)
data.result = c
return true
end,
}
efengqi__linwu:addRelatedSkill(efengqi__linwu_delay)
lvbu:addSkill(efengqi__linwu)
]]--
local jiwu = fk.CreateTriggerSkill{
name = "efengqi__jiwu",
anim_type = "offensive",
frequency = Skill.Compulsory,
events = {fk.TargetSpecified, fk.Damage},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event == fk.TargetSpecified then
return data.card.trueName == "slash"
elseif event == fk.Damage then
return true
end
end
end,
on_use = function(self, event, target, player, data)
if event == fk.TargetSpecified then
data.fixedResponseTimes = data.fixedResponseTimes or {}
data.fixedResponseTimes["jink"] = 1 + player:getMark("@efengqi__jiwu")[1]
elseif event == fk.Damage then
local room = player.room
local all_choices, result = {"1", "2", "3"}, {}
local n1 = room:askForChoice(player, all_choices, self.name, "#efengqi__jiwu1-ask")
table.removeOne(all_choices, n1)
n1 = tonumber(n1)
table.insert(result, n1)
local n2 = room:askForChoice(player, all_choices, self.name, "#efengqi__jiwu2-ask")
table.removeOne(all_choices, n2)
n2 = tonumber(n2)
table.insert(result, n2)
table.insert(result, tonumber(all_choices[1]))
room:setPlayerMark(player, "@efengqi__jiwu", result)
end
end,
on_acquire = function (self, player, is_start)
player.room:setPlayerMark(player, "@efengqi__jiwu", {1, 2, 3})
end,
on_lose = function (self, player, is_death)
player.room:setPlayerMark(player, "@efengqi__jiwu", 0)
end,
}
local jiwu_targetmod = fk.CreateTargetModSkill{
name = "#efengqi__jiwu_targetmod",
frequency = Skill.Compulsory,
extra_target_func = function(self, player, skill)
if skill.trueName == "slash_skill" and player:hasSkill(jiwu) then
return player:getMark("@efengqi__jiwu")[2]
end
end,
}
local jiwu_attackrange = fk.CreateAttackRangeSkill{
name = "#efengqi__jiwu_attackrange",
frequency = Skill.Compulsory,
correct_func = function (self, from, to)
if from:hasSkill(jiwu) then
return from:getMark("@efengqi__jiwu")[3]
end
return 0
end,
}
jiwu:addRelatedSkill(jiwu_targetmod)
jiwu:addRelatedSkill(jiwu_attackrange)
lvbu:addSkill(jiwu)
Fk:loadTranslationTable{
["efengqi__lvbu"] = "吕布",
["#efengqi__lvbu"] = "武开穹巅",
["designer:efengqi__lvbu"] = "zzcclll朱苦力",
["illustrator:efengqi__lvbu"] = "鱼仔",
["efengqi__wushuang"] = "无双",
[":efengqi__wushuang"] = "锁定技,当你使用【杀】指定目标后,其使用【闪】抵消此【杀】的方式改为需连续使用两张【闪】;当你使用【决斗】指定目标后,或当你成为【决斗】的目标后,你令其打出【杀】响应此【决斗】的方式改为需连续打出两张【杀】。",
["efengqi__linwu"] = "凛武",
[":efengqi__linwu"] = "出牌阶段开始时,你可以将所有角色各一张牌当一张【决斗】使用,且你与目标均可以用转化底牌响应之。",
["#efengqi__linwu-choose"] = "凛武:选择【决斗】的目标,你将所有角色各一张牌当一张【决斗】对其使用",
["#efengqi__linwu-ask"] = "凛武:你可以转化底牌响应此【决斗】",
["#efengqi__linwu-card"] = "凛武:转化一张牌响应此【决斗】",
["#efengqi__linwu_delay"] = "凛武",
["efengqi__jiwu"] = "极武",
[":efengqi__jiwu"] = "锁定技,你使用【杀】的:响应量+1、可指定目标数+2;攻击范围+3;你造成伤害后,可以重新分配数字!",
["@efengqi__jiwu"] = "极武",
["#efengqi__jiwu1-ask"] = "极武:选择你使用【杀】所需响应数+",
["#efengqi__jiwu2-ask"] = "极武:选择你使用【杀】额外指定目标数+",
["$efengqi__wushuang1"] = "别再做无谓的挣扎了!",
["$efengqi__wushuang2"] = "无敌还真是寂寞啊。",
["$efengqi__jiwu1"] = "还有哪个敢挑战我!?",
["$efengqi__jiwu2"] = "三个齐上,也不是我的对手!",
["~efengqi__lvbu"] = "我竟然输了……不可能!",
}
local sunquan = General(extension, "efengqi__sunquan", "wu", 4)
local zhiheng = fk.CreateActiveSkill{
name = "efengqi__zhiheng",
anim_type = "drawcard",
card_num = 0,
target_num = 1,
interaction = function(self)
local all_choices = {"efengqi__zhiheng1", "efengqi__zhiheng2"}
local choices = table.filter(all_choices, function (ch)
return Self:getMark(ch.."-phase") == 0
end)
if #choices > 0 then
return UI.ComboBox { choices = choices, all_choices = all_choices }
end
end,
prompt = "#efengqi__zhiheng",
can_use = function(self, player)
return player:getMark("efengqi__zhiheng1-phase") == 0 or player:getMark("efengqi__zhiheng2-phase") == 0
end,
card_filter = Util.FalseFunc,
target_filter = function (self, to_select, selected)
local to = Fk:currentRoom():getPlayerById(to_select)
if self.interaction.data == "efengqi__zhiheng1" then
return to:getHandcardNum() % 2 == 1
else
return to:getHandcardNum() % 2 == 0
end
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.tos[1])
local choice = self.interaction.data
room:setPlayerMark(player, choice.."-phase", 1)
local num = 3
if choice:endsWith("1") then
to:drawCards(num, self.name)
if not to.dead and not to:isKongcheng() then
num = to:getHandcardNum() // 2
room:askForDiscard(to, num, num, false, self.name, false)
end
else
num = to:getHandcardNum() // 2
room:askForDiscard(to, num, num, false, self.name, false)
if not to.dead then
to:drawCards(3, self.name)
end
end
end,
}
sunquan:addSkill(zhiheng)
local jiuyuan = fk.CreateTriggerSkill{
name = "efengqi__jiuyuan$",
anim_type = "drawcard",
events = {fk.TargetConfirmed},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and data.card.trueName == "peach" and target == player and data.from ~= player.id
end,
on_use = function (self, event, target, player, data)
local room = player.room
player:drawCards(1, self.name)
local from = room:getPlayerById(data.from)
if from.kingdom == "wu" then
data.additionalEffect = (data.additionalEffect or 0) + 1
end
end
}
sunquan:addSkill(jiuyuan)
Fk:loadTranslationTable{
["efengqi__sunquan"] = "孙权",
["#efengqi__sunquan"] = "轻冠镇江",
["designer:efengqi__sunquan"] = "廷玉",
["illustrator:efengqi__sunquan"] = "蛋蛋",
["efengqi__zhiheng"] = "制衡",
[":efengqi__zhiheng"] = "出牌阶段各限一次,你可以:令一名手牌数为奇数的角色摸三张牌并弃置半数手牌;令一名手牌数为偶数的角色弃置半数手牌并摸三张牌。",
["#efengqi__zhiheng"] = "制衡:令一名角色摸三弃半,或弃半摸三!",
["efengqi__zhiheng1"] = "令奇数手牌数角色摸三弃半",
["efengqi__zhiheng2"] = "令偶数手牌数角色弃半摸三",
["efengqi__jiuyuan"] = "救援",
[":efengqi__jiuyuan"] = "主公技,锁定技,其他角色对你使用【桃】时,你摸一张牌,若为吴势力角色,令之多结算一次。",
["$efengqi__zhiheng1"] = "不急不躁,稳谋应对。",
["$efengqi__zhiheng2"] = "制衡互牵,大局可安。",
["$efengqi__jiuyuan1"] = "你们真是朕的得力干将。",
["$efengqi__jiuyuan2"] = "有爱卿在,朕无烦忧。",
["~efengqi__sunquan"] = "锦绣江东,岂能失于我手……",
}
local ganning = General(extension, "efengqi__ganning", "wu", 4)
local qixi = fk.CreateViewAsSkill{
name = "efengqi__qixi",
anim_type = "control",
pattern = "dismantlement",
prompt = "#efengqi__qixi",
card_filter = function(self, to_select, selected)
return #selected == 0 and Fk:getCardById(to_select).color == Card.Black
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
local c = Fk:cloneCard("dismantlement")
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
enabled_at_response = function (self, player, response)
return not response
end
}
local qixi_delay = fk.CreateTriggerSkill{
name = "#efengqi__qixi_delay",
mute = true,
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(qixi) and not player:isNude()
and table.contains(data.card.skillNames, qixi.name)
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local useEvent = room.logic:getCurrentEvent():findParent(GameEvent.UseCard, true)
if not useEvent then return end
local ids = {}
useEvent:searchEvents(GameEvent.MoveCards, 1, function (e)
if e.parent and e.parent.parent and e.parent.parent.event == GameEvent.CardEffect
and e.parent.parent.data[1].card == data.card then
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard and move.skillName:endsWith("dismantlement_skill") then
for _, info in ipairs(move.moveInfo) do
if room:getCardArea(info.cardId) == Card.DiscardPile then
table.insertIfNeed(ids, info.cardId)
end
end
end
end
end
end)
if #ids > 0 then
local tos, cardId = room:askForChooseCardAndPlayers(player, table.map(room:getOtherPlayers(player, false), Util.IdMapper),
1, 1, ".|.|diamond,heart", "#efengqi__qixi-red:::"..#ids, qixi.name, true)
if #tos == 0 then return end
room:obtainCard(room:getPlayerById(tos[1]), cardId, true, fk.ReasonGive, player.id, qixi.name)
if player.dead then return end
ids = table.filter(ids, function (id) return room:getCardArea(id) == Card.DiscardPile end)
room:askForYiji(player, ids, nil, qixi.name, #ids, #ids, nil, ids)
end
end,
}
qixi:addRelatedSkill(qixi_delay)
ganning:addSkill(qixi)
local fenwei = fk.CreateTriggerSkill{
name = "efengqi__fenwei",
anim_type = "defensive",
frequency = Skill.Limited,
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and data.card.type == Card.TypeTrick and #AimGroup:getAllTargets(data.tos) > 1 and data.firstTarget
and player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
on_cost = function(self, event, target, player, data)
local tos = player.room:askForChoosePlayers(player, AimGroup:getAllTargets(data.tos),
1, 999, "#efengqi__fenwei-choose:::"..data.card:toLogString(), self.name, true)
if #tos > 0 then
self.cost_data = {tos = tos}
return true
end
end,
on_use = function(self, event, target, player, data)
table.insertTableIfNeed(data.nullifiedTargets, self.cost_data.tos)
end,
}
ganning:addSkill(fenwei)
Fk:loadTranslationTable{
["efengqi__ganning"] = "甘宁",
["#efengqi__ganning"] = "锦帆游侠",
["designer:efengqi__ganning"] = "隐匿",
["illustrator:efengqi__ganning"] = "太玄工作室",
["efengqi__qixi"] = "奇袭",
[":efengqi__qixi"] = "你可以将黑色牌当【过河拆桥】使用,然后你可以交出一张红色牌,分配弃置牌。",
["#efengqi__qixi"] = "奇袭:将黑色牌当【过河拆桥】使用,然后可交出一张红色牌,分配弃置牌",
["#efengqi__qixi-red"] = "奇袭:你可以交出一张红色牌,分配 %arg 张弃置牌",
["#efengqi__qixi_delay"] = "奇袭",
["efengqi__fenwei"] = "奋威",
[":efengqi__fenwei"] = "限定技,当一张锦囊牌指定多个目标后,你可令此牌对其中任意个目标无效。",
["#efengqi__fenwei-choose"] = "奋威:你可以令此%arg对任意个目标无效",
["$efengqi__qixi1"] = "弟兄们,准备动手!",
["$efengqi__qixi2"] = "你用不了这么多了!",
["$efengqi__fenwei1"] = "奋勇当先,威名远扬!",
["$efengqi__fenwei2"] = "哼!敢欺我东吴无人。",
["~efengqi__ganning"] = "别管我,继续上!",
}
local lvmeng = General(extension, "efengqi__lvmeng", "wu", 4)
local keji = fk.CreateTriggerSkill{
name = "efengqi__keji",
anim_type = "drawcard",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
for _, move in ipairs(data) do
if move.from == player.id and move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
if Fk:getCardById(info.cardId).trueName == "slash" then
return true
end
end
end
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local ids = {}
for _, move in ipairs(data) do
if move.from == player.id and move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
table.insert(ids, info.cardId)
end
end
end
local n = #ids
if table.every(ids, function (id)
return Fk:getCardById(id).trueName == "slash"
end) then
n = 2 * n
end
player:drawCards(n, self.name)
end,
}
lvmeng:addSkill(keji)
Fk:loadTranslationTable{
["efengqi__lvmeng"] = "吕蒙",
["#efengqi__lvmeng"] = "白衣渡江",
["designer:efengqi__lvmeng"] = "食马者",
["illustrator:efengqi__lvmeng"] = "M云涯",
["efengqi__keji"] = "克己",
[":efengqi__keji"] = "你弃置牌后,若包含【杀】,摸等量牌;若均为【杀】,改为摸两倍的牌。",
["$efengqi__keji1"] = "蓄力待时,不争首功。",
["$efengqi__keji2"] = "最好的机会,还在等着我。",
["~efengqi__lvmeng"] = "你,给我等着!",
}
local huanggai = General(extension, "efengqi__huanggai", "wu", 4)
local zhaxiang = fk.CreateViewAsSkill{
name = "efengqi__zhaxiang",
anim_type = "offensive",
pattern = "fire_attack",
prompt = "#efengqi__zhaxiang",
card_filter = Util.FalseFunc,
view_as = function(self)
local c = Fk:cloneCard("fire_attack")
c.skillName = self.name
return c
end,
before_use = function(self, player, use)
use.extra_data = use.extra_data or {}
use.extra_data.efengqi__zhaxiangSource = player.id
end,
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
enabled_at_response = Util.FalseFunc,
}
local zhaxiang_delay = fk.CreateTriggerSkill{
name = "#efengqi__zhaxiang_delay",
anim_type = "drawcard",
events = {fk.Damage},
can_trigger = function(self, event, target, player, data)
if player.dead then return false end
local useEvent = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if useEvent then
local use = useEvent.data[1]
return use.extra_data and use.extra_data.efengqi__zhaxiangSource == player.id
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
player:drawCards(3, zhaxiang.name)
room:addPlayerMark(player, MarkEnum.SlashResidue.."-phase")
end,
}
zhaxiang:addRelatedSkill(zhaxiang_delay)
huanggai:addSkill(zhaxiang)
Fk:loadTranslationTable{
["efengqi__huanggai"] = "黄盖",
["#efengqi__huanggai"] = "",
["designer:efengqi__huanggai"] = "食茸",
["illustrator:efengqi__huanggai"] = "白",
["efengqi__zhaxiang"] = "诈降",
[":efengqi__zhaxiang"] = "出牌阶段限一次,你可以视为使用【火攻】。你以此法造成伤害后,你摸三张牌,然后本阶段你可以多使用一张【杀】。",
["#efengqi__zhaxiang"] = "诈降:你可视为使用【火攻】,造成伤害后摸三张牌且出【杀】次数+1",
["#efengqi__zhaxiang_delay"] = "诈降",
["$efengqi__zhaxiang1"] = "铁锁连舟而行,东吴水师可破!",
["$efengqi__zhaxiang2"] = "两军阵前,不斩降将!",
["~efengqi__huanggai"] = "盖,有负公瑾重托……",
}
local zhouyu = General(extension, "efengqi__zhouyu", "wu", 3)
local yingzi = fk.CreateTriggerSkill{
name = "efengqi__yingzi",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
for _, move in ipairs(data) do
if move.from ~= player.id and move.moveReason == fk.ReasonUse then
for _, info in ipairs(move.moveInfo) do
if info.extra_data and info.extra_data.efengqi__yingziCheck then
return true
end
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 and move.moveReason == fk.ReasonUse then
for _, info in ipairs(move.moveInfo) do
if info.extra_data and info.extra_data.efengqi__yingziCheck then
n = n + 1
end
end
end
end
for _ = 1, n, 1 do
if not player:hasSkill(self) then return end
self:doCost(event, target, player, data)
end
end,
on_use = function (self, event, target, player, data)
player:drawCards(1, self.name)
end,
refresh_events = {fk.DrawInitialCards, fk.AfterDrawInitialCards, fk.AfterCardsMove},
can_refresh = function (self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.DrawInitialCards then
return true
elseif event == fk.AfterDrawInitialCards then
return target ~= player and not target:isKongcheng()
end
end
if event == fk.AfterCardsMove and player.seat == 1 then
for _, move in ipairs(data) do
if move.moveReason == fk.ReasonUse then
return true
end
end
end
end,
on_refresh = function (self, event, target, player, data)
if event == fk.DrawInitialCards then
if target == player then
data.num = 0
player:broadcastSkillInvoke(self.name)
player.room:notifySkillInvoked(player, self.name, "negative")
else
data.num = data.num + 1
end
elseif event == fk.AfterDrawInitialCards then
local room = player.room
for _, id in ipairs(target:getCardIds("h")) do
room:setCardMark(Fk:getCardById(id), "@@efengqi__yingzi", 1)
end
elseif event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.moveReason == fk.ReasonUse then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Player.Hand and Fk:getCardById(info.cardId):getMark("@@efengqi__yingzi") ~= 0 then
info.extra_data = info.extra_data or {}
info.extra_data.efengqi__yingziCheck = true
player.room:setCardMark(Fk:getCardById(info.cardId), "@@efengqi__yingzi", 0)
end
end
end
end
end
end,
}
zhouyu:addSkill(yingzi)
---@return integer[]
local getGuyinCard = function ()
local room = Fk:currentRoom()
return table.filter(room:getBanner("efengqi__guyin_card") or {}, function(id)
return room:getCardArea(id) == Card.DiscardPile
end)
end
local efengqi__guyin = fk.CreateViewAsSkill{
name = "efengqi__guyin",
pattern = ".",
prompt = "#efengqi__guyin",
expand_pile = function () return getGuyinCard() end,
card_filter = function(self, to_select, selected)
return #selected == 0 and table.contains(getGuyinCard(), to_select)
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
return Fk:getCardById(cards[1])
end,
after_use = function (self, player, use)
local room = player.room
if room:getCardArea(use.card) == Card.DiscardPile then
room:moveCards {
ids = Card:getIdList(use.card),
toArea = Card.DrawPile,
moveReason = fk.ReasonJustMove,
skillName = self.name,
moveVisible = true,
drawPilePosition = math.random(#room.draw_pile+1),
}
end
end,
enabled_at_play = function(self, player)
return true
end,
enabled_at_response = function (self, player, response)
if not response and Fk.currentResponsePattern then
return table.find(getGuyinCard(), function(id)
return Exppattern:Parse(Fk.currentResponsePattern):match(Fk:getCardById(id))
end) ~= nil
end
end,
}
local efengqi__guyin_trigger = fk.CreateTriggerSkill{
name = "#efengqi__guyin_trigger",
anim_type = "support",
events = {fk.TurnStart},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target ~= player and not target.dead and not target:isKongcheng() then
return target:getMark(self.name) == 0
end
end,
on_cost = function (self, event, target, player, data)
local cards = player.room:askForCard(target, 1, 1, false, self.name, true, ".", "#efengqi__guyin-card:"..player.id)
if #cards > 0 then
self.cost_data = {cards = cards, tos = {target.id}}
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(target, self.name, 1)
local card = Fk:getCardById(self.cost_data.cards[1])
room:setCardMark(card, "@@efengqi__guyin", 1)
local banner = room:getBanner("efengqi__guyin_card") or {}
table.insertIfNeed(banner, card.id)
room:setBanner("efengqi__guyin_card", banner)
room:recover { num = 1, skillName = "efengqi__guyin", who = target, recoverBy = player }
end,
}
efengqi__guyin:addRelatedSkill(efengqi__guyin_trigger)
zhouyu:addSkill(efengqi__guyin)
Fk:loadTranslationTable{
["efengqi__zhouyu"] = "周瑜",
["#efengqi__zhouyu"] = "",
["designer:efengqi__zhouyu"] = "",
["illustrator:efengqi__zhouyu"] = "小新",
["efengqi__yingzi"] = "英姿",
[":efengqi__yingzi"] = "锁定技,你没有初始手牌,其他角色的初始手牌+1。其他角色因使用而失去一张初始手牌时,你摸一张牌。",
["@@efengqi__yingzi"] = "英姿",
["efengqi__guyin"] = "顾音",
[":efengqi__guyin"] = "每名其他角色限一次,其他角色回合开始时,其可以将一张手牌标记为“顾”,然后其回复1点体力;你可以如手牌般使用弃牌堆中的“顾”,然后将之从弃牌堆洗入牌堆中。",
["#efengqi__guyin-card"] = "顾音:你可以将一张手牌标记为“顾”,然后回复1点体力",
["#efengqi__guyin_trigger"] = "顾音",
["@@efengqi__guyin"] = "顾",
["#efengqi__guyin"] = "顾音:你可以如手牌般使用弃牌堆中的“顾”!",
["$efengqi__yingzi1"] = "哈哈哈哈……",
["$efengqi__yingzi2"] = "汝等看好了!",
["$efengqi__fanjian1"] = "挣扎吧,在血和暗的深渊里!",
["$efengqi__fanjian2"] = "痛苦吧,在仇与恨的地狱中!",
["~efengqi__zhouyu"] = "既生瑜,何生……",
}
local daqiao = General(extension, "efengqi__daqiao", "wu", 3, 3, General.Female)
local qiqin = fk.CreateTriggerSkill{
name = "efengqi__qiqin",
anim_type = "special",
frequency = Skill.Compulsory,
events = {fk.GameStart, fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if event == fk.GameStart then
return player:hasSkill(self) and not player:isKongcheng()
elseif player:hasSkill(self) and target == player and player.phase == Player.Play then
local get = table.filter(player.room:getBanner("efengqi__qiqin_record") or {}, function(id)
return not table.contains(player:getCardIds("h"), id)
end)
if #get > 0 then
self.cost_data = get
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.GameStart then
local cards = player:getCardIds(Player.Hand)
for _, id in ipairs(cards) do
room:setCardMark(Fk:getCardById(id), "@@efengqi__qiqin", 1)
end
local record = room:getBanner("efengqi__qiqin_record") or {}
table.insertTableIfNeed(record, cards)
room:setBanner("efengqi__qiqin_record", record)
else
room:moveCardTo(self.cost_data, Player.Hand, player, fk.ReasonJustMove, self.name, "", false, player.id)
end
end,
}
local qiqin_maxcards = fk.CreateMaxCardsSkill{
name = "#efengqi__qiqin_maxcards",
exclude_from = function(self, player, card)
return card and card:getMark("@@efengqi__qiqin") ~= 0 and player:hasSkill(qiqin)
end,
}
qiqin:addRelatedSkill(qiqin_maxcards)
daqiao:addSkill(qiqin)
local zixi = fk.CreateTriggerSkill{
name = "efengqi__zixi",
anim_type = "support",
events = {fk.TurnStart},
can_trigger = function(self, event, target, player, data)
if not target.dead and player:hasSkill(self) then
return not player:isKongcheng() and not table.contains(target.sealedSlots, Player.JudgeSlot)
end
end,
on_cost = function(self, event, target, player, data)
local ids = table.filter(player:getCardIds("he"), function(id) return Fk:getCardById(id):getMark("@@efengqi__qiqin") ~= 0 end)
local cards = player.room:askForCard(player, 1, 1, true, self.name, true, tostring(Exppattern{ id = ids }),
"#efengqi__zixi-invoke:"..target.id)
if #cards > 0 then
self.cost_data = {cards = cards, tos = {target.id}}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local cid = self.cost_data.cards[1]
local card = Fk:cloneCard("indulgence")
card:addSubcard(cid)
target:addVirtualEquip(card)
room:moveCardTo(cid, Player.Judge, target, fk.ReasonJustMove, self.name)
if target.dead then return end
local get = table.filter(target:getCardIds("ej"), function (id)
return Fk:getCardById(id).suit == Fk:getCardById(cid).suit
end)
if #get > 0 then
room:delay(400)
room:moveCardTo(get, Player.Hand, target, fk.ReasonJustMove, self.name, "", true, target.id)
end
end,
}
daqiao:addSkill(zixi)
Fk:loadTranslationTable{
["efengqi__daqiao"] = "大乔",
["#efengqi__daqiao"] = "",
["designer:efengqi__daqiao"] = "Romantic",
["illustrator:efengqi__daqiao"] = "",
["efengqi__qiqin"] = "绮琴",
[":efengqi__qiqin"] = "锁定技,游戏开始时,将初始手牌标记为“琴”,“琴”不计入你的手牌上限;出牌阶段开始时,你获得所有“琴”。",
["@@efengqi__qiqin"] = "琴",
["efengqi__zixi"] = "姊希",
[":efengqi__zixi"] = "每回合开始时,你可以将一张“琴”置入当前回合角色的判定区,然后其获得其场上所有与此牌花色相同的牌。",
["#efengqi__zixi-invoke"] = "姊希:你可以将一张“琴”置入 %src 判定区,然后其获得其场上与之花色相同的牌",
}
--FY018 陆逊 by屑
local luxun = General(extension, "efengqi__luxun", "wu", 3)
local zhuying = fk.CreateViewAsSkill{
name = "efengqi__zhuying",
pattern = "fire_attack,nullification",
mute = true,
prompt = "#efengqi__zhuying",
interaction = function(self)
local all_names = {"fire_attack", "nullification"}
local names = U.getViewAsCardNames(Self, self.name, all_names)
if #names > 0 then
return U.CardNameBox {choices = names, all_choices = all_names}
end
end,
card_filter = function (self, to_select, selected)
if Self:getHandcardNum() > 1 then
return #selected < Self:getHandcardNum() - 1 and table.contains(Self:getCardIds("h"), to_select) and
not Self:prohibitDiscard(to_select)
else
return false
end
end,
view_as = function(self, cards)
if Self:getHandcardNum() > 1 then
if #cards ~= Self:getHandcardNum() - 1 then return end
self.cost_data = cards
elseif Self:getHandcardNum() == 0 then
if #cards > 0 then return end
self.cost_data = nil
end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = self.name
return card
end,
before_use = function (self, player, use)
local room = player.room
if self.interaction.data == "fire_attack" then
player:broadcastSkillInvoke(self.name, table.random({1, 2}))
room:notifySkillInvoked(player, self.name, "offensive")
else
player:broadcastSkillInvoke(self.name, table.random({3, 4}))
room:notifySkillInvoked(player, self.name, "control")
end
if self.cost_data then
room:throwCard(self.cost_data, self.name, player, player)
else
player:drawCards(1, self.name)
end
end,
enabled_at_play = function(self, player)
return player:getHandcardNum() ~= 1
end,
enabled_at_response = function(self, player, response)
return not response and player:getHandcardNum() ~= 1
end,
}
luxun:addSkill(zhuying)
local qianxun = fk.CreateProhibitSkill{
name = "efengqi__qianxun",
frequency = Skill.Compulsory,
is_prohibited = function(self, from, to, card)
if to:hasSkill(self) then
return card.name == "indulgence" or card.name == "snatch"
end
end,
}
luxun:addSkill(qianxun)
Fk:loadTranslationTable{
["efengqi__luxun"] = "陆逊",
["#efengqi__luxun"] = "剑照儒纶",
["illustrator:efengqi__luxun"] = "官方",
["designer:efengqi__luxun"] = "屑",
["efengqi__zhuying"] = "烛营",
[":efengqi__zhuying"] = "你可以将手牌数调整至1,视为使用【火攻】或【无懈可击】",
["#efengqi__zhuying"] = "烛营:你可以将手牌数调整至1,视为使用【火攻】或【无懈可击】",
["efengqi__qianxun"] = "谦逊",
[":efengqi__qianxun"] = "锁定技,你不能被选择为【顺手牵羊】与【乐不思蜀】的目标。",
["$efengqi__zhuying1"] = "今提墨笔绘乾坤,湖海添色山永春。",
["$efengqi__zhuying2"] = "手提玉剑斥千军,昔日锦鲤化金龙。",
["~efengqi__luxun"] = "此生清白,不为浊泥所染。",
}
local sunshangxiang = General(extension, "efengqi__sunshangxiang", "wu", 3, 3, General.Female)
local xiaoji = fk.CreateTriggerSkill{
name = "efengqi__xiaoji",
anim_type = "drawcard",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return end
local choices = {}
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 then --甚至比标准版还弱
table.insertIfNeed(choices, 1)
end
if table.concat({Card.PlayerHand, Card.PlayerEquip}, info.fromArea) then
n = n + 1
end
end
end
end
if n > 1 then
table.insert(choices, 2)
end
if #choices > 0 then
self.cost_data = choices
if table.contains(choices, 1) then
return true
else
return table.find(player.room:getOtherPlayers(player), function (p)
return p:isWounded()
end)
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
if table.contains(self.cost_data, 1) then
player:drawCards(2, self.name)
if player.dead or not table.contains(self.cost_data, 2) then return end
end
local room = player.room
local targets = table.filter(room:getOtherPlayers(player), function (p)
return p:isWounded()
end)
if #targets == 0 then return end
local to = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#efengqi__xiaoji-invoke", self.name, true)
if #to > 0 then
to = room:getPlayerById(to[1])
room:recover{
who = to,
num = 1,
recoverBy = player,
skillName = self.name
}
if player:isWounded() and not player.dead then
room:recover{
who = player,
num = 1,
recoverBy = player,
skillName = self.name
}
end
end
end,
}
local jieyin = fk.CreateViewAsSkill{
name = "efengqi__jieyin",
anim_type = "support",
prompt = "#efengqi__jieyin",
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local c = Fk:cloneCard("sincere_treat")
c.skillName = self.name
return c
end,
enabled_at_play = function (self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
}
local jieyin_targetmod = fk.CreateTargetModSkill{
name = "#efengqi__jieyin_targetmod",
bypass_distances = function(self, player, skill, card, to)
return card and table.contains(card.skillNames, "efengqi__jieyin") and to:isMale()
end,
}
jieyin:addRelatedSkill(jieyin_targetmod)
sunshangxiang:addSkill(xiaoji)
sunshangxiang:addSkill(jieyin)
Fk:loadTranslationTable{
["efengqi__sunshangxiang"] = "孙尚香",
["#efengqi__sunshangxiang"] = "弓腰姬",
["illustrator:efengqi__sunshangxiang"] = "君桓文化",
["designer:efengqi__sunshangxiang"] = "老猫",
["efengqi__xiaoji"] = "枭姬",
[":efengqi__xiaoji"] = "当你失去:装备区中的牌后,摸两张牌;至少两张牌后,你可以与一名其他角色各回复1点体力。",
["efengqi__jieyin"] = "结姻",
[":efengqi__jieyin"] = "出牌阶段限一次,你可以视为使用【推心置腹】,此牌对男性角色使用无距离限制。",
["#efengqi__xiaoji-invoke"] = "枭姬:你可以与一名其他角色各回复1点体力",
["#efengqi__jieyin"] = "结姻:你可以视为使用【推心置腹】",
["$efengqi__jieyin1"] = "随夫嫁娶,宜室宜家。",
["$efengqi__jieyin2"] = "得遇夫君,妾身福分。",
["$efengqi__xiaoji1"] = "剑利弓急,你可打不过我的。",
["$efengqi__xiaoji2"] = "我会的武器,可多着呢。",
["~efengqi__sunshangxiang"] = "哎呀,这次弓箭射歪了。",
}
local huatuo = General(extension, "efengqi__huatuo", "qun", 3)
local chuli = fk.CreateActiveSkill{
name = "efengqi__chuli",
anim_type = "control",
card_num = 1,
target_num = 0,
prompt = "#efengqi__chuli",
card_filter = function(self, to_select, selected)
return #selected == 0 and Fk:getCardById(to_select).suit == Card.Club
end,
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:recastCard(effect.cards, player, self.name)
if player.dead then return end
local n, drawer = 4, {}
while n > 0 do
local targets = table.filter(room.alive_players, function (p) return not p:isNude() end)
if #targets == 0 then break end
local tos = room:askForChoosePlayers(player, table.map(player.room.alive_players, Util.IdMapper),
1, 1, "#efengqi__chuli-choose:::"..n, self.name, false)
if #tos > 0 then
local to = room:getPlayerById(tos[1])
local cards = room:askForCardsChosen(player, to, 1, n, "he", self.name)
n = n - #cards
if table.find(cards, function (id) return Fk:getCardById(id).suit == Card.Spade end) then
table.insertIfNeed(drawer, to.id)
end
room:throwCard(cards, self.name, to, player)
if player.dead then break end
end
end
if #drawer > 0 then
room:delay(300)
room:sortPlayersByAction(drawer)
room:doIndicate(player.id, drawer)
for _, pid in ipairs(drawer) do
local p = room:getPlayerById(pid)
if not p.dead then
local num = p.maxHp - p:getHandcardNum()
if num > 0 then
p:drawCards(num, self.name)
end
end
end
end
end,
}
huatuo:addSkill(chuli)
local qingnang = fk.CreateViewAsSkill{
name = "efengqi__qingnang",
pattern = "peach,drugs",
prompt = "#efengqi__qingnang",
anim_type = "support",
card_filter = function(self, to_select, selected)
if #selected > 0 then return false end
local suit = Fk:getCardById(to_select).suit
local c
if suit == Card.Heart then
c = Fk:cloneCard("peach")
elseif suit == Card.Diamond then
c = Fk:cloneCard("drugs")
else
return false
end
c.skillName = self.name
return (Fk.currentResponsePattern == nil and c.skill:canUse(Self, c) and not Self:prohibitUse(c))
or (Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(c))
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
local c = Fk:cloneCard(Fk:getCardById(cards[1]).suit == Card.Heart and "peach" or "drugs")
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
}
huatuo:addSkill(qingnang)
Fk:loadTranslationTable{
["efengqi__huatuo"] = "华佗",
["#efengqi__huatuo"] = "治世医骨",
["designer:efengqi__huatuo"] = "zzcclll朱苦力",
["illustrator:efengqi__huatuo"] = "聚一",
["efengqi__chuli"] = "除疠",
[":efengqi__chuli"] = "出牌阶段限一次,你可以重铸一张♣牌,然后弃置任意名角色共四张牌,因此失去♠牌的角色摸牌至体力上限。",
["#efengqi__chuli"] = "除疠:重铸一张♣牌,弃置任意名角色共四张牌",
["#efengqi__chuli-choose"] = "除疠:选择一名角色,弃置其至多 %arg 张牌",
["efengqi__qingnang"] = "青囊",
[":efengqi__qingnang"] = "你可以将一张<font color='red'>♥</font>牌当【桃】使用;或将一张<font color='red'>♦</font>牌当【散】使用。",
["#efengqi__qingnang"] = "青囊:将<font color='red'>♥</font>牌当【桃】使用;将<font color='red'>♦</font>牌当【散】使用",
["$efengqi__qingnang1"] = "救死扶伤,悬壶济世。",
["$efengqi__qingnang2"] = "妙手仁心,药到病除。",
["$efengqi__chuli1"] = "病去,如抽丝。",
["$efengqi__chuli2"] = "病入膏肓,需下猛药。",
["~efengqi__huatuo"] = "生老病死,命不可违。",
}
local diaochan = General(extension, "efengqi__diaochan", "qun", 3, 3, General.Female)
local lijian = fk.CreateActiveSkill{
name = "efengqi__lijian",
anim_type = "control",
min_card_num = 0,
target_num = 0,
prompt = "#efengqi__lijian",
card_filter = function(self, to_select, selected)
return not Self:prohibitDiscard(Fk:getCardById(to_select))
end,
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)
if #effect.cards > 0 then
room:throwCard(effect.cards, self.name, player, player)
if player.dead then return end
end
local targets = table.filter(room.alive_players, function (p)
return p:getHandcardNum() > player:getHandcardNum() and p:isMale()
end)
if #targets == 0 then return false end
local tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#efengqi__lijian-choose", self.name, false)
if #tos > 0 then
local to = room:getPlayerById(tos[1])
player:control(to)
-- 存在隐患,应该恢复为原控制者
room.logic:getCurrentEvent():findParent(GameEvent.Turn):addCleaner(function()
to:control(to)
end)
U.askForUseVirtualCard(room, to, "duel", nil, self.name, nil, false, true, true, true)
end
end,
}
diaochan:addSkill(lijian)
local biyue = fk.CreateTriggerSkill{
name = "efengqi__biyue",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Finish
and table.find({"h","e","j"}, function(flag) return #player:getCardIds(flag) == 0 end)
end,
on_use = function(self, event, target, player, data)
player:drawCards(#table.filter({"h","e","j"}, function(flag) return #player:getCardIds(flag) == 0 end), self.name)
end,
}
diaochan:addSkill(biyue)
Fk:loadTranslationTable{
["efengqi__diaochan"] = "貂蝉",
["#efengqi__diaochan"] = "",
["designer:efengqi__diaochan"] = "屑",
["illustrator:efengqi__diaochan"] = "",
["efengqi__lijian"] = "离间",
[":efengqi__lijian"] = "出牌阶段限一次,你可以弃置任意张牌,选择一名手牌大于你的男性角色本回合由你操控,然后其视为使用一张【决斗】。",
["#efengqi__lijian"] = "离间:弃置任意张牌,操控一名手牌大于你的男性角色,令其使用【决斗】",
["#efengqi__lijian-choose"] = "操控一名手牌大于你的男性角色,令其使用【决斗】",
[""] = "",
["efengqi__biyue"] = "闭月",
[":efengqi__biyue"] = "锁定技,结束阶段,你每有一个区域没有牌,便摸一张牌。",
["$efengqi__lijian1"] = "嗯呵呵~~呵呵~~",
["$efengqi__lijian2"] = "夫君,你要替妾身作主啊~",
["$efengqi__biyue1"] = "失礼了~",
["$efengqi__biyue2"] = "羡慕吧~",
["~efengqi__diaochan"] = "父亲大人,对不起……",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化