diff --git a/image/generals/joy__godlvmeng.jpg b/image/generals/joy__godlvmeng.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f40921e9c57ef56b49a9ff5b017fb785c05e3185 Binary files /dev/null and b/image/generals/joy__godlvmeng.jpg differ diff --git a/image/generals/joy__sunyi.jpg b/image/generals/joy__sunyi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..87409829eb9fd608cee10ca38abdd69ee8310494 Binary files /dev/null and b/image/generals/joy__sunyi.jpg differ diff --git a/image/generals/joy__xushi.jpg b/image/generals/joy__xushi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7977dd011965d4ed5c9fc6a167d7b79ebb9b7d37 Binary files /dev/null and b/image/generals/joy__xushi.jpg differ diff --git a/image/generals/joyex__caocao.jpg b/image/generals/joyex__caocao.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5c04a782d2341a2557df73ac8812e21e46dc0611 Binary files /dev/null and b/image/generals/joyex__caocao.jpg differ diff --git a/image/generals/joyex__huanggai.jpg b/image/generals/joyex__huanggai.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fdecacfa0c323d07f23fc115be623f69808ce4af Binary files /dev/null and b/image/generals/joyex__huanggai.jpg differ diff --git a/image/generals/joyex__lvmeng.jpg b/image/generals/joyex__lvmeng.jpg new file mode 100644 index 0000000000000000000000000000000000000000..11cdae41bbcb9565fe7d7206c1f5f060ec465c5b Binary files /dev/null and b/image/generals/joyex__lvmeng.jpg differ diff --git a/image/generals/joyex__machao.jpg b/image/generals/joyex__machao.jpg new file mode 100644 index 0000000000000000000000000000000000000000..af9278c6212b4735bd0a1b5bf3ea776ac8c37118 Binary files /dev/null and b/image/generals/joyex__machao.jpg differ diff --git a/image/generals/joyex__sunce.jpg b/image/generals/joyex__sunce.jpg new file mode 100644 index 0000000000000000000000000000000000000000..81acbb32190f5d210629100d42630619d71569b3 Binary files /dev/null and b/image/generals/joyex__sunce.jpg differ diff --git a/image/generals/joysp__diaochan.jpg b/image/generals/joysp__diaochan.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b9ececdc7571772f16088d1bbc1a0cdb9b4c299d Binary files /dev/null and b/image/generals/joysp__diaochan.jpg differ diff --git a/joy_ex.lua b/joy_ex.lua index f67cdbec0ea41ebd4e0be220bbc34313092b2dae..13362e782d1330abb108d1c8bd6e7b3fc53b9b85 100644 --- a/joy_ex.lua +++ b/joy_ex.lua @@ -22,10 +22,17 @@ local yajiao = fk.CreateTriggerSkill{ end end end, + on_cost = function(self,event,target,player,data) + if event == fk.EventPhaseStart then + return true + else + return player.room:askForSkillInvoke(player,self.name,data) + end + end, on_use = function(self, event, target, player, data) local room = player.room if event == fk.EventPhaseStart then - player:drawCards(player:usedSkillTimes("ex__longdan", Player.HistoryTurn) ,self.name) + player:drawCards(1 ,self.name) else local cards = room:getNCards(1) player:showCards(cards) @@ -47,6 +54,7 @@ Fk:loadTranslationTable{ } + local huangyueying = General(extension, "joyex__huangyueying", "shu", 3, 3, General.Female) local joyex__jizhi = fk.CreateTriggerSkill{ name = "joyex__jizhi", @@ -473,5 +481,256 @@ Fk:loadTranslationTable{ ["#joy__shenglun-damage"] = "胜论:对一名角色造成1点伤害", } +local joyex__tieji = fk.CreateTriggerSkill{ + name = "joyex__tieji", + anim_type = "offensive", + events = {fk.TargetSpecified}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and + data.card.trueName == "slash" + end, + on_use = function(self, event, target, player, data) + local room = player.room + local to = room:getPlayerById(data.to) + room:addPlayerMark(to, "@@joytieji-turn") + room:addPlayerMark(to, MarkEnum.UncompulsoryInvalidity .. "-turn") + local judge = { + who = player, + reason = self.name, + pattern = ".", + } + room:judge(judge) + if judge.card.color == Card.Red then + data.disresponsive = true + elseif judge.card.color == Card.Black then + if not player.dead then + player:drawCards(2, self.name) + end + end + end, +} + +local joyex__machao = General:new(extension, "joyex__machao", "shu", 4) +joyex__machao:addSkill("joy__yuma") +joyex__machao:addSkill(joyex__tieji) +Fk:loadTranslationTable{ + ["joyex__machao"] = "界马超", + ["joyex__tieji"] = "铁骑", + [":joyex__tieji"] = "当你使用【杀】指定目标后,你可令其本回合非锁定技失效,然后你进行判定,若为红色,该角色不能使用【闪】;黑色,你摸两张牌。", + ["joyex__tieji_invalidity"] = "铁骑", + ["@@joytieji-turn"] = "铁骑", +} + +local caocao = General:new(extension, "joyex__caocao", "wei", 4) +local jianxiong = fk.CreateTriggerSkill{ + name = "joyex__jianxiong", + anim_type = "masochism", + events = {fk.Damaged}, + can_trigger = function(self, event, target, player, data) + if target == player and player:hasSkill(self) then + return true + end + end, + on_use = function(self, event, target, player, data) + local choices = {"drawCards1","drawCards2"} + local choice = player.room:askForChoice(player,choices,self.name) + if choice == "drawCards1" and not player.dead then + if data.card and target.room:getCardArea(data.card) == Card.Processing then + player.room:obtainCard(player.id, data.card, true, fk.ReasonJustMove) + end + player.room:drawCards(player,1,self.name) + elseif not player.dead then + player.room:drawCards(player,2,self.name) + end + + end, +} + +local hujia = fk.CreateTriggerSkill{ + name = "joyex__hujia$", + anim_type = "defensive", + events = {fk.AskForCardUse, fk.AskForCardResponse}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and + (data.cardName == "jink" or (data.pattern and Exppattern:Parse(data.pattern):matchExp("jink|0|nosuit|none"))) and + (data.extraData == nil or data.extraData.hujia_ask == nil) and + not table.every(player.room.alive_players, function(p) + return p == player or p.kingdom ~= "wei" + end) + end, + on_use = function(self, event, target, player, data) + local room = player.room + for _, p in ipairs(room:getOtherPlayers(player)) do + if p:isAlive() and p.kingdom == "wei" then + local cardResponded = room:askForResponse(p, "jink", "jink", "#joyex__hujia-ask:" .. player.id, true, {hujia_ask = true}) + if cardResponded then + room:responseCard({ + from = p.id, + card = cardResponded, + skipDrop = true, + }) + + if event == fk.AskForCardUse then + data.result = { + from = player.id, + card = Fk:cloneCard('jink'), + } + data.result.card:addSubcards(room:getSubcardsByRule(cardResponded, { Card.Processing })) + data.result.card.skillName = self.name + + if data.eventData then + data.result.toCard = data.eventData.toCard + data.result.responseToEvent = data.eventData.responseToEvent + end + else + data.result = Fk:cloneCard('jink') + data.result:addSubcards(room:getSubcardsByRule(cardResponded, { Card.Processing })) + data.result.skillName = self.name + end + if player:getMark("joyex__hujia-turn") == 0 then + if p.room:askForSkillInvoke(p,self.name,nil,"#joyex__hujia-drawcard:" .. player.id) and not player.dead then + player.room:drawCards(player,1,self.name) + player.room:setPlayerMark(player,"joyex__hujia-turn",1) + end + end + return true + end + end + end + end, +} + + +caocao:addSkill(jianxiong) +caocao:addSkill(hujia) +Fk:loadTranslationTable{ + ["joyex__caocao"] = "界曹操", + + ["joyex__jianxiong"] = "奸雄", + [":joyex__jianxiong"] = "当你每受到1点伤害后,你可以摸一张牌并获得对你造成伤害的牌;或摸两张牌", + ["joyex__hujia"] = "护驾", + [":joyex__hujia"] = "主公技,其他魏势力角色可以替你使用或打出【闪】。".. + "其他魏势力角色若以此法使用或打出【闪】时,可以令你摸一张牌,每回合限一张。", + + ["drawCards1"] = "奸雄:摸一张牌并获得对你造成伤害的牌", + ["drawCards2"] = "奸雄:摸两张牌", + + ["#joyex__hujia-ask"] = "护驾:是否为 %src 打出一张闪,若打出可令其摸一张牌(每回合限一张)。", + ["#joyex__hujia-drawcard"] = "护驾:是否令 %src 摸一张牌?" + +} + +local huanggai = General(extension, "joyex__huanggai", "wu", 4) +local zhaxiang_targetmod = fk.CreateTargetModSkill{ + name = "#joyex__zhaxiang_targetmod", + residue_func = function(self, player, skill, scope) + if skill.trueName == "slash_skill" and player:hasSkill(self) then + return 1 + end + return 0 + end, + distance_limit_func = function(self, player, skill, card) + if skill.trueName == "slash_skill" and card.color == Card.Red and player:hasSkill(self) then + return 999 + end + end, +} +local zhaxiang = fk.CreateTriggerSkill{ + name = "joyex__zhaxiang", + mute = true, + frequency = Skill.Compulsory, + events = {fk.TargetSpecified}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and + data.card.trueName == "slash" and data.card.color == Card.Red + end, + on_use = function(self, event, target, player, data) + data.disresponsive = true + end, +} +zhaxiang:addRelatedSkill(zhaxiang_targetmod) +huanggai:addSkill("kurou") +huanggai:addSkill(zhaxiang) +Fk:loadTranslationTable{ + ["joyex__huanggai"] = "界黄盖", + ["joyex__zhaxiang"] = "诈降", + [":joyex__zhaxiang"] = "锁定技,你使用【杀】次数上限+1、使用红色【杀】无距离限制且不可被响应。", + +} + +local lvmeng = General(extension, "joyex__lvmeng", "wu", 4) +local keji = fk.CreateTriggerSkill{ + name = "joy__keji", + anim_type = "defensive", + events = {fk.EventPhaseChanging}, + can_trigger = function(self, event, target, player, data) + if target == player and player:hasSkill(self) and data.to == Player.Discard then + local room = player.room + local logic = room.logic + local e = logic:getCurrentEvent():findParent(GameEvent.Turn, true) + if e == nil then return false end + local end_id = e.id + local events = logic.event_recorder[GameEvent.UseCard] or Util.DummyTable + for i = #events, 1, -1 do + e = events[i] + if e.id <= end_id then break end + local use = e.data[1] + if use.from == player.id and use.card.trueName == "slash" then + return false + end + end + events = logic.event_recorder[GameEvent.RespondCard] or Util.DummyTable + for i = #events, 1, -1 do + e = events[i] + if e.id <= end_id then break end + local resp = e.data[1] + if resp.from == player.id and resp.card.trueName == "slash" then + return false + end + end + return true + end + end, + on_use = function(self, event, target, player, data) + if not player.dead then + player:drawCards(1,self.name) + end + return true + end +} +local qinxue = fk.CreateTriggerSkill{ + name = "joyex__qinxue", + 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.Finish and + player:usedSkillTimes(self.name, Player.HistoryGame) == 0 + end, + can_wake = function(self, event, target, player, data) + return #player.player_cards[Player.Hand] >= player.hp*3 + end, + on_use = function(self, event, target, player, data) + local room = player.room + if player:isWounded() then + local n = player.maxHp - player.hp + room:changeMaxHp(player, -n) + end + room:handleAddLoseSkills(player, "-joy__keji", nil) + room:handleAddLoseSkills(player, "joy__gongxin", nil) + end, +} +lvmeng:addSkill(keji) +lvmeng:addSkill(qinxue) +lvmeng:addRelatedSkill("joy__gongxin") +Fk:loadTranslationTable{ + ["joyex__lvmeng"] = "界吕蒙", + + ["joy__keji"] = "克己", + [":joy__keji"] = "若你未于出牌阶段内打出或使用过【杀】,你可以跳过弃牌阶段并摸一张牌。", + ["joyex__qinxue"] = "勤学", + [":joyex__qinxue"] = "觉醒技,结束阶段,若你的手牌数大于等于体力值的3倍,你将体力上限减少至当前体力值,然后获得技能〖攻心〗失去〖克己〗。", + +} return extension diff --git a/joy_god.lua b/joy_god.lua index 41956bc6e68125b68ffd25c9217a74a59c9f6574..ef3cab12fed6cbf43753da332b18b1f4bc6c0bc9 100644 --- a/joy_god.lua +++ b/joy_god.lua @@ -97,12 +97,13 @@ local joy__jilue = fk.CreateTriggerSkill{ end, on_use = function(self, event, target, player, data) local room = player.room - room:removePlayerMark(player, "@godsimayi_bear", 1) room:notifySkillInvoked(player, "jilue", (event == fk.CardUsing or event == fk.AfterSkillEffect) and "drawcard" or "control") if event == fk.AskForRetrial then + room:removePlayerMark(player, "@godsimayi_bear", 1) player:broadcastSkillInvoke("guicai") room:retrial(self.cost_data, player, data, "uicai") elseif event == fk.Damaged then + room:removePlayerMark(player, "@godsimayi_bear", 1) player:broadcastSkillInvoke("fangzhu") local to = player.room:getPlayerById(self.cost_data) to:drawCards(1, "joy__fangzhu") @@ -110,9 +111,11 @@ local joy__jilue = fk.CreateTriggerSkill{ to:turnOver() end elseif event == fk.CardUsing then + room:removePlayerMark(player, "@godsimayi_bear", 1) player:broadcastSkillInvoke("jizhi") player:drawCards(1, "jizhi") elseif event == fk.EnterDying then + room:removePlayerMark(player, "@godsimayi_bear", 1) data.extra_data = data.extra_data or {} data.extra_data.joy__jilue_wansha = player.id room:handleAddLoseSkills(player, "joy__wansha") @@ -1818,7 +1821,7 @@ local qinyin = fk.CreateTriggerSkill{ on_use = function(self, event, target, player, data) local room = player.room - local choices = {"loseHp","drawcard"} + local choices = {"loseHp","Alldrawcard1"} if not table.every(room.alive_players, function (p) return not p:isWounded() end) then table.insert(choices, 1, "recover") end @@ -1838,7 +1841,7 @@ local qinyin = fk.CreateTriggerSkill{ for _, p in ipairs(room:getAlivePlayers()) do if not p.dead then room:loseHp(p, 1, self.name) end end - elseif choice == "drawcard" then + elseif choice == "Alldrawcard1" then for _, p in ipairs(room:getAlivePlayers()) do if not p.dead then room:drawCards(p, 1, self.name) end end @@ -1884,7 +1887,7 @@ Fk:loadTranslationTable{ [":joy__yeyan"] = "出牌阶段开始时,你可以选择一名其他角色对其造成1点火焰伤害。", ["#joy__yeyan-choose"] = "业炎:选择1名其他角色对其造成1点火焰伤害", - ["drawcard"] = "各摸一张牌" + ["Alldrawcard1"] = "各摸一张牌" } local godcaocao = General(extension, "joy__godcaocao", "god", 3) @@ -1911,11 +1914,19 @@ local guixin = fk.CreateTriggerSkill{ local room = player.room local get = {} room:doIndicate(player.id, table.map(room.alive_players, Util.IdMapper)) - local choises = {"h","e","j"} + local choises = {"$Hand","$Equip","$Judge"} local choice = room:askForChoice(player,choises,self.name,"#joy__guixin-choose") + local z = "hej" + if choice == "$Hand" then + z = "h" + elseif choice == "$Equip" then + z = "e" + elseif choice == "$Judge" then + z = "j" + end for _, p in ipairs(room:getOtherPlayers(player, true)) do - if #p:getCardIds(choice) ~= 0 then - local id = table.random(p:getCardIds(choice)) + if #p:getCardIds(z) ~= 0 then + local id = table.random(p:getCardIds(z)) room:obtainCard(player, id, false, fk.ReasonPrey) table.insert(get, id) elseif not p:isAllNude() then @@ -1939,12 +1950,89 @@ Fk:loadTranslationTable{ ["joy__guixin"] = "归心", [":joy__guixin"] = "当你受到1点伤害后,你可随机获得所有其他角色区域中的一张牌,如果获得牌大于4张且你为正面,你翻面。", ["#joy__guixin-choose"] = "归心:请选择优先获取的区域", - ["h"] = "手牌区", - ["e"] = "装备区", - ["j"] = "判定区", } +local godlvmeng = General(extension, "joy__godlvmeng", "god", 3) +local shelie = fk.CreateTriggerSkill{ + name = "joy__shelie", + anim_type = "drawcard", + frequency = Skill.Compulsory, + events = {fk.EventPhaseStart}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and player.phase == Player.Draw + end, + on_use = function(self, event, target, player, data) + local room = player.room + local cards = room:getNCards(5) + room:moveCards({ + ids = cards, + toArea = Card.Processing, + moveReason = fk.ReasonPut, + }) + local get = room:askForPoxi(player, "shelie", { + { self.name, cards }, + }, nil, false) + if #get > 0 then + local dummy = Fk:cloneCard("dilu") + dummy:addSubcards(get) + room:obtainCard(player, dummy, true, fk.ReasonPrey) + end + cards = table.filter(cards, function(id) return room:getCardArea(id) == Card.Processing end) + if #cards > 0 then + room:moveCards({ + ids = cards, + toArea = Card.DiscardPile, + moveReason = fk.ReasonPutIntoDiscardPile, + }) + end + return true + end, +} +local gongxin = fk.CreateTriggerSkill{ + name = "joy__gongxin", + events = {fk.TargetSpecified}, + can_trigger = function(self, event, target, player, data) + local to = player.room:getPlayerById(data.to) + if player:hasSkill(self) and data.firstTarget and #AimGroup:getAllTargets(data.tos) == 1 and + not to:isNude() and player:usedSkillTimes(self.name, Player.HistoryTurn) == 0 then + return to == player or (to ~= player and target == player) + end + end, + on_use = function(self, event, target, player, data) + local room = player.room + local to = room:getPlayerById(data.to) + local p = target + if target == player then + p = to + end + player:broadcastSkillInvoke(self.name) + local cards = p.player_cards[p.Hand] + local red = table.filter(cards, function (id) return Fk:getCardById(id).color == Card.Red end) + local ids, choice = U.askforChooseCardsAndChoice(player, red, {"gongxin_obtaincard", "gongxin_put"}, + self.name, "#joy__gongxin-view::" .. p.id, {"Cancel"}, 1, 1, cards) + local card = ids[1] + if choice == "gongxin_obtaincard" then + room:obtainCard(player,card,true,fk.ReasonPrey) + elseif choice == "gongxin_put" then + room:moveCardTo(ids, Card.DrawPile, nil, fk.ReasonPut, self.name, nil, true) + end + end, +} +godlvmeng:addSkill(shelie) +godlvmeng:addSkill(gongxin) +Fk:loadTranslationTable{ + ["joy__godlvmeng"] = "神吕蒙", + ["#joy__godlvmeng"] = "圣光之国士", + ["joy__shelie"] = "涉猎", + [":joy__shelie"] = "锁定技,摸牌阶段,你改为亮出牌堆顶五张牌,获得不同花色的牌各一张。", + ["joy__gongxin"] = "攻心", + [":joy__gongxin"] = "当你使用牌指定唯一目标或成为其他角色使用牌的唯一目标后,你可以观看一名其他角色的手牌并可以展示其中的一张红色牌,".. + "选择:1. 弃置此牌;2. 将此牌置于牌堆顶。", + ["#joy__gongxin-active"] = "是否发动 攻心,观看%dest的手牌", + ["#joy__gongxin-view"] = "攻心:观看%dest的手牌", + ["gongxin_obtaincard"] = "获得此牌", +} return extension diff --git a/joy_shzl.lua b/joy_shzl.lua index 606c3c665f70ab791c4919abd218f93357b0c424..a204db1b83abc35e0cb177dddfc2f831c9b1cc9a 100644 --- a/joy_shzl.lua +++ b/joy_shzl.lua @@ -738,4 +738,150 @@ Fk:loadTranslationTable{ } +local sunce = General(extension, "joyex__sunce", "wu", 4) +local jiang = fk.CreateTriggerSkill{ + name = "joyex__jiang", + anim_type = "drawcard", + events ={fk.TargetSpecified, fk.TargetConfirmed}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and data.firstTarget and + (data.card.trueName == "slash"or data.card.name == "duel") + end, + on_use = function(self, event, target, player, data) + player:drawCards(1, self.name) + end, +} +local hunzi = fk.CreateTriggerSkill{ + name = "joyex__hunzi", + frequency = Skill.Wake, + events = {fk.GameStart,fk.HpChanged}, + can_trigger = function(self, event, target, player, data) + return player:hasSkill(self) and + player:usedSkillTimes(self.name, Player.HistoryGame) == 0 + end, + can_wake = function(self, event, target, player, data) + return player.hp == 1 + end, + on_use = function(self, event, target, player, data) + local room = player.room + room:changeMaxHp(player, -1) + room:handleAddLoseSkills(player, "ex__yingzi|joy__yinghun", nil, true, false) + end, +} +local yinghun = fk.CreateTriggerSkill{ + name = "joy__yinghun", + anim_type = "control", + mute = true, + events = {fk.EventPhaseStart}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and player.phase == Player.Start + end, + on_cost = function(self, event, target, player, data) + local to + if player:getLostHp() > 0 then + to = player.room:askForChoosePlayers(player, table.map(player.room:getOtherPlayers(player), Util.IdMapper), 1, 1, "#joy__yinghun-discard:::"..player:getLostHp(), self.name, true) + else + to = player.room:askForChoosePlayers(player, table.map(player.room:getOtherPlayers(player), Util.IdMapper), 1, 1, "#joy__yinghun-drawcard", self.name, true) + end + if #to > 0 then + self.cost_data = to[1] + return true + end + end, + on_use = function (self,event,target,player,data) + local p = player.room:getPlayerById(self.cost_data) + if not p.dead then + player.room:drawCards(p,1,self.name) + end + if not p.dead and player:getLostHp() > 0 then + player.room:askForDiscard(p,player:getLostHp(),player:getLostHp()) + end + end +} +local zhiba = fk.CreateTriggerSkill{ + name = "joyex__zhiba$", + mute = true, + refresh_events = {fk.EventAcquireSkill, fk.EventLoseSkill, fk.BuryVictim, fk.AfterPropertyChange}, + can_refresh = function(self, event, target, player, data) + if event == fk.EventAcquireSkill or event == fk.EventLoseSkill then + return data == self + elseif event == fk.BuryVictim then + return target:hasSkill(self, true, true) + elseif event == fk.AfterPropertyChange then + return target == player + end + end, + on_refresh = function(self, event, target, player, data) + local room = player.room + local attached_huangtian = player.kingdom == "wu" and table.find(room.alive_players, function (p) + return p ~= player and p:hasSkill(self, true) + end) + if attached_huangtian and not player:hasSkill("joyex__zhiba_other&", true, true) then + room:handleAddLoseSkills(player, "joyex__zhiba_other&", nil, false, true) + elseif not attached_huangtian and player:hasSkill("joyex__zhiba_other&", true, true) then + room:handleAddLoseSkills(player, "-joyex__zhiba_other&", nil, false, true) + end + end, +} +local zhiba_other = fk.CreateActiveSkill{ + name = "joyex__zhiba_other&", + anim_type = "support", + prompt = "#joyex__zhiba-active", + mute = true, + can_use = function(self, player) + if player:usedSkillTimes(self.name, Player.HistoryPhase) < 1 and player.kingdom == "wu" then + return table.find(Fk:currentRoom().alive_players, function(p) return p:hasSkill("joyex__zhiba") and p ~= player end) + end + return false + end, + card_num = 1, + card_filter = function(self, to_select, selected) + return #selected < 1 and (Fk:getCardById(to_select).name == "slash" or Fk:getCardById(to_select).name == "duel") + end, + target_num = 0, + on_use = function(self, room, effect) + local player = room:getPlayerById(effect.from) + local targets = table.filter(room.alive_players, function(p) return p:hasSkill("joyex__zhiba") and p ~= player end) + local target + if #targets == 1 then + target = targets[1] + else + target = room:getPlayerById(room:askForChoosePlayers(player, table.map(targets, Util.IdMapper), 1, 1, nil, self.name, false)[1]) + end + if not target then return false end + room:notifySkillInvoked(player, "joyex__zhiba") + player:broadcastSkillInvoke("joyex__zhiba") + room:doIndicate(effect.from, { target.id }) + room:moveCardTo(effect.cards, Player.Hand, target, fk.ReasonGive, self.name, nil, true) + end, +} +sunce:addSkill(jiang) +sunce:addSkill(hunzi) +sunce:addRelatedSkill("ex__yingzi") +sunce:addRelatedSkill(yinghun) +sunce:addSkill(zhiba) +Fk:addSkill(zhiba_other) +Fk:loadTranslationTable{ + ["joyex__sunce"] = "界孙策", + ["#joyex__sunce"] = "江东的小霸王", + ["joyex__jiang"] = "激昂", + [":joyex__jiang"] = "当你使用【决斗】或【杀】指定目标后,或成为【决斗】或【杀】的目标后,你可以摸一张牌。", + ["joyex__hunzi"] = "魂姿", + [":joyex__hunzi"] = "觉醒技,当你的体力值为1时,你减1点体力上限,然后获得〖英姿〗和〖英魂〗。", + ["joyex__zhiba"] = "制霸", + [":joyex__zhiba"] = "主公技,其他吴势力角色的出牌阶段限一次,其可以交给你一张【杀】或【决斗】。", + --抄的标张角主公技 + + ["joyex__zhiba_other&"] = "制霸", + [":joyex__zhiba_other&"] = "出牌阶段限一次,你可以交给孙策一张【杀】或【决斗】。", + ["#joyex__zhiba-active"] = "制霸:你可以交给一名拥有“制霸”的角色一张【杀】或【决斗】。", + ["joy__yinghun"] = "英魂", + [":joy__yinghun"] = "准备阶段,你可以令一名其他角色摸一张牌,然后弃X张牌(X为你已损失的体力值)", + + ["#joy__yinghun-drawcard"] = "英魂:你可以选择一名其他角色摸一张牌。", + ["#joy__yinghun-discard"] = "英魂:你可以选择一名其他角色摸一张牌,然后弃%arg张牌", + ["$ex__yingzi_joyex__sunce1"] = "公瑾,助我决一死战!", + ["$ex__yingzi_joyex__sunce2"] = "尔等看好了!", +} + return extension diff --git a/joy_sp.lua b/joy_sp.lua index 1b7e41136d0cef6121c1fa5b887a10a95ce98759..9f4b95ee2339e992f6a1c0a24c72a6e54f37f295 100644 --- a/joy_sp.lua +++ b/joy_sp.lua @@ -242,7 +242,7 @@ local joy__huxiao = fk.CreateTriggerSkill{ player.room:setPlayerMark(data.to, "@@joy__huxiao-turn", mark) end, } -local ol__huxiao_targetmod = fk.CreateTargetModSkill{ +local joy__huxiao_targetmod = fk.CreateTargetModSkill{ name = "#joy__huxiao_targetmod", bypass_times = function(self, player, skill, scope, card, to) return table.contains(U.getMark(to, "@@joy__huxiao-turn"), player.id) @@ -1315,4 +1315,93 @@ Fk:loadTranslationTable{ } +local diaochan = General(extension, "joysp__diaochan", "qun", 3, 3, General.Female) +local lihun = fk.CreateActiveSkill{ + name = "joy__lihun", + mute = true, + 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 #selected == 0 + end, + target_filter = function(self, to_select, selected, cards) + local target = Fk:currentRoom():getPlayerById(to_select) + return #selected == 0 and + not target:isKongcheng() 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]) + player:broadcastSkillInvoke(self.name, 1) + room:notifySkillInvoked(player, self.name, "control") + local mark = player:getMark("joy__lihun-phase") + if mark == 0 then mark = {} end + table.insertIfNeed(mark, target.id) + room:setPlayerMark(player, "joy__lihun-phase", mark) + player:turnOver() + if player.dead or target.dead or target:isKongcheng() then return end + local dummy = Fk:cloneCard("dilu") + dummy:addSubcards(target:getCardIds("h")) + room:moveCardTo(dummy, Card.PlayerHand, player, fk.ReasonPrey, self.name, nil, false, player.id) + end, +} +local lihun_record = fk.CreateTriggerSkill{ + name = "#joy__lihun_record", + mute = true, + events = {fk.EventPhaseEnd}, + can_trigger = function(self, event, target, player, data) + return target == player and player.phase == Player.Play and player:getMark("joy__lihun-phase") ~= 0 + end, + on_cost = Util.TrueFunc, + on_use = function(self, event, target, player, data) + local room = player.room + player:broadcastSkillInvoke("joy__lihun", 2) + room:notifySkillInvoked(player, "joy__lihun", "control") + local mark = player:getMark("joy__lihun-phase") + for _, id in ipairs(mark) do + if player.dead or player:isNude() then return end + local to = room:getPlayerById(id) + if not to.dead then + local cards = player:getCardIds("he") + local n = to.hp + if n < #cards then + cards = room:askForCard(player, n, n, true, "joy__lihun", false, ".", "#lihun-give::"..to.id..":"..n) + end + room:moveCardTo(cards, Card.PlayerHand, to, fk.ReasonGive, "joy__lihun", nil, false, player.id) + end + end + end, +} +local biyue = fk.CreateTriggerSkill{ + name = "joysp__biyue", + anim_type = "drawcard", + events = {fk.TurnEnd}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) + end, + on_use = function(self, event, target, player, data) + local n = 1 + if not player.faceup then + n = 3 + end + player:drawCards(n, self.name) + end, +} +lihun:addRelatedSkill(lihun_record) +diaochan:addSkill(lihun) +diaochan:addSkill(biyue) +Fk:loadTranslationTable{ + ["joysp__diaochan"] = "貂蝉", + ["#joysp__diaochan"] = "暗黑的傀儡师", + + ["joy__lihun"] = "离魂", + [":joy__lihun"] = "出牌阶段限一次,你可翻面,并获得一名其他角色所有手牌。".. + "出牌阶段结束时,你交给该角色X张牌(X为其体力值)。", + ["joysp__biyue"] = "闭月", + [":joysp__biyue"] = "回合结束阶段开始时,你可以摸一张牌,如你处于翻面状态,则摸三张牌。", + +} + return extension diff --git a/joy_ty.lua b/joy_ty.lua index 05c407cb8108d3b97ce5f9ffff9490ba71575aa4..4d2cd796be3651f0d898c56ef62760f441fa72d9 100644 --- a/joy_ty.lua +++ b/joy_ty.lua @@ -884,4 +884,85 @@ Fk:loadTranslationTable{ } +local sunyi = General(extension, "joy__sunyi", "wu", 5) +local xiongyis = fk.CreateTriggerSkill{ + name = "joy__xiongyis", + anim_type = "defensive", + frequency = Skill.Limited, + events = {fk.AskForPeaches}, + 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_cost = function(self, event, target, player, data) + local prompt = "#xiongyis1-invoke:::"..tostring(math.min(3, player.maxHp)) + if table.find(player.room.alive_players, function(p) + return Fk.generals[p.general].trueName == "joy__xushi" + or (Fk.generals[p.deputyGeneral] and Fk.generals[p.deputyGeneral].trueName == "joy__xushi") end) + then + prompt = "#xiongyis2-invoke" + end + if player.room:askForSkillInvoke(player, self.name, nil, prompt) then + self.cost_data = prompt + return true + end + end, + on_use = function(self, event, target, player, data) + local room = player.room + local n = tonumber(string.sub(self.cost_data, 10, 10)) + if n == 1 then + local maxHp = player.maxHp + room:recover({ + who = player, + num = math.min(3, maxHp) - player.hp, + recoverBy = player, + skillName = self.name + }) + room:changeHero(player, "joy__xushi", false, false, true, false) + else + room:recover({ + who = player, + num = 1 - player.hp, + recoverBy = player, + skillName = self.name + }) + room:handleAddLoseSkills(player, "joy__hunzi", nil, true, false) + end + end, +} +local hunzi = fk.CreateTriggerSkill{ + name = "joy__hunzi", + frequency = Skill.Wake, + events = {fk.EventPhaseStart}, + can_trigger = function(self, event, target, player, data) + return target == player and player:hasSkill(self) and + player:usedSkillTimes(self.name, Player.HistoryGame) == 0 and + player.phase == Player.Start + end, + can_wake = function(self, event, target, player, data) + return player.hp == 1 + end, + on_use = function(self, event, target, player, data) + local room = player.room + room:changeMaxHp(player, -1) + room:handleAddLoseSkills(player, "ex__yingzi|joy__yinghun", nil, true, false) + end, +} +sunyi:addSkill("jiqiaos") +sunyi:addSkill(xiongyis) +sunyi:addRelatedSkill(hunzi) +sunyi:addRelatedSkill("ex__yingzi") +sunyi:addRelatedSkill("joy__yinghun") +Fk:loadTranslationTable{ + ["joy__sunyi"] = "孙翊", + ["#joy__sunyi"] = "虓风快意", + + ["joy__xiongyis"] = "凶疑", + [":joy__xiongyis"] = "限定技,当你处于濒死状态时,若徐氏:不在场,你可以将体力值回复至3点并将武将牌替换为徐氏;".. + "在场,你可以将体力值回复至1点并获得技能〖魂姿〗。", + ["joy__hunzi"] = "魂姿", + [":joy__hunzi"] = "觉醒技,准备阶段,若你的体力为1,你减一点体力上限,然后获得“英姿”和“英魂”", + + ["$ex__yingzi_joy__sunyi"] = "骁悍果烈,威震江东!", +} + return extension diff --git a/joy_yj.lua b/joy_yj.lua index adc5786aee711c19d0701e20a9d662f89134bbe2..6eecc3363010a2c030c1fd0f3e875447b74a39d5 100644 --- a/joy_yj.lua +++ b/joy_yj.lua @@ -670,4 +670,210 @@ Fk:loadTranslationTable{ } +local xushi = General(extension, "joy__xushi", "wu", 3, 3, General.Female) +local wengua = fk.CreateActiveSkill{ + name = "joy__wengua", + anim_type = "support", + card_num = 1, + target_num = 0, + prompt = "#wengua", + can_use = function(self, player) + return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isNude() + end, + card_filter = function(self, to_select, selected) + return #selected == 0 + end, + on_use = function(self, room, effect) + local player = room:getPlayerById(effect.from) + local choices = {"Cancel", "Top", "Bottom"} + local id = effect.cards[1] + local card = Fk:getCardById(id) + player:showCards(id) + if card.type == Card.TypeTrick then + if player.maxHp < 5 then + room:changeMaxHp(player, 1) + end + if player:isWounded() then + player.room:recover({ + who = player, + num = 1, + recoverBy = player, + skillName = self.name + }) + end + end + local choice = room:askForChoice(player, choices, self.name, + "#wengua-choice::"..player.id..":"..Fk:getCardById(effect.cards[1]):toLogString()) + if choice == "Cancel" then return end + local index = 1 + if choice == "Bottom" then + index = -1 + end + room:moveCards({ + ids = effect.cards, + from = player.id, + toArea = Card.DrawPile, + moveReason = fk.ReasonJustMove, + skillName = self.name, + drawPilePosition = index, + }) + if player.dead then return end + if choice == "Top" then + player:drawCards(1, self.name, "bottom") + if not player.dead then + player:drawCards(1, self.name, "bottom") + end + else + player:drawCards(1, self.name) + if not player.dead then + player:drawCards(1, self.name) + end + end + end, +} +local wengua_trigger = fk.CreateTriggerSkill{ + name = "#joy__wengua_trigger", + + refresh_events = {fk.GameStart, fk.EventAcquireSkill, fk.EventLoseSkill, fk.Deathed}, + can_refresh = function(self, event, target, player, data) + if event == fk.GameStart then + return player:hasSkill(self.name, true) + elseif event == fk.EventAcquireSkill or event == fk.EventLoseSkill then + return data == self and not table.find(player.room:getOtherPlayers(player), function(p) return p:hasSkill("joy__wengua", true) end) + else + return target == player and player:hasSkill(self.name, true, true) and + not table.find(player.room:getOtherPlayers(player), function(p) return p:hasSkill("joy__wengua", true) end) + end + end, + on_refresh = function(self, event, target, player, data) + local room = player.room + if event == fk.GameStart or event == fk.EventAcquireSkill then + if player:hasSkill(self.name, true) then + for _, p in ipairs(room:getOtherPlayers(player)) do + room:handleAddLoseSkills(p, "joy__wengua&", nil, false, true) + end + end + elseif event == fk.EventLoseSkill or event == fk.Deathed then + for _, p in ipairs(room:getOtherPlayers(player)) do + room:handleAddLoseSkills(p, "-joy__wengua&", nil, false, true) + end + end + end, +} +local wengua_active = fk.CreateActiveSkill{ + name = "joy__wengua&", + anim_type = "support", + card_num = 1, + target_num = 1, + prompt = "#wengua&", + can_use = function(self, player) + return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isKongcheng() + end, + card_filter = function(self, to_select, selected) + return #selected == 0 + end, + target_filter = function(self, to_select, selected) + return #selected == 0 and to_select ~= Self.id and Fk:currentRoom():getPlayerById(to_select):hasSkill("joy__wengua") + end, + on_use = function(self, room, effect) + local player = room:getPlayerById(effect.from) + local target = room:getPlayerById(effect.tos[1]) + local id = effect.cards[1] + local card = Fk:getCardById(id) + player:showCards(id) + room:obtainCard(target.id, id, false, fk.ReasonGive) + if card.type == Card.TypeTrick then + if target.maxHp < 5 then + room:changeMaxHp(target, 1) + end + if target:isWounded() then + target.room:recover({ + who = target, + num = 1, + recoverBy = target, + skillName = self.name + }) + end + end + if room:getCardOwner(id) ~= target or room:getCardArea(id) ~= Card.PlayerHand then return end + local choices = {"Cancel", "Top", "Bottom"} + local choice = room:askForChoice(target, choices, "wengua", + "#wengua-choice::"..player.id..":"..Fk:getCardById(id):toLogString()) + if choice == "Cancel" then return end + local index = 1 + if choice == "Bottom" then + index = -1 + end + room:moveCards({ + ids = effect.cards, + from = target.id, + toArea = Card.DrawPile, + moveReason = fk.ReasonJustMove, + skillName = "wengua", + drawPilePosition = index, + }) + if player.dead then return end + if choice == "Top" then + player:drawCards(1, "wengua", "bottom") + if not target.dead then + target:drawCards(1, "wengua", "bottom") + end + else + player:drawCards(1, "wengua") + if not target.dead then + target:drawCards(1, "wengua") + end + end + end, +} +local fuzhu = fk.CreateTriggerSkill{ + name = "joy__fuzhu", + anim_type = "offensive", + events = {fk.EventPhaseStart}, + can_trigger = function(self, event, target, player, data) + return player:hasSkill(self) and target ~= player and target.phase == Player.Finish and + #player.room.draw_pile <= 10 * player.maxHp + end, + on_cost = function(self, event, target, player, data) + return player.room:askForSkillInvoke(player, self.name, nil, "#fuzhu-invoke::"..target.id) + end, + on_use = function(self, event, target, player, data) + local room = player.room + room:doIndicate(player.id, {target.id}) + local n = 0 + local cards = table.simpleClone(room.draw_pile) + for _, id in ipairs(cards) do + local card = Fk:getCardById(id, true) + if card.trueName == "slash" then + room:useCard({ + from = player.id, + tos = {{target.id}}, + card = card, + }) + n = n + 1 + end + if n >= #room.players or player.dead or target.dead then + break + end + end + room:shuffleDrawPile() + end, +} +Fk:addSkill(wengua_active) +wengua:addRelatedSkill(wengua_trigger) +xushi:addSkill(wengua) +xushi:addSkill(fuzhu) +Fk:loadTranslationTable{ + ["joy__xushi"] = "徐氏", + ["joy__wengua"] = "问卦", + [":joy__wengua"] = "每名角色出牌阶段限一次,其可以交给你一张牌并展示,若该牌为锦囊牌,则你加一点体力上限(不会超过5)并回复一点体力,".. + "然后你可以将此牌置于牌堆顶或牌堆底,你与其从另一端摸一张牌。", + ["joy__fuzhu"] = "伏诛", + [":joy__fuzhu"] = "一名角色结束阶段,若牌堆剩余牌数不大于你体力值的十倍,你可以依次对其使用牌堆中所有的【杀】(不能超过游戏人数),然后洗牌。", + ["#joy__wengua"] = "问卦:你可以将一张牌置于牌堆顶或牌堆底,从另一端摸两张牌", + ["joy__wengua&"] = "问卦", + [":joy__wengua&"] = "出牌阶段限一次,你可以交给徐氏一张牌并展示之,若该牌为锦囊牌,则其加一点体力上限(不会超过5)并回复一点体力,".. + "然后其可以将此牌置于牌堆顶或牌堆底,其与你从另一端摸一张牌。", +} + return extension