diff --git a/audio/death/lijue.mp3 b/audio/death/lijue.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..ec1c054b0c781947c8c68b8d0a29ea9e29dc6c58 Binary files /dev/null and b/audio/death/lijue.mp3 differ diff --git a/audio/skill/langxi1.mp3 b/audio/skill/langxi1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..a54d61d6a252643b4d9f8e739d8828a19aa9fca5 Binary files /dev/null and b/audio/skill/langxi1.mp3 differ diff --git a/audio/skill/langxi2.mp3 b/audio/skill/langxi2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..cc8e07e75fb5205df880d78e01b5acd081e4a15b Binary files /dev/null and b/audio/skill/langxi2.mp3 differ diff --git a/audio/skill/yisuan1.mp3 b/audio/skill/yisuan1.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..0ae3b68e7c11e032a33d7eb28b66332bf7a2d177 Binary files /dev/null and b/audio/skill/yisuan1.mp3 differ diff --git a/audio/skill/yisuan2.mp3 b/audio/skill/yisuan2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..5ceb933dbef351a924335184d0636c8498739262 Binary files /dev/null and b/audio/skill/yisuan2.mp3 differ diff --git a/image/generals/lijue.jpg b/image/generals/lijue.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b9bf00e1ff635a904f5f60c86025b9f90d0ea833 Binary files /dev/null and b/image/generals/lijue.jpg differ diff --git a/init.lua b/init.lua index 2fbb52b623b69ff54f681c9f6f48cf57a71065ec..aa021208ada19cc1b0789387f6407071e312048a 100644 --- a/init.lua +++ b/init.lua @@ -680,25 +680,14 @@ local qinzheng = fk.CreateTriggerSkill{ name = "qinzheng", anim_type = "drawcard", frequency = Skill.Compulsory, - events = {fk.AfterCardUseDeclared, fk.CardResponding}, - on_trigger = function(self, event, target, player, data) - self.cancel_cost = false - local num = player:getMark("@qinzheng") - local skillNum = {} - - if num % 3 == 0 then table.insert(skillNum, 3) end - if num % 5 == 0 then table.insert(skillNum, 5) end - if num % 8 == 0 then table.insert(skillNum, 8) end - - for _, i in ipairs(skillNum) do - self.cost_data = i - self:doCost(event, target, player, data) - end - end, + events = {fk.CardUsing, fk.CardResponding}, can_trigger = function(self, event, target, player, data) - if player:hasSkill(self.name) and target == player then - return self.cost_data == 3 or self.cost_data == 5 or self.cost_data == 8 - end + return + target == player and + player:hasSkill(self.name) and + not table.every({ 3, 5, 8 }, function(num) + return player:getMark("@" .. self.name) % num ~= 0 + end) end, on_use = function(self, event, player, target, data) local randCard = function(cardName) @@ -723,34 +712,44 @@ local qinzheng = fk.CreateTriggerSkill{ return nil end - - if self.cost_data == 3 then - local card = randCard({"slash", "jink"}) - - if card ~= nil then - player.room:obtainCard(player.id, card, true, fk.ReasonDraw) - end - elseif self.cost_data == 5 then - local card = randCard({"peach", "analeptic"}) - - if card ~= nil then - player.room:obtainCard(player.id, card, true, fk.ReasonDraw) + + local loopList = table.filter({ 3, 5, 8 }, function(num) + return player:getMark("@" .. self.name) % num == 0 + end) + + local toObtain = {} + for _, count in ipairs(loopList) do + local cardList = {"slash", "jink"} + if count == 5 then + cardList = {"peach", "analeptic"} + elseif count == 8 then + cardList = {"ex_nihilo", "duel"} end - else - local card = randCard({"ex_nihilo", "duel"}) - - if card ~= nil then - player.room:obtainCard(player.id, card, true, fk.ReasonDraw) + + local randomCard = randCard(cardList) + if randomCard then + table.insert(toObtain, randomCard.id) end end + + if #toObtain > 0 then + player.room:moveCards({ + ids = toObtain, + to = player.id, + toArea = Player.Hand, + moveReason = fk.ReasonPrey, + proposer = player.id, + skillName = self.name, + }) + end end, - refresh_events = {fk.AfterCardUseDeclared, fk.CardResponding}, + refresh_events = {fk.PreCardUse, fk.PreCardRespond}, can_refresh = function(self, event, target, player, data) return player:hasSkill(self.name) and target == player end, on_refresh = function(self, event, target, player, data) - player.room:addPlayerMark(player, "@qinzheng", 1) + player.room:addPlayerMark(player, "@" .. self.name, 1) end, } @@ -764,5 +763,91 @@ Fk:loadTranslationTable{ ["@qinzheng"] = "勤政", } +local lijue = General(extension, "lijue", "qun", 4, 6) +Fk:loadTranslationTable{ + ["lijue"] = "李傕", +} + +local langxi = fk.CreateTriggerSkill{ + name = "langxi", + anim_type = "offensive", + events = { fk.EventPhaseStart }, + can_trigger = function(self, event, target, player, data) + return + target == player and + player:hasSkill(self.name) and + player.phase == Player.Start and + not table.every(player.room:getOtherPlayers(player), function(p) + return p.hp > player.hp + end) + end, + on_cost = function(self, event, target, player, data) + local room = player.room + local target = room:askForChoosePlayers( + player, + table.map( + table.filter(room:getOtherPlayers(player), function(p) + return p.hp <= player.hp + end), + function(p) + return p.id + end + ), + 1, + 1, + "#langxi-ask", + self.name + ) + + if #target > 0 then + self.cost_data = target[1] + return true + end + + return false + end, + on_use = function(self, event, target, player, data) + local room = player.room + room:damage({ + from = player, + to = room:getPlayerById(self.cost_data), + damage = math.random(0, 2), + damageType = fk.NormalDamage, + skillName = self.name, + }) + end, +} +Fk:loadTranslationTable{ + ["langxi"] = "狼袭", + [":langxi"] = "准备阶段开始时,你可以对一名体力值不大于你的其他角色随机造成0~2点伤害。", + ["#langxi-ask"] = "狼袭:请选择一名体力值不大于你的其他角色,对其随机造成0~2点伤害", +} +lijue:addSkill(langxi) + +local yisuan = fk.CreateTriggerSkill{ + name = "yisuan", + anim_type = "drawcard", + events = { fk.CardUseFinished }, + can_trigger = function(self, event, target, player, data) + return + target == player and + player:hasSkill(self.name) and + player.phase == Player.Play and + player:usedSkillTimes(self.name) < 1 and + data.card.type == Card.TypeTrick and + data.card.sub_type ~= Card.SubtypeDelayedTrick and + player.room:getCardArea(data.card) == Card.Processing + end, + on_use = function(self, event, target, player, data) + local room = player.room + room:changeMaxHp(player, -1) + room:obtainCard(player.id, data.card, true, fk.ReasonPrey) + end, +} +Fk:loadTranslationTable{ + ["yisuan"] = "亦算", + [":yisuan"] = "每阶段限一次,当你于出牌阶段内使用普通锦囊牌结算结束后,你可以减1点体力上限,然后获得此牌。", +} +lijue:addSkill(yisuan) return {extension}