加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
joy_qyhc.lua 76.17 KB
一键复制 编辑 原始数据 按行查看 历史
该账号已注销 提交于 2024-03-27 11:50 . 2024/3/26/1
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947
local extension = Package("joy_qyhc")
extension.extensionName = "newjoy"
Fk:loadTranslationTable{
["joy_qyhc"] = "欢乐-群英荟萃",
}
local U = require "packages/utility/utility"
local zhangxuan = General(extension, "joy__zhangxuan", "wu", 4, 4, General.Female)
local tongli = fk.CreateTriggerSkill{
name = "joy__tongli",
anim_type = "offensive",
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and player.phase == Player.Play and data.firstTarget and
data.extra_data and data.extra_data.tongli_target and
not table.contains(data.card.skillNames, self.name) and player:getMark("@joy__tongli-phase") > 0 and
data.card.type ~= Card.TypeEquip and data.card.sub_type ~= Card.SubtypeDelayedTrick and
not (table.contains({"peach", "analeptic"}, data.card.trueName) and
table.find(player.room.alive_players, function(p) return p.dying end)) then
local suits = {}
for _, id in ipairs(player.player_cards[Player.Hand]) do
table.insertIfNeed(suits, Fk:getCardById(id).suit)
end
return #suits == player:getMark("@joy__tongli-phase")
end
end,
on_use = function(self, event, target, player, data)
data.extra_data = data.extra_data or {}
data.extra_data.tongli = {
from = player.id,
tos = data.extra_data.tongli_target,
times = player:getMark("@joy__tongli-phase")
}
end,
refresh_events = {fk.PreCardUse},
can_refresh = function(self, event, target, player, data)
return player == target and player:hasSkill(self, true) and player.phase == Player.Play and
not table.contains(data.card.skillNames, self.name)
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
room:addPlayerMark(player, "@joy__tongli-phase", 1)
if type(data.tos) == "table" then
data.extra_data = data.extra_data or {}
data.extra_data.tongli_target = table.simpleClone(data.tos)
end
end,
}
local parseTongliUseStruct = function (player, name, targetGroup)
local card = Fk:cloneCard(name)
card.skillName = "joy__tongli"
if player:prohibitUse(card) then return nil end
local room = player.room
local all_tos = {}
for _, tos in ipairs(targetGroup) do
local passed_target = {}
for _, to in ipairs(tos) do
local target = room:getPlayerById(to)
if target.dead then return nil end
if #passed_target == 0 and player:isProhibited(target, card) then return nil end
if not card.skill:modTargetFilter(to, passed_target, player.id, card, false) then return nil end
table.insert(passed_target, to)
table.insert(all_tos, {to})
end
end
return {
from = player.id,
tos = (card.multiple_targets and card.skill:getMinTargetNum() == 0) and {} or all_tos,
card = card,
extraUse = true
}
end
local tongli_delay = fk.CreateTriggerSkill{
name = "#joy__tongli_delay",
events = {fk.CardUseFinished},
anim_type = "offensive",
can_trigger = function(self, event, target, player, data)
if data.extra_data and data.extra_data.tongli and not player.dead then
local dat = table.simpleClone(data.extra_data.tongli)
if dat.from == player.id then
local use = parseTongliUseStruct(player, data.card.name, dat.tos)
if use then
self.cost_data = use
return true
end
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local dat = table.simpleClone(data.extra_data.tongli)
local use = table.simpleClone(self.cost_data)
local room = player.room
player:broadcastSkillInvoke("joy__tongli")
for _ = 1, dat.times, 1 do
room:useCard(use)
if player.dead then break end
end
end,
}
local joy__shezang = fk.CreateTriggerSkill{
name = "joy__shezang",
anim_type = "drawcard",
events = {fk.EnterDying},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and (target == player or player == player.room.current) and
player:usedSkillTimes(self.name, Player.HistoryTurn) == 0
end,
on_use = function(self, event, target, player, data)
local room = player.room
local suits = {1, 2, 3, 4}
local cards = {}
local pile = table.simpleClone(room.draw_pile)
while #pile > 0 and #cards < 4 do
local id = table.remove(pile, math.random(#pile))
if table.removeOne(suits, Fk:getCardById(id).suit) then
table.insert(cards, id)
end
end
if #cards > 0 then
room:moveCards({
ids = cards,
to = player.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonPrey,
proposer = player.id,
skillName = self.name,
moveVisible = true
})
end
end,
}
tongli:addRelatedSkill(tongli_delay)
zhangxuan:addSkill(tongli)
zhangxuan:addSkill(joy__shezang)
Fk:loadTranslationTable{
["joy__zhangxuan"] = "张嫙",
["joy__tongli"] = "同礼",
[":joy__tongli"] = "当你于出牌阶段内使用基本牌或普通锦囊牌指定目标后,若你手牌中的花色数等于你此阶段已使用牌的张数,你可令此牌效果额外执行X次(X为你手牌中的花色数)。",
["joy__shezang"] = "奢葬",
[":joy__shezang"] = "每回合限一次,当你或你回合内有角色进入濒死状态时,你可以从牌堆获得不同花色的牌各一张。",
["@joy__tongli-phase"] = "同礼",
["#joy__tongli_delay"] = "同礼",
}
local caoying = General(extension, "joy__caoying", "wei", 4, 4, General.Female)
local lingren = fk.CreateTriggerSkill{
name = "joy__lingren",
anim_type = "offensive",
events = {fk.TargetSpecified},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Play and data.firstTarget and
data.card.is_damage_card and player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
on_cost = function(self, event, target, player, data)
local to = player.room:askForChoosePlayers(player, AimGroup:getAllTargets(data.tos), 1, 1, "#joy__lingren-choose", self.name, true)
if #to > 0 then
self.cost_data = to[1]
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(self.cost_data)
local choices = {"joy__lingren_basic", "joy__lingren_trick", "joy__lingren_equip"}
local yes = room:askForChoices(player, choices, 0, 3, self.name, "#joy__lingren-choice::" .. self.cost_data, false)
for _, value in ipairs(yes) do
table.removeOne(choices, value)
end
local right = 0
for _, id in ipairs(to.player_cards[Player.Hand]) do
local str = "joy__lingren_"..Fk:getCardById(id):getTypeString()
if table.contains(yes, str) then
right = right + 1
table.removeOne(yes, str)
else
table.removeOne(choices, str)
end
end
right = right + #choices
room:sendLog{
type = "#joy__lingren_result",
from = player.id,
arg = tostring(right),
}
if right > 0 then
data.extra_data = data.extra_data or {}
data.extra_data.lingren = data.extra_data.lingren or {}
table.insert(data.extra_data.lingren, self.cost_data)
end
if right > 1 then
player:drawCards(2, self.name)
end
if right > 2 then
local skills = {}
if not player:hasSkill("ex__jianxiong", true) then
table.insert(skills, "ex__jianxiong")
end
if not player:hasSkill("joy__xingshang", true) then
table.insert(skills, "joy__xingshang")
end
room:setPlayerMark(player, self.name, skills)
room:handleAddLoseSkills(player, table.concat(skills, "|"), nil, true, false)
end
end,
}
local lingren_delay = fk.CreateTriggerSkill {
name = "#joy__lingren_delay",
mute = true,
events = {fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
if player.dead or data.card == nil or target ~= player then return false end
local room = player.room
local card_event = room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if not card_event then return false end
local use = card_event.data[1]
return use.extra_data and use.extra_data.lingren and table.contains(use.extra_data.lingren, player.id)
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
data.damage = data.damage + 1
end,
refresh_events = {fk.TurnStart},
can_refresh = function(self, event, target, player, data)
return target == player and player:getMark("joy__lingren") ~= 0
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
local skills = player:getMark("joy__lingren")
room:setPlayerMark(player, "joy__lingren", 0)
room:handleAddLoseSkills(player, "-"..table.concat(skills, "|-"), nil, true, false)
end,
}
local fujian = fk.CreateTriggerSkill {
name = "joy__fujian",
anim_type = "control",
frequency = Skill.Compulsory,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.phase == Player.Finish and
not table.find(player.room.alive_players, function(p) return p:isKongcheng() end)
end,
on_use = function(self, event, target, player, data)
local room = player.room
local targets = room:getOtherPlayers(player, false)
local to = table.random(targets)
room:doIndicate(player.id, {to.id})
U.viewCards(player, table.random(to.player_cards[Player.Hand], 1), self.name)
end,
}
lingren:addRelatedSkill(lingren_delay)
caoying:addSkill(lingren)
caoying:addSkill(fujian)
caoying:addRelatedSkill("ex__jianxiong")
caoying:addRelatedSkill("joy__xingshang")
Fk:loadTranslationTable{
["joy__caoying"] = "曹婴",
["#joy__caoying"] = "龙城凤鸣",
["joy__lingren"] = "凌人",
[":joy__lingren"] = "出牌阶段限一次,当你使用【杀】或伤害类锦囊牌指定目标后,你可以猜测其中一名目标角色的手牌区中是否有基本牌、锦囊牌或装备牌。"..
"若你猜对:至少一项,此牌对其造成的伤害+1;至少两项,你摸两张牌;三项,你获得技能〖奸雄〗和〖行殇〗直到你的下个回合开始。",
["joy__fujian"] = "伏间",
[":joy__fujian"] = "锁定技,结束阶段,你随机观看一名其他角色的一张手牌)。",
["#joy__lingren-choose"] = "凌人:你可以猜测其中一名目标角色的手牌中是否有基本牌、锦囊牌或装备牌",
["#joy__lingren-choice"] = "凌人:猜测%dest的手牌中是否有基本牌、锦囊牌或装备牌",
["joy__lingren_basic"] = "有基本牌",
["joy__lingren_trick"] = "有锦囊牌",
["joy__lingren_equip"] = "有装备牌",
["#joy__lingren_result"] = "%from 猜对了 %arg 项",
["joy__lingren_delay"] = "凌人",
}
local baosanniang = General(extension, "joy__baosanniang", "shu", 3, 3, General.Female)
local joy__wuniang = fk.CreateTriggerSkill{
name = "joy__wuniang",
anim_type = "control",
events = {fk.CardUsing, fk.CardResponding},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and data.card.trueName == "slash" and
not table.every(player.room:getOtherPlayers(player), function(p) return p:isNude() end)
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local prompt = "#joy__wuniang1-choose"
if player:usedSkillTimes("joy__xushen", Player.HistoryGame) > 0 and
table.find(room.alive_players, function(p) return string.find(p.general, "guansuo") end) then
prompt = "#joy__wuniang2-choose"
end
local to = room:askForChoosePlayers(player, table.map(table.filter(room:getOtherPlayers(player), function(p)
return not p:isNude() end), Util.IdMapper), 1, 1, prompt, self.name, true)
if #to > 0 then
self.cost_data = to[1]
return true
end
end,
on_use = function(self, event, player, target, data)
local room = player.room
local to = room:getPlayerById(self.cost_data)
local id = room:askForCardChosen(player, to, "he", self.name)
room:obtainCard(player.id, id, false, fk.ReasonPrey)
if not to.dead then
to:drawCards(1, self.name)
end
if player:usedSkillTimes("joy__xushen", Player.HistoryGame) > 0 then
for _, p in ipairs(room.alive_players) do
if string.find(p.general, "guansuo") and not p.dead then
p:drawCards(1, self.name)
end
end
end
end,
}
local joy__xushen = fk.CreateTriggerSkill{
name = "joy__xushen",
anim_type = "defensive",
frequency = Skill.Limited,
events = {fk.EnterDying},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player.dying and player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:recover({
who = player,
num = 1,
recoverBy = player,
skillName = self.name
})
room:handleAddLoseSkills(player, "ty__zhennan", nil, true, false)
if player.dead or table.find(room.alive_players, function(p) return string.find(p.general, "guansuo") end) then return end
local targets = table.map(room:getOtherPlayers(player), Util.IdMapper)
local to = room:askForChoosePlayers(player, targets, 1, 1, "#joy__xushen-choose", self.name, true)
if #to > 0 then
to = room:getPlayerById(to[1])
if room:askForSkillInvoke(to, self.name, nil, "#joy__xushen-invoke") then
if player.general == "joy__baosanniang" then
room:notifySkillInvoked(player, "joy__xushen","drawcard")
room:changeHero(player,"joy_skin__baosanniang",false,false,true,false)
room:notifySkillInvoked(to, "joy__xushen","drawcard")
room:changeHero(to, "joy_skin__guansuo", false, false, true)
if not to.dead then
to:drawCards(3, self.name)
end
elseif player.deputyGeneral == "joy__baosanniang" then
room:notifySkillInvoked(player, "joy__xushen","drawcard")
room:changeHero(player,"joy_skin__baosanniang",false,true,true,false)
room:notifySkillInvoked(to, "joy__xushen","drawcard")
room:changeHero(to, "joy_skin__guansuo", false, false, true)
if not to.dead then
to:drawCards(3, self.name)
end
else
room:changeHero(to, "joy__guansuo", false, false, true)
if not to.dead then
to:drawCards(3, self.name)
end
end
end
end
end,
}
baosanniang:addSkill(joy__wuniang)
baosanniang:addSkill(joy__xushen)
baosanniang:addRelatedSkill("ty__zhennan")
Fk:loadTranslationTable{
["joy__baosanniang"] = "鲍三娘",
["#joy__baosanniang"] = "南中武娘",
["joy__wuniang"] = "武娘",
[":joy__wuniang"] = "当你使用或打出【杀】时,你可以获得一名其他角色的一张牌,若如此做,其摸一张牌。若你已发动〖许身〗,则关索也摸一张牌。",
["joy__xushen"] = "许身",
[":joy__xushen"] = "限定技,当你进入濒死状态后,你可以回复1点体力并获得技能〖镇南〗,然后如果你脱离濒死状态且关索不在场,"..
"你可令一名其他角色选择是否用关索代替其武将并令其摸三张牌",
["joy__zhennan"] = "镇南",
[":joy__zhennan"] = "当有角色使用普通锦囊牌指定目标后,若此牌目标数大于1,你可以对一名其他角色造成1点伤害。",
["#joy__wuniang1-choose"] = "武娘:你可以获得一名其他角色的一张牌,其摸一张牌",
["#joy__wuniang2-choose"] = "武娘:你可以获得一名其他角色的一张牌,其摸一张牌,关索摸一张牌",
["#joy__xushen-choose"] = "许身:你可以令一名其他角色摸三张牌并选择是否变身为欢乐杀关索!",
["#joy__xushen-invoke"]= "许身:你可以变身为欢乐杀关索!",
}
local zhangqiying = General(extension, "joy__zhangqiying", "qun", 3, 3, General.Female)
local zhenyi = fk.CreateViewAsSkill{
name = "joy__zhenyi",
anim_type = "support",
pattern = "peach",
prompt = "#joy__zhenyi2",
card_num = 1,
card_filter = function(self, to_select, selected)
return #selected == 0
end,
before_use = function(self, player)
player.room:removePlayerMark(player, "@@faluclub", 1)
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
local c = Fk:cloneCard("peach")
c.skillName = self.name
c:addSubcard(cards[1])
return c
end,
enabled_at_play = Util.FalseFunc,
enabled_at_response = function(self, player)
return player.phase == Player.NotActive and player:getMark("@@faluclub") > 0
end,
}
local zhenyi_trigger = fk.CreateTriggerSkill {
name = "#joy__zhenyi_trigger",
main_skill = zhenyi,
events = {fk.AskForRetrial, fk.DamageCaused, fk.Damaged},
mute = true,
can_trigger = function(self, event, target, player, data)
if player:hasSkill(zhenyi.name) then
if event == fk.AskForRetrial then
return player:getMark("@@faluspade") > 0
elseif event == fk.DamageCaused then
return target == player and player:getMark("@@faluheart") > 0 and data.to ~= player
elseif event == fk.Damaged then
return target == player and player:getMark("@@faludiamond") > 0
end
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local prompt
if event == fk.AskForRetrial then
prompt = "#joy__zhenyi1::"..target.id
elseif event == fk.DamageCaused then
prompt = "#joy__zhenyi3::"..data.to.id
elseif event == fk.Damaged then
prompt = "#joy__zhenyi4"
end
return room:askForSkillInvoke(player, zhenyi.name, nil, prompt)
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(zhenyi.name)
if event == fk.AskForRetrial then
room:notifySkillInvoked(player, zhenyi.name, "control")
room:removePlayerMark(player, "@@faluspade", 1)
local choice = room:askForChoice(player, {"joy__zhenyi_spade", "joy__zhenyi_heart"}, zhenyi.name)
local new_card = Fk:cloneCard(data.card.name, choice == "joy__zhenyi_spade" and Card.Spade or Card.Heart, 5)
new_card.skillName = zhenyi.name
new_card.id = data.card.id
data.card = new_card
room:sendLog{
type = "#ChangedJudge",
from = player.id,
to = { data.who.id },
arg2 = new_card:toLogString(),
arg = zhenyi.name,
}
elseif event == fk.DamageCaused then
room:notifySkillInvoked(player, zhenyi.name, "offensive")
room:removePlayerMark(player, "@@faluheart", 1)
data.damage = data.damage + 1
elseif event == fk.Damaged then
room:notifySkillInvoked(player, zhenyi.name, "masochism")
room:removePlayerMark(player, "@@faludiamond", 1)
local cards = {}
table.insertTable(cards, room:getCardsFromPileByRule(".|.|.|.|.|basic"))
table.insertTable(cards, room:getCardsFromPileByRule(".|.|.|.|.|trick"))
table.insertTable(cards, room:getCardsFromPileByRule(".|.|.|.|.|equip"))
if #cards > 0 then
room:moveCards({
ids = cards,
to = player.id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonJustMove,
proposer = player.id,
skillName = zhenyi.name,
})
end
end
end,
}
local dianhua = fk.CreateTriggerSkill{
name = "joy__dianhua",
anim_type = "control",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and (player.phase == Player.Start or player.phase == Player.Finish)
end,
on_cost = function(self, event, target, player, data)
local n = 1
for _, suit in ipairs({"spade", "club", "heart", "diamond"}) do
if player:getMark("@@falu"..suit) > 0 then
n = n + 1
end
end
if player.room:askForSkillInvoke(player, self.name) then
self.cost_data = n
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:askForGuanxing(player, room:getNCards(self.cost_data), nil, {0, 0}, self.name)
end,
}
zhenyi:addRelatedSkill(zhenyi_trigger)
zhangqiying:addSkill("falu")
zhangqiying:addSkill(zhenyi)
zhangqiying:addSkill(dianhua)
Fk:loadTranslationTable{
["joy__zhangqiying"] = "张琪瑛",
["#joy__zhangqiying"] = "禳祷西东",
["joy__zhenyi"] = "真仪",
[":joy__zhenyi"] = "你可以在以下时机弃置相应的标记来发动以下效果:<br>"..
"当一张判定牌生效前,你可以弃置“紫微”,然后将判定结果改为♠5或<font color='red'>♥5</font>;<br>"..
"当你于回合外需要使用【桃】时,你可以弃置“后土”,然后将你的一张手牌当【桃】使用;<br>"..
"当你对其他角色造成伤害时,你可以弃置“玉清”,此伤害+1;<br>"..
"当你受到伤害后,你可以弃置“勾陈”,然后你从牌堆中随机获得三种类型的牌各一张。",
["joy__dianhua"] = "点化",
[":joy__dianhua"] = "准备阶段或结束阶段,你可以观看牌堆顶的X张牌(X为你的标记数+1)。若如此做,你将这些牌以任意顺序放回牌堆顶。",
["#joy__zhenyi1"] = "真仪:你可以弃置♠紫微,将 %dest 的判定结果改为♠5或<font color='red'>♥5</font>",
["#joy__zhenyi2"] = "真仪:你可以弃置♣后土,将一张手牌当【桃】使用",
["#joy__zhenyi3"] = "真仪:你可以弃置<font color='red'>♥</font>玉清,对 %dest 造成的伤害+1",
["#joy__zhenyi4"] = "真仪:你可以弃置<font color='red'>♦</font>勾陈,从牌堆中随机获得三种类型的牌各一张",
["#joy__zhenyi_trigger"] = "真仪",
["joy__zhenyi_spade"] = "将判定结果改为♠5",
["joy__zhenyi_heart"] = "将判定结果改为<font color='red'>♥</font>5",
}
local joy__sunru = General(extension, "joy__sunru", "wu", 3, 3, General.Female)
local joy__xiecui = fk.CreateTriggerSkill{
name = "joy__xiecui",
anim_type = "offensive",
events = {fk.DamageCaused},
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) and target and not target.dead and target == player.room.current and data.card then
return player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 and
#U.getActualDamageEvents(player.room, 1, function(e) return e.data[1].from == target end) == 0
end
end,
on_cost = function(self, event, target, player, data)
return player.room:askForSkillInvoke(player, self.name, data, "#joy__xiecui-invoke:"..data.from.id..":"..data.to.id)
end,
on_use = function(self, event, target, player, data)
local room = player.room
data.damage = data.damage + 1
if not target.dead and target:getHandcardNum() > target.hp and room:getCardArea(data.card) == Card.Processing then
room:addPlayerMark(target, MarkEnum.AddMaxCardsInTurn, 1)
room:moveCardTo(data.card, Card.PlayerHand, target, fk.ReasonPrey, self.name)
end
end,
}
joy__sunru:addSkill(joy__xiecui)
joy__sunru:addSkill("youxu")
Fk:loadTranslationTable{
["joy__sunru"] = "孙茹",
["#joy__sunru"] = "呦呦鹿鸣",
["joy__xiecui"] = "撷翠",
[":joy__xiecui"] = "每当一名角色于其回合内使用牌首次造成伤害时,你可令此伤害+1。若该角色手牌数大于等于体力值,其获得此伤害牌且本回合手牌上限+1。",
["#joy__xiecui-invoke"] = "撷翠:你可以令 %src 对 %dest造成的伤害+1",
}
local caojinyu = General(extension, "joy__caojinyu", "wei", 3, 3, General.Female)
caojinyu:addSkill("yuqi")
caojinyu:addSkill("shanshen")
caojinyu:addSkill("xianjing")
Fk:loadTranslationTable{
["joy__caojinyu"] = "曹金玉",
["#joy__caojinyu"] = "金乡公主",
["$yuqi_joy__caojinyu1"] = "玉儿摔倒了,要阿娘抱抱。 ",
["$yuqi_joy__caojinyu2"] = "这么漂亮的雪花,为什么只能在寒冬呢? ",
["$shanshen_joy__caojinyu1"] = "人家只想做安安静静的小淑女。 ",
["$shanshen_joy__caojinyu2"] = " 雪花纷飞,独存寒冬。",
["$xianjing_joy__caojinyu1"] = " 得父母之爱,享公主之礼遇。",
["$xianjing_joy__caojinyu2"] = " 哼,可不要小瞧女孩子啊。",
["~joy__caojinyu"] = "娘亲,雪人不怕冷吗? ",
}
local fengyu = General(extension, "joy__fengshu", "qun", 3, 3, General.Female)
fengyu:addSkill("tiqi")
fengyu:addSkill("baoshu")
Fk:loadTranslationTable{
["joy__fengshu"] = "冯妤",
["#joy__fengshu"] = "泣珠伊人",
}
local caohua = General(extension, "joy__caohua", "wei", 3, 3, General.Female)
caohua:addSkill("caiyi")
caohua:addSkill("guili")
Fk:loadTranslationTable{
["joy__caohua"] = "曹华",
["#joy__caohua"] = "殊凰求凤",
}
local xuelingyun = General(extension, "joy__xuelingyun", "wei", 3, 3, General.Female)
xuelingyun:addSkill("xialei")
xuelingyun:addSkill("anzhi")
Fk:loadTranslationTable{
["joy__xuelingyun"] = "薛灵芸",
["#joy__xuelingyun"] = "霓裳缀红泪",
}
local quanhuijie = General(extension, "joy__quanhuijie", "wu", 3, 3, General.Female)
local ligong = fk.CreateTriggerSkill{
name = "joy__ligong",
frequency = Skill.Wake,
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and
player.phase == Player.Start and
player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
can_wake = function(self, event, target, player, data)
return player:hasSkill("huishu", true) and
(player:getMark("huishu1") > 1 or player:getMark("huishu2") > 3 or player:getMark("huishu3") > 2)
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:changeMaxHp(player, 1)
room:recover({
who = player,
num = 1,
recoverBy = player,
skillName = self.name
})
room:handleAddLoseSkills(player, "-yishu", nil)
local generals = {"nya__daqiao", "nya__xiaoqiao","joyex__sunshangxiang","joyex__daqiao","joy__zhoufei", "joyex__xiaoqiao","joy__wuguotai","joy__bulianshi","joy__sunluban","joy__xushi",
"joy__sunluyu","joysp__daqiao","joysp__xiaoqiao","joy__zhangxuan","joy__sunru","joy__panshu","joy__zhaoyanw","joy__zhangyao","joy__tenggongzhu","joy__zhouyi","joy__luyusheng",}
if #generals == 0 then return false end
generals = table.random(generals, 4)
local skills = {}
for _, general_name in ipairs(generals) do
local general = Fk.generals[general_name]
local g_skills = {}
for _, skill in ipairs(general.skills) do
if not (table.contains({Skill.Quest}, skill.frequency) or skill.lordSkill) and
(#skill.attachedKingdom == 0 or (table.contains(skill.attachedKingdom, "wu") and player.kingdom == "wu")) then
table.insertIfNeed(g_skills, skill.name)
end
end
for _, s_name in ipairs(general.other_skills) do
local skill = Fk.skills[s_name]
if not (table.contains({Skill.Quest}, skill.frequency) or skill.lordSkill) and
(#skill.attachedKingdom == 0 or (table.contains(skill.attachedKingdom, "wu") and player.kingdom == "wu")) then
table.insertIfNeed(g_skills, skill.name)
end
end
table.insertIfNeed(skills, g_skills)
end
local result = player.room:askForCustomDialog(player, self.name,
"packages/tenyear/qml/ChooseGeneralSkillsBox.qml", {
generals, skills, 1, 2, "#ligong-choice", true
})
local choices = {}
if result ~= "" then
choices = json.decode(result)
end
if #choices == 0 then
player:drawCards(3, self.name)
else
room:handleAddLoseSkills(player, "-huishu|"..table.concat(choices, "|"), nil)
end
end,
}
quanhuijie:addSkill("huishu")
quanhuijie:addSkill("yishu")
quanhuijie:addSkill(ligong)
Fk:loadTranslationTable{
["joy__quanhuijie"] = "全惠解",
["#joy__quanhuijie"] = "春宫早深",
["joy__ligong"] = "离宫",
[":joy__ligong"] = "觉醒技,准备阶段,若〖慧淑〗有数字达到5,你加1点体力上限并回复1点体力,失去〖易数〗,"..
"然后从随机四个吴国女性武将中选择至多两个技能获得并失去〖慧淑〗(如果不获得技能则改为摸三张牌)。"..
'<br /><font color="red">(村:欢杀包特色,只会获得欢杀池内武将的技能,没说不能拿的技能就是能拿)</font>',
}
local fanyufeng = General(extension, "joy__fanyufeng", "qun", 3, 3, General.Female)
fanyufeng:addSkill("bazhan")
fanyufeng:addSkill("jiaoying")
Fk:loadTranslationTable{
["joy__fanyufeng"] = "樊玉凤",
["#joy__fanyufeng"] = "红鸾寡宿",
}
local panshu = General(extension, "joy__panshu", "wu", 3, 3, General.Female)
panshu:addSkill("zhiren")
panshu:addSkill("yaner")
Fk:loadTranslationTable{
["joy__panshu"] = "潘淑",
["#joy__panshu"] = "神女",
}
local zhaoyanw = General(extension, "joy__zhaoyanw", "wu", 3, 3, General.Female)
zhaoyanw:addSkill("jinhui")
zhaoyanw:addSkill("qingman")
Fk:loadTranslationTable{
["joy__zhaoyanw"] = "赵嫣",
["#joy__zhaoyanw"] = "霞蔚青歇",
}
local zhangyao = General(extension, "joy__zhangyao", "wu", 3, 3, General.Female)
zhangyao:addSkill("yuanyu")
zhangyao:addSkill("xiyan")
Fk:loadTranslationTable{
["joy__zhangyao"] = "张媱",
["#joy__zhangyao"] = "琼楼孤蒂",
}
local lvlingqi = General(extension, "joy__lvlingqi", "qun", 4, 4, General.Female)
lvlingqi:addSkill("guowu")
lvlingqi:addSkill("zhuangrong")
lvlingqi:addRelatedSkill("shenwei")
lvlingqi:addRelatedSkill("wushuang")
Fk:loadTranslationTable{
["joy__lvlingqi"] = "吕玲绮",
["#joy__lvlingqi"] = "无双虓姬",
["$shenwei_joy__lvlingqi1"] = "继父神威,无坚不摧!",
["$shenwei_joy__lvlingqi2"] = "我乃温侯吕奉先之女!",
["$wushuang_joy__lvlingqi1"] = "猛将策良骥,长戟破敌营。",
["$wushuang_joy__lvlingqi2"] = "杀气腾剑戟,严风卷戎装。",
}
local wanniangongzhu = General(extension, "joy__wanniangongzhu", "qun", 3, 3, General.Female)
wanniangongzhu:addSkill("zhenge")
wanniangongzhu:addSkill("xinghan")
Fk:loadTranslationTable{
["joy__wanniangongzhu"] = "万年公主",
["#joy__wanniangongzhu"] = "还汉明珠",
}
local tenggongzhu = General(extension, "joy__tenggongzhu", "wu", 3, 3, General.Female)
tenggongzhu:addSkill("xingchong")
tenggongzhu:addSkill("liunian")
Fk:loadTranslationTable{
["joy__tenggongzhu"] = "滕公主",
["#joy__tenggongzhu"] = "芳华荏苒",
}
local zhouyi = General(extension, "joy__zhouyi", "wu", 3, 3, General.Female)
zhouyi:addSkill("zhukou")
zhouyi:addSkill("mengqing")
zhouyi:addRelatedSkill("yuyun")
Fk:loadTranslationTable{
["joy__zhouyi"] = "周夷",
["#joy__zhouyi"] = "靛情雨黛",
}
local luyi = General(extension, "joy__luyi", "qun", 3, 3, General.Female)
local function searchFuxueCards(room, findOne)
if #room.discard_pile == 0 then return {} end
local ids = {}
local discard_pile = table.simpleClone(room.discard_pile)
local logic = room.logic
local events = logic.event_recorder[GameEvent.MoveCards] or Util.DummyTable
for i = #events, 1, -1 do
local e = events[i]
for _, move in ipairs(e.data) do
for _, info in ipairs(move.moveInfo) do
local id = info.cardId
if table.removeOne(discard_pile, id) then
if move.toArea == Card.DiscardPile and move.moveReason ~= fk.ReasonUse then
table.insertIfNeed(ids, id)
if findOne then
return ids
end
end
end
end
end
if #discard_pile == 0 then break end
end
return ids
end
local fuxue = fk.CreateTriggerSkill{
name = "joy__fuxue",
anim_type = "drawcard",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) then
if player.phase == Player.Start then
return #searchFuxueCards(player.room, true) > 0
elseif player.phase == Player.Finish then
return player:isKongcheng() or
table.every(player.player_cards[Player.Hand], function(id) return Fk:getCardById(id):getMark("@@joy__fuxue-inhand") == 0 end)
end
end
end,
on_cost = function(self, event, target, player, data)
if player.phase == Player.Start then
return player.room:askForSkillInvoke(player, self.name, nil, "#joy__fuxue-invoke:::"..player.hp)
else
return true
end
end,
on_use = function(self, event, target, player, data)
if player.phase == Player.Start then
local room = player.room
local cards = searchFuxueCards(room, false)
if #cards == 0 then return false end
table.sort(cards, function (a, b)
local cardA, cardB = Fk:getCardById(a), Fk:getCardById(b)
if cardA.type == cardB.type then
if cardA.sub_type == cardB.sub_type then
if cardA.name == cardB.name then
return a > b
else
return cardA.name > cardB.name
end
else
return cardA.sub_type < cardB.sub_type
end
else
return cardA.type < cardB.type
end
end)
local get = room:askForCardsChosen(player, player, 1, player.hp, {
card_data = {
{ self.name, cards }
}
}, self.name)
if #get > 0 then
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(get)
room:obtainCard(player.id, dummy, true, fk.ReasonJustMove)
for _, id in ipairs(get) do
if room:getCardArea(id) == Card.PlayerHand and room:getCardOwner(id) == player then
room:setCardMark(Fk:getCardById(id), "@@joy__fuxue-inhand", 1)
end
end
end
else
player:drawCards(player.hp, self.name)
end
end,
refresh_events = {fk.TurnEnd},
can_refresh = function(self, event, target, player, data)
return target == player and not player:isKongcheng()
end,
on_refresh = function(self, event, target, player, data)
for _, id in ipairs(player.player_cards[Player.Hand]) do
player.room:setCardMark(Fk:getCardById(id), "@@joy__fuxue-inhand", 0)
end
end,
}
local yaoyi = fk.CreateTriggerSkill{
name = "joy__yaoyi",
anim_type = "special",
frequency = Skill.Compulsory,
events = {fk.GameStart},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self)
end,
on_use = function(self, event, target, player, data)
local room = player.room
for _, p in ipairs(player.room:getAlivePlayers()) do
local yes = true
for _, skill in ipairs(p.player_skills) do
if skill.switchSkillName then
yes = false
break
end
end
if yes then
room:handleAddLoseSkills(p, "joy__shoutan", nil, true, false)
end
end
end,
refresh_events = {fk.Deathed},
can_refresh = function(self, event, target, player, data)
return target == player and player:hasSkill(self, true, true)
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
for _, p in ipairs(room:getAllPlayers()) do
room:handleAddLoseSkills(p, "-joy__shoutan", nil, true, true)
end
end,
}
local yaoyi_prohibit = fk.CreateProhibitSkill{
name = "#joy__yaoyi_prohibit",
frequency = Skill.Compulsory,
is_prohibited = function(self, from, to, card)
if table.find(Fk:currentRoom().alive_players, function(p) return p:hasSkill("joy__yaoyi") end) then
if from ~= to then
local fromskill = {}
for _, skill in ipairs(from.player_skills) do
if skill.switchSkillName then
table.insertIfNeed(fromskill, skill.switchSkillName)
end
end
local toskill = {}
for _, skill in ipairs(to.player_skills) do
if skill.switchSkillName then
table.insertIfNeed(toskill, skill.switchSkillName)
end
end
if #fromskill == 0 or #toskill == 0 then return false end
if #fromskill > 1 then
end
return from:getSwitchSkillState(fromskill[1], false) == to:getSwitchSkillState(toskill[1], false)
end
end
end,
}
local shoutan_refresh = fk.CreateTriggerSkill{
name = "#joy__shoutan_refresh",
mute = true,
frequency = Skill.Compulsory,
events = {fk.AfterCardUseDeclared},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and player:getMark("joy__shoutan-phase") > 0
end,
on_use = function(self, event, target, player, data)
player.room:setPlayerMark(player,"joy__shoutan-phase",0)
end
}
local shoutan = fk.CreateActiveSkill{
name = "joy__shoutan",
anim_type = "switch",
switch_skill_name = "joy__shoutan",
card_num = function()
if Self:hasSkill("joy__yaoyi") then
return 0
else
return 1
end
end,
target_num = 0,
can_use = function(self, player)
if player:hasSkill("joy__yaoyi") then
return true and player:getMark("joy__shoutan-phase") == 0
else
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end
end,
card_filter = function(self, to_select, selected)
if Self:hasSkill("joy__yaoyi") then
return false
elseif #selected == 0 and Fk:currentRoom():getCardArea(to_select) ~= Card.PlayerEquip then
if Self:getSwitchSkillState(self.name, false) == fk.SwitchYang then
return Fk:getCardById(to_select).color ~= Card.Black
else
return Fk:getCardById(to_select).color == Card.Black
end
end
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
if player:hasSkill("joy__yaoyi") then
room:setPlayerMark(player,"joy__shoutan-phase",1)
end
room:throwCard(effect.cards, self.name, player, player)
end,
}
yaoyi:addRelatedSkill(shoutan_refresh)
yaoyi:addRelatedSkill(yaoyi_prohibit)
luyi:addSkill(fuxue)
luyi:addSkill(yaoyi)
luyi:addRelatedSkill(shoutan)
Fk:loadTranslationTable{
["joy__luyi"] = "卢弈",
["#joy__luyi"] = "落子惊鸿",
["joy__fuxue"] = "复学",
[":joy__fuxue"] = "准备阶段,你可以从弃牌堆中获得至多X张不因使用而进入弃牌堆的牌。结束阶段,若你手中没有以此法获得的牌,你摸X张牌。(X为你的体力值)",
["joy__yaoyi"] = "邀弈",
[":joy__yaoyi"] = "锁定技,游戏开始时,所有没有转换技的角色获得〖手谈〗;你发动〖手谈〗无需弃置牌且无次数限制。"..
'<br /><font color="grey">(防止永动,每次发动手谈后需使用一张牌后才可再次发动)</font>'..
"<br>所有角色使用牌只能指定自己及与自己转换技状态不同的角色为目标。",
["joy__shoutan"] = "手谈",
[":joy__shoutan"] = "转换技,出牌阶段限一次,你可以弃置一张:阳:非黑色手牌;阴:黑色手牌。",
["#joy__fuxue-invoke"] = "复学:你可以获得弃牌堆中至多%arg张不因使用而进入弃牌堆的牌",
["@@joy__fuxue-inhand"] = "复学",
["#joy__shoutan_refresh"] = "邀弈",
["is_selected"] = "已选择",
["$joy__fuxue1"] = " ",
["$joy__fuxue2"] = " ",
["$joy__yaoyi1"] = " ",
["$joy__yaoyi2"] = " ",
["$joy__shoutan1"] = " ",
["$joy__shoutan2"] = " ",
["~joy__luyi"] = " ",
}
local yinfuren = General(extension, "joy__yinfuren", "wei", 3, 3, General.Female)
local yingyu = fk.CreateTriggerSkill{
name = "joy__yingyu",
anim_type = "control",
events = {fk.EventPhaseStart},
can_trigger = function(self, event, target, player, data)
return target == player and player:hasSkill(self) and
(player.phase == Player.Play or (player.phase == Player.Finish and player:usedSkillTimes("joy__yongbi", Player.HistoryGame) > 0))
end,
on_cost = function(self, event, target, player, data)
local room = player.room
local targets = table.map(table.filter(room.alive_players, function(p)
return not p:isKongcheng() end), Util.IdMapper)
if #targets < 2 then return end
local tos = room:askForChoosePlayers(player, targets, 2, 2, "#yingyu-choose", self.name, true)
if #tos == 2 then
self.cost_data = tos
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local target1 = room:getPlayerById(self.cost_data[1])
local target2 = room:getPlayerById(self.cost_data[2])
room:doIndicate(player.id, {self.cost_data[1]})
local id1 = room:askForCardChosen(player, target1, "h", self.name)
room:doIndicate(player.id, {self.cost_data[2]})
local id2 = room:askForCardChosen(player, target2, "h", self.name)
target1:showCards(id1)
target2:showCards(id2)
if Fk:getCardById(id1).suit ~= Fk:getCardById(id2).suit and
Fk:getCardById(id1).suit ~= Card.NoSuit and Fk:getCardById(id1).suit ~= Card.NoSuit then
local to = room:askForChoosePlayers(player, self.cost_data, 1, 1, "#yingyu2-choose", self.name, false)
if #to > 0 then
to = to[1]
else
to = table.random(self.cost_data)
end
if to == target1.id then
room:obtainCard(self.cost_data[1], id2, true, fk.ReasonPrey)
else
room:obtainCard(self.cost_data[2], id1, true, fk.ReasonPrey)
end
end
end,
}
local yongbi = fk.CreateActiveSkill{
name = "joy__yongbi",
anim_type = "support",
min_card_num = 1,
target_num = 1,
can_use = function(self, player)
return not player:isKongcheng() and player:usedSkillTimes(self.name, Player.HistoryGame) == 0
end,
card_filter = function(self, to_select, selected)
return Fk:currentRoom():getCardArea(to_select) ~= Card.PlayerEquip
end,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local cards = effect.cards
local dummy = Fk:cloneCard("dilu")
dummy:addSubcards(cards)
room:moveCardTo(cards, Player.Hand, target, fk.ReasonGive, self.name, nil, false)
local suits = {}
for _, id in ipairs(dummy.subcards) do
if Fk:getCardById(id, true).suit ~= Card.NoSuit then
table.insertIfNeed(suits, Fk:getCardById(id, true).suit)
end
end
if #suits > 1 then
room:addPlayerMark(player, MarkEnum.AddMaxCards, 2)
room:addPlayerMark(target, MarkEnum.AddMaxCards, 2)
end
if #suits > 2 then
room:setPlayerMark(player, "@@joy__yongbi", 1)
room:setPlayerMark(target, "@@joy__yongbi", 1)
end
end,
}
local yongbi_trigger = fk.CreateTriggerSkill{
name = "#joy__yongbi_trigger",
anim_type = "defensive",
events = {fk.DamageInflicted},
can_trigger = function(self, event, target, player, data)
return target == player and player:getMark("@@joy__yongbi") > 0 and data.damage > 1
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
data.damage = data.damage - 1
end,
}
yongbi:addRelatedSkill(yongbi_trigger)
yinfuren:addSkill(yingyu)
yinfuren:addSkill(yongbi)
Fk:loadTranslationTable{
["joy__yinfuren"] = "尹夫人",
["#joy__yinfuren"] = "委身允翕",
["joy__yingyu"] = "媵予",
[":joy__yingyu"] = "准备阶段,你可以展示两名角色的各一张手牌,若花色不同,则你选择其中的一名角色获得另一名角色的展示牌。(若你已发动过〖拥嬖〗,则结束阶段也可发动此技能)",
["joy__yongbi"] = "拥嬖",
[":joy__yongbi"] = "限定技,出牌阶段,你可将任意手牌交给一名其他角色。根据其中牌的花色数量,"..
"你与其永久获得以下效果:至少两种,手牌上限+2;至少三种,受到大于1点的伤害时伤害-1。",
["@@joy__yongbi"] = "拥嬖",
["#joy__yongbi_trigger"] = "拥嬖",
}
local guozhao = General(extension, "joy__guozhao", "wei", 3, 3, General.Female)
guozhao:addSkill("pianchong")
guozhao:addSkill("zunwei")
Fk:loadTranslationTable{
["joy__guozhao"] = "郭照",
["#joy__guozhao"] = "碧海青天",
}
local laiyinger = General(extension, "joy__laiyinger", "qun", 3, 3, General.Female)
local xiaowu = fk.CreateActiveSkill{
name = "joy__xiaowu",
anim_type = "offensive",
prompt = "#xiaowu",
max_card_num = 0,
target_num = 1,
interaction = function(self)
return UI.ComboBox { choices = {"xiaowu_clockwise", "xiaowu_anticlockwise"} }
end,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) < 1
end,
card_filter = Util.FalseFunc,
target_filter = function(self, to_select, selected, selected_cards)
return #selected == 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 players = room:getOtherPlayers(player)
local targets = {}
local choice = self.interaction.data
for i = 1, #players, 1 do
local real_i = i
if choice == "xiaowu_anticlockwise" then
real_i = #players + 1 - real_i
end
local temp = players[real_i]
table.insert(targets, temp)
if temp == target then break end
end
room:doIndicate(player.id, table.map(targets, Util.IdMapper))
local x = 0
local to_damage = {}
for _, p in ipairs(targets) do
if not p.dead and not player.dead then
choice = room:askForChoice(p, {"xiaowu_draw1", "draw1"}, self.name, "#xiawu_draw:" .. player.id)
if choice == "xiaowu_draw1" then
player:drawCards(1, self.name)
x = x+1
elseif choice == "draw1" then
p:drawCards(1, self.name)
table.insert(to_damage, p.id)
end
end
end
if not player.dead then
local n = 0
if x > 0 then
n = x%2
n = n + x//2
end
room:addPlayerMark(player, "@xiaowu_sand",n)
if x < #to_damage then
room:sortPlayersByAction(to_damage)
for _, pid in ipairs(to_damage) do
local p = room:getPlayerById(pid)
if not p.dead then
room:damage{ from = player, to = p, damage = 1, skillName = self.name }
end
end
end
end
end,
}
laiyinger:addSkill(xiaowu)
laiyinger:addSkill("huaping")
laiyinger:addRelatedSkill("shawu")
Fk:loadTranslationTable{
["joy__laiyinger"] = "来莺儿",
["#joy__laiyinger"] = "雀台歌女",
["joy__xiaowu"] = "绡舞",
[":joy__xiaowu"] = "出牌阶段限一次,你可以从你的上家或下家起选择任意名座位连续的其他角色,每名角色依次选择一项:1.令你摸一张牌;2.自己摸一张牌。"..
"选择完成后,你获得X个“沙”标记(X为选择令你摸牌的角色数的一半,向上取整);若自己摸牌的选择人数较多,你对这些角色各造成1点伤害。",
}
local yanfuren = General(extension, "joy__yanfuren", "qun", 3, 3, General.Female)
local channi_viewas = fk.CreateViewAsSkill{
name = "joy__channi_viewas",
anim_type = "offensive",
pattern = "duel",
card_filter = function(self, to_select, selected)
return Fk:currentRoom():getCardArea(to_select) ~= Player.Equip and #selected < Self:getMark("joy__channi")
end,
view_as = function(self, cards)
if #cards == 0 then return end
local card = Fk:cloneCard("duel")
card:addSubcards(cards)
card.skillName = "joy__channi"
return card
end,
}
local channi = fk.CreateActiveSkill{
name = "joy__channi",
anim_type = "support",
prompt = "#channi-active",
min_card_num = 1,
target_num = 1,
can_use = function(self, player)
return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_filter = function(self, to_select, selected)
return Fk:currentRoom():getCardArea(to_select) ~= Card.PlayerEquip
end,
target_filter = function(self, to_select, selected)
return #selected == 0 and to_select ~= Self.id
end,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
local target = room:getPlayerById(effect.tos[1])
local n = #effect.cards
room:moveCardTo(effect.cards, Player.Hand, target, fk.ReasonGive, self.name, nil, false, player.id)
room:setPlayerMark(target, self.name, n)
local success, data = room:askForUseActiveSkill(target, "joy__channi_viewas", "#joy__channi-invoke:"..player.id.."::"..n, true, {}, false)
room:setPlayerMark(target, self.name, 0)
if success then
local card = Fk:cloneCard("duel")
card.skillName = self.name
card:addSubcards(data.cards)
local use = {
from = target.id,
tos = table.map(data.targets, function(id) return {id} end),
card = card,
extra_data = {channi_data = {player.id, target.id, #data.cards}}
}
room:useCard(use)
end
end,
}
local channi_delay = fk.CreateTriggerSkill{
name = "#joy__channi_delay",
events = {fk.Damage, fk.DamageInflicted},
mute = true,
can_trigger = function(self, event, target, player, data)
if not player.dead and target and not target.dead and data.card and not data.chain and
table.contains(data.card.skillNames, channi.name) then
local room = player.room
local card_event = room.logic:getCurrentEvent():findParent(GameEvent.UseCard)
if not card_event then return false end
local use = card_event.data[1]
if use.extra_data then
local channi_data = use.extra_data.channi_data
if channi_data and channi_data[1] == player.id and channi_data[2] == target.id then
self.cost_data = channi_data[3]
return true
end
end
end
end,
on_cost = Util.TrueFunc,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.Damage then
room:notifySkillInvoked(player, channi.name, "drawcard")
room:doIndicate(player.id, {target.id})
room:drawCards(target, self.cost_data, channi.name)
else
local cards = player.player_cards[Player.Hand]
if #cards > 0 then
if room:askForSkillInvoke(player,self.name,data,"#joy__channi_damaged") then
room:notifySkillInvoked(player, "joy__channi", "negative")
room:throwCard(cards,self.name,player)
return true
end
end
end
end
}
local nifu = fk.CreateTriggerSkill{
name = "joy__nifu",
anim_type = "drawcard",
frequency = Skill.Compulsory,
events = {fk.TurnEnd},
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and player:getHandcardNum() ~= 3
end,
on_use = function(self, event, target, player, data)
local n = player:getHandcardNum() - 3
if n < 0 then
player:drawCards(-n, self.name)
else
player.room:askForDiscard(player, n, n, false, self.name, false)
end
end,
}
Fk:addSkill(channi_viewas)
channi:addRelatedSkill(channi_delay)
yanfuren:addSkill(channi)
yanfuren:addSkill(nifu)
Fk:loadTranslationTable{
["joy__yanfuren"] = "严夫人",
["#joy__yanfuren"] = "霜天薄裳",
["joy__channi"] = "谗逆",
[":joy__channi"] = "出牌阶段限一次,你可以交给一名其他角色任意张手牌,然后该角色可以将至多等量张手牌当一张【决斗】使用。"..
"其因此使用【决斗】造成伤害后,其摸X张牌;其因此使用【决斗】受到伤害时,你可以弃置所有手牌(至少为1)防止此伤害。",
["joy__nifu"] = "匿伏",
[":joy__nifu"] = "锁定技,每个回合结束时,你将手牌摸至或弃置至三张。",
["#joy__channi-invoke"] = "谗逆:你可以将至多%arg张手牌当一张【决斗】使用<br>若对目标造成伤害你摸等量牌",
["#joy__channi_damaged"] = "馋逆:是否弃置所有手牌防止此【决斗】的伤害",
["joy__channi_viewas"] = "馋逆",
["#joy__channi_delay"] = "馋逆",
}
local xiahoulingnv = General(extension, "joy__xiahoulingnv", "wei", 4, 4, General.Female)
local fuping = fk.CreateViewAsSkill{
name = "joy__fuping",
anim_type = "special",
pattern = ".",
prompt = "#fuping-viewas",
interaction = function()
if type(Self:getMark("@$fuping")) ~= "table" then return end
local all_names, names = Self:getMark("@$fuping"), {}
local used_names = type(Self:getMark("fuping-turn")) == "table" and Self:getMark("fuping-turn") or {}
for _, name in ipairs(all_names) do
if not table.contains(used_names, name) then
local to_use = Fk:cloneCard(name)
to_use.skillName = "fuping"
if ((Fk.currentResponsePattern == nil and Self:canUse(to_use) and not Self:prohibitUse(to_use)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(to_use))) then
table.insertIfNeed(names, name)
end
end
end
if #names == 0 then return end
return UI.ComboBox {choices = names, all_choices = all_names}
end,
card_filter = function(self, to_select, selected)
return #selected < 1 and Fk:getCardById(to_select).type ~= Card.TypeBasic
end,
view_as = function(self, cards)
if #cards ~= 1 or not self.interaction.data then return end
local card = Fk:cloneCard(self.interaction.data)
card:addSubcard(cards[1])
card.skillName = self.name
return card
end,
enabled_at_play = function(self, player)
local names = player:getMark("@$fuping")
if type(names) ~= "table" then return false end
local used_names = type(player:getMark("fuping-turn")) == "table" and player:getMark("fuping-turn") or {}
for _, name in ipairs(names) do
if not table.contains(used_names, name) then
local to_use = Fk:cloneCard(name)
to_use.skillName = self.name
if player:canUse(to_use) and not player:prohibitUse(to_use) then
return true
end
end
end
end,
enabled_at_response = function(self, player, response)
local names = player:getMark("@$fuping")
if type(names) ~= "table" then return false end
local used_names = type(player:getMark("fuping-turn")) == "table" and player:getMark("fuping-turn") or {}
for _, name in ipairs(names) do
if not table.contains(used_names, name) then
local to_use = Fk:cloneCard(name)
to_use.skillName = self.name
if (Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(to_use)) then
return true
end
end
end
end,
before_use = function(self, player, useData)
local names = type(player:getMark("fuping-turn")) == "table" and player:getMark("fuping-turn") or {}
table.insert(names, useData.card.trueName)
player.room:setPlayerMark(player, "fuping-turn", names)
end,
}
local fuping_trigger = fk.CreateTriggerSkill{
name = "#joy__fuping_trigger",
events = {fk.CardUseFinished},
main_skill = fuping,
can_trigger = function(self, event, target, player, data)
if target == player or not player:hasSkill(fuping.name) or #player:getAvailableEquipSlots() == 0 then return false end
if data.card.type ~= Card.TypeEquip and table.contains(TargetGroup:getRealTargets(data.tos), player.id) then
local mark = player:getMark("@$fuping")
return type(mark) ~= "table" or not table.contains(mark, data.card.trueName)
end
end,
on_cost = function(self, event, target, player, data)
local all_choices = {"WeaponSlot", "ArmorSlot", "DefensiveRideSlot", "OffensiveRideSlot", "TreasureSlot"}
local subtypes = {Card.SubtypeWeapon, Card.SubtypeArmor, Card.SubtypeDefensiveRide, Card.SubtypeOffensiveRide, Card.SubtypeTreasure}
local choices = {}
for i = 1, 5, 1 do
if #player:getAvailableEquipSlots(subtypes[i]) > 0 then
table.insert(choices, all_choices[i])
end
end
table.insert(all_choices, "Cancel")
table.insert(choices, "Cancel")
local choice = player.room:askForChoice(player, choices, fuping.name, "#fuping-choice:::" .. data.card.trueName, false, all_choices)
if choice ~= "Cancel" then
self.cost_data = choice
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
player:broadcastSkillInvoke(fuping.name)
room:abortPlayerArea(player, {self.cost_data})
local mark = type(player:getMark("@$fuping")) == "table" and player:getMark("@$fuping") or {}
table.insertIfNeed(mark, data.card.trueName)
room:setPlayerMark(player, "@$fuping", mark)
end,
}
local fuping_targetmod = fk.CreateTargetModSkill{
name = "#joy__fuping_targetmod",
bypass_distances = function(self, player, skill, card, to)
return player:hasSkill(fuping.name) and #player:getAvailableEquipSlots() == 1
end,
}
local weilie = fk.CreateActiveSkill{
name = "joy__weilie",
anim_type = "support",
prompt = function ()
local max_times = type(Self:getMark("@$fuping")) == "table" and #Self:getMark("@$fuping") or 0
return "#joy__weilie-active:::" .. tostring(max_times - Self:usedSkillTimes("weilie", Player.HistoryGame) + 1)
end,
can_use = function(self, player)
local max_times = type(player:getMark("@$fuping")) == "table" and #player:getMark("@$fuping") or 0
return player:usedSkillTimes(self.name, Player.HistoryGame) <= max_times
end,
card_filter = function(self, to_select, selected, targets)
return #selected == 0
end,
target_filter = function(self, to_select, selected, cards)
return #selected == 0 and Fk:currentRoom():getPlayerById(to_select):isWounded()
end,
target_num = 1,
card_num = 1,
on_use = function(self, room, effect)
local from = room:getPlayerById(effect.from)
room:throwCard(effect.cards, self.name, from, from)
local target = room:getPlayerById(effect.tos[1])
room:recover({
who = target,
num = 1,
recoverBy = from,
skillName = self.name
})
if not target.dead then
room:drawCards(target, 1, self.name)
end
end,
}
fuping:addRelatedSkill(fuping_trigger)
fuping:addRelatedSkill(fuping_targetmod)
xiahoulingnv:addSkill(fuping)
xiahoulingnv:addSkill(weilie)
Fk:loadTranslationTable{
["joy__xiahoulingnv"] = "夏侯令女",
["#joy__xiahoulingnv"] = "女义如山",
["joy__fuping"] = "浮萍",
[":joy__fuping"] = "当其他角色以你为目标的基本牌或锦囊牌牌结算后,若你未记录此牌,你可以废除一个装备栏并记录此牌。"..
"你可以将一张非基本牌当记录的牌使用或打出(每种牌名每回合限一次)。若你的装备栏均已废除,你使用牌无距离限制。",
["joy__weilie"] = "炜烈",
[":joy__weilie"] = "每局游戏限一次,出牌阶段,你可以弃置一张牌令一名角色回复1点体力并摸一张牌。你每次发动〖浮萍〗记录牌名时,"..
"此技能可发动次数+1。",
["#joy__fuping_trigger"] = "浮萍",
["#joy__weilie-active"] = "发动 炜烈,弃置一张牌令一名已受伤的角色回复体力(剩余 %arg 次)并摸1张牌",
}
local luyusheng = General(extension, "joy__luyusheng", "wu", 3, 3, General.Female)
local zhente = fk.CreateTriggerSkill{
name = "joy__zhente",
anim_type = "defensive",
events = {fk.TargetConfirmed},
can_trigger = function(self, event, target, player, data)
if target == player and player:hasSkill(self) and data.from ~= player.id then
return data.card:isCommonTrick() or data.card.type == Card.TypeBasic
end
end,
on_cost = function(self, event, target, player, data)
if player.room:askForSkillInvoke(player, self.name, nil,
"#zhente-invoke:".. data.from .. "::" .. data.card:toLogString() .. ":" .. data.card:getColorString()) then
player.room:doIndicate(player.id, {data.from})
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
local to = room:getPlayerById(data.from)
local color = data.card:getColorString()
local choice = room:askForChoice(to, {
"zhente_negate::" .. tostring(player.id) .. ":" .. data.card.name,
"zhente_colorlimit:::" .. color
}, self.name)
if choice:startsWith("zhente_negate") then
table.insertIfNeed(data.nullifiedTargets, player.id)
else
local colorsRecorded = type(to:getMark("@zhente-turn")) == "table" and to:getMark("@zhente-turn") or {}
table.insertIfNeed(colorsRecorded, color)
room:setPlayerMark(to, "@zhente-turn", colorsRecorded)
end
end,
}
local zhente_prohibit = fk.CreateProhibitSkill{
name = "#joy__zhente_prohibit",
prohibit_use = function(self, player, card)
local mark = player:getMark("@zhente-turn")
return type(mark) == "table" and table.contains(mark, card:getColorString())
end,
}
local zhiwei = fk.CreateTriggerSkill{
name = "joy__zhiwei",
events = {fk.GameStart, fk.TurnStart, fk.AfterCardsMove, fk.Damage, fk.Damaged},
mute = true,
can_trigger = function(self, event, target, player, data)
if player:hasSkill(self) then
if event == fk.GameStart then
return true
elseif event == fk.TurnStart then
return player == target and player:getMark(self.name) == 0
elseif event == fk.AfterCardsMove then
if player.phase ~= Player.Discard then return false end
local zhiwei_id = player:getMark(self.name)
if zhiwei_id == 0 then return false end
local room = player.room
local to = room:getPlayerById(zhiwei_id)
if to == nil or to.dead then return false end
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip) and
room:getCardArea(info.cardId) == Card.DiscardPile then
return true
end
end
end
end
elseif event == fk.Damage then
return target ~= nil and not target.dead and player:getMark(self.name) == target.id
elseif event == fk.Damaged then
return target ~= nil and not target.dead and player:getMark(self.name) == target.id and not player:isKongcheng()
end
end
end,
on_cost = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnStart then
local targets = table.map(room:getOtherPlayers(player, false), Util.IdMapper)
local to = room:askForChoosePlayers(player, targets, 1, 1, "#zhiwei-choose", self.name, true, true)
if #to > 0 then
self.cost_data = to[1]
return true
end
return false
elseif event == fk.Damaged then
local card = room:askForCard(player,1,1,false,self.name,true,".","#joy__zhiwei-give")
if #card > 0 then
self.cost_data = card
return true
end
else
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.TurnStart then
room:notifySkillInvoked(player, self.name, "special")
player:broadcastSkillInvoke(self.name)
room:setPlayerMark(player, self.name, self.cost_data)
elseif event == fk.GameStart then
room:notifySkillInvoked(player, self.name, "special")
player:broadcastSkillInvoke(self.name)
local targets = table.map(room:getOtherPlayers(player, false), Util.IdMapper)
if #targets == 0 then return false end
local to = room:askForChoosePlayers(player, targets, 1, 1, "#zhiwei-choose", self.name, false, true)
if #to > 0 then
room:setPlayerMark(player, self.name, to[1])
end
elseif event == fk.AfterCardsMove then
local zhiwei_id = player:getMark(self.name)
if zhiwei_id == 0 then return false end
local to = room:getPlayerById(zhiwei_id)
if to == nil or to.dead then return false end
local cards = {}
for _, move in ipairs(data) do
if move.from == player.id and move.moveReason == fk.ReasonDiscard then
for _, info in ipairs(move.moveInfo) do
if (info.fromArea == Card.PlayerHand or info.fromArea == Card.PlayerEquip) and
room:getCardArea(info.cardId) == Card.DiscardPile then
table.insertIfNeed(cards, info.cardId)
end
end
end
end
if #cards > 0 then
player:showCards(cards)
if room:askForSkillInvoke(player,self.name,data,"#joy__zhiwei-discard") then
room:notifySkillInvoked(player, self.name, "support")
player:broadcastSkillInvoke(self.name)
room:setPlayerMark(player, "@joy__zhiwei", to.general)
room:moveCards({
ids = cards,
to = zhiwei_id,
toArea = Card.PlayerHand,
moveReason = fk.ReasonPrey,
proposer = player.id,
skillName = self.name,
})
end
end
elseif event == fk.Damage then
room:notifySkillInvoked(player, self.name, "drawcard")
player:broadcastSkillInvoke(self.name)
room:setPlayerMark(player, "@joy__zhiwei", target.general)
room:drawCards(player, 1, self.name)
elseif event == fk.Damaged then
local card = self.cost_data[1]
if not target.dead then
room:obtainCard(target,card,false,fk.ReasonGive)
end
end
end,
refresh_events = {fk.BuryVictim},
can_refresh = function(self, event, target, player, data)
return player:getMark(self.name) == target.id
end,
on_refresh = function(self, event, target, player, data)
local room = player.room
room:setPlayerMark(player, self.name, 0)
room:setPlayerMark(player, "@joy__zhiwei", 0)
end,
}
zhente:addRelatedSkill(zhente_prohibit)
luyusheng:addSkill(zhente)
luyusheng:addSkill(zhiwei)
Fk:loadTranslationTable{
["joy__luyusheng"] = "陆郁生",
["#joy__luyusheng"] = "义姑",
["joy__zhente"] = "贞特",
[":joy__zhente"] = "当你成为其他角色使用基本牌或普通锦囊牌的目标后,你可令其选择一项:1.本回合不能再使用此颜色的牌;2.此牌对你无效。",
["joy__zhiwei"] = "至微",
[":joy__zhiwei"] = "游戏开始时,你选择一名其他角色,该角色造成伤害后,你摸一张牌;该角色受到伤害后,你可以给予其一张手牌。"..
"你弃牌阶段弃置的牌可以给予该角色。准备阶段,若场上没有“至微”角色,你可以重新选择一名其他角色。",
["#joy__zhiwei-give"] = "至微:是否给予“至微”角色一张手牌?",
["#joy__zhiwei-discard"] = "至微:是否将你弃牌阶段弃置的牌全部给予“至微”角色?",
["@joy__zhiwei"] = "至微",
["$joy__zhente1"] = " ",
["$joy__zhente2"] = " ",
["$joy__zhiwei1"] = " ",
["$joy__zhiwei2"] = " ",
["~joy__luyusheng"] = " ",
}
local zhangning = General(extension, "joy__zhangning", "qun", 3, 3, General.Female)
local tianze = fk.CreateTriggerSkill{
name = "joy__tianze",
events = {fk.CardUseFinished},
anim_type = "offensive",
can_trigger = function(self, event, target, player, data)
return player:hasSkill(self) and target ~= player and target.phase == Player.Play and data.card.color == Card.Black and
player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 and not player:isNude()
end,
on_cost = function(self, event, target, player, data)
local card = player.room:askForDiscard(player, 1, 1, true, self.name, true, ".|.|spade,club|hand,equip", "#joy__tianze-invoke::"..target.id, true)
if #card > 0 then
self.cost_data = card
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
room:doIndicate(player.id, {target.id})
room:throwCard(self.cost_data, self.name, player, player)
room:damage{ from = player, to = target, damage = 1, skillName = self.name}
end,
}
local tianze_draw = fk.CreateTriggerSkill{
name = "#joy__tianze_draw",
events = {fk.FinishJudge},
anim_type = "drawcard",
mute = true,
can_trigger = function(self, event, target, player, data)
return target ~= player and player:hasSkill(tianze.name) and data.card.color == Card.Black
end,
on_cost = function() return true end,
on_use = function(self, event, target, player, data)
player:broadcastSkillInvoke(tianze.name)
player.room:notifySkillInvoked(player, tianze.name, self.anim_type)
player.room:drawCards(player, 1, self.name)
end,
}
local difa = fk.CreateActiveSkill{
name = "joy__difa",
anim_type = "drawcard",
prompt = "#joy__difa",
can_use = function(self, player)
return not player:isKongcheng() and player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
end,
card_num = 1,
card_filter = function(self, to_select, selected)
return #selected < 1 and Fk:getCardById(to_select).color == Card.Red
end,
target_num = 0,
on_use = function(self, room, effect)
local player = room:getPlayerById(effect.from)
room:moveCards({
ids = effect.cards,
from = player.id,
toArea = Card.DiscardPile,
skillName = self.name,
moveReason = fk.ReasonPutIntoDiscardPile,
proposer = player.id
})
if player.dead then return end
player:drawCards(1,self.name)
local allCardMapper = {}
local allCardNames = {}
for _, id in ipairs(Fk:getAllCardIds()) do
local card = Fk:getCardById(id)
if card.type == Card.TypeTrick and room:getCardArea(id) == Card.DrawPile then
if allCardMapper[card.name] == nil then
allCardMapper[card.name] = {}
table.insert(allCardNames, card.name)
end
table.insert(allCardMapper[card.name], id)
end
end
if #allCardNames == 0 then return end
local cardName = room:askForChoice(player, allCardNames, self.name)
room:moveCardTo(table.random(allCardMapper[cardName]), Card.PlayerHand, player, fk.ReasonPrey, self.name)
end,
}
tianze:addRelatedSkill(tianze_draw)
zhangning:addSkill(tianze)
zhangning:addSkill(difa)
Fk:loadTranslationTable{
["joy__zhangning"] = "张宁",
["#joy__zhangning"] = "大贤后人",
["joy__tianze"] = "天则",
[":joy__tianze"] = "每回合限一次,当其他角色于其出牌阶段内使用一张黑色牌结算后,你可以弃置一张黑色牌对其造成1点伤害;其他角色的黑色判定牌生效后,你摸一张牌。",
["joy__difa"] = "地法",
[":joy__difa"] = "出牌阶段限一次,你可以重铸一张红色牌,然后声明一种锦囊牌的牌名,从牌堆获得一张。",
["#joy__tianze-invoke"] = "天则:每回合限一次,你可弃置一张黑色牌来对%dest造成1点伤害",
["#joy__difa"] = "地法:你可重铸一张红色牌,然后检索一张锦囊牌",
["$joy__tianze1"] = " ",
["$joy__tianze2"] = " ",
["$joy__difa1"] = " ",
["$joy__difa2"] = " ",
["~joy__zhangning"] = " ",
}
local bianfuren = General(extension, "joy__bianfuren", "wei", 3, 3, General.Female)
local wanwei = fk.CreateTriggerSkill{
name = "joy__wanwei",
anim_type = "support",
events = {fk.EnterDying, fk.AfterDying},
can_trigger = function(self, event, target, player, data)
if event == fk.EnterDying then
return player:hasSkill(self) and target ~= player and not player:isNude() and
player:usedSkillTimes(self.name, Player.HistoryRound) == 0
else
return not target.dead and data.extra_data and data.extra_data.ofl__fuding and data.extra_data.ofl__fuding[1] == player.id and
not player.dead
end
end,
on_cost = function(self, event, target, player, data)
if event == fk.EnterDying then
local cards = player.room:askForCard(player, 1, 5, true, self.name, true, ".", "#joy__wanwei-invoke::"..target.id)
if #cards > 0 then
self.cost_data = cards
return true
end
else
return true
end
end,
on_use = function(self, event, target, player, data)
local room = player.room
if event == fk.EnterDying then
room:moveCardTo(self.cost_data, Card.PlayerHand, target, fk.ReasonGive, self.name)
data.extra_data = data.extra_data or {}
data.extra_data.ofl__fuding = {player.id, #self.cost_data}
else
player:drawCards(data.extra_data.ofl__fuding[2], self.name)
if player:isWounded() and not player.dead then
room:recover{
who = player,
num = 1,
recoverBy = player,
skillName = self.name
}
end
end
end,
}
local yuejian = fk.CreateViewAsSkill{
name = "joy__yuejian",
pattern = ".|.|.|.|.|basic",
prompt = "#joy__yuejian",
interaction = function()
local names = {}
for _, id in ipairs(Fk:getAllCardIds()) do
local card = Fk:getCardById(id)
if card.type == Card.TypeBasic and not card.is_derived then
local to_use = Fk:cloneCard(card.name)
if ((Fk.currentResponsePattern == nil and Self:canUse(to_use) and not Self:prohibitUse(to_use)) or
(Fk.currentResponsePattern and Exppattern:Parse(Fk.currentResponsePattern):match(to_use))) then
table.insertIfNeed(names, card.name)
end
end
end
return UI.ComboBox { choices = names }
end,
card_filter = function(self, to_select, selected)
return false
end,
view_as = function(self, cards)
if not self.interaction.data then return nil end
local card = Fk:cloneCard(self.interaction.data)
card.skillName = self.name
return card
end,
enabled_at_play = function(self, player)
return player:getMark("joy__yuejian-turn") == 0
end,
enabled_at_response = function(self, player, response)
return not response and player:getMark("joy__yuejian-turn") == 0
end,
}
local yuejian_record = fk.CreateTriggerSkill{
name = "#joy__yuejian_record",
refresh_events = {fk.AfterCardUseDeclared, fk.EventAcquireSkill},
can_refresh = function(self, event, target, player, data)
if event == fk.AfterCardUseDeclared then
return target == player and data.card.type == Card.TypeBasic and player:getMark("joy__yuejian-turn") == 0
elseif target == player and data == self and player:getMark("joy__yuejian-turn") == 0 then
return #player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function(e)
local use = e.data[1]
return use.from == player.id and use.card.type == Card.TypeBasic
end, Player.HistoryRound) > 0
end
end,
on_refresh = function(self, event, target, player, data)
player.room:setPlayerMark(player, "joy__yuejian-turn", 1)
end,
}
local yuejian_maxcards = fk.CreateMaxCardsSkill{
name = "#joy__yuejian_maxcards",
frequency = Skill.Compulsory,
correct_func = function(self, player)
if player:hasSkill("joy__yuejian") then
return player.maxHp
else
return 0
end
end,
}
yuejian:addRelatedSkill(yuejian_record)
yuejian:addRelatedSkill(yuejian_maxcards)
bianfuren:addSkill(wanwei)
bianfuren:addSkill(yuejian)
Fk:loadTranslationTable{
["joy__bianfuren"] = "卞夫人",
["#joy__bianfuren"] = "内助贤后",
["joy__wanwei"] = "挽危",
[":joy__wanwei"] = "每轮限一次,当一名其他角色进入濒死状态时,你可以交给其至多五张牌,若如此做,当其脱离濒死状态时,你摸等量牌并回复1点体力。",
["joy__yuejian"] = "约俭",
[":joy__yuejian"] = "你的手牌上限+X(X为你的体力上限)。当你需使用一张基本牌时,若你本回合未使用过基本牌,你可以视为使用之。",
["#joy__wanwei-invoke"] = "挽危:你可以交给 %dest 至多五张牌,其脱离濒死状态后你摸等量牌并回复1点体力",
["#joy__yuejian"] = "约俭:你可以视为使用一张基本牌",
}
return extension
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化