加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rfenghou_qin.lua 52.81 KB
一键复制 编辑 原始数据 按行查看 历史
张大北 提交于 2024-12-17 19:13 . 修改政哥哥
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307
local extension = Package("rfenghou_qin")
extension.extensionName = "aaa_fenghou"
local U = require "packages/utility/utility"
local RUtil = require "packages/aaa_fenghou/utility/rfenghou_util"
Fk:loadTranslationTable{
["rfenghou_qin"] = "还秦",
}
local yingzheng = General(extension, "rfenghou__yingzheng", "qin", 4)
local rfenghou__liuhe = fk.CreateTriggerSkill{
name = "rfenghou__liuhe",
anim_type = "drawcard",
events = {fk.TurnEnd},
frequency = Skill.Limited,
can_trigger = function (self, event, target, player, data)
return player:hasSkill(self) and player:usedSkillTimes(self.name, Player.HistoryGame) == 0
and #player.room:getBanner("@$CenterArea") > 0
end,
on_cost = function (self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "@rfenghou__liuhe", 6)
local cardsMap = {}
for _, id in ipairs(room:getBanner("@$CenterArea")) do
local suit = Fk:getCardById(id):getSuitString(true)
cardsMap[suit] = cardsMap[suit] or {}
table.insert(cardsMap[suit], id)
end
local card_data = {}
for suit, cards in pairs(cardsMap) do
table.insert(card_data, {suit, cards})
end
if #card_data == 0 then return end
if room:askForSkillInvoke(player, self.name, nil, "#rfenghou__liuhe-invoke:::"..(#card_data)) then
local result = room:askForPoxi(player, "rfenghou__liuhe_poxi", card_data, nil, false)
self.cost_data = {cards = result}
return true
end
end,
on_use = function(self, event, target, player, data)
player.room:obtainCard(player, self.cost_data.cards, true, fk.ReasonJustMove, player.id, self.name)
end,
refresh_events = {fk.CardUseFinished},
can_refresh = function (self, event, target, player, data)
return target == player and player:getMark("@rfenghou__liuhe") > 0
end,
on_refresh = function (self, event, target, player, data)
player.room:removePlayerMark(player, "@rfenghou__liuhe")
if player:getMark("@rfenghou__liuhe") == 0 then
player:setSkillUseHistory(self.name, 0, Player.HistoryGame)
end
end,
on_lose = function (self, player, is_death)
player.room:setPlayerMark(player, "@rfenghou__liuhe", 0)
end,
}
rfenghou__liuhe.CenterArea = true
yingzheng:addSkill(rfenghou__liuhe)
Fk:addPoxiMethod{
name = "rfenghou__liuhe_poxi",
prompt = function (data, extra_data)
return "#rfenghou__liuhe-card"
end,
card_filter = function (to_select, selected, data, extra_data)
if data and #selected < #data then
for _, id in ipairs(selected) do
for _, v in ipairs(data) do
if table.contains(v[2], id) and table.contains(v[2], to_select) then
return false
end
end
end
return true
end
end,
feasible = function(selected, data)
return data and #data == #selected
end,
default_choice = function(data)
if not data then return {} end
local cids = table.map(data, function(v) return v[2][1] end)
return cids
end,
}
local rfenghou__taishi = fk.CreateTriggerSkill{
name = "rfenghou__taishi$",
anim_type = "control",
events = {fk.CardUsing},
can_trigger = function (self, event, target, player, data)
if player:hasSkill(self) and player.phase == Player.NotActive and target.phase ~= Player.NotActive then
if target.kingdom == "qin" then return true end
return player.room.logic:getCurrentEvent().id == target:getMark("rfenghou__taishi-turn")
end
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(target, self.name, nil, "#rfenghou__taishi-invoke::"..player.id..":"..data.card:toLogString())
end,
on_use = function(self, event, target, player, data)
data.from = player.id
end,
refresh_events = {fk.CardUsing},
can_refresh = function (self, event, target, player, data)
return target.phase ~= Player.NotActive and target:getMark("rfenghou__taishi-turn") == 0
end,
on_refresh = function (self, event, target, player, data)
-- 注意,修改使用者会导致记录器不计此次,必须记录真实的首次使用牌事件
local useEvent = player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
local use = e.data[1]
return use.from == target.id
end, Player.HistoryTurn)[1]
if not useEvent then return end
player.room:setPlayerMark(target, "rfenghou__taishi-turn", useEvent.id)
end,
}
yingzheng:addSkill(rfenghou__taishi)
Fk:loadTranslationTable{
["rfenghou__yingzheng"] = "嬴政",
["#rfenghou__yingzheng"] = "",
["designer:rfenghou__yingzheng"] = "隐匿",
["illustrator:rfenghou__yingzheng"] = "官方",
["rfenghou__liuhe"] = "六合",
[":rfenghou__liuhe"] = "昂扬技,每回合结束时,你可以获得中央区花色不同的牌各一张。昂扬:使用六张牌。",
["#rfenghou__liuhe-invoke"] = "六合:你可以获得中央区花色不同的牌各一张(共%arg种花色)",
["@rfenghou__liuhe"] = "六合",
["#rfenghou__liuhe-card"] = "六合:选择花色不同的牌各一张",
["rfenghou__liuhe_poxi"] = "六合选牌",
["rfenghou__taishi"] = "泰始",
[":rfenghou__taishi"] = "主公技,你的回合外,当前回合角色每回合首次使用牌时,其可以将使用者改为你,若为秦势力角色,删去「每回合首次」。",
["#rfenghou__taishi-invoke"] = "泰始:你可以将使用的%arg的使用者改为%dest",
["$rfenghou__liuhe1"] = "",
["$rfenghou__liuhe2"] = "",
["$rfenghou__taishi1"] = "",
["$rfenghou__taishi2"] = "",
}
local yingziying = General(extension, "rfenghou__yingziying", "qin", 3)
local linggao = fk.CreateTriggerSkill{
name = "rfenghou__linggao",
mute = true,
events = {fk.GameStart, fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.GameStart then
return true
end
end
return target == player and player:hasSkill(self)
end,
on_cost = function (self, event, target, player, data)
if event == fk.GameStart then
return true
else
local use = player.room:askForUseCard(player, self.name, "fire_attack,lightning,iron_chain",
"#rfenghou__linggao-invoke", true, {exclusive_targets = {player.id}})
if use then
self.cost_data = use
return true
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.GameStart then
local cards = {}
for _, name in ipairs({"fire_attack", "lightning", "iron_chain"}) do
table.insertTable(cards, room:getCardsFromPileByRule(name, 1, "drawPile"))
end
if #cards > 0 then
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "drawcard")
room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
end
else
player:broadcastSkillInvoke(self.name)
room:notifySkillInvoked(player, self.name, "defensive")
room:useCard(self.cost_data)
return true
end
end,
}
local chengxia = fk.CreateViewAsSkill{
name = "rfenghou__chengxia",
anim_type = "offensive",
pattern = "slash,fire_attack,lightning", --仅留三个牌名以供回合外触发使用
prompt = function (self)
return "#rfenghou__chengxia:::"..Self:getMark(self.name)
end,
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(Self:getMark(self.name))
card.skillName = self.name
card:addSubcard(cards[1])
return card
end,
enabled_at_play = function(self, player)
return player:getMark(self.name) ~= 0 and player:getMark("rfenghou__chengxia_invoke") > 0
end,
enabled_at_response = function (self, player, response)
return not response and player:getMark(self.name) ~= 0 and player:getMark("rfenghou__chengxia_invoke") > 0 and
((Fk.currentResponsePattern == nil and player:canUse(Fk:cloneCard(player:getMark(self.name)))) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(Fk:cloneCard(player:getMark(self.name)))))
end,
}
local chengxia_trigger = fk.CreateTriggerSkill{
name = "#rfenghou__chengxia_trigger",
mute = true,
main_skill = chengxia,
events = {fk.AfterCardsMove, fk.PreCardEffect, fk.AfterCardTargetDeclared},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(chengxia) then
if event == fk.AfterCardsMove then
local cards = {}
for _, move in ipairs(data) do
if move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerJudge and
info.extra_data and info.extra_data.rfenghou__chengxia == player.id and
not table.contains(player:getCardIds("h"), info.cardId) then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
if #cards > 0 then
self.cost_data = cards
return true
end
elseif event == fk.PreCardEffect then --FIXME: 伪实现以获得转化闪电
if data.to == player.id and data.card.name == "lightning" and data.card:isVirtual() and #data.card.subcards > 0 then
self.cost_data = data.card.subcards
return true
end
end
end
if event == fk.AfterCardTargetDeclared then
return target == player and table.contains(data.card.skillNames, "rfenghou__chengxia") and
#player.room:getUseExtraTargets(data) > 0 and
table.find(player.room.alive_players, function (p)
return p:hasDelayedTrick("lightning")
end)
end
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove or event == fk.PreCardEffect then
player:broadcastSkillInvoke("rfenghou__chengxia")
room:notifySkillInvoked(player, "rfenghou__chengxia", "drawcard")
room:delay(600)
room:moveCardTo(self.cost_data, Card.PlayerHand, player, fk.ReasonPrey, "rfenghou__chengxia", nil, true, player.id)
else
local to = room:askForChoosePlayers(player, room:getUseExtraTargets(data), 1, 1,
"#rfenghou__chengxia-choose:::"..data.card:toLogString(), "rfenghou__chengxia", true)
if #to > 0 then
table.insert(data.tos, to)
end
end
end,
refresh_events = {fk.BeforeCardsMove, fk.StartPlayCard, fk.AskForCardUse, fk.Damaged, fk.EventAcquireSkill},
can_refresh = function(self, event, target, player, data)
if event == fk.BeforeCardsMove then
return player:hasSkill(chengxia, true) and player:hasDelayedTrick("lightning")
elseif event == fk.StartPlayCard or event == fk.AskForCardUse then
return target == player and player:hasSkill(chengxia)
elseif event == fk.Damaged then
return target == player and player:hasSkill(chengxia, true) and data.card
elseif event == fk.EventAcquireSkill then
return target == player and data == chengxia
end
end,
on_refresh = function(self, event, target, player, data)
if event == fk.BeforeCardsMove then
for _, move in ipairs(data) do
if move.from == player.id then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerJudge and
(Fk:getCardById(info.cardId).trueName == "lightning" or
(player:getVirualEquip(info.cardId) and player:getVirualEquip(info.cardId).trueName == "lightning")) then
--转化闪电在判定阶段移动到处理区的移动事件中card信息完全丢失
info.extra_data = info.extra_data or {}
info.extra_data.rfenghou__chengxia = player.id
end
end
end
end
elseif event == fk.StartPlayCard or event == fk.AskForCardUse then
local room = player.room
local phase_event = room.logic:getCurrentEvent():findParent(GameEvent.Phase, true)
if phase_event == nil or phase_event.data[2] ~= Player.Play then
room:setPlayerMark(player, "rfenghou__chengxia_invoke", 0)
return
end
if #room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
local use = e.data[1]
return use.from == target.id
end, Player.HistoryPhase) > 0 then
room:setPlayerMark(player, "rfenghou__chengxia_invoke", 0)
return
end
room:setPlayerMark(player, "rfenghou__chengxia_invoke", 1)
elseif event == fk.Damaged then
player.room:setPlayerMark(player, "rfenghou__chengxia", data.card.name)
elseif event == fk.EventAcquireSkill then
local room = player.room
local name = 0
room.logic:getActualDamageEvents(1, function(e)
local damage = e.data[1]
if damage.to == player and damage.card then
name = damage.card.name
return true
end
end, Player.HistoryGame, 1)
room:setPlayerMark(player, "rfenghou__chengxia", name)
end
end,
}
chengxia:addRelatedSkill(chengxia_trigger)
yingziying:addSkill(linggao)
yingziying:addSkill(chengxia)
Fk:loadTranslationTable{
["rfenghou__yingziying"] = "嬴子婴",
["#rfenghou__yingziying"] = "落暮回钟",
["designer:rfenghou__yingziying"] = "慰酒",
["illustrator:rfenghou__yingziying"] = "漂泊诗人",
["rfenghou__linggao"] = "陵高",
[":rfenghou__linggao"] = "游戏开始时,将【闪电】【火攻】【铁索连环】各一张加入手牌。当你受到伤害时,你可以对你使用上述一张同名牌,防止此伤害。",
["rfenghou__chengxia"] = "城狭",
[":rfenghou__chengxia"] = "一名角色的出牌阶段,若你此阶段未使用过牌,你可以将一张牌当上次对你造成伤害的牌使用,若场上有【闪电】,此牌可以额外"..
"指定一个目标。当【闪电】离开你的判定区后,你获得之。",
["#rfenghou__linggao-invoke"] = "陵高:你可以对自己使用一张【闪电】【火攻】或【铁索连环】,防止你受到的伤害",
["#rfenghou__chengxia"] = "城狭:你可以将一张牌当【%arg】使用",
["#rfenghou__chengxia_trigger"] = "城狭",
["#rfenghou__chengxia-choose"] = "城狭:是否为%arg额外指定一个目标?",
}
local wangmeng = General(extension, "rfenghou__wangmeng", "qin", 3)
local wucai = fk.CreateViewAsSkill{
name = "rfenghou__wucai",
pattern = ".|.|.|.|.|basic;nullification",
prompt = "#rfenghou__wucai",
interaction = function(self)
local all_names = U.getAllCardNames("b")
table.insert(all_names, "nullification")
local names = U.getViewAsCardNames(Self, self.name, all_names, Self:getCardIds("h"))
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
card:addSubcards(Self:getCardIds("h"))
return card
end,
after_use = function (self, player, use)
if not player.dead then
player.room:setPlayerMark(player, "@@rfenghou__wucai", use.card.trueName)
local types = {}
for _, id in ipairs(use.card.subcards) do
table.insertIfNeed(types, Fk:getCardById(id).type)
end
player:drawCards(#types, self.name)
end
end,
enabled_at_play = function (self, player)
return not player:isKongcheng() and player:getMark("@@rfenghou__wucai") == 0
end,
enabled_at_response = function (self, player, response)
return not response and not player:isKongcheng() and player:getMark("@@rfenghou__wucai") == 0
end,
}
local wucai_trigger = fk.CreateTriggerSkill{
name = "#rfenghou__wucai",
refresh_events = {fk.AfterCardUseDeclared},
can_refresh = function(self, event, target, player, data)
return player:getMark("@@rfenghou__wucai") == data.card.trueName
end,
on_cost = Util.TrueFunc,
on_refresh = function(self, event, target, player, data)
player.room:setPlayerMark(player, "@@rfenghou__wucai", 0)
end,
}
local youqin = fk.CreateTriggerSkill{
name = "rfenghou__youqin",
anim_type = "support",
events = {fk.EventPhaseEnd},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target.phase == Player.Discard and not target.dead and
#player.room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function(e)
for _, move in ipairs(e.data) do
if move.from == target.id and move.moveReason == fk.ReasonDiscard then
return true
end
end
end, Player.HistoryPhase) == 0
end,
on_cost = function(self, event, target, player, data)
if player.room:askForSkillInvoke(player, self.name, nil, "#rfenghou__youqin-invoke::"..target.id) then
self.cost_data = {tos = {target.id}}
return true
end
end,
on_use = function(self, event, target, player, data)
target:drawCards(1, self.name)
end,
}
wucai:addRelatedSkill(wucai_trigger)
wangmeng:addSkill(wucai)
wangmeng:addSkill(youqin)
Fk:loadTranslationTable{
["rfenghou__wangmeng"] = "王猛",
["#rfenghou__wangmeng"] = "清平执威",
["designer:rfenghou__wangmeng"] = "爱咋咋地",
["illustrator:rfenghou__wangmeng"] = "率土之滨",
["rfenghou__wucai"] = "武才",
[":rfenghou__wucai"] = "你可以将所有手牌当任意基本牌或【无懈可击】使用,然后你摸X张牌(X为用以转化的类别数),此技能失效直到有角色使用同名牌。",
["rfenghou__youqin"] = "忧勤",
[":rfenghou__youqin"] = "一名角色弃牌阶段结束时,若其未于此阶段内弃置牌,你可以令其摸一张牌。",
["#rfenghou__wucai"] = "武才:你可以将所有手牌当任意基本牌或【无懈可击】使用,然后摸其中类别数的牌",
["@@rfenghou__wucai"] = "武才失效",
["#rfenghou__youqin-invoke"] = "忧勤:是否令 %dest 摸一张牌?",
}
local fujian = General(extension, "rfenghou__fujian", "qin", 4)
local hezhi = fk.CreateViewAsSkill{
name = "rfenghou__hezhi",
mute = true,
prompt = "#rfenghou__hezhi",
interaction = function(self)
local all_names = {"hanqing__enemy_at_the_gates", "amazing_grace"}
local names = U.getViewAsCardNames(Self, self.name, all_names)
if #names > 0 then
return U.CardNameBox { choices = names, all_choices = all_names }
end
end,
card_filter = Util.FalseFunc,
view_as = function(self, cards)
if self.interaction.data == nil 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
player:broadcastSkillInvoke(self.name)
if use.card.name == "hanqing__enemy_at_the_gates" then
room:notifySkillInvoked(player, self.name, "offensive")
else
room:notifySkillInvoked(player, self.name, "support")
end
end,
after_use = function (self, player, use)
if not player.dead and not (use.extra_data and use.extra_data.rfenghou__hezhi) then
local name = "amazing_grace"
if use.card.name == "amazing_grace" then
name = "hanqing__enemy_at_the_gates"
end
local card = Fk:cloneCard(name)
card.skillName = "#rfenghou__hezhi_delay"
if player:canUse(card) then
U.askForUseVirtualCard(player.room, player, name, nil, "#rfenghou__hezhi_delay",
"#rfenghou__hezhi-use:::"..name, false)
end
end
end,
enabled_at_play = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
}
local hezhi_prohibit = fk.CreateProhibitSkill{
name = "#rfenghou__hezhi_prohibit",
is_prohibited = function(self, from, to, card)
return card and table.contains(card.skillNames, "rfenghou__hezhi") and from == to
end,
}
local hezhi_delay = fk.CreateTriggerSkill{
name = "#rfenghou__hezhi_delay",
mute = true,
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
local effect_event = player.room.logic:getCurrentEvent():findParent(GameEvent.CardEffect) --兵临城下亮出牌是对于effect
if effect_event then
local use = effect_event.data[1]
if table.contains(use.card.skillNames, "rfenghou__hezhi") and use.card.name == "hanqing__enemy_at_the_gates" and
use.from == player.id and not player.dead and use.extra_data then
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonPutIntoDiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.Processing and table.contains(use.extra_data.HQenemy_at_the_gates, info.cardId) then
return true
end
end
end
end
end
end
local use_event = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard) --五谷丰登亮出牌是对于use
if use_event then
local use = use_event.data[1]
if table.contains(use.card.skillNames, "rfenghou__hezhi") and use.card.name == "amazing_grace" and
use.from == player.id and not player.dead and use.extra_data then
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonPutIntoDiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.Processing and table.contains(use.extra_data.AGFilled, info.cardId) then
return true
end
end
end
end
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
local cards = {}
local effect_event = room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
if effect_event then
local use = effect_event.data[1]
if table.contains(use.card.skillNames, "rfenghou__hezhi") and use.card.name == "hanqing__enemy_at_the_gates" then
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonPutIntoDiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.Processing and table.contains(use.extra_data.HQenemy_at_the_gates, info.cardId) then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
end
end
local use_event = room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if use_event then
local use = use_event.data[1]
if table.contains(use.card.skillNames, "rfenghou__hezhi") and use.card.name == "amazing_grace" then
for _, move in ipairs(data) do
if move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonPutIntoDiscardPile then
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.Processing and table.contains(use.extra_data.AGFilled, info.cardId) then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
end
end
if #cards > 0 and use_event then
local use = use_event.data[1]
use.extra_data = use.extra_data or {}
use.extra_data.rfenghou__hezhi = true
end
U.moveCardsHoldingAreaCheck(room, cards)
if #cards > 0 then
player:broadcastSkillInvoke("rfenghou__hezhi")
room:notifySkillInvoked(player, "rfenghou__hezhi", "drawcard")
player:throwAllCards("h")
if not player.dead then
cards = table.filter(cards, function (id)
return table.contains(room.discard_pile, id)
end)
if #cards > 0 then
room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
end
end
end
end,
}
local yingzhi = fk.CreateTriggerSkill{
name = "rfenghou__yingzhi",
anim_type = "control",
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player:getHandcardNum() == player:getMaxCards() and
(data.card.type == Card.TypeBasic or data.card:isCommonTrick()) and data.firstTarget and
player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 then
local n = #AimGroup:getAllTargets(data.tos)
return n > 1 or #player.room:getUseExtraTargets(data, false, true) >= n
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "rfenghou__yingzhi-tmp", {AimGroup:getAllTargets(data.tos), room:getUseExtraTargets(data, false, true)})
local success, dat = room:askForUseActiveSkill(player, "rfenghou__yingzhi_active",
"#rfenghou__yingzhi-choose:::"..data.card:toLogString(), true, nil, false)
room:setPlayerMark(player, "rfenghou__yingzhi-tmp", 0)
if success and dat then
self.cost_data = dat
return true
end
end,
on_use = function(self, event, target, player, data)
local tos = self.cost_data.targets
player.room:sortPlayersByAction(tos)
data.nullifiedTargets = data.nullifiedTargets or {}
for _, id in ipairs(tos) do
if table.contains(AimGroup:getAllTargets(data.tos), id) then
table.insertIfNeed(data.nullifiedTargets, id)
else
TargetGroup:pushTargets(data.targetGroup, id)
end
end
end,
}
local yingzhi_active = fk.CreateActiveSkill{
name = "rfenghou__yingzhi_active",
card_num = 0,
min_target_num = 1,
interaction = UI.ComboBox {choices = {"rfenghou__yingzhi1", "rfenghou__yingzhi2"}},
card_filter = Util.FalseFunc,
target_filter = function (self, to_select, selected)
local n = #Self:getMark("rfenghou__yingzhi-tmp")[1]
if self.interaction.data == "rfenghou__yingzhi1" then
return #selected < n and table.contains(Self:getMark("rfenghou__yingzhi-tmp")[2], to_select)
else
return #selected < n // 2 and table.contains(Self:getMark("rfenghou__yingzhi-tmp")[1], to_select)
end
end,
feasible = function (self, selected, selected_cards)
if #selected > 0 then
local n = #Self:getMark("rfenghou__yingzhi-tmp")[1]
if self.interaction.data == "rfenghou__yingzhi1" then
return #selected == n
else
return #selected == n // 2
end
end
end,
}
local rfenghou__chezhiAGSkill = fk.CreateActiveSkill{ --AGFilled数据赋值比移牌晚了几行,只能重写AG
name = "rfenghou__chezhi_amazing_grace_skill",
prompt = "#amazing_grace_skill",
can_use = Util.GlobalCanUse,
on_use = Util.GlobalOnUse,
mod_target_filter = Util.TrueFunc,
on_action = function(self, room, use, finished)
if not finished then
local toDisplay = room:getNCards(#TargetGroup:getRealTargets(use.tos))
use.extra_data = use.extra_data or {}
use.extra_data.AGFilled = toDisplay
room:moveCards({
ids = toDisplay,
toArea = Card.Processing,
moveReason = fk.ReasonPut,
proposer = use.from,
})
toDisplay = use.extra_data.AGFilled
table.forEach(room.players, function(p)
room:fillAG(p, toDisplay)
end)
use.extra_data.AGResult = {}
else
if use.extra_data and use.extra_data.AGFilled then
table.forEach(room.players, function(p)
room:closeAG(p)
end)
local toDiscard = table.filter(use.extra_data.AGFilled, function(id)
return room:getCardArea(id) == Card.Processing
end)
if #toDiscard > 0 then
room:moveCards({
ids = toDiscard,
toArea = Card.DiscardPile,
moveReason = fk.ReasonPutIntoDiscardPile,
})
end
end
use.extra_data.AGFilled = nil
end
end,
on_effect = function(self, room, effect)
local to = room:getPlayerById(effect.to)
if not (effect.extra_data and effect.extra_data.AGFilled and #effect.extra_data.AGFilled > 0) then
return
end
local chosen = room:askForAG(to, effect.extra_data.AGFilled, false, "amazing_grace_skill")
room:takeAG(to, chosen, room.players)
table.insert(effect.extra_data.AGResult, {effect.to, chosen})
room:moveCardTo(chosen, Card.PlayerHand, effect.to, fk.ReasonPrey, "amazing_grace_skill", nil, true, effect.to)
table.removeOne(effect.extra_data.AGFilled, chosen)
end
}
Fk:addSkill(rfenghou__chezhiAGSkill)
rfenghou__chezhiAGSkill.cardSkill = true
local chezhi = fk.CreateTriggerSkill{
name = "rfenghou__chezhi$",
anim_type = "special",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and
table.find(player.room:getOtherPlayers(player), function (p)
return p.kingdom == "qin" and not p:isNude()
end) then
local effect_event = player.room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
if effect_event then
local use = effect_event.data[1]
if use.card.name == "hanqing__enemy_at_the_gates" and use.from == player.id and use.extra_data then
for _, move in ipairs(data) do
if move.toArea == Card.Processing and move.moveReason == fk.ReasonJustMove then
for _, info in ipairs(move.moveInfo) do
if table.contains(use.extra_data.HQenemy_at_the_gates, info.cardId) then
return true
end
end
end
end
end
end
local use_event = player.room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if use_event then
local use = use_event.data[1]
if use.card.trueName == "amazing_grace" and use.from == player.id and use.extra_data then
for _, move in ipairs(data) do
if move.toArea == Card.Processing and move.moveReason == fk.ReasonPut then
for _, info in ipairs(move.moveInfo) do
if table.contains(use.extra_data.AGFilled, info.cardId) then
return true
end
end
end
end
end
end
end
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
local room = player.room
local name, cards = "", {}
local to = 0
local effect_event = room.logic:getCurrentEvent():findParent(GameEvent.CardEffect)
if effect_event then
local use = effect_event.data[1]
if use.card.name == "hanqing__enemy_at_the_gates" and use.from == player.id and use.extra_data then
name = "hanqing__enemy_at_the_gates"
to = use.to
for _, move in ipairs(data) do
if move.toArea == Card.Processing and move.moveReason == fk.ReasonJustMove then
for _, info in ipairs(move.moveInfo) do
if table.contains(use.extra_data.HQenemy_at_the_gates, info.cardId) then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
end
end
local use_event = room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if use_event then
local use = use_event.data[1]
if use.card.trueName == "amazing_grace" and use.from == player.id and use.extra_data then
name = "amazing_grace"
for _, move in ipairs(data) do
if move.toArea == Card.Processing and move.moveReason == fk.ReasonPut then
for _, info in ipairs(move.moveInfo) do
if table.contains(use.extra_data.AGFilled, info.cardId) then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
end
end
for _, p in ipairs(room:getOtherPlayers(player)) do
cards = table.filter(cards, function (id)
return room:getCardArea(id) == Card.Processing
end)
if #cards == 0 then break end
if p.kingdom == "qin" and not p.dead and not p:isNude() then
local cards1, cards2 = {}, {}
for _, id in ipairs(cards) do
if Fk:getCardById(id).trueName == "slash" then
table.insert(cards2, id)
else
table.insert(cards1, id)
end
end
local choices = {}
if #cards1 > 1 and not p:isKongcheng() then
table.insert(choices, "rfenghou__chezhi1")
end
if #cards2 > 0 and #p:getCardIds("he") > 1 then
table.insert(choices, "rfenghou__chezhi2")
end
if #choices > 0 then
room:setPlayerMark(p, "rfenghou__chezhi-tmp", choices)
local prompt
if name == "hanqing__enemy_at_the_gates" then
prompt = "#rfenghou__chezhi1-invoke:"..player.id..":"..to
elseif name == "amazing_grace" then
prompt = "#rfenghou__chezhi2-invoke:"..player.id
end
local success, dat = room:askForUseActiveSkill(p, "rfenghou__chezhi_active", prompt, true)
room:setPlayerMark(p, "rfenghou__chezhi-tmp", 0)
if success and dat then
local ids
if dat.interaction == "rfenghou__chezhi1" then
ids = U.askforChooseCardsAndChoice(p, cards1, {"OK"}, self.name, "#rfenghou__chezhi1-prey", nil, 2, 2, cards)
table.removeOne(cards, ids[1])
table.removeOne(cards, ids[2])
table.insert(cards, dat.cards[1])
else
ids = U.askforChooseCardsAndChoice(p, cards2, {"OK"}, self.name, "#rfenghou__chezhi2-prey", nil, 1, 1, cards)
table.removeOne(cards, ids[1])
table.insert(cards, dat.cards[1])
table.insert(cards, dat.cards[2])
end
room:moveCards(
{
ids = dat.cards,
from = p.id,
toArea = Card.Processing,
moveReason = fk.ReasonExchange,
proposer = p.id,
skillName = self.name,
moveVisible = true,
},
{
ids = ids,
to = p.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonExchange,
proposer = p.id,
skillName = self.name,
moveVisible = true,
}
)
end
end
end
end
if name == "hanqing__enemy_at_the_gates" then
if effect_event then
local use = effect_event.data[1]
if use.card.name == "hanqing__enemy_at_the_gates" and use.from == player.id and use.extra_data then
use.extra_data.HQenemy_at_the_gates = cards
end
end
elseif name == "amazing_grace" then
if use_event then
local use = use_event.data[1]
if use.card.trueName == "amazing_grace" and use.from == player.id and use.extra_data then
use.extra_data.AGFilled = cards
end
end
end
end,
refresh_events = {fk.CardUsing}, --在使用事件牌生效前的最后一个时机改掉card.skill
can_refresh = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.card.trueName == "amazing_grace"
end,
on_refresh = function(self, event, target, player, data)
local new_card = Fk:cloneCard("amazing_grace", data.card.suit, data.card.number)
local c = table.simpleClone(data.card)
for k, v in pairs(c) do
if new_card[k] == nil then
new_card[k] = v
end
end
if data.card:isVirtual() then
new_card.subcards = data.card.subcards
else
new_card.id = data.card.id
end
new_card.skillNames = data.card.skillNames
new_card.skill = rfenghou__chezhiAGSkill
data.card = new_card
player.room.logic:getCurrentEvent().data[1].card = new_card
end,
}
local chezhi_active = fk.CreateActiveSkill{
name = "rfenghou__chezhi_active",
min_card_num = 1,
max_card_num = 2,
interaction = function ()
local all_choices = {"rfenghou__chezhi1", "rfenghou__chezhi2"}
local choices = Self:getMark("rfenghou__chezhi-tmp")
return UI.ComboBox {choices = choices, all_choices = all_choices}
end,
card_filter = function (self, to_select, selected)
if self.interaction.data == "rfenghou__chezhi1" then
return #selected == 0 and Fk:getCardById(to_select).trueName == "slash"
elseif self.interaction.data == "rfenghou__chezhi2" then
return #selected < 2
end
end,
feasible = function (self, selected, selected_cards)
if self.interaction.data == "rfenghou__chezhi1" then
return #selected_cards == 1
else
return #selected_cards == 2
end
end,
}
hezhi:addRelatedSkill(hezhi_prohibit)
hezhi:addRelatedSkill(hezhi_delay)
Fk:addSkill(yingzhi_active)
Fk:addSkill(chezhi_active)
fujian:addSkill(hezhi)
fujian:addSkill(yingzhi)
fujian:addSkill(chezhi)
Fk:loadTranslationTable{
["rfenghou__fujian"] = "苻坚",
["#rfenghou__fujian"] = "辟目垂旒",
["designer:rfenghou__fujian"] = "鱼竿",
["illustrator:rfenghou__fujian"] = "率土之滨",
["rfenghou__hezhi"] = "合志",
[":rfenghou__hezhi"] = "出牌阶段限一次,你可以视为对其他角色使用【兵临城下】或【五谷丰登】,然后若有亮出牌因此置入弃牌堆,你弃置所有手牌获得之,"..
"否则你视为使用另一种牌。",
["rfenghou__yingzhi"] = "盈制",
[":rfenghou__yingzhi"] = "每回合限一次,当你使用基本牌或普通锦囊牌指定目标后,若你的手牌数等于手牌上限,你可以为之增加一倍目标或"..
"令之对一半目标无效(向下取整)。",
["rfenghou__chezhi"] = "掣治",
[":rfenghou__chezhi"] = "主公技,当你使用【兵临城下】或【五谷丰登】亮出牌后,其他秦势力角色可以用一张【杀】替换其中的两张非【杀】牌或"..
"用两张牌替换其中的一张【杀】。",
["#rfenghou__hezhi"] = "合志:视为对其他角色使用【兵临城下】或【五谷丰登】,根据是否有亮出牌置入弃牌堆执行额外效果",
["#rfenghou__hezhi_delay"] = "合志",
["#rfenghou__hezhi-use"] = "合志:请视为使用【%arg】",
["#rfenghou__yingzhi-choose"] = "盈制:你可以为%arg增加一倍目标,或对一半目标无效",
["rfenghou__yingzhi_active"] = "盈制",
["rfenghou__yingzhi1"] = "增加一倍目标",
["rfenghou__yingzhi2"] = "对一半目标无效",
["rfenghou__chezhi_active"] = "掣治",
["#rfenghou__chezhi1-invoke"] = "掣治:%src 对 %dest 使用【兵临城下】,是否交换亮出牌?(选择你用来交换的牌)",
["#rfenghou__chezhi2-invoke"] = "掣治:%src 使用【五谷丰登】,是否交换亮出牌?(选择你用来交换的牌)",
["rfenghou__chezhi1"] = "一张【杀】替换其中两张非【杀】牌",
["rfenghou__chezhi2"] = "两张牌替换其中一张【杀】",
["#rfenghou__chezhi1-prey"] = "掣治:选择获得的两张非【杀】牌",
["#rfenghou__chezhi2-prey"] = "掣治:选择获得的一张【杀】",
}
local jiumoluoshi = General(extension, "rfenghou__jiumoluoshi", "qin", 3)
local haobian = fk.CreateTriggerSkill{
name = "rfenghou__haobian",
anim_type = "control",
frequency = Skill.Compulsory,
events = {fk.BeforeDrawCard},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self)
end,
on_use = function(self, event, target, player, data)
local room = player.room
while true do
local cards = room:getNCards(2 * data.num)
room:moveCardTo(cards, Card.Processing, nil, fk.ReasonJustMove, self.name, nil, true, player.id)
room:delay(1000)
local id = 0
for i = #cards, 1, -1 do
if Fk:getCardById(cards[i]).type == Card.TypeBasic then
id = cards[i]
break
end
end
if id == 0 then
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonJustMove)
break
end
room:moveCardTo(id, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
if player.dead then
cards = table.filter(cards, function (c)
return room:getCardArea(c) == Card.Processing
end)
if #cards > 0 then
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonJustMove)
end
break
end
local card = Fk:getCardById(id)
if card.trueName == "slash" or #table.filter(cards, function (c)
return Fk:getCardById(c).type == Card.TypeBasic
end) == 1 then
if not player:prohibitUse(card) and not player:isProhibited(player, card) and
(player:canUseTo(card, player) or card.skill.target_num) and
room:askForSkillInvoke(player, self.name, nil, "#rfenghou__haobian-use:::"..card:toLogString()) then
room:useCard{
from = player.id,
tos = {{player.id}},
card = card,
extraUse = true,
}
cards = table.filter(cards, function (c)
return room:getCardArea(c) == Card.Processing
end)
if #cards > 0 then
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonJustMove)
end
break
else
cards = table.filter(cards, function (c)
return room:getCardArea(c) == Card.Processing
end)
if #cards > 0 then
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonJustMove)
end
end
else
cards = table.filter(cards, function (c)
return room:getCardArea(c) == Card.Processing
end)
if #cards > 0 then
room:moveCardTo(cards, Card.DiscardPile, nil, fk.ReasonJustMove)
end
break
end
end
return true
end,
}
local ningcheng = fk.CreateTriggerSkill{
name = "rfenghou__ningcheng",
anim_type = "masochism",
events = {fk.Damaged},
can_trigger = function (self, event, target, player, data)
return target == player and player:hasSkill(self) and #player.room:getBanner("@$CenterArea") > 0
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local success, dat = room:askForUseActiveSkill(player, "rfenghou__ningcheng_active",
"#rfenghou__ningcheng-invoke", true, {expand_pile = room:getBanner("@$CenterArea")})
if success and dat then
self.cost_data = {tos = dat.targets, cards = dat.cards, choice = dat.interaction}
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 card = Fk:getCardById(self.cost_data.cards[1])
local yes = true
if table.find(room.alive_players, function (p)
return table.find(p:getCardIds("ej"), function (id)
return card:compareSuitWith(Fk:getCardById(id))
end)
end) then
yes = false
end
if self.cost_data.choice == "rfenghou__ningcheng_put" then
if card.type == Card.TypeEquip then
room:moveCardIntoEquip(to, card.id, self.name, false, player)
else
room:moveCardTo(card, Card.PlayerJudge, to, fk.ReasonPut, self.name, nil, true, player.id)
end
else
RUtil.premeditate(to, card, self.name, player.id)
end
if not player.dead and yes then
player:drawCards(1, self.name)
end
end,
}
local ningcheng_active = fk.CreateActiveSkill{
name = "rfenghou__ningcheng_active",
card_num = 1,
target_num = 1,
interaction = UI.ComboBox {choices = {"rfenghou__ningcheng_put", "rfenghou__ningcheng_premeditate"}},
card_filter = function (self, to_select, selected)
if #selected == 0 and table.contains(Fk:currentRoom():getBanner("@$CenterArea"), to_select) then
if self.interaction.data == "rfenghou__ningcheng_put" then
local card = Fk:getCardById(to_select)
return card.type == Card.TypeEquip or card.sub_type == Card.SubtypeDelayedTrick
elseif self.interaction.data == "rfenghou__ningcheng_premeditate" then
return true
end
end
end,
target_filter = function (self, to_select, selected, selected_cards)
if #selected == 0 and #selected_cards == 1 then
if self.interaction.data == "rfenghou__ningcheng_put" then
local card = Fk:getCardById(selected_cards[1])
local target = Fk:currentRoom():getPlayerById(to_select)
if card.type == Card.TypeEquip then
return target:hasEmptyEquipSlot(card.sub_type)
elseif card.sub_type == Card.SubtypeDelayedTrick then
return not target:hasDelayedTrick(card.name)
end
elseif self.interaction.data == "rfenghou__ningcheng_premeditate" then
return true
end
end
end,
}
Fk:addSkill(ningcheng_active)
ningcheng.CenterArea = true
jiumoluoshi:addSkill(haobian)
jiumoluoshi:addSkill(ningcheng)
Fk:loadTranslationTable{
["rfenghou__jiumoluoshi"] = "鸠摩罗什",
["#rfenghou__jiumoluoshi"] = "沙中之火",
["designer:rfenghou__jiumoluoshi"] = "三秋",
["illustrator:rfenghou__jiumoluoshi"] = "卡扑文化",
["rfenghou__haobian"] = "皓编",
[":rfenghou__haobian"] = "锁定技,当你摸牌时,改为亮出牌堆顶两倍的牌,你获得其中最后一张基本牌,若此牌为【杀】或为其中唯一的基本牌,"..
"你须选择对自己使用此牌或重复此流程。",
["rfenghou__ningcheng"] = "泞程",
[":rfenghou__ningcheng"] = "当你受到伤害后,你可以将中央区一张牌置于场上(置入装备区、判定区或蓄谋);若为场上没有的花色,你摸一张牌。",
["#rfenghou__haobian-use"] = "皓编:点“确定”对自己使用%arg,或点“取消”重复此流程",
["rfenghou__ningcheng_active"] = "泞程",
["#rfenghou__ningcheng-invoke"] = "泞程:你可以将中央区一张牌置于场上,若为场上没有的花色,你摸一张牌",
["rfenghou__ningcheng_put"] = "置于场上",
["rfenghou__ningcheng_premeditate"] = "蓄谋",
}
local yaochang = General(extension, "rfenghou__yaochang", "qin", 4)
local sichan = fk.CreateTriggerSkill{
name = "rfenghou__sichan",
anim_type = "switch",
events = {fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and
(#player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
return e.data[1].from == player.id
end, Player.HistoryTurn) > 0 or
#player.room.logic:getEventsOfScope(GameEvent.RespondCard, 1, function(e)
return e.data[1].from == player.id
end, Player.HistoryTurn) > 0) and
table.find({1, 2, 3}, function (i)
return player:getMark("@!rfenghou"..i) > 0 and not table.contains(player:getTableMark("rfenghou__sichan-round"), i)
end)
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local prompt = ""
for i = 1, 3, 1 do
if player:getMark("@!rfenghou"..i) > 0 then
prompt = "#rfenghou__sichan"..i.."-invoke"
if i < 3 and i + player:getMark("rfenghou__sichan_removed") == 3 then
prompt = prompt.."2"
end
break
end
end
local to = room:askForChoosePlayers(player, table.map(room.alive_players, Util.IdMapper), 1, 1, prompt, self.name, true)
if #to > 0 then
self.cost_data = {tos = to, choice = tonumber(prompt[18])}
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 n = self.cost_data.choice
room:addTableMark(player, "rfenghou__sichan-round", n)
to:drawCards(n, self.name)
if n + player:getMark("rfenghou__sichan_removed") == 3 then
if not to.dead then
room:askForDiscard(to, 3, 3, true, self.name, false)
end
if player.dead then return end
if player:getMark("rfenghou__sichan_removed") < 2 then
room:addPlayerMark(player, "rfenghou__sichan_removed", 1)
player:drawCards(n, self.name)
end
end
if player.dead then return end
RUtil.RfenghouSwitch(player, 3 - player:getMark("rfenghou__sichan_removed"))
end,
refresh_events = {fk.EventAcquireSkill},
can_refresh = function (self, event, target, player, data)
return target == player and data == self
end,
on_refresh = function (self, event, target, player, data)
player.room:setPlayerMark(player, "@!rfenghou1", 1)
end,
}
local xuanwei = fk.CreateViewAsSkill{
name = "rfenghou__xuanwei$",
anim_type = "control",
frequency = Skill.Limited,
pattern = "nullification",
prompt = "#rfenghou__xuanwei",
card_filter = Util.FalseFunc,
view_as = function(self, cards)
local card = Fk:cloneCard("nullification")
card.skillName = self.name
return card
end,
before_use = function (self, player, use)
local room = player.room
local skills = table.map(table.filter(player.player_skills, function(s)
return s:isPlayerSkill(player) and s.visible and table.contains({"rfenghou__sichan", "rfenghou__xuanwei"}, s.name)
end), function(s)
return s.name
end)
local choice = room:askForChoice(player, skills, self.name, "#rfenghou__xuanwei-choice", true)
room:addTableMark(player, self.name, choice)
room:handleAddLoseSkills(player, "-"..choice, nil, true, false)
end,
enabled_at_response = function (self, player, response)
return not response and (response == nil or player:getMark("rfenghou__xuanwei_activated") > 0) and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
}
local xuanwei_trigger = fk.CreateTriggerSkill{
name = "#rfenghou__xuanwei_trigger",
anim_type = "special",
events = {fk.Damaged},
can_trigger = function (self, event, target, player, data)
return target == player and not player.dead and player:getMark("rfenghou__xuanwei") ~= 0
end,
on_cost = Util.TrueFunc,
on_use = function (self, event, target, player, data)
local room = player.room
local skills = table.filter(player:getMark("rfenghou__xuanwei"), function(s)
return not player:hasSkill(s, true)
end)
room:setPlayerMark(player, "rfenghou__xuanwei", 0)
if #skills > 0 then
for _, skill in ipairs(skills) do
if skill == "rfenghou__sichan" then
room:setPlayerMark(player, "rfenghou__sichan_removed", 0)
room:setPlayerMark(player, "rfenghou__sichan-round", 0)
room:setPlayerMark(player, "@!rfenghou1", 1)
room:setPlayerMark(player, "@!rfenghou2", 0)
room:setPlayerMark(player, "@!rfenghou3", 0)
elseif skill == "rfenghou__xuanwei" then
player:setSkillUseHistory("rfenghou__xuanwei", 0, Player.HistoryGame)
end
end
room:handleAddLoseSkills(player, skills, nil, true, false)
end
end,
refresh_events = {fk.HandleAskForPlayCard},
can_refresh = function(self, event, target, player, data)
if data.afterRequest and (data.extra_data or {}).rfenghou__xuanwei then
return player:getMark("rfenghou__xuanwei_activated") > 0
end
return player:hasSkill(xuanwei) and
data.eventData and data.eventData.to and player.room:getPlayerById(data.eventData.to).kingdom == "qin" and
Exppattern:Parse(data.pattern):match(Fk:cloneCard("nullification"))
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if data.afterRequest then
room:setPlayerMark(player, "rfenghou__xuanwei_activated", 0)
else
room:setPlayerMark(player, "rfenghou__xuanwei_activated", 1)
data.extra_data = data.extra_data or {}
data.extra_data.rfenghou__xuanwei = true
end
end,
}
xuanwei:addRelatedSkill(xuanwei_trigger)
yaochang:addSkill(sichan)
yaochang:addSkill(xuanwei)
Fk:loadTranslationTable{
["rfenghou__yaochang"] = "姚苌",
["#rfenghou__yaochang"] = "腾骧建位",
["designer:rfenghou__yaochang"] = "折翼",
["illustrator:rfenghou__yaochang"] = "卡扑文化",
["cv:rfenghou__yaochang"] = "折翼",
["rfenghou__sichan"] = "斯缠",
[":rfenghou__sichan"] = "转换技,每轮每项限一次,当你使用或打出过牌的回合结束时,你可以令一名角色摸①一②二③三张牌。若此次发动为最后一项,"..
"该角色弃置三张牌,然后若转换项不唯一,你执行并移除此项。",
["rfenghou__xuanwei"] = "宣慰",
[":rfenghou__xuanwei"] = "主公技,限定技,当锦囊牌对秦势力角色生效前,你可以失去此武将牌上的一个技能,视为使用【无懈可击】;直到你下次受到伤害,"..
"恢复并复原失去的技能。",
["#rfenghou__sichan1-invoke"] = "斯缠:你可以令一名角色摸一张牌",
["#rfenghou__sichan1-invoke2"] = "斯缠:你可以令一名角色摸一张牌并弃置三张牌",
["#rfenghou__sichan2-invoke"] = "斯缠:你可以令一名角色摸两张牌",
["#rfenghou__sichan2-invoke2"] = "斯缠:你可以令一名角色摸两张牌并弃置三张牌",
["#rfenghou__sichan3-invoke"] = "斯缠:你可以令一名角色摸三张牌并弃置三张牌",
["#rfenghou__xuanwei"] = "宣慰:你可以失去一个技能直到你下次受到伤害,视为使用【无懈可击】!",
["#rfenghou__xuanwei-choice"] = "宣慰:选择失去一个技能直到你下次受到伤害",
["#rfenghou__xuanwei_trigger"] = "宣慰",
["$rfenghou__sichan1"] = "盛怒之师难破,盛怒之势可挫。",
["$rfenghou__sichan2"] = "归师勿遏,穷寇勿迫。",
["$rfenghou__sichan3"] = "急攻则败散其众,缓之则其谋得成。",
["$rfenghou__xuanwei1"] = "陛下命臣以龙骧建业,臣领命,不敢违。",
["$rfenghou__xuanwei2"] = "吾不及亡兄有四,幸算中群贤之能。",
["~rfenghou__yaochang"] = "兄襄之过,非臣之罪,陛下?陛下!",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化