加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
aaa_steam1.lua 112.67 KB
一键复制 编辑 原始数据 按行查看 历史
张大北 提交于 2024-12-24 13:23 . 马斯克修改
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825
local extension = Package("aaa_steam1")
extension.extensionName = "aaa_steam"
local U = require "packages/utility/utility"
local RUtil = require "packages/aaa_fenghou/utility/rfenghou_util"
local DIY = require "packages/diy_utility/diy_utility"
Fk:loadTranslationTable{
["steam"] = "蒸",
["aaa_steam1"] = "steam1",
}
local lixiu = General(extension, "steam__lixiu", "jin", 3, 4, General.Female)
local qingshi = fk.CreateTriggerSkill{
name = "steam__qingshi",
frequency = Skill.Compulsory,
mute = true,
events = {fk.TurnStart, fk.EventPhaseChanging, fk.DrawNCards, fk.EventPhaseStart, fk.EventPhaseProceeding},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event == fk.TurnStart then
return #player.room:canMoveCardInBoard() > 0
else
local n = 0
for _, p in ipairs(player.room.players) do
n = n + p:getLostHp()
end
n = n // #player.room.players
if event == fk.EventPhaseChanging then
return data.to == Player.Judge and n >= 1
elseif event == fk.DrawNCards then
return data.n > 0 and n >= 2
elseif event == fk.EventPhaseStart then
return player.phase == Player.Play and n >= 3 and
table.find(player.room.discard_pile, function (id)
return Fk:getCardById(id).trueName == "slash"
end)
elseif event == fk.EventPhaseProceeding then
return player.phase == Player.Discard and player:getHandcardNum() - player:getMaxCards() > 2 and n >= 4
end
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnStart then
local targets = room:askForChooseToMoveCardInBoard(player, "#steam__qingshi-move", self.name, true)
if #targets > 0 then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "control")
room:askForMoveCardInBoard(player, room:getPlayerById(targets[1]), room:getPlayerById(targets[2]), self.name)
end
elseif event == fk.EventPhaseChanging then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "defensive")
return true
elseif event == fk.DrawNCards and room:askForSkillInvoke(player, self.name, nil, "#steam__qingshi-draw") then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "drawcard")
data.n = player:getHandcardNum()
elseif event == fk.EventPhaseStart then
local card = room:getCardsFromPileByRule("slash", 1, "discardPile")
if #card > 0 then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "drawcard")
room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
end
elseif event == fk.EventPhaseProceeding then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "defensive")
room:askForDiscard(player, 2, 2, false, "phase_discard", false)
player._phase_end = true
end
end,
}
lixiu:addSkill(qingshi)
Fk:loadTranslationTable{
["steam__lixiu"] = "李秀",
["#steam__lixiu"] = "明惠耀林",
["illustrator:steam__lixiu"] = "哥达耀",
["designer:steam__lixiu"] = "志文",
["cv:steam__lixiu"] = "桃妮儿",
["steam__qingshi"] = "情势",
[":steam__qingshi"] = "锁定技,根据所有角色(包括已死亡角色)已损失体力值的平均值,你获得效果:<br>"..
"不小于0点:回合开始时,你可以移动场上一张牌。<br>"..
"不小于1点:你跳过判定阶段。<br>"..
"不小于2点:摸牌阶段,你可以改为摸手牌数的牌。<br>"..
"不小于3点:出牌阶段开始时,你从弃牌堆获得一张【杀】。<br>"..
"不小于4点:弃牌阶段,若你的手牌数减手牌上限大于2,你改为弃置两张牌。",
["#steam__qingshi-move"] = "情势:你可以移动场上一张牌",
["#steam__qingshi-draw"] = "情势:是否改为摸手牌数的牌?",
["$steam__qingshi1"] = "决胜料敌,情势既得,断在不疑。",
["$steam__qingshi2"] = "勇而轻死、智则心怯,智勇并济者,方为大将。",
["$steam__qingshi3"] = "行营面面、帐门深深,出得沙场又安归?",
["~steam__lixiu"] = "父死女继,妻死夫继,誓扫蛮夷!",
}
local zhaoqu = General(extension, "steam__zhaoqu", "wei", 4)
local steam__chixiao = fk.CreateTriggerSkill{
name = "steam__chixiao",
frequency = Skill.Compulsory,
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and not player:isKongcheng() then
return #DIY.GetShownCards(player) < (player:getHandcardNum() / 2) and (player:getHandcardNum() % 2 == 0)
end
end,
on_use = function(self, event, target, player, data)
local num = player:getHandcardNum() // 2
local cards = player.room:askForCard(player, num, num, false, self.name, false, nil, "#steam__chixiao-card")
local shown = DIY.GetShownCards(player)
local hidden = table.filter(cards, function (id)
return not table.contains(shown, id)
end)
DIY.HideCards(player, shown)
DIY.ShowCards(player, hidden)
end,
}
local steam__chixiao_maxcards = fk.CreateMaxCardsSkill{
name = "#steam__chixiao_maxcards",
exclude_from = function(self, player, card)
if player:hasSkill(steam__chixiao) then
return card:getMark("@@ShownCards-inhand") == 0
end
end,
}
steam__chixiao:addRelatedSkill(steam__chixiao_maxcards)
zhaoqu:addSkill(steam__chixiao)
local steam__henge = fk.CreateTriggerSkill{
name = "steam__henge",
mute = true,
frequency = Skill.Compulsory,
events = {fk.Damage},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and data.card then
local useEvent = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if useEvent then
local use = useEvent.data[1]
return use.from == player.id and data.card == use.card and use.extra_data and use.extra_data.steam__hengeInfo
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local useEvent = room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if useEvent then
local use = useEvent.data[1]
if use.extra_data.steam__hengeInfo == "hidden" then
player:broadcastSkillInvoke(self.name, 1)
room:notifySkillInvoked(player, self.name, "negative")
local shown = DIY.GetShownCards(player)
if #shown > 0 then
local num = math.ceil(#shown / 2)
room:askForDiscard(player, num, num, false, self.name, false, tostring(Exppattern{ id = shown }))
end
else
player:broadcastSkillInvoke(self.name, 2)
room:notifySkillInvoked(player, self.name, "drawcard")
local hidden = table.filter(player:getCardIds("h"), function (id)
return Fk:getCardById(id):getMark("@@ShownCards-inhand") == 0
end)
local num = math.floor(#hidden / 2)
if num > 0 then
player:drawCards(num, self.name)
end
end
end
end,
refresh_events = {fk.PreCardUse},
can_refresh = function (self, event, target, player, data)
return target == player and player:hasSkill(self, true)
end,
on_refresh = function (self, event, target, player, data)
data.extra_data = data.extra_data or {}
if data.card:getMark("@@ShownCards-inhand") > 0 then
data.extra_data.steam__hengeInfo = "shown"
else
data.extra_data.steam__hengeInfo = "hidden"
end
end,
}
zhaoqu:addSkill(steam__henge)
Fk:loadTranslationTable{
["steam__zhaoqu"] = "赵衢",
["#steam__zhaoqu"] = "",
["designer:steam__zhaoqu"] = "半城",
["illustrator:steam__zhaoqu"] = "2B铅笔",
["steam__chixiao"] = "鸱鸮",
[":steam__chixiao"] = "锁定技,你使用牌后,若明置牌数小于暗置牌数,且手牌数为偶数,你将一半手牌翻面;你的暗置牌不计入手牌上限。",
["#steam__chixiao-card"] = "鸱鸮:请选择半数手牌,将它们翻面",
["steam__henge"] = "衡扼",
[":steam__henge"] = "锁定技,你使用暗置牌造成伤害后,弃置半数取上张明置牌;你使用明置牌造成伤害后,摸暗置牌的半数取下张牌。",
}
local mateng = General(extension, "steam__mateng", "qun", 4)
local xiongdang = fk.CreateActiveSkill{
name = "steam__xiongdang",
anim_type = "control",
card_num = 0,
min_target_num = 1,
prompt = "#steam__xiongdang",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = Util.FalseFunc,
target_filter = Util.TrueFunc,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
player:drawCards(#effect.tos, self.name)
if player.dead or player:isKongcheng() then return end
local cards = room:askForCard(player, #effect.tos, #effect.tos, false, self.name, false, nil,
"#steam__xiongdang-show:::"..#effect.tos)
player:showCards(cards)
cards = table.filter(cards, function (id)
return table.contains(player:getCardIds("h"), id)
end)
room:sortPlayersByAction(effect.tos)
local targets = table.map(effect.tos, Util.Id2PlayerMapper)
targets = table.filter(targets, function (p)
return not p.dead
end)
while #targets > 0 and #cards > 0 and not player.dead do
local to = targets[1]
local use = U.askForUseRealCard(room, to, cards, nil, self.name,
"#steam__xiongdang-use", {
bypass_times = true,
extraUse = true,
expand_pile = to ~= player and cards or {},
}, false, false)
if use then
table.removeOne(cards, use.card.id)
else
break
end
cards = table.filter(cards, function (id)
return table.contains(player:getCardIds("h"), id)
end)
table.remove(targets, 1)
table.insert(targets, to)
targets = table.filter(targets, function (p)
return not p.dead
end)
end
cards = table.filter(cards, function (id)
return table.contains(player:getCardIds("h"), id)
end)
if #cards > 0 then
room:throwCard(cards, self.name, player, player)
end
end,
}
local beikou = fk.CreateTriggerSkill{
name = "steam__beikou$",
anim_type = "support",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
local cards = {}
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard and move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
cards = table.filter(cards, function(id) return player.room:getCardArea(id) == Card.DiscardPile end)
cards = U.moveCardsHoldingAreaCheck(player.room, cards)
if #cards > 0 then
self.cost_data = {cards = cards}
return true
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local _, dat = room:askForUseActiveSkill(player, "steam__beikou_active", "#steam__beikou-give",
true, {expand_pile = self.cost_data.cards})
if dat then
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:obtainCard(self.cost_data.tos[1], self.cost_data.cards, true, fk.ReasonGive, player.id, self.name)
end,
}
local beikou_active = fk.CreateActiveSkill{
name = "steam__beikou_active",
min_card_num = 1,
target_num = 1,
card_filter = function(self, to_select, selected)
return type(self.expand_pile) == "table" and table.contains(self.expand_pile, to_select)
end,
target_filter = function(self, to_select, selected, selected_cards)
local to = Fk:currentRoom():getPlayerById(to_select)
if #selected == 0 and Self.id ~= to_select then
if to.kingdom ~= "qun" then
return #selected_cards == 1
else
return #selected_cards > 0
end
end
end,
}
Fk:addSkill(beikou_active)
mateng:addSkill(xiongdang)
mateng:addSkill("mashu")
mateng:addSkill(beikou)
Fk:loadTranslationTable{
["steam__mateng"] = "马腾",
["#steam__mateng"] = "驰骋西陲",
["illustrator:steam__mateng"] = "君桓文化",
["designer:steam__mateng"] = "胖即是胖",
["steam__xiongdang"] = "雄荡",
[":steam__xiongdang"] = "出牌阶段限一次,你可以选择任意名角色,然后你摸等量张牌并展示等量张手牌;若如此做,这些角色依次使用一张因此展示的牌"..
"直到无法使用,然后你弃置剩余的牌。",
["steam__beikou"] = "备寇",
[":steam__beikou"] = "主公技,当你因弃置失去牌后,你可以将其中一张牌交给一名其他角色,或将其中任意张牌交给一名其他群势力角色。",
["#steam__xiongdang"] = "雄荡:选择任意名角色,你摸等量牌并展示等量牌,令这些角色依次使用其中一张",
["#steam__xiongdang-use"] = "雄荡:请使用其中一张牌",
["#steam__xiongdang-show"] = "雄荡:请展示%arg张牌",
["#steam__beikou-give"] = "备寇:你可将其中一张牌交给一名其他角色/任意张牌交给一名其他群势力角色",
["steam__beikou_active"] = "备寇分牌",
}
local godzhanghe = General(extension, "steam__godzhanghe", "god", 4)
for loop = 0, 50, 1 do --50个应该够用
local zhenmang = fk.CreateTriggerSkill{
name = loop == 0 and "steam__zhenmang" or "steam"..loop.."__zhenmang",
mute = true,
frequency = Skill.Wake,
events = {fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and
player.hp > 0 and player:getMark(self.name.."-turn") == 0 --防止因此获得技能时触发
end,
can_wake = function(self, event, target, player, data)
return #player.room.logic:getActualDamageEvents(1, function (e)
return e.data[1].damageType ~= fk.NormalDamage
end, Player.HistoryTurn) > 0 or
#player.room.logic:getEventsOfScope(GameEvent.Dying, 1, Util.TrueFunc,
Player.HistoryTurn) > 0
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke("steam__zhenmang")
room:notifySkillInvoked(player, "steam__zhenmang", "special")
local all_choices, choices = {}, {}
for i = 1, 2, 1 do
table.insert(all_choices, "steam__zhenmang_choice"..i)
if player.hp >= i then
table.insert(choices, "steam__zhenmang_choice"..i)
end
end
if #choices == 0 then return end
local choice = room:askForChoice(player, choices, "steam__zhenmang", nil, false, all_choices)
if choice == "steam__zhenmang_choice1" then
for i = 1, 50, 1 do
local name = "steam"..i.."__xuncang"
if not player:hasSkill(name, true) then
player:setSkillUseHistory(name, 0, Player.HistoryGame)
room:handleAddLoseSkills(player, name, nil, true, false)
break
end
end
elseif choice == "steam__zhenmang_choice2" then
local skills = {}
for i = 1, 50, 1 do
local name = "steam"..i.."__zhenmang"
if not player:hasSkill(name, true) then
player:setSkillUseHistory(name, 0, Player.HistoryGame)
room:setPlayerMark(player, name.."-turn", 1)
table.insert(skills, name)
end
if #skills == 2 then break end
end
room:handleAddLoseSkills(player, skills, nil, true, false)
--elseif choice == "steam__zhenmang_choice3" then
--player:drawCards(3, "steam__zhenmang")
end
end,
}
if loop > 0 then
Fk:addSkill(zhenmang)
else
godzhanghe:addSkill(zhenmang)
end
Fk:loadTranslationTable{
["steam"..loop.."__zhenmang"] = "震莽",
[":steam"..loop.."__zhenmang"] = "觉醒技,进行过属性伤害或濒死结算的回合结束时,你选择体力值不小于序号的一项:"..
"1.获得一个〖巽苍〗;2.获得两个〖震莽〗。",
}
local xuncang = fk.CreateActiveSkill{
name = loop == 0 and "steam__xuncang" or "steam"..loop.."__xuncang",
mute = true,
frequency = Skill.Limited,
prompt = function ()
if Self:getMark("steam__xuncang-phase") == 0 then
return "#steam__xuncang-any"
else
return "#steam__xuncang:::"..(Self:getMark("steam__xuncang-phase") - 1)
end
end,
min_card_num = 1,
max_card_num = function ()
if Self:getMark("steam__xuncang-phase") == 0 then
return 999
else
return Self:getMark("steam__xuncang-phase") - 1
end
end,
target_num = 1,
times = function (self)
return 1 - Self:usedSkillTimes(self.name, Player.HistoryGame)
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and Self:getMark("steam__xuncang-phase") ~= 1
end,
card_filter = function(self, to_select, selected)
return (Self:getMark("steam__xuncang-phase") == 0 or #selected < Self:getMark("steam__xuncang-phase") - 1) and
not Self:prohibitDiscard(to_select)
end,
target_filter = function(self, to_select, selected, selected_cards)
return #selected == 0
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
player:broadcastSkillInvoke("steam__xuncang")
room:notifySkillInvoked(player, "steam__xuncang", "offensive")
room:setPlayerMark(player, "steam__xuncang-phase", #effect.cards)
room:throwCard(effect.cards, self.name, player)
if not target.dead then
room:damage{
from = player,
to = target,
damage = 1,
damageType = fk.ThunderDamage,
skillName = self.name,
}
end
end,
}
if loop > 0 then
Fk:addSkill(xuncang)
else
godzhanghe:addRelatedSkill(xuncang)
end
Fk:loadTranslationTable{
["steam"..loop.."__xuncang"] = "巽苍",
[":steam"..loop.."__xuncang"] = "限定技,出牌阶段,你可以弃置至多X张牌(X本阶段上次弃置数-1),对一名角色造成1点雷电伤害。",
}
end
local qiongyi = fk.CreateViewAsSkill{
name = "steam__qiongyi",
anim_type = "special",
pattern = ".",
prompt = function (self)
if self.interaction.data then
local card = Fk:cloneCard(self.interaction.data)
if card.type == Card.TypeBasic then
return "#steam__qiongyi-basic:::"..Self:getMark("@steam__qiongyi")[1]
else
return "#steam__qiongyi-trick:::"..Self:getMark("@steam__qiongyi")[2]
end
end
end,
interaction = function(self)
local all_names = U.getAllCardNames("b")
if #table.filter(Self.player_skills, function (s)
return s:isPlayerSkill(Self) and s.visible
end) >= Self:getMark("@steam__qiongyi")[2] then
table.insertTable(all_names, U.getAllCardNames("t"))
end
local names = U.getViewAsCardNames(Self, self.name, all_names, {}, Self:getTableMark("@$steam__qiongyi"))
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 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:addTableMark(player, "@$steam__qiongyi", use.card.trueName)
local mark = player:getMark("@steam__qiongyi")
local n = mark[1]
if use.card:isCommonTrick() then
n = mark[2]
end
if n > 0 then
local skill_names = table.map(table.filter(player.player_skills, function (s)
return s:isPlayerSkill(player) and s.visible
end), function (s)
return s.name
end)
local mapper = table.map(skill_names, function (name)
if (name:startsWith("steam__zhenmang") or name:startsWith("steam__xuncang")) and
player:usedSkillTimes(name, Player.HistoryGame) > 0 then
return "√"
else
return ""
end
end)
local choices = {}
for i = 1, #skill_names, 1 do
table.insert(choices, Util.TranslateMapper(skill_names[i])..mapper[i])
end
local choice = room:askForChoices(player, choices, n, n, self.name, "#steam__qiongyi-lose:::"..n, false)
local skills = {}
for _, c in ipairs(choice) do
table.insert(skills, skill_names[table.indexOf(choices, c)])
end
room:handleAddLoseSkills(player, "-"..table.concat(skills, "|-"), nil, true, false)
end
for i = 1, 3, 1 do
mark[i] = mark[i] + 1
end
room:setPlayerMark(player, "@steam__qiongyi", mark)
end,
enabled_at_play = function(self, player)
return player:getMark("@steam__qiongyi") ~= 0 and
#table.filter(player.player_skills, function (s)
return s:isPlayerSkill(player) and s.visible
end) >= player:getMark("@steam__qiongyi")[1]
end,
enabled_at_response = function(self, player, response)
if Fk.currentResponsePattern == "nullification" then
if table.contains(Self:getTableMark("@$steam__qiongyi"), "nullification") then return false end
end
return not response and player:getMark("@steam__qiongyi") ~= 0 and
#table.filter(player.player_skills, function (s)
return s:isPlayerSkill(player) and s.visible
end) >= player:getMark("@steam__qiongyi")[1]
end,
}
local qiongyi_trigger = fk.CreateTriggerSkill{
name = "#steam__qiongyi_trigger",
refresh_events = {fk.EventAcquireSkill, fk.EventLoseSkill},
can_refresh = function(self, event, target, player, data)
return target == player and data == qiongyi
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.EventAcquireSkill then
room:setPlayerMark(player, "@steam__qiongyi", {0, 1, 2})
room:handleAddLoseSkills(player, "steam__qiongyi_active&", nil, false, true)
else
room:setPlayerMark(player, "@steam__qiongyi", 0)
room:setPlayerMark(player, "@$steam__qiongyi", 0)
room:handleAddLoseSkills(player, "-steam__qiongyi_active&", nil, false, true)
end
end,
}
local qiongyi_active = fk.CreateActiveSkill{
name = "steam__qiongyi_active&",
anim_type = "support",
card_num = 0,
target_num = 0,
prompt = function (self)
return "#steam__qiongyi_active&:::"..Self:getMark("@steam__qiongyi")[3]
end,
can_use = function (self, player)
return player:hasSkill(qiongyi) and player:getMark("@steam__qiongyi") ~= 0 and
#table.filter(player.player_skills, function (s)
return s:isPlayerSkill(player) and s.visible
end) >= player:getMark("@steam__qiongyi")[3]
end,
card_filter = Util.FalseFunc,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
player:broadcastSkillInvoke("steam__qiongyi")
local skill_names = table.map(table.filter(player.player_skills, function (s)
return s:isPlayerSkill(player) and s.visible
end), function (s)
return s.name
end)
local mapper = table.map(skill_names, function (name)
if (name:startsWith("steam__zhenmang") or name:startsWith("steam__xuncang")) and
player:usedSkillTimes(name, Player.HistoryGame) > 0 then
return "√"
else
return ""
end
end)
local choices = {}
for i = 1, #skill_names, 1 do
table.insert(choices, Util.TranslateMapper(skill_names[i])..mapper[i])
end
local n = player:getMark("@steam__qiongyi")[3]
local choice = room:askForChoices(player, choices, n, n, self.name, "#steam__qiongyi-lose:::"..n, false)
local skills = {}
for _, c in ipairs(choice) do
table.insert(skills, skill_names[table.indexOf(choices, c)])
end
room:handleAddLoseSkills(player, "-"..table.concat(skills, "|-"), nil, true, false)
room:setPlayerMark(player, "@steam__qiongyi", {0, 1, 2})
room:setPlayerMark(player, "@$steam__qiongyi", 0)
room:handleAddLoseSkills(player, "-"..table.concat(choice, "|-"), nil, true, false)
end,
}
qiongyi:addRelatedSkill(qiongyi_trigger)
Fk:addSkill(qiongyi_active)
--godzhanghe:addSkill(qiongyi)
Fk:loadTranslationTable{
["steam__godzhanghe"] = "神张郃",
["#steam__godzhanghe"] = "不坠青云",
["designer:steam__godzhanghe"] = "末页",
["illustrator:steam__godzhanghe"] = "歪真人",
["cv:steam__godzhanghe"] = "末页",
["steam__zhenmang"] = "震莽",
[":steam__zhenmang"] = "觉醒技,进行过属性伤害或濒死结算的回合结束时,你选择体力值不小于序号的一项:1.获得一个〖巽苍〗;"..
"2.获得两个〖震莽〗;3.摸三张牌。",
["steam__qiongyi"] = "穹异",
[":steam__qiongyi"] = "你可以失去『0』/『1』个技能,视为使用一张未以此法使用过的基本牌/普通锦囊牌,令本技能的所有数字加一;"..
"出牌阶段,你可以失去『2』个技能,重置本技能的数字和记录。",
["steam__xuncang"] = "巽苍",
[":steam__xuncang"] = "限定技,出牌阶段,你可以弃置至多X张牌(X本阶段上次弃置数-1),对一名角色造成1点雷电伤害。",
["steam__zhenmang_choice1"] = "获得一个〖巽苍〗",
["steam__zhenmang_choice2"] = "获得两个〖震莽〗",
["steam__zhenmang_choice3"] = "摸三张牌",
["#steam__qiongyi-basic"] = "穹异:你可以失去%arg个技能,视为使用一张基本牌!",
["#steam__qiongyi-trick"] = "穹异:你可以失去%arg个技能,视为使用一张普通锦囊牌!",
["#steam__qiongyi-lose"] = "穹异:请失去%arg个技能(“√”表示该技能已发动过)",
["steam__qiongyi_active&"] = "穹异[复原]",
[":steam__qiongyi_active&"] = "出牌阶段,你可以失去『2』个技能,重置“穹异”的数字和记录。",
["#steam__qiongyi_active&"] = "穹异:你可以失去%arg个技能,重置“穹异”的数字和记录!",
["@steam__qiongyi"] = "穹异",
["@$steam__qiongyi"] = "穹异",
["#steam__xuncang-any"] = "巽苍:你可以弃置任意张牌,对一名角色造成1点雷电伤害",
["#steam__xuncang"] = "巽苍:你可以弃置至多%arg张牌,对一名角色造成1点雷电伤害",
["$steam__zhenmang1"] = "授我斧钺,锡我彤弓,伐谋为兵,克胜群丑。",
["$steam__zhenmang2"] = "按剑则日中见斗,挥戈而曜灵再晡。",
["$steam__qiongyi1"] = "悬六合之休咎,着六军之成败。",
["$steam__qiongyi2"] = "玄穹彼苍,悉称上天;列缺飞廉,皆兆大横!",
["$steam__xuncang1"] = "挥云出塞、乘月渡河,旌旗指敌,荡寇清雠!",
["$steam__xuncang2"] = "苍雷注地飞紫星,龙子扰烟呼百灵。",
["~steam__godzhanghe"] = "授之者天,成之者运,岂徒人事?",
}
local thutmose = General(extension, "steam__thutmose_third", "west", 4)
local zaizhu = fk.CreateTriggerSkill{
name = "steam__zaizhu",
anim_type = "control",
events = {fk.CardUsing},
frequency = Skill.Compulsory,
can_trigger = function (self, event, target, player, data)
if target == player and player:hasSkill(self) then
local current = player.room.logic:getCurrentEvent()
local last = player.room.logic:getEventsByRule(GameEvent.UseCard, 1, function (e)
return e.id < current.id
end, 1)[1]
if last and last.data[1].from ~= player.id then
local num = Fk:translate(data.card.trueName, "zh_CN"):len() + Fk:translate(last.data[1].card.trueName, "zh_CN"):len()
local minus = math.abs(Fk:translate(data.card.trueName, "zh_CN"):len() - Fk:translate(last.data[1].card.trueName, "zh_CN"):len())
if num ~= player:getHandcardNum() then
self.cost_data = {num = num, minus = minus}
return true
end
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local num = player:getHandcardNum() - self.cost_data.num
if num > 0 then
local cards = room:askForDiscard(player, num, num, false, self.name, true, ".|.|.|hand",
"#steam__zaizhu-cost:::"..num..":"..(self.cost_data.minus), true)
if #cards > 0 then
self.cost_data.cards = cards
return true
end
else
return room:askForSkillInvoke(player, self.name, nil, "#steam__zaizhu-draw:::"..(-num))
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if not self.cost_data.cards then
player:drawCards(self.cost_data.num - player:getHandcardNum(), self.name)
return
end
room:throwCard(self.cost_data.cards, self.name, player, player)
if player.dead or #self.cost_data.cards < 2 then return end
local minus = self.cost_data.minus
local targets = room:getOtherPlayers(player, false)
local tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
"#steam__zaizhu-choose:::"..minus, self.name, true)
if #tos > 0 then
local to = room:getPlayerById(tos[1])
local num = to:getHandcardNum() - minus
if num > 0 then
room:askForDiscard(to, num, num, false, self.name, false)
elseif num < 0 then
to:drawCards(-num, self.name)
end
end
end,
}
thutmose:addSkill(zaizhu)
local lvzheng = fk.CreateTriggerSkill{
name = "steam__lvzheng$",
events = {fk.EventPhaseStart},
anim_type = "control",
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) then
if player.phase == Player.Start and #player:getCardIds("j") > 0 then
return table.find(player.room.alive_players, function (p)
return p ~= player and #p:getCardIds("j") > 0 and p.kingdom == "west"
end)
elseif player.phase == Player.Finish and #player:getCardIds("e") > 0 then
return table.find(player.room.alive_players, function (p)
return p ~= player and #p:getCardIds("e") > 0 and p.kingdom ~= "west"
end)
end
end
end,
on_cost = function (self, event, target, player, data)
local targets = table.filter(player.room:getOtherPlayers(player, false), function (p)
if player.phase == Player.Start then
return #p:getCardIds("j") > 0 and p.kingdom == "west"
else
return #p:getCardIds("e") > 0 and p.kingdom ~= "west"
end
end)
if #targets == 0 then return false end
local tos = player.room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
player.phase == Player.Start and "#steam__lvzheng-judge" or "#steam__lvzheng-equip", 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 area = player.phase == Player.Start and "j" or "e"
for _, p in ipairs({player, to}) do
if #p:getCardIds(area) > 0 then
local cid = room:askForCardChosen(player, p, area, self.name)
room:throwCard(cid, self.name, p, player)
end
end
end,
}
thutmose:addSkill(lvzheng)
Fk:loadTranslationTable{
["steam__thutmose_third"] = "图特摩斯三世",
["#steam__thutmose_third"] = "荣日重光",
["designer:steam__thutmose_third"] = "扬林",
["illustrator:steam__thutmose_third"] = "",
["steam__zaizhu"] = "再铸",
[":steam__zaizhu"] = "连击技(其他角色使用牌+你使用牌),你可将你的手牌张数调整至这两张牌牌名字数之和;若你因此弃置至少两张牌,你可令一名其他角色调整手牌数至这两张牌牌名字数之差。",
["#steam__zaizhu-draw"] = "再铸:你可以摸 %arg 张牌",
["#steam__zaizhu-cost"] = "再铸:你可以弃置 %arg 张手牌,若至少弃2张,可将一名其他角色手牌调整至%arg2张",
["#steam__zaizhu-choose"] = "再铸:你可令一名其他角色调整手牌至%arg",
["steam__zaizhu_tip"] = "再铸",
["steam__lvzheng"] = "屡征",
[":steam__lvzheng"] = "主公技,准备阶段/结束阶段,你可弃置你和一名其他西势力角色判定区/其他非西势力角色装备区的各一张牌。",
["#steam__lvzheng-judge"] = "屡征:你可弃置你和一名其他西势力角色判定区各一张牌",
["#steam__lvzheng-equip"] = "屡征:你可弃置你和一名其他非西势力角色装备区各一张牌",
}
local nobunaga = General(extension, "steam__nobunaga", "west", 4)
local steam__exi = fk.CreateViewAsSkill{
name = "steam__exi",
anim_type = "drawcard",
pattern = ".",
prompt = "#steam__exi",
card_filter = function(self, to_select, selected)
if #selected ~= 0 or not table.contains(Self.player_cards[Player.Hand], to_select) then return false end
local card = Fk:getCardById(to_select)
if Fk.currentResponsePattern == nil then
return Self:canUse(card) and not Self:prohibitUse(card)
else
return Exppattern:Parse(Fk.currentResponsePattern):match(card)
end
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
return Fk:getCardById(cards[1])
end,
before_use = function(self, player, use)
local room = player.room
local current = room.current
if player:isKongcheng() then return "" end
room:sendLog{ type = "#steam__exiLog", from = player.id, arg = use.card:toLogString(), toast = true }
local cid = room:askForCardChosen(current, player, "h", self.name)
player:showCards({cid})
local right = (cid == use.card.id)
room:setCardEmotion(cid, right and "judgegood" or "judgebad")
room:delay(600)
if right then
local players = {player}
local tos = table.filter(room:getOtherPlayers(player, false), function (p) return not p:isNude() end)
if #tos > 0 then
tos = room:askForChoosePlayers(player, table.map(tos, Util.IdMapper), 1, 1, "#steam__exi-choose", self.name, false)
if #tos > 0 then
table.insert(players, room:getPlayerById(tos[1]))
end
end
for _, p in ipairs(players) do
local cards = p:getCardIds("he")
if #cards > 0 then
room:recastCard(cards, p, self.name)
end
end
return ""
else
use.extra_data = use.extra_data or {}
use.extra_data.steam__exiDraw = true
end
end,
after_use = function(self, player, use)
if not player.dead and use.extra_data and use.extra_data.steam__exiDraw then
local num = player.maxHp - player:getHandcardNum()
if num > 0 then
player:drawCards(num, self.name)
end
end
end,
enabled_at_play = function(self, player)
return player:getHandcardNum() <= player.maxHp and not player:isKongcheng() and player:usedSkillTimes(self.name) == 0
end,
enabled_at_response = function (self, player, response)
return player:getHandcardNum() <= player.maxHp and not player:isKongcheng() and player:usedSkillTimes(self.name) == 0
and not response and Fk.currentResponsePattern
and table.find(player:getCardIds("h"), function (id)
return Exppattern:Parse(Fk.currentResponsePattern):match(Fk:getCardById(id))
end)
end,
}
nobunaga:addSkill(steam__exi)
local steam__buwu = fk.CreateTriggerSkill{
name = "steam__buwu",
anim_type = "drawcard",
events = {fk.AfterCardsMove, fk.Deathed},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if event == fk.AfterCardsMove then
local room = player.room
local ids = {}
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.from and move.from ~= player.id then
for _, info in ipairs(move.moveInfo) do
if room:getCardArea(info.cardId) == Card.DiscardPile and info.fromArea == Card.PlayerEquip then
local card = Fk:getCardById(info.cardId)
if player:getEquipment(card.sub_type) == nil and table.every(ids, function (id)
return Fk:getCardById(id).sub_type ~= card.sub_type
end) then
table.insert(ids, info.cardId)
end
end
end
end
end
if #ids > 0 then
self.cost_data = ids
return true
end
else
return target ~= player and not (data.damage and data.damage.from == player)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
room:delay(200)
room:moveCardIntoEquip(player, self.cost_data, self.name, false, player)
else
Fk.game_modes[room.settings.gameMode]:deathRewardAndPunish(target, player)
end
end,
}
nobunaga:addSkill(steam__buwu)
Fk:loadTranslationTable{
["steam__nobunaga"] = "织田信长",
["#steam__nobunaga"] = "第六天魔王",
["designer:steam__nobunaga"] = "扬林",
["illustrator:steam__nobunaga"] = "信长的野望",
["steam__exi"] = "恶戏",
[":steam__exi"] = "每回合限一次,你需使用手牌中的基本牌或锦囊牌时,若你的手牌数不多于体力上限,你可以声明此牌,且令当前回合角色展示你一张手牌。若不为声明牌,你使用声明牌,再将手牌数补至体力上限。若为声明牌,你令你与一名其他角色依次重铸各自的所有牌。",
["#steam__exi-choose"] = "恶戏:选择一名其他角色,你与其各重铸所有牌",
["#steam__exi"] = "恶戏:你可以选择并声明一张即将使用的牌,你有可能使用之",
["#steam__exiLog"] = "%from 声明了牌 %arg",
["steam__buwu"] = "布武",
[":steam__buwu"] = "锁定技,其他角色的装备牌进入弃牌堆时,若你对应的装备栏无牌,将此牌置入你装备区;其他角色阵亡后,若你不为杀死其的角色,你于结算奖惩后结算一次杀死其身份的奖惩。",
}
local sheldon = General(extension, "steam__sheldon", "west", 3)
local zhuyun = fk.CreateTriggerSkill{
name = "steam__zhuyun",
anim_type = "control",
events = {fk.TurnEnd},
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 = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function(e)
for _, move in ipairs(e.data) do
if move.from then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
table.insertIfNeed(targets, move.from)
end
end
end
end
return false
end, Player.HistoryTurn)
if table.contains(targets, player.id) and #targets > 1 then
local tos = room:askForChoosePlayers(player, targets, 1, 2, "#steam__zhuyun-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 _, p in ipairs(tos) do
if not p.dead then
p:drawCards(1, self.name)
end
end
if table.contains(tos, player) and not player:isKongcheng() then
local targets = table.filter(room:getOtherPlayers(player, false), function (p) return player:canPindian(p) end)
tos = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#steam__zhuyun-pindian", self.name, true)
if #tos > 0 then
local to = room:getPlayerById(tos[1])
local pd = player:pindian({to}, self.name)
if pd.results[to.id].winner == player then
RUtil.resetSkill(player, "steam__zanju")
end
end
end
end,
}
sheldon:addSkill(zhuyun)
---@param player ServerPlayer
local handCardsForThrow = function (player)
return table.filter(player.player_cards[Player.Hand], function (id)
return not player:prohibitDiscard(id)
end)
end
local zanju = fk.CreateTriggerSkill{
name = "steam__zanju",
anim_type = "control",
events = {fk.StartPindian},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryRound) == 0 then
-- 一个拼点只能开一次赌局
if (data.extra_data and data.extra_data.steam__zanju_Source) then return false end
local pd_players = {data.from}
table.insertTable(pd_players, data.tos)
for _, p in ipairs(player.room.alive_players) do
-- 拼点角色至少拥有两张手牌才能参加赌局,不然没牌拼点了
if #handCardsForThrow(p) > (table.contains(pd_players, p) and 1 or 0) then
return true
end
end
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#steam__zanju-invoke:::"..data.reason)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local pd_players = {data.from}
table.insertTable(pd_players, data.tos)
local players = table.filter(room.alive_players, function(p)
return #handCardsForThrow(p) > (table.contains(pd_players, p) and 1 or 0)
end)
if #players == 0 then return end
data.extra_data = data.extra_data or {}
data.extra_data.steam__zanju_Source = player.id
data.extra_datasteam__zanju_Record = {}
pd_players = table.map(pd_players, Util.IdMapper)
local moves = {}
local req = Request:new(players, "AskForUseActiveSkill")
req.focus_text = self.name
req.focus_players = players
local req_data = {
"steam__zanju_active",
"#steam__zanju-active",
false,
{
steam__zanju_targets = pd_players,
},
}
for _, p in ipairs(players) do
req:setData(p, req_data)
end
req:ask()
for _, to in ipairs(players) do
local cards, tar
local result = req:getResult(to)
if result ~= "" then
cards = result.card.subcards
tar = result.targets[1]
else
cards = table.random(handCardsForThrow(to), 1)
tar = table.random(pd_players)
end
table.insert(moves, {
from = to.id,
ids = cards,
toArea = Card.DiscardPile,
moveReason = fk.ReasonDiscard,
moveVisible = true,
proposer = to.id,
skillName = self.name,
})
room:sendLog{type = "#steam__zanju_guess", from = to.id, to = {tar}}
data.extra_datasteam__zanju_Record[to.id] = tar
end
room:moveCards(table.unpack(moves))
end,
}
local zanju_delay = fk.CreateTriggerSkill{
name = "#steam__zanju_delay",
mute = true,
events = {fk.PindianFinished},
can_trigger = function(self, event, target, player, data)
return data.extra_data and data.extra_data.steam__zanju_Source == player.id
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local winners = {}
for _, result in pairs(data.results) do
local winner = result.winner
if winner then
table.insert(winners, winner.id)
end
end
local wrong_num = 0
for pid, tar in pairs(data.extra_datasteam__zanju_Record) do
local to = room:getPlayerById(pid)
if table.contains(winners, tar) then
if not to.dead then
to:drawCards(2, zanju.name)
end
else
wrong_num = wrong_num + 1
end
end
if wrong_num > 0 and not player.dead then
player:drawCards(wrong_num, zanju.name)
end
end,
}
zanju:addRelatedSkill(zanju_delay)
sheldon:addSkill(zanju)
local zanju_active = fk.CreateActiveSkill{
name = "steam__zanju_active",
card_num = 1,
target_num = 1,
card_filter = function(self, to_select, selected)
return #selected == 0 and table.contains(Self.player_cards[Player.Hand], to_select)
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 == 0 and table.contains(self.steam__zanju_targets or {}, to_select)
end,
}
Fk:addSkill(zanju_active)
Fk:loadTranslationTable{
["steam__sheldon"] = "谢尔登", -- Sheldon Gary Adelson
["#steam__sheldon"] = "倾天豪掷",
["designer:steam__sheldon"] = "杨林",
["illustrator:steam__sheldon"] = "AI",
["steam__zhuyun"] = "助运",
[":steam__zhuyun"] = "一名角色的回合结束时,若此回合包括你在内有至少两名角色失去过牌,你可令其中至多两名角色各摸一张牌;若你因此摸牌,你可与一名角色拼点,且若你拼点赢,重置“攒局”的次数。",
["#steam__zhuyun-choose"] = "助运:你可以令至多 2 名失去过牌的角色各摸一张牌",
["#steam__zhuyun-pindian"] = "助运:你可以与任一角色拼点,若你赢,重置“攒局”",
["steam__zanju"] = "攒局",
[":steam__zanju"] = "轮次技,一次拼点开始时,你可令所有角色依次弃置一张手牌,以此法弃牌的角色同时声明此次拼点赢的角色;拼点结束后,声明与结果相符的角色各摸两张牌,然后你摸X张牌(X为此次声明与结果不符的角色数)。",
["#steam__zanju-invoke"] = "攒局:你可以令所有角色弃1张手牌猜测“%arg”拼点的赢家,猜对的摸2张牌,每错1个你摸1张牌",
["#steam__zanju-active"] = "攒局:请弃置1张手牌,并选择你猜测的赢家!",
["steam__zanju_active"] = "攒局猜测",
["#steam__zanju_delay"] = "攒局",
["#steam__zanju_guess"] = "%from 猜测 %to 会赢",
}
local simayi = General(extension, "steam__simayi", "jin", 3)
local taozhu = fk.CreateTriggerSkill{
name = "steam__taozhu",
anim_type = "control",
events = {fk.CardUsing, fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
if event == fk.CardUsing then
return data.card.type == Card.TypeTrick
elseif event == fk.DamageInflicted then
return true
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local prompt = event == fk.CardUsing and "taozhu_cardusing" or "taozhu_damage"
local choices = {"steam__taozhu1:::"..prompt, "draw1", "Cancel"}
local to = nil
if event == fk.CardUsing then
room.logic:getEventsByRule(GameEvent.UseCard, 1, function (e)
if e.id ~= room.logic:getCurrentEvent().id then
local use = e.data[1]
if use.card.type == Card.TypeTrick then
to = room:getPlayerById(use.from)
return true
end
end
end, 1)
elseif event == fk.DamageInflicted then
room.logic:getActualDamageEvents(1, function (e)
if e.id ~= room.logic:getCurrentEvent().id then
to = e.data[1].to
return true
end
end, nil, 1)
end
if to and not to.dead then
prompt = event == fk.CardUsing and "taozhu_canceluse" or "taozhu_canceldamage"
choices[2] = "steam__taozhu2:"..target.id..":"..to.id..":"..prompt
end
local choice = room:askForChoice(player, choices, self.name)
if choice ~= "Cancel" then
if choice:startsWith("steam__taozhu2") and to then
self.cost_data = {tos = {to.id}, choice = choice}
return true
else
self.cost_data = {choice = choice}
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if self.cost_data.choice:startsWith("steam__taozhu1") then
local info = string.split(self.cost_data.choice, ":")
room:setPlayerMark(player, "@@steam__"..info[4], 1)
else
player:drawCards(1, self.name)
if player.dead then return end
if self.cost_data.choice:startsWith("steam__taozhu2") then
local to = room:getPlayerById(self.cost_data.tos[1])
if to.dead or not player:canPindian(to) then return end
local pindian = player:pindian({to}, self.name)
if pindian.results[to.id].winner ~= player then
if event == fk.CardUsing then
data.tos = {}
elseif event == fk.DamageInflicted then
return true
end
end
end
end
end,
}
local taozhu_delay = fk.CreateTriggerSkill{
name = "#steam__taozhu_delay",
priority = 2,
anim_type = "control",
events = {fk.CardUsing, fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if event == fk.CardUsing and data.card.type == Card.TypeTrick then
return player:getMark("@@steam__taozhu_cardusing") > 0
elseif event == fk.DamageInflicted then
return player:getMark("@@steam__taozhu_damage") > 0
end
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, {target.id})
if event == fk.CardUsing and data.card.type == Card.TypeTrick then
room:setPlayerMark(player, "@@steam__taozhu_cardusing", 0)
elseif event == fk.DamageInflicted then
room:setPlayerMark(player, "@@steam__taozhu_damage", 0)
end
if target.dead or target:isNude() then return end
local flag = "he"
if target == player then
if #player:getCardIds("e") == 0 then return end
flag = "e"
end
local card = room:askForCardChosen(player, target, flag, "steam__taozhu", "#steam__taozhu-prey::"..target.id)
room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonPrey, "steam__taozhu", nil, false, player.id)
end,
}
local tuigong = fk.CreateTriggerSkill{
name = "steam__tuigong",
mute = true,
events = {fk.DamageCaused, fk.RoundEnd},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and player:getMark(self.name) == 0 then
if event == fk.DamageCaused then
return target == player and data.damage >= data.to.hp + data.to.shield and
not data.to.dead and player:canUseTo(Fk:cloneCard("sincere_treat"), data.to, {bypass_distances = true})
elseif event == fk.RoundEnd then
local to = nil
for _, p in ipairs(player.room.alive_players) do
if #p:getCardIds("ej") > 0 then
if to ~= nil then return end
if #p:getCardIds("ej") > 1 then
return
else
to = p
end
end
end
if to == nil then return end
if player.room:canMoveCardInBoard(nil, {to}) then
self.cost_data = {tos = {to.id}}
return true
end
end
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
if event == fk.DamageCaused then
if room:askForSkillInvoke(player, self.name, nil,
"#steam__tuigong-invoke::"..data.to.id..":"..player:getMark("@steam__tuigong")) then
self.cost_data = {tos = {data.to.id}}
return true
end
elseif event == fk.RoundEnd then
return room:askForSkillInvoke(player, self.name, nil, "#steam__tuigong-add::"..self.cost_data.tos[1])
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(self.name)
if event == fk.DamageCaused then
room:notifySkillInvoked(player, self.name, "big")
room:setPlayerMark(player, self.name, 1)
local n = player:getMark("@steam__tuigong")
room:setPlayerMark(player, "@steam__tuigong", 0)
for i = 1, n, 1 do
if player.dead or data.to.dead then return end
room:useVirtualCard("sincere_treat", nil, player, data.to, self.name)
end
elseif event == fk.RoundEnd then
room:notifySkillInvoked(player, self.name, "control")
room:addPlayerMark(player, "@steam__tuigong", 1)
local tos = room:askForChooseToMoveCardInBoard(player, "#steam__tuigong-move", self.name, false, nil, false)
local targets = table.map(tos, Util.Id2PlayerMapper)
room:askForMoveCardInBoard(player, targets[1], targets[2], self.name)
end
end,
on_acquire = function (self, player, is_start)
player.room:setPlayerMark(player, "@steam__tuigong", 3)
end,
on_lose = function (self, player, is_death)
player.room:setPlayerMark(player, "@steam__tuigong", 0)
end,
}
taozhu:addRelatedSkill(taozhu_delay)
simayi:addSkill(taozhu)
simayi:addSkill(tuigong)
Fk:loadTranslationTable{
["steam__simayi"] = "司马懿",
["#steam__simayi"] = "",
["illustrator:steam__simayi"] = "凝聚永恒",
["designer:steam__simayi"] = "初长风",
["steam__taozhu"] = "韬逐",
[":steam__taozhu"] = "当你使用锦囊牌或受到伤害时,你可以选择一项:1.获得下名执行本操作的角色一张牌;2.摸一张牌,然后与上名执行本操作的角色拼点,"..
"若你没赢,取消之。",
["steam__tuigong"] = "推宫",
[":steam__tuigong"] = "每局游戏限一次,当你造成致命伤害时,你可以视为对其使用(3)张【推心置腹】。此前轮次结束时,你可以令此值+1并移动场上"..
"唯一的牌。",
["steam__taozhu1"] = "下一名角色%arg时,你获得其一张牌",
["steam__taozhu2"] = "摸一张牌并与 %dest 拼点,若你没赢,%src %arg",
["taozhu_cardusing"] = "使用锦囊牌",
["taozhu_damage"] = "受到伤害",
["taozhu_canceluse"] = "取消使用的锦囊",
["taozhu_canceldamage"] = "防止受到的伤害",
["@@steam__taozhu_cardusing"] = "韬逐 使用锦囊",
["@@steam__taozhu_damage"] = "韬逐 受到伤害",
["#steam__taozhu_delay"] = "韬逐",
["#steam__taozhu-prey"] = "韬逐:获得 %dest 一张牌",
["#steam__tuigong-invoke"] = "推宫:是否视为对 %dest 使用%arg张【推心置腹】?",
["@steam__tuigong"] = "推宫",
["#steam__tuigong-add"] = "推宫:是否令“推宫”张数+1并移动 %dest 场上的牌?",
["#steam__tuigong-move"] = "推宫:请移动场上的牌",
}
local simashi = General(extension, "steam__simashi", "jin", 3)
local maishi = fk.CreateFilterSkill{
name = "steam__maishi",
card_filter = function(self, card, player, isJudgeEvent)
return player:hasSkill(self) and player.phase ~= Player.NotActive and player:getMark("steam__maishi-turn") == 0 and
card.color == Card.Black and table.contains(player:getCardIds("h"), card.id)
end,
view_as = function(self, card)
return Fk:cloneCard("steam__underhanding", card.suit, card.number)
end,
}
local maishi_trigger = fk.CreateTriggerSkill{
name = "#steam__maishi_trigger",
refresh_events = {fk.AfterCardUseDeclared},
can_refresh = function(self, event, target, player, data)
return target == player and player.phase ~= Player.NotActive and data.card.type == Card.TypeTrick
end,
on_refresh = function (self, event, target, player, data)
player.room:setPlayerMark(player, "steam__maishi-turn", 1)
end,
}
local ruilve = fk.CreateActiveSkill{
name = "steam__ruilve",
anim_type = "drawcard",
min_card_num = 1,
target_num = 0,
prompt = "#steam__ruilve",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected)
return Fk:getCardById(to_select, false).type == Card.TypeTrick
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 cards = table.filter(effect.cards, function (id)
if table.contains(room.discard_pile, id) then
local card = Fk:getCardById(id)
return player:canUse(card, { bypass_times = true }) and not player:prohibitUse(card)
end
end)
if #cards == 0 then return end
U.askForUseRealCard(room, player, cards, nil, self.name, "#steam__ruilve-use", { expand_pile = cards, bypass_times = true })
end
}
local getShade = function (room, n)
local ids = {}
local name
if Fk.all_card_types["shade"] then
name = "shade"
elseif Fk.all_card_types["rfenghou__shade"] then
name = "rfenghou__shade"
end
assert(name, "服务器未加入【影】!请联系管理员安装“江山如故”或“封侯”包")
for _, id in ipairs(room.void) do
if n <= 0 then break end
if Fk:getCardById(id).name == name then
room:setCardMark(Fk:getCardById(id), MarkEnum.DestructIntoDiscard, 1)
table.insert(ids, id)
n = n - 1
end
end
while n > 0 do
local card = room:printCard(name, Card.Spade, 1)
room:setCardMark(card, MarkEnum.DestructIntoDiscard, 1)
table.insert(ids, card.id)
n = n - 1
end
return ids
end
local fuyu = fk.CreateTriggerSkill{
name = "steam__fuyu",
anim_type = "support",
frequency = Skill.Compulsory,
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and
table.find(player.room.alive_players, function (p)
return Fk.generals[p.general].trueName:startsWith("sima")
end)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local targets = table.filter(room.alive_players, function (p)
return Fk.generals[p.general].trueName:startsWith("sima")
end)
local to
if #targets == 1 then
to = {player.id}
else
to = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, "#steam__fuyu-choose", self.name, false)
end
room:moveCardTo(getShade(room, 1), Card.PlayerHand, to[1], fk.ReasonJustMove, self.name, nil, true, player.id)
end,
}
maishi:addRelatedSkill(maishi_trigger)
simashi:addSkill(maishi)
simashi:addSkill(ruilve)
simashi:addSkill(fuyu)
Fk:loadTranslationTable{
["steam__simashi"] = "司马师",
["#steam__simashi"] = "韬隐沉略",
["illustrator:steam__simashi"] = "拉布拉卡",
["designer:steam__simashi"] = "胖即是胖",
["steam__maishi"] = "埋士",
[":steam__maishi"] = "锁定技,你的回合内,若你本回合未使用过锦囊牌,你的所有黑色手牌均视为【瞒天过海】。",
["steam__ruilve"] = "睿略",
[":steam__ruilve"] = "出牌阶段限一次,你可以重铸任意张锦囊牌,然后你可以使用其中的一张牌。",
["steam__fuyu"] = "伏慾",
[":steam__fuyu"] = "宗族技,当你使用牌结算后,你令一名同宗族角色获得一张【影】。",
["#steam__ruilve"] = "睿略:你可以重铸任意张锦囊牌,然后可以使用其中一张牌",
["#steam__ruilve-use"] = "睿略:你可以使用其中一张牌",
["#steam__fuyu-choose"] = "伏慾:令一名同族角色获得一张【影】",
}
local simayiw = General(extension, "steam__simayiw", "jin", 4)
local tongkai = fk.CreateTriggerSkill{
name = "steam__tongkai",
anim_type = "offensive",
frequency = Skill.Compulsory,
events = {fk.TargetSpecifying},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and data.card.trueName == "slash" and #AimGroup:getAllTargets(data.tos) == 1 then
local to = player.room:getPlayerById(data.to)
for _, p in ipairs({player, to}) do
if table.find(p:getCardIds("he"), function (id)
return not p:prohibitDiscard(id)
end) then
return true
end
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local tos = {}
local to = room:getPlayerById(data.to)
for _, p in ipairs({player, to}) do
if table.find(p:getCardIds("he"), function (id)
return not p:prohibitDiscard(id)
end) then
table.insert(tos, p.id)
end
end
local target = room:askForChoosePlayers(player, tos, 1, 1, "#steam__tongkai-choose", self.name, false)
target = room:getPlayerById(target[1])
local choices = {}
tos = {}
if target:getNextAlive() ~= to and target:getNextAlive() ~= player and
not player:isProhibited(target:getNextAlive(), data.card) then
table.insert(tos, target:getNextAlive().id)
table.insert(choices, "steam__tongkai1")
end
if target:getLastAlive() ~= to and target:getLastAlive() ~= player and
not player:isProhibited(target:getLastAlive(), data.card) then
table.insert(tos, target:getLastAlive().id)
table.insertIfNeed(choices, "steam__tongkai1")
end
if table.find(target:getCardIds("he"), function (id)
return not target:prohibitDiscard(id)
end) then
table.insert(choices, "steam__tongkai2")
end
local cards = table.filter(target:getCardIds("he"), function (id)
return not target:prohibitDiscard(id)
end)
if #choices == 2 and #cards > 1 then
table.insert(choices, "steam__tongkai_beishui")
end
local choice = room:askForChoice(target, choices, self.name, nil, false,
{"steam__tongkai1", "steam__tongkai2", "steam__tongkai_beishui"})
if choice ~= "steam__tongkai2" then
local num = choice == "steam__tongkai_beishui" and 2 or 1
local victim, ids = room:askForChooseCardsAndPlayers(target, num, num, tos, 1, 1, tostring(Exppattern{ id = cards }),
"#steam__tongkai-transfer:::"..num, self.name, false, false)
room:throwCard(ids, self.name, target, target)
AimGroup:cancelTarget(data, data.to)
AimGroup:addTargets(room, data, victim[1])
end
if choice ~= "steam__tongkai1" then
if choice == "steam__tongkai2" then
room:askForDiscard(target, 1, 1, true, self.name, false)
end
data.additionalDamage = (data.additionalDamage or 0) + 1
end
if choice == "steam__tongkai_beishui" then
data.extra_data = data.extra_data or {}
data.extra_data.steam__tongkai_draw = data.extra_data.steam__tongkai_draw or {}
data.extra_data.steam__tongkai_draw[target.id] = (data.extra_data.steam__tongkai_draw[target.id] or 0) + 1
end
end,
}
local tongkai_delay = fk.CreateTriggerSkill{
name = "#steam__tongkai_delay",
mute = true,
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
return not player.dead and data.extra_data and data.extra_data.steam__tongkai_draw and
data.extra_data.steam__tongkai_draw[player.id]
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
player:drawCards(2 * data.extra_data.steam__tongkai_draw[player.id], "steam__tongkai")
end,
}
tongkai:addRelatedSkill(tongkai_delay)
simayiw:addSkill(tongkai)
Fk:loadTranslationTable{
["steam__simayiw"] = "司马乂",
["#steam__simayiw"] = "",
["illustrator:steam__simayiw"] = "",
["designer:steam__simayiw"] = "末折",
["steam__tongkai"] = "同忾",
[":steam__tongkai"] = "锁定技,你使用【杀】指定唯一目标时,你令你或其执行一项:<br>"..
"1.弃置一张牌,此牌重新指定其一名邻家为目标;<br>2.弃置一张牌,此牌造成的伤害加1。<br>背水:此牌结算后,摸两张牌。",
["#steam__tongkai-choose"] = "同忾:请令一名角色选择一项",
["steam__tongkai1"] = "弃一张牌,重新指定你一名邻家为此【杀】目标",
["steam__tongkai2"] = "弃一张牌,此【杀】伤害加1",
["steam__tongkai_beishui"] = "背水:此【杀】结算后你摸两张牌",
["#steam__tongkai-transfer"] = "同忾:弃%arg张牌,重新选择此【杀】的目标",
["#steam__tongkai_delay"] = "同忾",
}
local steam__underhandingSkill = fk.CreateActiveSkill{
name = "steam__underhanding_skill",
prompt = "#steam__underhanding_skill",
can_use = Util.CanUse,
min_target_num = 1,
max_target_num = 2,
mod_target_filter = function(self, to_select, selected, user, card)
return user ~= to_select and not Fk:currentRoom():getPlayerById(to_select):isAllNude()
end,
target_filter = Util.TargetFilter,
on_effect = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.to)
if not to:isAllNude() then
local id = room:askForCardChosen(player, to, "hej", self.name)
room:obtainCard(player, id, false, fk.ReasonPrey, player.id, self.name)
local e = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if e then
local use = e.data[1]
use.extra_data = use.extra_data or {}
use.extra_data.steam__underhanding_targets = use.extra_data.steam__underhanding_targets or {}
table.insertIfNeed(use.extra_data.steam__underhanding_targets, to.id)
end
end
end,
on_action = function (self, room, use, finished)
if not finished then return end
local player = room:getPlayerById(use.from)
if player.dead or player:isNude() then return end
local targets = (use.extra_data or {}).steam__underhanding_targets or {}
if #targets == 0 then return end
room:sortPlayersByAction(targets)
for _, pid in ipairs(targets) do
local target = room:getPlayerById(pid)
if not player:isNude() and not target.dead and not player.dead then
local c = room:askForCard(player, 1, 1, true, self.name, false, nil, "#steam__underhanding-card::" .. pid)[1]
room:moveCardTo(c, Player.Hand, target, fk.ReasonGive, self.name, nil, false, player.id)
end
end
end
}
local steam__underhandingExclude = fk.CreateMaxCardsSkill{
name = "steam__underhanding_exclude",
global = true,
exclude_from = function(self, player, card)
return card and card.name == "steam__underhanding"
end,
}
Fk:addSkill(steam__underhandingExclude)
local steam__underhanding = fk.CreateTrickCard{
name = "&steam__underhanding",
suit = Card.Heart,
number = 5,
skill = steam__underhandingSkill,
multiple_targets = true,
}
steam__underhanding.package = extension
Fk:addCard(steam__underhanding)
Fk:loadTranslationTable{
["steam__underhanding"] = "瞒天过海",
[":steam__underhanding"] = "锦囊牌<br /><b>时机</b>:出牌阶段<br /><b>目标</b>:一至两名区域内有牌的其他角色。<br/><b>效果</b>:"..
"你依次获得目标角色区域内的一张牌,然后依次交给目标角色一张牌。<br/>此牌不计入你的手牌上限。",
["steam__underhanding_skill"] = "瞒天过海",
["steam__underhanding_action"] = "瞒天过海",
["#steam__underhanding-card"] = "瞒天过海:交给 %dest 一张牌",
["#steam__underhanding_skill"] = "选择一至两名区域内有牌的其他角色,依次获得其区域内的一张牌,然后依次交给其一张牌",
}
local yuquan = General(extension, "steam__yuquan", "wu", 2, 5)
local steam__mianzhou = fk.CreateTriggerSkill{
name = "steam__mianzhou",
anim_type = "defensive",
frequency = Skill.Compulsory,
events = {fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target == player and #player:getCardIds("e") == 0 then
return data.damage >= (player.hp + player.shield)
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:changeMaxHp(player, -1)
if player.dead then return end
local targets = table.map(room:getOtherPlayers(player, false), Util.IdMapper)
if #targets > 0 then
local tos = room:askForChoosePlayers(player, targets, 1, 1, "#steam__mianzhou-choose", self.name, false)
if #tos > 0 then
local to = room:getPlayerById(tos[1])
local choices = {"basic", "trick", "equip"}
if player:usedSkillTimes(self.name) < 2 then table.remove(choices, 1) end
local cardType = room:askForChoice(player, choices, self.name, "#steam__mianzhou-choice:"..to.id) .. "_char"
local mark = to:getTableMark("@steam__mianzhou-turn")
if table.insertIfNeed(mark, cardType) then
room:setPlayerMark(to, "@steam__mianzhou-turn", mark)
end
end
end
return true
end,
}
local steam__mianzhou_prohibit = fk.CreateProhibitSkill{
name = "#steam__mianzhou_prohibit",
prohibit_use = function(self, player, card)
return card and table.contains(player:getTableMark("@steam__mianzhou-turn"), card:getTypeString() .. "_char")
end,
}
steam__mianzhou:addRelatedSkill(steam__mianzhou_prohibit)
yuquan:addSkill(steam__mianzhou)
local steam__fuzhen = fk.CreateTriggerSkill{
name = "steam__fuzhen",
anim_type = "control",
frequency = Skill.Compulsory,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target ~= player and not target.dead then
if target.phase == Player.Start then
return target:inMyAttackRange(player)
elseif target.phase == Player.Finish then
return not target:inMyAttackRange(player) and #player:getCardIds("he") > 1
end
end
end,
on_cost = function (self, event, target, player, data)
if target.phase == Player.Start then
if player.room:askForSkillInvoke(player, self.name, nil, "#steam__fuzhen-invoke:"..target.id) then
self.cost_data = {tos = {target.id}}
return true
end
else
local cards = player.room:askForDiscard(player, 2, 2, true, self.name, true, ".", "#steam__fuzhen-cost", true)
if #cards == 2 then
self.cost_data = {cards = cards}
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if target.phase == Player.Start then
room:addTableMark(target, "@@steam__fuzhen-turn", player.id)
else
room:throwCard(self.cost_data.cards, self.name, player, player)
room:changeMaxHp(player, 1)
end
end,
}
local steam__fuzhen_prohibit = fk.CreateProhibitSkill{
name = "#steam__fuzhen_prohibit",
is_prohibited = function (self, player, to, card)
if not player then return false end
local mark = player:getTableMark("@@steam__fuzhen-turn")
if #mark == 0 then return false end
if card and card.is_damage_card then
return #mark > 1 or not table.contains(mark, to.id)
end
end,
}
steam__mianzhou:addRelatedSkill(steam__fuzhen_prohibit)
yuquan:addSkill(steam__fuzhen)
Fk:loadTranslationTable{
["steam__yuquan"] = "于诠",
["#steam__yuquan"] = "杀身成仁",
["illustrator:steam__yuquan"] = "",
["designer:steam__yuquan"] = "颜渊",
["steam__mianzhou"] = "免胄",
[":steam__mianzhou"] = "锁定技,若你的装备区没有牌,当你受到致命伤害时,改为减少1点体力上限,然后令一名其他角色本回合不能使用一种类型的牌(每回合首次发动不可选择基本牌)。",
["@steam__mianzhou-turn"] = "免胄",
["#steam__mianzhou-choose"] = "免胄:令一名其他角色本回合不能使用一种类型的牌",
["#steam__mianzhou-choice"] = "免胄:选择令 %src 本回合不能使用一种类型的牌",
["steam__fuzhen"] = "赴阵",
[":steam__fuzhen"] = "其他角色的准备阶段,若你在其攻击范围内,你可以令其本回合使用伤害类牌只能指定你为目标;其他角色的结束阶段,若你不在其攻击范围内,你可以弃置两张牌并增加1点体力上限。",
["#steam__fuzhen-invoke"] = "赴阵:你可以令 %src 本回合伤害牌只能指定你为目标",
["#steam__fuzhen-cost"] = "赴阵:你可以弃置两张牌并增加1点体力上限",
["@@steam__fuzhen-turn"] = "被赴阵",
}
local zhangte = General(extension, "steam__zhangte", "wei", 4)
local steam__buzhu = fk.CreateActiveSkill{
name = "steam__buzhu",
anim_type = "support",
min_card_num = 1,
target_num = 1,
prompt = "#steam__buzhu",
card_filter = function(self, to_select, selected)
return Fk:getCardById(to_select).type ~= Card.TypeEquip
and not Self:prohibitUse(Fk:getCardById(to_select)) and Self:canUse(Fk:getCardById(to_select))
end,
target_filter = function(self, to_select, selected, selected_cards)
return #selected == 0 and #selected_cards > 0
end,
can_use = function(self, player)
return not player:isKongcheng()
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local to = room:getPlayerById(effect.tos[1])
room:throwCard(effect.cards, self.name, player, player)
if to.dead then return end
local ids = room:getCardsFromPileByRule(".|.|.|.|.|equip", #effect.cards)
if #ids == 0 then return end
room:obtainCard(to, ids, true, fk.ReasonJustMove, player.id, self.name)
while to:isAlive() do
ids = table.filter(ids, function(id)
return table.contains(to:getCardIds("h"), id)
end)
-- stupid filter skill...
for _, id in ipairs(ids) do
Fk:filterCard(id, to)
end
ids = table.filter(ids, function(id)
return Fk:getCardById(id).type == Card.TypeEquip and to:canUseTo(Fk:getCardById(id), to)
and to:hasEmptyEquipSlot(Fk:getCardById(id).sub_type)
end)
if #ids == 0 then break end
local cid = table.random(ids)
local same = table.filter(ids, function(id)
return Fk:getCardById(cid).sub_type == Fk:getCardById(id).sub_type
end)
if #same > 1 then
same = room:askForCard(to, 1, 1, false, self.name, false, tostring(Exppattern{ id = same }), "#steam__buzhu-use")
end
table.removeOne(ids, same[1]) -- 谨防防止移动导致的死循环
room:useCard{from = to.id, tos = {{to.id}}, card = Fk:getCardById(same[1])}
end
end,
}
zhangte:addSkill(steam__buzhu)
local steam__zhenyu = fk.CreateTriggerSkill{
name = "steam__zhenyu",
anim_type = "support",
events = {fk.Damaged},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and not target.dead and #target:getCardIds("e") > 0
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#steam__zhenyu-invoke:"..target.id)
end,
on_use = function (self, event, target, player, data)
local room = player.room
local equps = target:getCardIds("e")
local cid = equps[1]
if #equps > 1 then
-- 哈哈,用这个函数可以看见卡牌标记
cid = U.askforChooseCardsAndChoice(player, equps, {"OK"}, self.name, "$ChooseCard", {}, 1, 1)[1]
end
local good = Fk:getCardById(cid):getMark("@@steam__buzhu_card") ~= 0
room:throwCard({cid}, self.name, target, player)
if not target.dead then
room:recover { num = 1, skillName = self.name, who = target, recoverBy = player }
end
if good then
if not target.dead then
local x = math.min(5, target.maxHp - target:getHandcardNum())
if x > 0 then
target:drawCards(x, self.name)
end
end
else
if not player.dead then
room:loseHp(player, 1, self.name)
end
end
end,
refresh_events = {fk.AfterCardsMove},
can_refresh = function(self, event, target, player, data)
return player.seat == 1
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
--- 检测是否因为“补筑”而移入装备区
local skillCheck = function ()
local currentEvent = room.logic:getCurrentEvent()
if currentEvent.parent and currentEvent.parent.event == GameEvent.UseCard
and currentEvent.parent.parent then
return currentEvent.parent.parent.data[3].name == "steam__buzhu"
end
end
for _, move in ipairs(data) do
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Player.Equip then
if Fk:getCardById(info.cardId):getMark("@@steam__buzhu_card") ~= 0 then
room:setCardMark(Fk:getCardById(info.cardId), "@@steam__buzhu_card", 0)
end
end
end
if move.toArea == Player.Equip then
if skillCheck() then
for _, info in ipairs(move.moveInfo) do
room:setCardMark(Fk:getCardById(info.cardId), "@@steam__buzhu_card", 1)
end
end
end
end
end,
}
zhangte:addSkill(steam__zhenyu)
Fk:loadTranslationTable{
["steam__zhangte"] = "张特",
["#steam__zhangte"] = "缓兵之策",
["illustrator:steam__zhangte"] = "",
["designer:steam__zhangte"] = "颜渊",
["steam__buzhu"] = "补筑",
[":steam__buzhu"] = "出牌阶段,你可以弃置任意张可以使用的非装备牌,令一名角色从牌堆获得等量张装备牌,若其有对应的空置装备栏,使用之。",
["#steam__buzhu"] = "补筑:弃置任意张可以使用的非装备牌,令一名角色获得等量张装备牌",
["#steam__buzhu-use"] = "补筑:请选择一张装备牌使用!",
["@@steam__buzhu_card"] = "补筑",
["steam__zhenyu"] = "镇御",
[":steam__zhenyu"] = "一名角色受到伤害后,你可以弃置其装备区一张牌,令其回复1点体力,若为“补筑”牌,其摸牌至体力上限(至多摸5张);否则你失去1点体力。",
["#steam__zhenyu-invoke"] = "镇御:你可以弃置 %src 装备区一张牌,令其回复1点体力",
}
local zhonghui = General(extension, "steam__laizhonghui", "shu", 4)
local steam__chengren = fk.CreateActiveSkill{
name = "steam__chengren",
anim_type = "offensive",
min_card_num = 1,
target_num = 0,
prompt = "#steam__chengren",
card_filter = function(self, to_select, selected)
return table.contains(Self.player_cards[Player.Hand], to_select)
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
and table.find(Fk:currentRoom().alive_players, function (p)
return p ~= player
end) ~= nil
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local x = 0
local cards = effect.cards
for _, id in ipairs(cards) do
x = x + RUtil.cardNameLen(id)
end
room:askForYiji(player, cards, room:getOtherPlayers(player, false), self.name, #cards, #cards)
if player.dead then return end
local all_choices = U.getAllCardNames("bt")
local choices = table.filter(all_choices, function (name)
local card = Fk:cloneCard(name)
if RUtil.cardNameLen(card) > x then return false end
card.skillName = self.name
return player:canUse(card, {bypass_times = true}) and not player:prohibitUse(card)
end)
if #choices == 0 then return end
U.askForUseVirtualCard(room, player, choices, nil, self.name, nil, false, true, false, true)
end,
}
zhonghui:addSkill(steam__chengren)
local steam__suishu = fk.CreateTriggerSkill{
name = "steam__suishu",
anim_type = "control",
events = {fk.AfterCardsMove, fk.Damaged},
can_trigger = function(self, event, target, player, data)
if not player:hasSkill(self) then return false end
if player.room:canMoveCardInBoard() == 0 then return false end
if event == fk.AfterCardsMove then
return data.extra_data and data.extra_data.hcnm_becomeEmpty and table.contains(data.extra_data.hcnm_becomeEmpty, player.id)
else
return target == player
end
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local tos = room:askForChooseToMoveCardInBoard(player, "#steam__suishu-move", 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)
room:askForMoveCardInBoard(player, tos[1], tos[2], self.name)
local from = tos[1]---@type ServerPlayer
if from.dead then return end
local x = #table.filter(from.equipSlots, function (slot)
return from:getEquipment(Util.convertSubtypeAndEquipSlot(slot)) == nil
end)
x = from:getHandcardNum() - x
if x > 0 then
room:askForDiscard(from, x, x, false, self.name, false)
elseif x < 0 then
from:drawCards(-x, self.name)
end
end,
}
zhonghui:addSkill(steam__suishu)
local steam__tongju = fk.CreateTriggerSkill{
name = "steam__tongju$",
anim_type = "offensive",
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target == player and data.card.trueName == "slash" and data.firstTarget then
return table.find(player.room.alive_players, function (p)
return p ~= player and (p.kingdom == "shu" or p.kingdom == "wei")
end) ~= nil
end
end,
on_trigger = function (self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(self.name)
local targets = table.filter(room:getOtherPlayers(player), function (p)
return (p.kingdom == "shu" or p.kingdom == "wei")
end)
room:doIndicate(player.id, table.map(targets, Util.IdMapper))
-- 小心魏武帝插结改势力
for _, p in ipairs(room:getOtherPlayers(player)) do
if not player:hasSkill(self) then break end
if p:isAlive() and not p:isKongcheng() and (p.kingdom == "shu" or p.kingdom == "wei") then
self:doCost(event, p, player, data)
end
end
end,
on_cost = function (self, event, target, player, data)
local cards = player.room:askForCard(target, 1, 1, false, self.name, true, "jink", "#steam__tongju-card:"..player.id)
if #cards > 0 then
self.cost_data = {cards = cards }
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
room:recastCard(self.cost_data.cards, target, self.name)
data.additionalEffect = (data.additionalEffect or 0) + 1
end,
}
zhonghui:addSkill(steam__tongju)
Fk:loadTranslationTable{
["steam__laizhonghui"] = "<font color='#0596BE'>来</font>钟会", -- 希望别有读取名字长度的设,不然露馅
["#steam__laizhonghui"] = "潜蛟化龙",
["cv:steam__laizhonghui"] = "官方",
["illustrator:steam__laizhonghui"] = "官方",
["designer:steam__laizhonghui"] = "Sachiko",
["steam__chengren"] = "承仁",
[":steam__chengren"] = "出牌阶段限一次,你可以分配任意张手牌,然后视为使用一张牌名字数不大于X的即时牌(X为你分配的牌名字数之和)。",
["#steam__chengren"] = "承仁:分配任意张手牌,然后视为使用一张牌名字数不大于X的即时牌(X为你分配的牌名字数之和)",
["steam__suishu"] = "绥术",
[":steam__suishu"] = "当你受到伤害后或失去所有手牌后,你可以移动场上一张牌,然后令因此失去牌的角色将手牌数调整至其空置装备栏数。",
["#steam__suishu-move"] = "绥术:你可移动场上一张牌,令失去牌的角色将手牌数调整至其空置装备栏数",
["steam__tongju"] = "同举",
[":steam__tongju"] = "主公技。当你使用【杀】指定第一个目标后,其他蜀或魏势力角色可以重铸一张【闪】,然后令此牌效果额外结算一次。",
["#steam__tongju-card"] = "同举:你可以重铸一张【闪】,令 %src 的【杀】额外结算一次",
["$steam__chengren1"] = "既已功高盖主,何妨冕服加身?",
["$steam__chengren2"] = "天下大事无常,钟某亦可为王。",
["$steam__suishu1"] = "王侯将相不在其种,而在其行。",
["$steam__suishu2"] = "心怀屠龙之术,何患手无长缨?",
["$steam__tongju1"] = "我既搏一世之功,亦求万世之名。",
["$steam__tongju2"] = "我一人筚路蓝缕,可保阖族千秋万代!",
["~steam__laizhonghui"] = "我有大功于国,尔等怎敢逾制!",
}
local dongmindonghuang = General(extension, "steam__dongmindonghuang", "qun", 4)
local ciheng = fk.CreateTriggerSkill{
name = "steam__ciheng",
anim_type = "offensive",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Play and
#player.room.alive_players > 1
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local tos = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 2, 2,
"#steam__ciheng-choose", self.name)
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 targets = table.map(self.cost_data.tos, Util.Id2PlayerMapper)
for _, p in ipairs(targets) do
room:setPlayerMark(p, "@@steam__ciheng-turn", 1)
room:handleAddLoseSkills(p, "steam__ciheng&", nil, false, true)
room.logic:getCurrentEvent():findParent(GameEvent.Turn):addCleaner(function()
room:handleAddLoseSkills(p, "-steam__ciheng&", nil, false, true)
end)
end
targets = table.filter(targets, function (p)
return not p:isKongcheng()
end)
if #targets > 0 then
local result = U.askForJointCard(targets, 1, 999, false, self.name, true, nil, "#steam__ciheng-ask")
for _, ids in pairs(result) do
if #ids > 0 then
for _, id in ipairs(ids) do
room:setCardMark(Fk:getCardById(id), "@@steam__ciheng-inhand-turn", 1)
end
end
end
end
end,
}
local ciheng_delay = fk.CreateTriggerSkill{
name = "#steam__ciheng_delay",
anim_type = "control",
events = {fk.EventPhaseEnd},
can_trigger = function(self, event, target, player, data)
return target == player and player.phase == Player.Play and player:usedSkillTimes("steam__ciheng", Player.HistoryPhase) > 0 and
table.find(player.room.alive_players, function (p)
return p:getMark("@@steam__ciheng-turn") > 0
end)
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
local room = player.room
for _, p in ipairs(room:getAlivePlayers()) do
if p:getMark("@@steam__ciheng-turn") > 0 then
local cards = table.filter(p:getCardIds("h"), function (id)
local card = Fk:getCardById(id, false)
return card:getMark("@@steam__ciheng-inhand-turn") == 0 and card.trueName ~= "duel" and not p:prohibitDiscard(id)
end)
if #cards > 0 then
room:throwCard(cards, "steam__ciheng", p, p)
end
end
end
end,
}
local ciheng_filter = fk.CreateFilterSkill{
name = "#steam__ciheng_filter",
anim_type = "offensive",
card_filter = function(self, card, player, isJudgeEvent)
return card:getMark("@@steam__ciheng-inhand-turn") > 0 and table.contains(player:getCardIds("h"), card.id)
end,
view_as = function(self, card)
return Fk:cloneCard("duel", card.suit, card.number)
end,
}
local ciheng_prohibit = fk.CreateProhibitSkill{
name = "#steam__ciheng_prohibit",
is_prohibited = function (self, from, to, card)
return from:usedSkillTimes("steam__ciheng", Player.HistoryPhase) > 0 and card and
to:getMark("@@steam__ciheng-turn") == 0
end,
}
local ciheng_viewas = fk.CreateViewAsSkill{
name = "steam__ciheng&",
anim_type = "offensive",
pattern = "slash",
prompt = "#steam__ciheng&",
card_filter = function(self, to_select, selected)
return #selected == 0 and table.contains(Self:getCardIds("h"), to_select) and
Fk:getCardById(to_select):getMark("@@steam__ciheng-inhand-turn") == 0
end,
view_as = function(self, cards)
if #cards ~= 1 then return end
local c = Fk:cloneCard("slash")
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
}
Fk:addSkill(ciheng_viewas)
ciheng:addRelatedSkill(ciheng_delay)
ciheng:addRelatedSkill(ciheng_filter)
ciheng:addRelatedSkill(ciheng_prohibit)
dongmindonghuang:addSkill(ciheng)
Fk:loadTranslationTable{
["steam__dongmindonghuang"] = "董旻董璜",
["#steam__dongmindonghuang"] = "魔鲠",
["illustrator:steam__dongmindonghuang"] = "北★MAN",
["designer:steam__dongmindonghuang"] = "小叶子",
["steam__ciheng"] = "呲横",
[":steam__ciheng"] = "出牌阶段开始时,你可选择两名角色,本回合你仅能对这些角色使用牌,并令这些角色选择其任意张手牌,本回合这些牌视为【决斗】且"..
"其余手牌可当【杀】使用或打出。此阶段结束时,这些角色弃置手牌中不为【决斗】的牌。",
["steam__ciheng&"] = "呲横",
[":steam__ciheng&"] = "你可以将非“呲横”手牌当【杀】使用或打出。",
["#steam__ciheng-choose"] = "呲横:你可以选择两名角色,本回合仅能对这些角色使用牌",
["@@steam__ciheng-turn"] = "呲横",
["#steam__ciheng-ask"] = "呲横:选择任意张手牌本回合视为【决斗】,其他手牌本回合可以当【杀】",
["@@steam__ciheng-inhand-turn"] = "呲横",
["#steam__ciheng_delay"] = "呲横",
["#steam__ciheng_filter"] = "呲横",
["#steam__ciheng&"] = "呲横:你可以将非“呲横”手牌当【杀】使用或打出",
}
local guanyinping = General(extension, "steam__guanyinping", "shu", 3, 3, General.Female)
local zhuiyue = fk.CreateViewAsSkill{
name = "steam__zhuiyue",
anim_type = "offensive",
pattern = ".|.|.|.|analeptic,fire_attack,fire__slash",
prompt = function (self, selected_cards, selected)
local names = {"analeptic", "fire_attack", "fire__slash"}
local index = (1 + Self:usedSkillTimes(self.name, Player.HistoryGame)) % 3
if index == 0 then
index = 3
end
return "#steam__zhuiyue:::"..names[index]
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local names = {"analeptic", "fire_attack", "fire__slash"}
local index = (1 + Self:usedSkillTimes(self.name, Player.HistoryGame)) % 3
if index == 0 then
index = 3
end
local card = Fk:cloneCard(names[index])
card.skillName = self.name
return card
end,
before_use = function (self, player, use)
local room = player.room
if use.tos then
for _, id in ipairs(TargetGroup:getRealTargets(use.tos)) do
local p = room:getPlayerById(id)
if not p.dead and not p.chained then
p:setChainState(true)
end
end
elseif not player.chained then
player:setChainState(true)
end
end,
enabled_at_response = function (self, player, response)
if response then return end
local names = {"analeptic", "fire_attack", "fire__slash"}
local index = (1 + player:usedSkillTimes(self.name, Player.HistoryGame)) % 3
if index == 0 then
index = 3
end
local card = Fk:cloneCard(names[index])
card.skillName = self.name
return (Fk.currentResponsePattern == nil and player:canUse(card)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(card))
end,
}
local zhuiyue_trigger = fk.CreateTriggerSkill{
name = "#steam__zhuiyue_trigger",
refresh_events = {fk.ChainStateChanged, fk.AfterCardTargetDeclared},
can_refresh = function(self, event, target, player, data)
if event == fk.ChainStateChanged then
return player:hasSkill(zhuiyue) and not target.chained and not target.dead
elseif event == fk.AfterCardTargetDeclared then
return target == player and
table.find(player:getTableMark("steam__zhuiyue"), function (id)
return table.contains(TargetGroup:getRealTargets(data.tos), id)
end)
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.ChainStateChanged then
room:addTableMark(player, "steam__zhuiyue", target.id)
elseif event == fk.AfterCardTargetDeclared then
local mark = player:getTableMark("steam__zhuiyue")
for i = #mark, 1, -1 do
if table.contains(TargetGroup:getRealTargets(data.tos), mark[i]) then
table.remove(mark, i)
end
end
room:setPlayerMark(player, "steam__zhuiyue", mark)
if not data.extraUse then
player:addCardUseHistory(data.card.trueName, -1)
data.extraUse = true
end
end
end,
}
local zhuiyue_targetmod = fk.CreateTargetModSkill{
name = "#steam__zhuiyue_targetmod",
bypass_distances = function (self, player, skill, card, to)
return card and table.contains(player:getTableMark("steam__zhuiyue"), to.id)
end,
bypass_times = function (self, player, skill, scope, card, to)
return card and table.contains(player:getTableMark("steam__zhuiyue"), to.id)
end,
}
local zhuohun = fk.CreateTriggerSkill{
name = "steam__zhuohun",
mute = true,
events = {fk.Damage, fk.Damaged},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
self.cost_data = nil
for i = 1, 2, 1 do
local events = player.room.logic:getActualDamageEvents(i, function(e)
if event == fk.Damage then
return e.data[1].from == player
elseif event == fk.Damaged then
return e.data[1].to == player
end
end, Player.HistoryTurn)
if #events == i and events[i].data[1] == data then
if i == 1 and table.find(player:getCardIds("h"), function (id)
return not player:prohibitDiscard(id)
end) then
self.cost_data = 1
elseif i == 2 and player.hp > 0 then
self.cost_data = 2
end
end
end
return self.cost_data ~= nil
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#steam__zhuohun"..self.cost_data.."-invoke")
end,
on_use = function (self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(self.name)
if self.cost_data == 1 then
room:notifySkillInvoked(player, self.name, "drawcard")
player:throwAllCards("h")
if not player.dead then
player:drawCards(3, self.name)
end
elseif self.cost_data == 2 then
room:notifySkillInvoked(player, self.name, "support")
room:loseHp(player, player.hp, self.name)
if player:isWounded() and not player.dead then
room:recover{
who = player,
num = player.maxHp - player.hp,
recoverBy = player,
skillName = self.name,
}
end
end
end,
}
zhuiyue:addRelatedSkill(zhuiyue_trigger)
zhuiyue:addRelatedSkill(zhuiyue_targetmod)
guanyinping:addSkill(zhuiyue)
guanyinping:addSkill(zhuohun)
Fk:loadTranslationTable{
["steam__guanyinping"] = "关银屏",
["#steam__guanyinping"] = "九天凰舞",
["illustrator:steam__guanyinping"] = "木美人",
["designer:steam__guanyinping"] = "末页&屑",
["steam__zhuiyue"] = "追月",
[":steam__zhuiyue"] = "转换技,你可以视为使用①【酒】②【火攻】③火【杀】,并横置此牌的目标;一名角色重置后,你以其为目标的下一张牌无距离次数限制。",
["steam__zhuohun"] = "灼魂",
[":steam__zhuohun"] = "你每回合首次造成或受到伤害后,可以弃置所有手牌并摸三张牌;再次造成或受到伤害后,可以失去所有体力并将体力回复至上限。",
["#steam__zhuiyue"] = "追月:你可以视为使用【%arg】,并横置此牌目标",
["#steam__zhuohun1-invoke"] = "灼魂:是否弃置所有手牌,然后摸三张牌?",
["#steam__zhuohun2-invoke"] = "灼魂:是否失去所有体力,然后回复体力至上限?",
}
local shaco = General(extension, "steam__shaco", "west", 1)
local fear_box = fk.CreateTriggerSkill{
name = "steam__fear_box",
mute = true,
events = {"fk.GeneralAppeared", fk.AfterPlayerRevived, fk.EventPhaseStart},
can_trigger = function (self, event, target, player, data)
if target == player and player:hasShownSkill(self) then
if event == "fk.GeneralAppeared" then
return true
elseif event == fk.AfterPlayerRevived then
return target == player and data.reason == "rest"
elseif event == fk.EventPhaseStart then
return target == player and player.phase == Player.Finish
end
end
end,
on_cost = function (self, event, target, player, data)
if event == fk.EventPhaseStart then
return player.room:askForSkillInvoke(player, self.name, nil, "#steam__fear_box-invoke")
else
return true
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(self.name)
if event == "fk.GeneralAppeared" or event == fk.AfterPlayerRevived then
room:notifySkillInvoked(player, self.name, "drawcard")
player:drawCards(2, self.name)
if not player.dead and not player:isNude() then
local success, dat = room:askForUseActiveSkill(player, "steam__fear_box_viewas", "#steam__fear_box-use", true)
if success and dat then
local card = Fk.skills["steam__fear_box_viewas"]:viewAs(dat.cards)
local use = {
from = player.id,
tos = table.map(dat.targets, function(id) return {id} end),
card = card,
}
room:useCard(use)
end
end
elseif event == fk.EventPhaseStart then
room:notifySkillInvoked(player, self.name, "special")
room:loseHp(player, 1, self.name)
if not player.dead then
DIY.EnterHidden(player)
end
end
end,
refresh_events = {fk.PreDamage},
can_refresh = function (self, event, target, player, data)
return target == player and data.card and table.contains(data.card.skillNames, self.name)
end,
on_refresh = function (self, event, target, player, data)
data.damageType = fk.IceDamage
end,
}
local fear_box_viewas = fk.CreateViewAsSkill{
name = "steam__fear_box_viewas",
card_filter = function(self, to_select, selected)
return #selected == 0
end,
view_as = function(self, cards)
if #cards ~= 1 then return end
local card = Fk:cloneCard("unexpectation")
card.skillName = "steam__fear_box"
card:addSubcard(cards[1])
return card
end,
}
local deceive_magic = fk.CreateTriggerSkill{
name = "steam__deceive_magic",
anim_type = "defensive",
frequency = Skill.Compulsory,
events = {fk.AskForPeachesDone},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player:usedSkillTimes(self.name) == 0 and player.hp <= 0 then
return table.find(player.room:getOtherPlayers(player), function (p)
return table.contains(U.GetFriends(player.room, player), p)
end)
end
end,
on_use = function(self, event, target, player, data)
player.room:setPlayerRest(player, 1)
end,
}
fear_box.isHiddenSkill = true
Fk:addSkill(fear_box_viewas)
shaco:addSkill(fear_box)
shaco:addSkill(deceive_magic)
Fk:loadTranslationTable{
["steam__shaco"] = "萨科",
["#steam__shaco"] = "恶魔小丑",
["illustrator:steam__shaco"] = "Evan Monteiro",
["designer:steam__shaco"] = "cyc",
["steam__fear_box"] = "惊吓魔盒",
[":steam__fear_box"] = "隐匿。你登场后,或休整归来后,你摸两张牌且可以将一张牌当造成冰冻伤害的【出其不意】使用。结束阶段,"..
"你可以失去1点体力并隐匿。",
["steam__deceive_magic"] = "欺诈魔术",
[":steam__deceive_magic"] = "锁定技,你的濒死结算后,若你未被救回,且你不是所在阵营的唯一存活者,则休整至你的下回合开始。",
["steam__fear_box_viewas"] = "惊吓魔盒",
["#steam__fear_box-use"] = "惊吓魔盒:你可以将一张牌当造成冰冻伤害的【出其不意】使用",
["#steam__fear_box-invoke"] = "惊吓魔盒:是否失去1点体力并隐匿?",
}
local yanghuiyu = General(extension, "steam__yanghuiyu", "jin", 3, 3, General.Female)
local shenyi = fk.CreateTriggerSkill{
name = "steam__shenyi",
anim_type = "support",
events = {fk.CardUseFinished},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 then
local dat = nil
player.room.logic:getEventsByRule(GameEvent.UseCard, 1, function (e)
if e.id ~= player.room.logic:getCurrentEvent().id then
local use = e.data[1]
dat = use
return true
end
end, 1)
return dat and dat.from ~= player.id
end
end,
on_use = function (self, event, target, player, data)
local room = player.room
local n = #room.logic:getEventsOfScope(GameEvent.UseCard, 5, Util.TrueFunc, Player.HistoryTurn)
local cards = room:getNCards(n)
local red = table.filter(cards, function (id)
return Fk:getCardById(id).color == Card.Red
end)
if #red > 0 then
room:askForYiji(player, red, room.alive_players, self.name, 0, n, "#steam__shenyi-give", cards)
end
cards = table.filter(cards, function (id)
return table.contains(room.draw_pile, id)
end)
if #cards > 0 and not player.dead then
room:askForGuanxing(player, cards)
end
end,
}
local hongcao = fk.CreateViewAsSkill{
name = "steam__hongcao",
anim_type = "support",
pattern = "peach,nullification",
prompt = function (self)
local red = table.filter(Self:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Red
end)
local black = table.filter(Self:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Black
end)
if #red > #black then
return "#steam__hongcao-peach"
else
return "#steam__hongcao-nullification"
end
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local red = table.filter(Self:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Red
end)
local black = table.filter(Self:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Black
end)
local c = Fk:cloneCard(#red > #black and "peach" or "nullification")
c.skillName = self.name
return c
end,
before_use = function (self, player, use)
local room = player.room
local red = table.filter(player:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Red
end)
local black = table.filter(player:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Black
end)
if use.card.name == "peach" then
room:recastCard(red, player, self.name)
else
room:throwCard(black, self.name, player, player)
end
end,
enabled_at_play = function (self, player)
local red = table.filter(player:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Red
end)
local black = table.filter(player:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Black
end)
return #red > #black and player:canUse(Fk:cloneCard("peach"))
end,
enabled_at_response = function(self, player, response)
if response or player:isKongcheng() then return end
local red = table.filter(player:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Red
end)
local black = table.filter(player:getCardIds("h"), function(id)
return Fk:getCardById(id).color == Card.Black
end)
if #red > #black then
return #U.getViewAsCardNames(player, self.name, {"peach"}) > 0
elseif table.every(black, function (id)
return not player:prohibitDiscard(id)
end) then
return #U.getViewAsCardNames(player, self.name, {"nullification"}) > 0
end
end,
}
yanghuiyu:addSkill(shenyi)
yanghuiyu:addSkill(hongcao)
Fk:loadTranslationTable{
["steam__yanghuiyu"] = "羊徽瑜",
["#steam__yanghuiyu"] = "端清才德",
["illustrator:steam__yanghuiyu"] = "匠人绘",
["designer:steam__yanghuiyu"] = "末页",
["steam__shenyi"] = "慎仪",
[":steam__shenyi"] = "每回合限一次,你使用牌结算完毕后,若上一张牌不为你使用,你可以卜算X并分配其中的红色牌(X为本回合所有角色使用的牌数之和且"..
"至多为5)。",
["steam__hongcao"] = "弘操",
[":steam__hongcao"] = "若你手牌中:红色牌更多,你可以重铸所有红色手牌以视为使用【桃】;否则你可以弃置所有黑色手牌以视为使用【无懈可击】。",
["#steam__shenyi-give"] = "慎仪:你可以分配其中的红色牌",
["#steam__hongcao-peach"] = "弘操:你可以重铸所有红色手牌,视为使用【桃】",
["#steam__hongcao-nullification"] = "弘操:你可以弃置所有黑色手牌,视为使用【无懈可击】",
}
local zhaoe = General(extension, "steam__zhaoe", "qun", 4, 4, General.Female)
local steam__renchou = fk.CreateViewAsSkill{
name = "steam__renchou",
anim_type = "offensive",
pattern = "duel",
prompt = function(self)
local promot = "#steam__renchou"
local x = Self:getMark("steam__renchou-turn")
if x > 0 then
promot = "#steam__renchou-ex:::"..(x+1)
end
return promot
end,
card_filter = function(self, to_select, selected)
return true
end,
view_as = function(self, cards)
if #cards == 0 or #cards <= Self:getMark("steam__renchou-turn") then return nil end
local c = Fk:cloneCard("duel")
c.skillName = self.name
c:addSubcards(cards)
return c
end,
before_use = function(self, player, use)
local room = player.room
local x = #use.card.subcards
room:setPlayerMark(player, "steam__renchou-turn", x)
use.additionalDamage = (x - 1)
end,
after_use = function (self, player, use)
if player:getMark("@@steam__yanshi") ~= 0 then
local room = player.room
room:setPlayerMark(player, "@@steam__yanshi", 0)
room:handleAddLoseSkills(player, "-steam__renchou")
end
end,
enabled_at_play = function(self, player)
return true
end,
enabled_at_response = function (self, player, response)
return not response
end,
on_lose = function (self, player)
if player:getMark("@@steam__yanshi") ~= 0 then
player.room:setPlayerMark(player, "@@steam__yanshi", 0)
end
end,
}
local steam__renchou_trigger = fk.CreateTriggerSkill{
name = "#steam__renchou_trigger",
events = {fk.CardUsing},
anim_type = "drawcard",
can_trigger = function(self, event, target, player, data)
if player:hasSkill(steam__renchou) and table.contains(data.card.skillNames, steam__renchou.name)
and player.hp == 1 then
return #player.room.logic:getEventsOfScope(GameEvent.Death, 1, function(e)
local death = e.data[1]
return death.damage and death.damage.from == player
end, Player.HistoryTurn) > 0
end
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
player:drawCards(1, "steam__renchou")
end,
}
steam__renchou:addRelatedSkill(steam__renchou_trigger)
zhaoe:addSkill(steam__renchou)
local steam__yanshi = fk.CreateTriggerSkill{
name = "steam__yanshi",
events = {fk.EnterDying},
anim_type = "defensive",
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target == player and player.hp < 1 then
-- 隐藏描述:因其他人的“刃仇”而进入濒死不能发动
--[[
local cardEffct = player.room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
if cardEffct then
cardEffct = cardEffct.data[1]
if cardEffct.card and table.contains(cardEffct.card.skillNames, "steam__renchou") and data.damage and data.damage.card
and cardEffct.card == data.damage.card and cardEffct.from ~= player.id then
return false
end
end
]]
return table.find(player.room.alive_players, function (p)
return not p:hasSkill(steam__renchou, true)
end) ~= nil
end
end,
on_cost = function (self, event, target, player, data)
local targets = table.filter(player.room.alive_players, function (p) return not p:hasSkill(steam__renchou, true) end)
local tos = player.room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
"#steam__yanshi-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])
room:setPlayerMark(to, "@@steam__yanshi", 1)
room:handleAddLoseSkills(to, "steam__renchou")
if not player.dead then
room:recover { num = 1-player.hp, skillName = self.name, who = player, recoverBy = player }
end
end,
}
zhaoe:addSkill(steam__yanshi)
Fk:loadTranslationTable{
["steam__zhaoe"] = "赵娥",
["#steam__zhaoe"] = "",
["illustrator:steam__zhaoe"] = "哥达耀",
["designer:steam__zhaoe"] = "从珂",
["steam__renchou"] = "刃仇",
[":steam__renchou"] = "你可以将任意张牌当一张伤害基数为底牌数的【决斗】使用(须至少比本回合上次发动多1张);你杀死角色的回合内,此【决斗】带有《残躯→摸一张牌》。",
["#steam__renchou"] = "刃仇:将任意张牌当害基数为底牌数的【决斗】使用",
["#steam__renchou-ex"] = "刃仇:将至少%arg张牌当害基数为底牌数的【决斗】使用",
["#steam__renchou_trigger"] = "刃仇",
["steam__yanshi"] = "言誓",
[":steam__yanshi"] = "当你进入濒死状态时,你可以令一名没有“刃仇”的角色获得发动后失去的“刃仇”,然后你回复体力至1点。",
["#steam__yanshi-choose"] = "言誓:你可令一名没有“刃仇”的角色获得发动后失去的“刃仇”,回复体力至1",
["@@steam__yanshi"] = "言誓:刃仇",
}
local steam__musk = General(extension, "steam__musk", "west", 4)
local steam__lianxi = fk.CreateTriggerSkill{
name = "steam__lianxi",
anim_type = "drawcard",
events = {fk.AfterCardsMove},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
local tos = {}
for _, move in ipairs(data) do
if move.to and move.to ~= player.id and move.toArea == Player.Hand and player.room:getPlayerById(move.to):getHandcardNum()
> player:getHandcardNum() and player.room:getPlayerById(move.to).phase ~= Player.Draw then
if table.find(move.moveInfo, function (info) return info.fromArea == Card.DrawPile end) then
table.insertIfNeed(tos, move.to)
end
end
end
if #tos > 0 then
player.room:sortPlayersByAction(tos)
self.cost_data = tos
return true
end
end
end,
on_trigger = function (self, event, target, player, data)
local room = player.room
local tos = table.simpleClone(self.cost_data)
for _, id in ipairs(tos) do
if not player:hasSkill(self) then return end
local to = room:getPlayerById(id)
if to:getHandcardNum() > player:getHandcardNum() then
self:doCost(event, to, player, data)
end
end
end,
on_cost = function (self, event, target, player, data)
self.cost_data = {tos = {target.id}}
return true
end,
on_use = function (self, event, target, player, data)
player:drawCards(1, self.name)
end,
}
steam__musk:addSkill(steam__lianxi)
local steam__xinglian = fk.CreateTriggerSkill{
name = "steam__xinglian",
events = {fk.EventPhaseStart},
frequency = Skill.Compulsory,
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
return player.phase == Player.Start and #player:getPile("steam__xinglian_pile") == 0
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:addToPile("steam__xinglian_pile", room:getNCards(4), true, self.name)
end,
}
local steam__xinglian_exchange = fk.CreateTriggerSkill{
name = "#steam__xinglian_exchange",
mute = true,
main_skill = steam__lianxi,
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(steam__lianxi) and #player:getPile("steam__xinglian_pile") > 0 and not player:isKongcheng() then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Player.Hand and move.skillName ~= "steam__xinglian" then
return true
end
end
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#steam__xinglian-invoke")
end,
on_use = function (self, event, target, player, data)
local room = player.room
local to_ex = U.askForExchange(player, "steam__xinglian_pile", "$Hand",
player:getPile("steam__xinglian_pile"), player:getCardIds("h"), "#steam__xinglian-exchange", 1)
if #to_ex == 0 then return end
local get, put
if table.contains(player:getCardIds("h"), to_ex[1]) then
put, get = to_ex[1], to_ex[2]
else
put, get = to_ex[2], to_ex[1]
end
U.swapCardsWithPile(player, {put}, {get}, "steam__xinglian", "steam__xinglian_pile", false, player.id)
if not player.dead then
local num = 0
for _, id in ipairs(player:getPile("steam__xinglian_pile")) do
num = num + Fk:getCardById(id).number
end
if num == 24 then
room:obtainCard(player, player:getPile("steam__xinglian_pile"), true, fk.ReasonJustMove, player.id, "steam__xinglian")
end
end
end,
}
steam__xinglian:addRelatedSkill(steam__xinglian_exchange)
steam__musk:addSkill(steam__xinglian)
Fk:loadTranslationTable{
["steam__musk"] = "马斯克", -- Elon Musk
["#steam__musk"] = "硅谷钢铁侠",
["illustrator:steam__musk"] = "",
["designer:steam__musk"] = "杨林",
["steam__lianxi"] = "联席",
[":steam__lianxi"] = "锁定技,其他角色于摸牌阶段外摸牌后,若你的手牌数少于其,你摸一张牌。",
["steam__xinglian"] = "星链",
[":steam__xinglian"] = "锁定技,准备阶段,若你无星链牌,你将牌堆顶的四张牌置于武将牌上。你不因此技能获得牌后,你可用一张手牌替换一张星链牌;然后若星链牌的点数之和等于24,你获得这些牌。",
["steam__xinglian_pile"] = "星链",
["#steam__xinglian_exchange"] = "星链",
["#steam__xinglian-invoke"] = "星链:你可用一张牌替换一张星链牌,若星链牌点数和为24,你获得之",
["#steam__xinglian-exchange"] = "用一张牌替换一张星链牌,若星链牌点数和为24,你获得之",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化