加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
rfenghou_qun.lua 42.88 KB
一键复制 编辑 原始数据 按行查看 历史
张大北 提交于 2024-12-24 13:36 . 搬运石韬
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068
local extension = Package("rfenghou_qun")
extension.extensionName = "aaa_fenghou"
local U = require "packages/utility/utility"
local RUtil = require "packages/aaa_fenghou/utility/rfenghou_util"
Fk:loadTranslationTable{
["rfenghou_qun"] = "出群",
}
local function AddWinAudio(general)
local Win = fk.CreateActiveSkill{ name = general.name.."_win_audio" }
Win.package = extension
Fk:addSkill(Win)
end
local nuerhachi = General(extension, "rfenghou__nuerhachi", "qun", 4)
local chiguo = fk.CreateTriggerSkill{
name = "rfenghou__chiguo",
frequency = Skill.Compulsory,
events = {fk.CardUseFinished, fk.BuryVictim},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.CardUseFinished then
return target == player and data.card.trueName == "slash"
elseif event == fk.BuryVictim then
return data.damage and data.damage.from and data.damage.from == player and not player.room:getTag(self.name)
end
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.CardUseFinished then
room:addPlayerMark(player, self.name, 1)
elseif event == fk.BuryVictim then
room:setTag("SkipNormalDeathProcess", true)
room:setTag(self.name, true)
player:setCardUseHistory("slash", 0, Player.HistoryGame)
room:setPlayerMark(player, "@rfenghou__chiguo", 3)
end
end,
refresh_events = {fk.GameStart, fk.EventAcquireSkill, fk.AfterCardUseDeclared, fk.DrawNCards, fk.Deathed},
can_refresh = function (self, event, target, player, data)
if event == fk.GameStart then
return player:hasSkill(self, true)
elseif event == fk.EventAcquireSkill then
return target == player and data == self
elseif event == fk.AfterCardUseDeclared then
return target == player and player:hasSkill(self, true) --本身只是提示作用,就不限牌名了
elseif event == fk.DrawNCards then
return target == player and player:getMark(self.name) ~= 0
elseif event == fk.Deathed then
return player.room:getTag(self.name)
end
end,
on_refresh = function (self, event, target, player, data)
local room = player.room
if event == fk.GameStart then
room:setPlayerMark(player, "@rfenghou__chiguo", 3)
elseif event == fk.EventAcquireSkill or event == fk.AfterCardUseDeclared then
local n = 3 - player:usedCardTimes("slash", Player.HistoryGame)
if n >= 0 then
room:setPlayerMark(player, "@rfenghou__chiguo", n)
else
room:setPlayerMark(player, "@rfenghou__chiguo", 0)
end
elseif event == fk.DrawNCards then
data.n = data.n + player:getMark(self.name)
elseif event == fk.Deathed then
room:setTag("SkipNormalDeathProcess", false)
room:setTag(self.name, false)
end
end,
}
local chiguo_prohibit = fk.CreateProhibitSkill{
name = "#rfenghou__chiguo_prohibit",
prohibit_use = function(self, player, card)
return player:hasSkill(chiguo) and card and card.trueName == "slash" and player:usedCardTimes("slash", Player.HistoryGame) > 2
end
}
local jiezhu_active = fk.CreateActiveSkill{
name = "rfenghou__jiezhu_active",
card_num = 1,
min_target_num = 0,
max_target_num = 1,
interaction = function()
return UI.ComboBox {choices = {"rfenghou__jiezhu1", "rfenghou__jiezhu2"}}
end,
card_filter = function(self, to_select, selected)
if #selected == 0 and not Self:prohibitDiscard(to_select) then
if self.interaction.data == "rfenghou__jiezhu1" then
return Fk:getCardById(to_select).sub_type == Card.SubtypeOffensiveRide
else
return Fk:getCardById(to_select).sub_type == Card.SubtypeWeapon
end
end
end,
target_filter = function (self, to_select, selected)
if self.interaction.data == "rfenghou__jiezhu1" then
return false
else
return #selected == 0 and to_select ~= Self.id
end
end,
feasible = function (self, selected, selected_cards)
if #selected_cards == 1 then
if self.interaction.data == "rfenghou__jiezhu1" then
return #selected == 0
else
return #selected == 1
end
end
end,
}
local jiezhu = fk.CreateTriggerSkill{
name = "rfenghou__jiezhu",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Finish and not player:isNude()
end,
on_cost = function (self, event, target, player, data)
local success, dat = player.room:askForUseActiveSkill(player, "rfenghou__jiezhu_active",
"#rfenghou__jiezhu-choice", true, nil, false)
if success and dat then
self.cost_data = {cards = dat.cards, tos = dat.targets, choice = dat.interaction}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:throwCard(self.cost_data.cards, self.name, player, player)
if self.cost_data.choice == "rfenghou__jiezhu1" then
if player.dead then return end
player:gainAnExtraTurn(true, self.name)
else
local to = room:getPlayerById(self.cost_data.tos[1])
if not to.dead then
to:turnOver()
end
end
end
}
Fk:addSkill(jiezhu_active)
chiguo:addRelatedSkill(chiguo_prohibit)
nuerhachi:addSkill(chiguo)
nuerhachi:addSkill(jiezhu)
Fk:loadTranslationTable{
["rfenghou__nuerhachi"] = "努尔哈赤",
["#rfenghou__nuerhachi"] = "罪日拓咎",
["designer:rfenghou__nuerhachi"] = "猪",
["rfenghou__chiguo"] = "笞国",
[":rfenghou__chiguo"] = "锁定技,每局游戏你至多使用三张【杀】;当你使用【杀】结算后,你摸牌阶段摸牌数+1;你执行的击杀奖惩改为重置使用"..
"【杀】次数。",
["rfenghou__jiezhu"] = "皆逐",
[":rfenghou__jiezhu"] = "结束阶段,你可以选择一项:1.弃置一张进攻坐骑牌,获得一个额外回合;2.弃置一张武器牌,令一名其他角色翻面。",
["@rfenghou__chiguo"] = "笞国",
["#rfenghou__jiezhu-choice"] = "皆逐:你可以弃置一张牌,执行对应效果",
["rfenghou__jiezhu_active"] = "皆逐",
["rfenghou__jiezhu1"] = "弃置进攻坐骑,获得额外回合",
["rfenghou__jiezhu2"] = "弃置武器牌,令一名角色翻面",
}
local huangtaiji = General(extension, "rfenghou__huangtaiji", "qun", 4)
local gulve = fk.CreateActiveSkill{
name = "rfenghou__gulve",
prompt = "#rfenghou__gulve",
card_num = function ()
if Self:getHandcardNum() > 3 then
return Self:getHandcardNum() - 3
else
return 0
end
end,
target_num = 0,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and player:getHandcardNum() ~= 3
end,
card_filter = function(self, to_select, selected)
if Self:getHandcardNum() > 3 then
return #selected < Self:getHandcardNum() - 3 and table.contains(Self:getCardIds("h"), to_select) and
not Self:prohibitDiscard(to_select)
else
return false
end
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
if #effect.cards == 0 then
player:drawCards(3 - player:getHandcardNum(), self.name)
else
room:throwCard(effect.cards, self.name, player, player)
if player.dead or player:isKongcheng() or #room.discard_pile == 0 then return end
local cards = room:askForPoxi(player, "rfenghou__gulve_exchange", {
{ "pile_discard", room.discard_pile },
{ player.general, player:getCardIds("h") },
}, {num = #effect.cards}, true)
if #cards == 0 then return end
local cards1 = table.filter(cards, function (id)
return table.contains(player:getCardIds("h"), id)
end)
local cards2 = table.filter(cards, function (id)
return table.contains(room.discard_pile, id)
end)
U.swapCardsWithPile(player, cards1, cards2, self.name, "discardPile", true, player.id)
end
end
}
Fk:addPoxiMethod{
name = "rfenghou__gulve_exchange",
prompt = function (data, extra_data)
return "#rfenghou__gulve_exchange:::"..math.floor(extra_data.num)
end,
card_filter = function(to_select, selected, data, extra_data)
return #selected < 2 * extra_data.num
end,
feasible = function(selected, data, extra_data)
if #selected > 0 and #selected % 2 == 0 then
local dat1, dat2 = {0, 0, 0}, {0, 0, 0}
for _, id in ipairs(selected) do
local card = Fk:getCardById(id)
if table.contains(data[1][2], id) then
dat1[card.type] = dat1[card.type] + 1
else
dat2[card.type] = dat2[card.type] + 1
end
end
return table.every({1, 2, 3}, function (index)
return dat1[index] == dat2[index]
end)
end
end,
}
local lanqi = fk.CreateTriggerSkill{
name = "rfenghou__lanqi",
events = {fk.BeforeDrawCard},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and
table.find(player.room.alive_players, function (p)
if not table.contains(player:getTableMark(self.name), p.id) then
if p == player then
return #player:getCardIds("ej") >= data.num
else
return #p:getCardIds("hej") >= data.num
end
end
end)
end,
on_cost = function (self, event, target, player, data)
local room = player.room
local targets = table.filter(room.alive_players, function (p)
if not table.contains(player:getTableMark(self.name), p.id) then
if p == player then
return #player:getCardIds("ej") >= data.num
else
return #p:getCardIds("hej") >= data.num
end
end
end)
local to = room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1,
"#rfenghou__lanqi-choose:::"..data.num, self.name, true, false)
if #to > 0 then
self.cost_data = {tos = to}
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 flag = "hej"
if to == player then
flag = "ej"
end
local cards = room:askForCardsChosen(player, to, data.num, data.num, "hej", flag, "#rfenghou__lanqi-prey::"..to.id..":"..data.num)
room:moveCardTo(cards, Card.PlayerHand, player, fk.ReasonPrey, self.name, nil, false, player.id)
if player.dead or to.dead then return end
if room:askForSkillInvoke(to, self.name, nil, "#rfenghou__lanqi-invoke:"..player.id.."::"..#cards) then
to:drawCards(#cards, self.name)
else
room:addTableMark(player, self.name, to.id)
end
return true
end
}
huangtaiji:addSkill(gulve)
huangtaiji:addSkill(lanqi)
Fk:loadTranslationTable{
["rfenghou__huangtaiji"] = "皇太极",
["#rfenghou__huangtaiji"] = "莽天腾苍",
["designer:rfenghou__huangtaiji"] = "zzcclll朱苦力",
["illustrator:rfenghou__huangtaiji"] = "珊瑚虫",
["rfenghou__gulve"] = "固略",
[":rfenghou__gulve"] = "出牌阶段限一次,你可以将手牌调整至三张,每因此弃置一张牌,你便可用一张手牌替换弃牌堆中一张相同类别的牌。",
["rfenghou__lanqi"] = "揽气",
[":rfenghou__lanqi"] = "每名角色限一次,当你摸牌时,你可以改为获得一名角色区域内等量张牌,然后其可以摸等量牌令此技能视为未对其发动过。",
["#rfenghou__gulve"] = "固略:将手牌调整至三张,每弃置一张牌便可以用一张手牌交换弃牌堆中的同类别牌",
["rfenghou__gulve_exchange"] = "固略",
["#rfenghou__gulve_exchange"] = "固略:用手牌与弃牌堆同类别交换,至多%arg张",
["#rfenghou__lanqi-choose"] = "揽气:你即将摸%arg张牌,是否改为获得一名角色区域内等量的牌?",
["#rfenghou__lanqi-prey"] = "揽气:获得 %dest 区域内%arg张牌",
["#rfenghou__lanqi-invoke"] = "揽气:你可以摸%arg张牌,或点“取消”令 %src 不能再对你发动“揽气”",
}
local xiaofeng = General(extension, "rfenghou__xiaofeng", "qun", 4)
local feichou = fk.CreateActiveSkill{
name = "rfenghou__feichou",
anim_type = "offensive",
prompt = function (self)
if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
return "#rfenghou__feichou-fire_attack"
else
return "#rfenghou__feichou-peach"
end
end,
can_use = function(self, player)
if player:usedSkillTimes(self.name, player.HistoryPhase) == 0 then
return table.find(Fk:currentRoom().alive_players, function (p)
return player:canUseTo(Fk:cloneCard("fire_attack"), p)
end)
else
return player:getMark("@rfenghou__feichou-phase") ~= 0
end
end,
card_num = function ()
if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
return 0
else
return 1
end
end,
target_num = function ()
if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
return 0
else
return 1
end
end,
card_filter = function(self, to_select, selected)
if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
return false
else
return #selected == 0 and
table.contains(Self:getTableMark("@rfenghou__feichou-phase"), Fk:getCardById(to_select):getColorString())
end
end,
target_filter = function(self, to_select, selected, selected_cards)
if Self:usedSkillTimes("rfenghou__feichou", Player.HistoryPhase) == 0 then
return false
else
local target = Fk:currentRoom():getPlayerById(to_select)
if #selected == 0 and target:isWounded() and #selected_cards == 1 then
local card = Fk:cloneCard("peach")
card:addSubcard(selected_cards[1])
card.skillName = self.name
return not Self:isProhibited(target, card)
end
end
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
if #effect.cards == 0 then
local targets = table.filter(room:getAlivePlayers(), function (p)
return player:canUseTo(Fk:cloneCard("fire_attack"), p)
end)
room:useVirtualCard("fire_attack", nil, player, targets, self.name)
else
room:useVirtualCard("peach", effect.cards, player, room:getPlayerById(effect.tos[1]), self.name)
end
end
}
local feichou__fireAttackSkill = fk.CreateActiveSkill{
name = "feichou__fire_attack_skill",
prompt = "#fire_attack_skill",
target_num = 1,
mod_target_filter = function(self, to_select, selected, user, card, distance_limited)
return not Fk:currentRoom():getPlayerById(to_select):isKongcheng()
end,
target_filter = function(self, to_select, selected, selected_cards, card)
if #selected < self:getMaxTargetNum(Self, card) then
return self:modTargetFilter(to_select, selected, Self.id, card)
end
end,
on_effect = function(self, room, cardEffectEvent)
local from = room:getPlayerById(cardEffectEvent.from)
local to = room:getPlayerById(cardEffectEvent.to)
if to:isKongcheng() then return end
local showCard = room:askForCard(to, 1, 1, false, "fire_attack_skill", false, ".|.|.|hand", "#fire_attack-show:" .. from.id)[1]
to:showCards(showCard)
if from.dead then return end
local cancelable = true
if #room.logic:getEventsOfScope(GameEvent.Death, 1, function (e)
local deathData = e.data[1]
return deathData.damage and deathData.damage.from == to
end, Player.HistoryGame) > 0 then
cancelable = false
end
showCard = Fk:getCardById(showCard)
local prompt = "#fire_attack-discard:"..to.id.."::"..showCard:getSuitString(true)
if not cancelable then
prompt = "#rfenghou__feichou-discard:"..to.id.."::"..showCard:getSuitString(true)
end
local cards = room:askForDiscard(from, 1, 1, false, "fire_attack_skill", true, ".|.|"..showCard:getSuitString(), prompt)
if not cancelable and #cards == 0 then
local card = table.filter(from:getCardIds("h"), function (id)
return Fk:getCardById(id).suit == showCard.suit and not from:prohibitDiscard(id)
end)
if #card > 0 then
cards = table.random(card, 1)
room:throwCard(cards, "fire_attack_skill", from, from)
end
end
if #cards > 0 then
if not from.dead then
room:addTableMark(from, "@rfenghou__feichou-phase", showCard:getColorString())
end
room:damage({
from = from,
to = to,
card = cardEffectEvent.card,
damage = 1,
damageType = fk.FireDamage,
skillName = "fire_attack_skill",
})
end
end,
}
feichou__fireAttackSkill.cardSkill = true
Fk:addSkill(feichou__fireAttackSkill)
local feichou_trigger = fk.CreateTriggerSkill{
name = "#rfenghou__feichou_trigger",
events = {fk.PreCardEffect},
mute = true,
can_trigger = function(self, event, target, player, data)
return data.from == player.id and data.card.trueName == "fire_attack" and table.contains(data.card.skillNames, "rfenghou__feichou")
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local card = data.card:clone()
local c = table.simpleClone(data.card)
for k, v in pairs(c) do
card[k] = v
end
card.skill = feichou__fireAttackSkill
data.card = card
end,
}
feichou:addRelatedSkill(feichou_trigger)
xiaofeng:addSkill(feichou)
Fk:loadTranslationTable{
["rfenghou__xiaofeng"] = "萧峰",
["designer:rfenghou__xiaofeng"] = "拼音",
["#rfenghou__xiaofeng"] = "龙心负矢",
["rfenghou__feichou"] = "沸仇",
[":rfenghou__feichou"] = "出牌阶段限一次,你可以视为对所有角色使用【火攻】。若目标杀死过角色,你响应此【火攻】弃置牌时若能弃置则必须弃置。"..
"你以此法弃牌后,本回合可以将相同颜色的牌当【桃】对任意角色使用。",
["#rfenghou__feichou-fire_attack"] = "沸仇:你可以视为对所有角色使用一张【火攻】!",
["#rfenghou__feichou-peach"] = "沸仇:你可以将一张对应颜色的牌当【桃】对任意角色使用",
["@rfenghou__feichou-phase"] = "沸仇",
["#rfenghou__feichou-discard"] = "%src 杀死过角色,你必须弃置一张%arg手牌对其造成1点火焰伤害!(点“取消”随机弃置一张此花色手牌)",
}
local duanyu = General(extension, "rfenghou__duanyu", "qun", 3)
local fangshi = fk.CreateTriggerSkill{
name = "rfenghou__fangshi",
anim_type = "drawcard",
events = {fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and not player:isKongcheng() and
((target == player and player:getMark("rfenghou__fangshi1-round") == 0) or
(target ~= player and player:getMark("rfenghou__fangshi2-round") == 0)) then
local room = player.room
local id = -1
room.logic:getEventsByRule(GameEvent.MoveCards, 1, function (e)
for i = #e.data, 1, -1 do
local move = e.data[i]
if move.toArea == Card.DiscardPile then
if move.from == player.id then
for j = #move.moveInfo, 1, -1 do
local info = move.moveInfo[j]
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
id = info.cardId
return true
end
end
elseif move.from == nil and
table.contains({fk.ReasonUse, fk.ReasonResonpse, fk.ReasonPutIntoDiscardPile}, move.moveReason) then
local parent_event = e.parent
if parent_event ~= nil then
local card_ids = {}
if parent_event.event == GameEvent.UseCard or parent_event.event == GameEvent.RespondCard then
if parent_event.data[1].from == player.id then
parent_event:searchEvents(GameEvent.MoveCards, 1, function(e2)
if e2.parent and e2.parent.id == parent_event.id then
for _, move2 in ipairs(e2.data) do
if (move2.moveReason == fk.ReasonUse or move2.moveReason == fk.ReasonResonpse) then
for _, info in ipairs(move2.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
table.insertIfNeed(card_ids, info.cardId)
end
end
end
end
if #card_ids > 0 then
return true
end
end
end)
end
elseif parent_event.event == GameEvent.Pindian then
local pindian = parent_event.data[1]
if pindian.from == player then
card_ids = room:getSubcardsByRule(pindian.fromCard)
elseif pindian.results[player.id] then
card_ids = room:getSubcardsByRule(pindian.results[player.id].toCard)
end
end
if #card_ids > 0 then
for j = #move.moveInfo, 1, -1 do
local info = move.moveInfo[j]
if table.contains(card_ids, info.cardId) and info.fromArea == Card.Processing then
id = info.cardId
return true
end
end
end
end
end
end
end
end, room.logic:getCurrentEvent().id)
if id ~= -1 and table.contains(room.discard_pile, id) then
self.cost_data = id
return true
end
end
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil,
"#rfenghou__fangshi-invoke:::"..Fk:getCardById(self.cost_data):toLogString())
end,
on_use = function(self, event, target, player, data)
local room = player.room
if target == player then
room:setPlayerMark(player, "rfenghou__fangshi1-round", 1)
else
room:setPlayerMark(player, "rfenghou__fangshi2-round", 1)
end
U.swapCardsWithPile(player, player:getCardIds("h"), {self.cost_data}, self.name, "discardPile", true, player.id)
if player.dead or #room.discard_pile == 0 then return end
room:delay(800)
local all_cards = {}
room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function (e)
for _, move in ipairs(e.data) do
if move.toArea == Card.DiscardPile then
for _, info in ipairs(move.moveInfo) do
table.insert(all_cards, info.cardId)
end
end
end
end, Player.HistoryTurn)
local cards = {}
for i = #all_cards, 1, -1 do
table.insertIfNeed(cards, all_cards[i])
end
if #all_cards < 2 then return end
local card = {}
local index = table.indexOf(cards, self.cost_data)
if index == -1 then return end
local cards1 = table.slice(cards, 1, index)
cards1 = table.filter(cards1, function (id)
return table.contains(room.discard_pile, id) and id ~= self.cost_data
end)
if #cards1 > 0 then
card = U.askforChooseCardsAndChoice(player, cards1, {"OK"}, self.name, "#rfenghou__fangshi-prey")
room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
end
local cards2 = table.slice(cards, index, #cards)
cards2 = table.filter(cards2, function (id)
return table.contains(room.discard_pile, id) and id ~= self.cost_data
end)
if #cards2 > 0 then
card = U.askforChooseCardsAndChoice(player, cards2, {"OK"}, self.name, "#rfenghou__fangshi-prey")
room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonJustMove, self.name, nil, true, player.id)
end
end,
}
local zaiyu = fk.CreateTriggerSkill{
name = "rfenghou__zaiyu",
anim_type = "control",
frequency = Skill.Limited,
events = {fk.CardUsing},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.tos and not data.card.is_damage_card and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
on_cost = function (self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#rfenghou__zaiyu-invoke:::"..data.card:toLogString())
end,
on_use = function(self, event, target, player, data)
data.additionalEffect = (data.additionalEffect or 0) + 2
player.room:setPlayerMark(player, "@rfenghou__zaiyu",
table.concat({Fk:translate(data.card:getSuitString(true)), data.card:getNumberStr(), " ", Fk:translate(data.card.name)}))
player.room:setPlayerMark(player, "rfenghou__zaiyu", {data.card.color, data.card.number, data.card.type, data.card.trueName})
end,
}
local zaiyu_delay = fk.CreateTriggerSkill{
name = "#rfenghou__zaiyu_delay",
anim_type = "drawcard",
events = {fk.AfterCardsMove},
can_trigger = function(self, event, target, player, data)
if player:getMark("rfenghou__zaiyu") ~= 0 and player:usedSkillTimes(self.name, Player.HistoryRound) == 0 then
local cards = {}
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Card.PlayerHand then
for _, info in ipairs(move.moveInfo) do
if table.contains(player:getCardIds("h"), info.cardId) then
local card = Fk:getCardById(info.cardId)
if card.color == player:getMark("rfenghou__zaiyu")[1] or
card.number == player:getMark("rfenghou__zaiyu")[2] or
card.type == player:getMark("rfenghou__zaiyu")[3] then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
end
if #cards > 0 then
self.cost_data = cards
return true
end
end
end,
on_cost = function(self, event, target, player, data)
local card = player.room:askForCard(player, 1, 1, false, "rfenghou__zaiyu", true, tostring(Exppattern{ id = self.cost_data }),
"#rfenghou__zaiyu_delay-invoke")
if #card > 0 then
self.cost_data = {cards = card}
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke("rfenghou__zaiyu")
local card = Fk:getCardById(self.cost_data.cards[1])
local n = 0
if card.color == player:getMark("rfenghou__zaiyu")[1] then
n = n + 1
end
if card.number == player:getMark("rfenghou__zaiyu")[2] then
n = n + 1
end
if card.type == player:getMark("rfenghou__zaiyu")[3] then
n = n + 1
end
player:showCards(self.cost_data.cards)
if player.dead then return end
player:drawCards(n, "rfenghou__zaiyu")
if n == 3 and card.trueName ~= player:getMark("rfenghou__zaiyu")[4] then
room:setPlayerMark(player, "@rfenghou__zaiyu", 0)
room:setPlayerMark(player, "rfenghou__zaiyu", 0)
if player:isWounded() then
room:recover({
who = player,
num = player.maxHp - player.hp,
skillName = "rfenghou__zaiyu",
})
end
room:handleAddLoseSkills(player, "-rfenghou__zaiyu")
end
end,
}
zaiyu:addRelatedSkill(zaiyu_delay)
duanyu:addSkill(fangshi)
duanyu:addSkill(zaiyu)
AddWinAudio(duanyu)
Fk:loadTranslationTable{
["rfenghou__duanyu"] = "段誉",
["#rfenghou__duanyu"] = "终定猿心",
["illustrator:rfenghou__duanyu"] = "珊瑚虫",
["designer:rfenghou__duanyu"] = "拼音",
["cv:rfenghou__duanyu"] = "胖即是胖",
["rfenghou__fangshi"] = "芳识",
[":rfenghou__fangshi"] = "每轮你的回合内外各限一次,一名角色回合结束时,你可以用所有手牌交换你此回合最后进入弃牌堆的牌,然后获得此回合在"..
"之前与之后进入弃牌堆的牌各一张。",
["rfenghou__zaiyu"] = "再遇",
[":rfenghou__zaiyu"] = "限定技,当你使用非伤害牌时,你可以令此牌结算三次。每轮限一次,当你获得颜色/类别/点数与之相同的牌后,"..
"你可展示之并摸满足项数张牌,若为三项但牌名不同,你回复所有体力并失去此技能。",
["#rfenghou__fangshi-invoke"] = "芳识:是否用所有手牌交换%arg?",
["#rfenghou__fangshi-prey"] = "芳识:获得其中一张牌",
["#rfenghou__zaiyu-invoke"] = "再遇:是否令%arg结算三次?",
["@rfenghou__zaiyu"] = "再遇",
["#rfenghou__zaiyu_delay"] = "再遇",
["#rfenghou__zaiyu_delay-invoke"] = "再遇:你可以展示其中一张与“再遇”有相同信息的牌并摸牌",
["$rfenghou__fangshi1"] = "庄子这话,拿来形容神仙姐姐,再也贴切不过……",
["$rfenghou__fangshi2"] = "倘得长卧小舟,以此女为伴,此生更无他求。",
["$rfenghou__zaiyu1"] = "姑娘如此待我,休说西夏公主,便是宋辽吐蕃公主一起,却又如何?",
["$rfenghou__zaiyu2"] = "我能见姑娘言笑晏晏,心下欢喜,便是极大的好处。",
["~rfenghou__duanyu"] = "葬身这湖畔花下,倒也风雅的紧。",
["$rfenghou__duanyu_win_audio"] = "向来痴,从此醉,有情皆孽,何人无恨?",
}
--FY011 袁谭袁尚袁熙 by熊猫
local yuantanyuanshangyuanxi = General(extension, "rfenghou__yuantanyuanshangyuanxi", "qun", 4)
local cuoyi = fk.CreateTriggerSkill{
name = "rfenghou__cuoyi",
anim_type = "switch",
frequency = Skill.Compulsory,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase > 2 and player.phase < 7
end,
on_use = function(self, event, target, player, data)
local room = player.room
if player:getMark("@!rfenghou1") > 0 then
if #player:getCardIds("he") > 2 and table.find(room:getOtherPlayers(player), function (p)
return player:canUseTo(Fk:cloneCard("slash"), p, {bypass_times = true})
end) then
if player:getMark("@rfenghou__zhengjiong") > 0 and
#table.filter(player:getCardIds("h"), function (id) --耦
return Fk:getCardById(id):getMark("@@rfenghou__zhengjiong-inhand-turn") > 0
end) < 3 then return end
local success, dat = room:askForUseActiveSkill(player, "rfenghou__cuoyi_viewas",
"#rfenghou__cuoyi-slash", false, {bypass_times = true})
if success then
RUtil.RfenghouSwitch(player, 3)
local card = Fk:cloneCard("slash")
card.skillName = self.name
card:addSubcards(dat.cards)
room:useCard{
from = player.id,
tos = table.map(dat.targets, function(id) return {id} end),
card = card,
extraUse = true,
}
end
end
return
elseif player:getMark("@!rfenghou2") > 0 then
player:drawCards(3, self.name)
RUtil.RfenghouSwitch(player, 3)
return
elseif player:getMark("@!rfenghou3") > 0 and player.phase == Player.Play then
room:addPlayerMark(player, MarkEnum.SlashResidue.."-phase", 3)
RUtil.RfenghouSwitch(player, 3)
return
end
end,
on_acquire = function (self, player, is_start)
player.room:setPlayerMark(player, "@!rfenghou1", 1)
end,
on_lose = function (self, player, is_death)
for i = 1, 3, 1 do
player.room:setPlayerMark(player, "@!rfenghou"..i, 0)
end
end,
}
local rfenghou__cuoyi_viewas = fk.CreateViewAsSkill{
name = "rfenghou__cuoyi_viewas",
card_filter = function(self, to_select, selected)
if #selected < 3 then
if Self:getMark("@rfenghou__zhengjiong") == 0 then
return true
else
return Fk:getCardById(to_select):getMark("@@rfenghou__zhengjiong-inhand-turn") > 0
end
end
end,
view_as = function(self, cards)
if #cards ~= 3 then return end
local card = Fk:cloneCard("slash")
card:addSubcards(cards)
card.skillName = "rfenghou__cuoyi"
return card
end,
}
local zhengjiong = fk.CreateTriggerSkill{
name = "rfenghou__zhengjiong",
anim_type = "offensive",
events = {fk.BeforeTurnStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player:getMark("@@rfenghou_readying:::"..self.name) == 0 and
data.reason == "game_rule"
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, nil, "#rfenghou__zhengjiong-invoke")
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "@rfenghou__zhengjiong", 3)
room:sendLog{
type = "#GainAnExtraTurn",
from = player.id
}
player.tag["_extra_turn_count"] = player.tag["_extra_turn_count"] or {}
local ex_tag = player.tag["_extra_turn_count"]
table.insert(ex_tag, self.name)
end,
refresh_events = {fk.AfterCardsMove, fk.AfterTurnEnd},
can_refresh = function(self, event, target, player, data)
if player:getMark("@rfenghou__zhengjiong") > 0 then
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Card.PlayerHand then
for _, info in ipairs(move.moveInfo) do
if table.contains(player:getCardIds("h"), info.cardId) then
return true
end
end
end
end
elseif event == fk.AfterTurnEnd then
return true
end
end
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
if event == fk.AfterCardsMove then
for _, move in ipairs(data) do
if move.to == player.id and move.toArea == Card.PlayerHand then
for _, info in ipairs(move.moveInfo) do
if table.contains(player:getCardIds("h"), info.cardId) then
room:setCardMark(Fk:getCardById(info.cardId), "@@rfenghou__zhengjiong-inhand-turn", 1)
end
end
end
end
elseif event == fk.AfterTurnEnd then
room:removePlayerMark(player, "@rfenghou__zhengjiong", 1)
if player:getMark("@rfenghou__zhengjiong") > 0 then
player:gainAnExtraTurn(true, self.name)
if player:getMark("@rfenghou__zhengjiong") == 2 then
table.remove(player.tag["_extra_turn_count"])
end
end
end
end,
}
local zhengjiong_prohibit = fk.CreateProhibitSkill{
name = "#rfenghou__zhengjiong",
prohibit_use = function(self, from, card)
if from:getMark("@rfenghou__zhengjiong") > 0 and card then
if card:isVirtual() then
if #card.subcards == 0 then
return false
else
return table.find(card.subcards, function (id)
return Fk:getCardById(id):getMark("@@rfenghou__zhengjiong-inhand-turn") == 0
end)
end
else
return card:getMark("@@rfenghou__zhengjiong-inhand-turn") == 0
end
end
end,
}
zhengjiong.RfenghouReadySkill = true
Fk:addSkill(rfenghou__cuoyi_viewas)
zhengjiong:addRelatedSkill(zhengjiong_prohibit)
yuantanyuanshangyuanxi:addSkill(cuoyi)
yuantanyuanshangyuanxi:addSkill(zhengjiong)
Fk:loadTranslationTable{
["rfenghou__yuantanyuanshangyuanxi"] = "袁谭袁尚袁熙",
["#rfenghou__yuantanyuanshangyuanxi"] = "虺蛇自噬",
["illustrator:rfenghou__yuantanyuanshangyuanxi"] = "食茸",
["designer:rfenghou__yuantanyuanshangyuanxi"] = "熊猫",
["rfenghou__cuoyi"] = "厝异",
[":rfenghou__cuoyi"] = "转换技,锁定技,你除准备阶段和结束阶段以外的阶段开始时:①你需将三张牌当【杀】使用;②摸三张牌;"..
"③若为出牌阶段,你此阶段使用【杀】次数上限+3。",
["rfenghou__zhengjiong"] = "争迥",
[":rfenghou__zhengjiong"] = "蓄势技,你的额定回合开始前,你可以改为执行三个额外回合,但这些回合中你只能使用本回合获得的牌。",
["rfenghou__cuoyi_viewas"] = "厝异",
["#rfenghou__cuoyi-slash"] = "厝异:你需将三张牌当【杀】使用",
["#rfenghou__zhengjiong-invoke"] = "争迥:是否改为执行三个额外回合?",
["@rfenghou__zhengjiong"] = "争迥",
["@@rfenghou__zhengjiong-inhand-turn"] = "争迥",
["#rfenghou__zhengjiong"] = "争迥",
["@@rfenghou_readying:::rfenghou__zhengjiong"] = "争迥失效",
["$rfenghou__cuoyi1"]="同室操戈,胜者王、败者寇。",
["$rfenghou__cuoyi2"]="兄弟无能,吾当继袁氏大统。",
["$rfenghou__zhengjiong1"] = "今日吾掌中之剑,必要饮兄弟之血!",
["$rfenghou__zhengjiong2"] = "外有强敌环伺,汝二人不欲助我、奈何助贼!",
["~rfenghou__yuantanyuanshangyuanxi"] = "冀州宝地,宁予外寇,不予家贼!",
}
local shitao = General(extension, "rfenghou__shitao", "qun", 4)
--- 获取被废除的装备栏
---@param player Player
local function getSealedEquipSlot(player)
local all_slots = {"WeaponSlot", "ArmorSlot", "DefensiveRideSlot", "OffensiveRideSlot", "TreasureSlot"}
return table.filter(all_slots, function(slot) return table.contains(player.sealedSlots, slot) end)
end
local jieqiu = fk.CreateActiveSkill{
name = "rfenghou__jieqiu",
anim_type = "control",
prompt = "#rfenghou__jieqiu",
card_num = 0,
target_num = 1,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected)
return #selected == 0 and #getSealedEquipSlot(Fk:currentRoom():getPlayerById(to_select)) == 0 and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local num = #target:getCardIds(Player.Equip)
room:abortPlayerArea(target, target.equipSlots)
if not target.dead then
room:setPlayerMark(target, "@rfenghou__jieqiu", player.general)
room:setPlayerMark(target, "_rfenghou__jieqiu", player.id)
target:drawCards(num, self.name)
end
end,
}
local jieqiu_delay = fk.CreateTriggerSkill{
name = "#rfenghou__jieqiu_delay",
events = {fk.EventPhaseEnd, fk.TurnEnd},
anim_type = "control",
mute = true,
can_trigger = function(self, event, target, player, data)
if target:getMark("_rfenghou__jieqiu") == 0 or target.dead then return end
if event == fk.EventPhaseEnd then
if target == player and target.phase == Player.Discard then
local num = 0
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
for _, info in ipairs(move.moveInfo) do
if info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip then
num = num + 1
end
end
end
end
return false
end, Player.HistoryPhase)
if num > 0 then
self.cost_data = num
return true
end
end
elseif target:getMark("_rfenghou__jieqiu") == player.id and not player.dead then
return player:usedSkillTimes(self.name, Player.HistoryRound) == 0
end
end,
on_cost = function(self, event, target, player, data)
return event == fk.EventPhaseEnd or player.room:askForSkillInvoke(player, self.name, data, "#rfenghou__jieqiu-ask")
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.EventPhaseEnd then
local num = self.cost_data
local all_choices = getSealedEquipSlot(player)
if #all_choices > 0 then
local choices = room:askForChoices(player, all_choices, num, num, self.name, "#rfenghou__jieqiu-choice:::" .. num, false)
room:resumePlayerArea(player, choices)
end
else
room:doIndicate(player.id, {target.id})
room:notifySkillInvoked(player, self.name, "control")
player:broadcastSkillInvoke("rfenghou__jieqiu")
player:gainAnExtraTurn()
end
end,
refresh_events = {fk.AreaResumed},
can_refresh = function(self, event, target, player, data)
return player == target and #getSealedEquipSlot(player) == 0 and player:getMark("_rfenghou__jieqiu") ~= 0
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, "@rfenghou__jieqiu", 0)
room:setPlayerMark(player, "_rfenghou__jieqiu", 0)
end,
}
jieqiu:addRelatedSkill(jieqiu_delay)
local enchou = fk.CreateActiveSkill{
name = "rfenghou__enchou",
anim_type = "control",
card_num = 0,
target_num = 1,
prompt = "#rfenghou__enchou",
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected)
return #selected == 0 and #getSealedEquipSlot(Fk:currentRoom():getPlayerById(to_select)) > 0 and to_select ~= Self.id
and not Fk:currentRoom():getPlayerById(to_select):isKongcheng()
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local cids = target:getCardIds(Player.Hand)
local cards, _ = U.askforChooseCardsAndChoice(player, cids, {"rfenghou__enchou_get"}, self.name, "#rfenghou__enchou-ask::" .. target.id)
room:obtainCard(player, cards[1], false, fk.ReasonPrey, player.id, self.name)
if not target.dead and not player.dead then
local choices = getSealedEquipSlot(target)
if #choices > 0 then
local choice = room:askForChoice(player, choices, self.name, "#rfenghou__enchou-choice::" .. target.id, false)
room:resumePlayerArea(target, {choice})
end
end
end,
}
shitao:addSkill(jieqiu)
shitao:addSkill(enchou)
Fk:loadTranslationTable{
["rfenghou__shitao"] = "石韬",
["#rfenghou__shitao"] = "快意恩仇",
["illustrator:rfenghou__shitao"] = "鱼仔",
["rfenghou__jieqiu"] = "劫囚",
[":rfenghou__jieqiu"] = "出牌阶段限一次,你可选择一名所有装备栏均未被废除的其他角色,废除其所有装备栏,然后其摸X张牌(X为废除前其装备区里的牌数)。其弃牌阶段结束时,其恢复等同于此阶段弃置手牌数量的装备栏。其回合结束时,若仍有装备栏被废除,则你可执行一个额外回合(每轮限一次)。",
["rfenghou__enchou"] = "恩仇",
[":rfenghou__enchou"] = "出牌阶段限一次,你可观看一名有装备栏被废除的其他角色的手牌并获得其中一张牌,然后你恢复其一个装备栏。",
["#rfenghou__jieqiu"] = "劫囚:废除一名其他角色所有装备栏",
["@rfenghou__jieqiu"] = "被劫囚",
["#rfenghou__jieqiu_delay"] = "劫囚",
["#rfenghou__jieqiu-choice"] = "劫囚:恢复 %arg 个装备栏",
["#rfenghou__jieqiu-ask"] = "劫囚:你可执行一个额外回合",
["#rfenghou__enchou"] = "恩仇:观看一名有装备栏被废除的其他角色的手牌并获得一张牌,再恢复其一个装备栏",
["rfenghou__enchou_get"] = "获得",
["#rfenghou__enchou-ask"] = "恩仇:获得 %dest 一张手牌,然后恢复其一个装备栏",
["#rfenghou__enchou-choice"] = "恩仇:恢复 %dest 一个装备栏",
["$rfenghou__jieqiu1"] = "元直莫慌,石韬来也!",
["$rfenghou__jieqiu2"] = "一群鼠辈,焉能挡我等去路!",
["$rfenghou__enchou1"] = "江湖快意,恩仇必报!",
["$rfenghou__enchou2"] = "今日之因,明日之果!",
["~rfenghou__shitao"] = "想不到竟中了官府的埋伏……",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化