diff --git a/audio/death/maliang.mp3 b/audio/death/maliang.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..9bea7b10d69e84547dd72dcf79e969158b17e195 Binary files /dev/null and b/audio/death/maliang.mp3 differ diff --git a/audio/death/new__wangyi.mp3 b/audio/death/new__wangyi.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..3ee026465e8c36d41408ac1f25e96bc35150d1d8 Binary files /dev/null and b/audio/death/new__wangyi.mp3 differ diff --git a/audio/skill/new__miji1.mp3 b/audio/skill/new__miji1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..1104d45d47b68da5899c76e733a483423cff0b14 Binary files /dev/null and b/audio/skill/new__miji1.mp3 differ diff --git a/audio/skill/new__miji2.mp3 b/audio/skill/new__miji2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..3d79ed157bca48ac29635b145b20352a5d07ba74 Binary files /dev/null and b/audio/skill/new__miji2.mp3 differ diff --git a/audio/skill/new__zhenlie1.mp3 b/audio/skill/new__zhenlie1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f656a7f805fcabc8b74f64f0bdaf0d6ae51070fb Binary files /dev/null and b/audio/skill/new__zhenlie1.mp3 differ diff --git a/audio/skill/new__zhenlie2.mp3 b/audio/skill/new__zhenlie2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..bfdcbc7dbc669b2eebc13087ff18cd97638fb512 Binary files /dev/null and b/audio/skill/new__zhenlie2.mp3 differ diff --git a/audio/skill/yingyuan1.mp3 b/audio/skill/yingyuan1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..e27ae270a2df7d450ea8feac7610c0b3149da2a4 Binary files /dev/null and b/audio/skill/yingyuan1.mp3 differ diff --git a/audio/skill/yingyuan2.mp3 b/audio/skill/yingyuan2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..c68472d65029974b41b25fb4afe479100a60aef2 Binary files /dev/null and b/audio/skill/yingyuan2.mp3 differ diff --git a/audio/skill/zishu1.mp3 b/audio/skill/zishu1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..b65959084bc566218649aaf94247cdeb133e66cd Binary files /dev/null and b/audio/skill/zishu1.mp3 differ diff --git a/audio/skill/zishu2.mp3 b/audio/skill/zishu2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..65cd236dd7a4a878d6a621ac7c8e8be655180de9 Binary files /dev/null and b/audio/skill/zishu2.mp3 differ diff --git a/image/generals/maliang.jpg b/image/generals/maliang.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c151fd9205232b0a2c1d6a4e7a236f03cc7dfc13 Binary files /dev/null and b/image/generals/maliang.jpg differ diff --git a/image/generals/new__wangyi.jpg b/image/generals/new__wangyi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4b38f1cdc6be15bef3d89cc51af0ebfd329d223a Binary files /dev/null and b/image/generals/new__wangyi.jpg differ diff --git a/init.lua b/init.lua index 0002bf1cec561fc1df690d4c8fa221936d77e391..136cd70c91dca46c141f4993f77a3ac7e63ae2b5 100644 --- a/init.lua +++ b/init.lua @@ -944,4 +944,206 @@ Fk:loadTranslationTable{ ["#zhaxiangHit"] = "诈降", } +local new__zhenlie = fk.CreateTriggerSkill{ + name = "new__zhenlie", + anim_type = "defensive", + events = {fk.TargetConfirmed}, + can_trigger = function(self, event, target, player, data) + if player:hasSkill(self.name) and target == player and data.from ~= player.id then + return (data.card.type == Card.TypeTrick and data.card.sub_type ~= Card.SubtypeDelayedTrick) or data.card.trueName == "slash" + end + end, + on_use = function(self, event, target, player, data) + player.room:loseHp(player, 1, from) + + table.insertIfNeed(data.nullifiedTargets, player.id) + + local tar = player.room:getPlayerById(data.from) + if tar:isAllNude() then return end + local cid = player.room:askForCardChosen( + player, + tar, + "he", + self.name + ) + + player.room:throwCard(cid, self.name, tar, player) + end, +} +local new__miji = fk.CreateTriggerSkill{ + name = "new__miji", + anim_type = "drawcard", + events = {fk.EventPhaseStart}, + can_trigger = function(self, event, target, player, data) + return player:hasSkill(self.name) and target == player and player.phase == Player.Finish and player:isWounded() + end, + on_use = function(self, event, target, player, data) + local num = player:getLostHp() + + player:drawCards(num, self.name) + + local cids = player.room:askForCard(player, 1, num, false, self.name, true) + local cards = table.map(cids, function(p) + return Fk:getCardById(p) + end) + + if #cards > 0 then + local dummy = Fk:cloneCard'slash' + local prompt = "#new__miji" + local tar = player.room:askForChoosePlayers(player, table.map(player.room:getOtherPlayers(player), function(p) + return p.id + end), 1, 1, prompt, self.name) + + dummy:addSubcards(cards) + + player.room:obtainCard(tar[1], dummy, false, fk.ReasonGive) + end + end, +} +local new__wangyi = General:new(extension, "new__wangyi", "wei", 3, 3, General.Female) + +new__wangyi:addSkill(new__zhenlie) +new__wangyi:addSkill(new__miji) + +Fk:loadTranslationTable{ + ["new__wangyi"] = "王异", + ["new__zhenlie"] = "贞烈", + [":new__zhenlie"] = "当你成为其他角色使用【杀】或普通锦囊牌的目标后,你可以失去1点体力使此牌对你无效,然后你弃置其一张牌。", + ["new__miji"] = "秘计", + [":new__miji"] = "结束阶段,你可以摸至多X张牌(X为你已损失的体力值),然后将等量的手牌交给其他角色。", + ["#new__miji"] = "将牌交给1名其他角色", +} + +local zishu = fk.CreateTriggerSkill{ + name = "zishu", + anim_type = "drawcard", + frequency = Skill.Compulsory, + events = {fk.EventPhaseStart, fk.AfterCardsMove}, + can_trigger = function(self, event, target, player, data) + if not player:hasSkill(self.name) then return end + + if event == fk.EventPhaseStart and target.phase == Player.NotActive then + local cards = player:getMark("#zishu-discard") + + return cards ~= 0 and cards ~= {} + elseif event == fk.AfterCardsMove and player.phase < Player.NotActive then + for _, d in ipairs(data) do + return d.skillName ~= self.name and d.toArea == Player.Hand and d.to == player.id + end + end + end, + on_use = function(self, event, target, player, data) + if event == fk.EventPhaseStart then + local discards = player:getMark("#zishu-discard") + + for _, discid in ipairs(discards) do + for _, card in ipairs(player.player_cards[Player.Hand]) do + if discid == card then + player.room:throwCard(card, self.name, player, player) + end + end + end + + player.room:setPlayerMark(player, "#zishu-discard", 0) + elseif event == fk.AfterCardsMove then + player:drawCards(1, self.name) + end + end, + + refresh_events = {fk.AfterCardsMove}, + can_refresh = function(self, event, target, player, data) + if player:hasSkill(self.name) then + for _, d in ipairs(data) do + return d.skillName ~= self.name and d.toArea == Player.Hand and d.to == player.id + end + end + end, + on_refresh = function(self, event, target, player, data) + if player.phase == Player.NotActive then + local discards = player:getMark("#zishu-discard") + local cards = {} + + if discards == 0 then + discards = {} + end + + for _, d in ipairs(data) do + for _, info in ipairs(d.moveInfo) do + if d.toArea == Player.Hand and d.to == player.id and info.cardId ~= nil then + table.insert(cards, info.cardId) + end + end + end + + table.insertTable(discards, cards) + player.room:setPlayerMark(player, "#zishu-discard", discards) + end + end, +} +local yingyuan = fk.CreateTriggerSkill{ + name = "yingyuan", + anim_type = "support", + events = {fk.CardUseFinished}, + can_trigger = function(self, event, target, player, data) + if player:hasSkill(self.name) and target == player and player.phase == Player.Play and data.card ~= nil and player.room:getCardArea(data.card) == Card.Processing then + local cardMark = player:getMark("#yingyuan-give") + + if cardMark == 0 then cardMark = {} end + + return not table.contains(cardMark, data.card.trueName) + end + end, + on_cost = function(self, event, target, player, data) + local prompt = "#yingyuan-give:::" .. data.card.name + local tar = player.room:askForChoosePlayers(player, table.map(player.room:getOtherPlayers(player), function(p) + return p.id + end), 1, 1, prompt, self.name) + + if #tar > 0 then + self.cost_data = tar + return true + end + end, + on_use = function(self, event, target, player, data) + local cards = data.card + + player.room:obtainCard(self.cost_data[1], cards, false, fk.ReasonGive) + + local cardMark = player:getMark("#yingyuan-give") + + if cardMark == 0 then + cardMark = {} + end + + table.insert(cardMark, cards.trueName) + player.room:setPlayerMark(player, "#yingyuan-give", cardMark) + end, + + refresh_events = {fk.EventPhaseStart}, + can_refresh = function(self, event, target, player, data) + if player:hasSkill(self.name) and target.phase == Player.NotActive then + local cards = player:getMark("#yingyuan-give") + + return cards ~= 0 and cards ~= {} + end + end, + on_refresh = function(self, event, target, player, data) + player.room:setPlayerMark(player, "#yingyuan-give", 0) + end, +} +local maliang = General:new(extension, "maliang", "shu", 3) + +maliang:addSkill(zishu) +maliang:addSkill(yingyuan) + +Fk:loadTranslationTable{ + ["maliang"] = "马良", + ["zishu"] = "自书", + [":zishu"] = "锁定技,你的回合外,你获得的牌均会在当前回合结束后置入弃牌堆;你的回合内,当你不因此技能效果获得牌时,摸一张牌。", + ["#zishu-discard"] = "自书", + ["yingyuan"] = "应援", + [":yingyuan"] = "当你于回合内使用的牌置入弃牌堆后,你可以将之交给一名其他角色(相同牌名的牌每回合限一次)。", + ["#yingyuan-give"] = "你可以选择1名其他角色,并将 %arg 交给他", +} + return {extension}