From e626e3b629b09e364b823eeefbc9c30de5fc8670 Mon Sep 17 00:00:00 2001 From: s1134s <9902511+s1134s@user.noreply.gitee.com> Date: Fri, 20 Sep 2024 11:52:44 +0000 Subject: [PATCH] update rtengyun.lua. Signed-off-by: s1134s <9902511+s1134s@user.noreply.gitee.com> --- rtengyun.lua | 212 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) diff --git a/rtengyun.lua b/rtengyun.lua index 626a0fa..4254ab2 100644 --- a/rtengyun.lua +++ b/rtengyun.lua @@ -1248,5 +1248,217 @@ Fk:loadTranslationTable{ [":rfenghou__jiawen"] = "每轮限一次,其他角色的出牌阶段开始时,你可以展示其所有手牌并重铸其中的伤害类牌。你受到伤害后,重置此技能。", } +--HY003 曹宪 by ? +local caoxian = General(extension, "rfenghou__caoxian", "wei", 3, 3, General.Female) +local lingxi = fk.CreateTriggerSkill{ + name = "rfenghou__rfenghou__lingxi", + derived_piles = "rfenghou__lingxi_wing", + frequency = Skill.Compulsory, + mute = true, + events = {fk.EventPhaseStart, fk.EventPhaseEnd, fk.AfterCardsMove}, + can_trigger = function(self, event, target, player, data) + if not player:hasSkill(self) then return false end + if event == fk.AfterCardsMove then + for _, move in ipairs(data) do + if move.from == player.id then + for _, info in ipairs(move.moveInfo) do + if info.fromSpecialName == "rfenghou__lingxi_wing" then + return true + end + end + end + end + else + return target == player and player.phase == Player.Play + end + end, + on_use = function(self, event, target, player, data) + local room = player.room + player:broadcastSkillInvoke(self.name) + if event == fk.AfterCardsMove then + local suits = {} + for _, id in ipairs(player:getPile("rfenghou__lingxi_wing")) do + local suit = Fk:getCardById(id).suit + table.insertIfNeed(suits, suit) + end + local x = #suits - player:getHandcardNum() + if x > 0 then + room:notifySkillInvoked(player, self.name, "drawcard") + player:drawCards(x, self.name) + else + room:notifySkillInvoked(player, self.name, "negative") + room:askForDiscard(player, -x, -x, false, self.name, false) + end + else + player:drawCards(1, self.name) + if not player:isNude() then + local card = room:askForCard(player, 1, 1, true, self.name, false, ".", "#rfenghou__lingxi-put:::"..1) + room:notifySkillInvoked(player, self.name, "special") + player:addToPile("rfenghou__lingxi_wing", card, true, self.name) + end + end + end, +} + +local zhifou = fk.CreateTriggerSkill{ + name = "rfenghou__zhifou", + anim_type = "control", + events = {fk.CardUseFinished}, + frequency = Skill.Compulsory, + can_trigger = function(self, event, target, player, data) + if player ~= target or not player:hasSkill(self) then return false end + local room = player.room + local logic = room.logic + local use_event = logic:getCurrentEvent() + local turn_event = use_event:findParent(GameEvent.Turn, false) + if not turn_event then return false end + local events = logic.event_recorder[GameEvent.UseCard] or Util.DummyTable + local last_find = false + for i = #events, 1, -1 do + local e = events[i] + if e.id < turn_event.id then break end + if e.id == use_event.id then + last_find = true + elseif last_find then + local last_use = e.data[1] + return not data.card:compareColorWith(last_use.card) and #player:getPile("rfenghou__lingxi_wing") > 0 + end + end + end, + on_use = function(self, event, target, player, data) + local room = player.room + local card = room:askForCard(player, 1, 1, false, self.name, false, ".|.|.|rfenghou__lingxi_wing", "#rfenghou__rfenghou__zhifou-invoke", "rfenghou__lingxi_wing") + room:moveCardTo(card, Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, self.name, "rfenghou__lingxi_wing", true, player.id) + local tos = TargetGroup:getRealTargets(data.tos) + if #table.filter(player.room.alive_players, function(p) return table.contains(tos, p.id) end) == 1 then + local to = room:getPlayerById(tos[1]) + if to.dead then return end + local choices = {} + local all_choices = {"rfenghou__zhifou_put", "rfenghou__zhifou_discard", "rfenghou__zhifou_losehp"} + local used = Self:getTableMark("rfenghou__zhifou-turn") + for _, choice in ipairs(all_choices) do + if not table.contains(used, choice) and (choice == "rfenghou__zhifou_losehp" or not to:isNude()) then + table.insert(choices, choice) + end + end + local choice = room:askForChoice(player, choices, self.name) + local mark = player:getTableMark("rfenghou__zhifou-turn") + table.insert(mark, choice) + room:setPlayerMark(player, "rfenghou__zhifou-turn", mark) + if choice == "rfenghou__zhifou_put" then + if player.dead or to:isNude() then return end + local card2 = room:askForCard(to, 1, 1, true, self.name, false, ".", "#rfenghou__zhifou-put") + player:addToPile("rfenghou__lingxi_wing", card2[1], true, self.name) + elseif choice == "rfenghou__zhifou_discard" then + room:askForDiscard(to, 2, 2, true, self.name, false) + else + room:loseHp(to, 1, self.name) + end + end + end, +} + +caoxian:addSkill(lingxi) +caoxian:addSkill(zhifou) +Fk:loadTranslationTable{ + ["rfenghou__caoxian"] = "曹宪", + ["#rfenghou__caoxian"] = "蝶步韶华", + ["designer:rfenghou__caoxian"] = "快雪时晴", + ["rfenghou__lingxi"] = "灵犀", + [":rfenghou__lingxi"] = "锁定技,出牌阶段开始或结束时,你摸一张牌并将至少一张牌置于武将牌上,称为“翼”。“翼”数量改变后,你将手牌调整至“翼”花色数。", + ["#rfenghou__lingxi-put"] = "灵犀:将至多 %arg 张牌置入“翼”", + ["rfenghou__lingxi_wing"] = "翼", + ["rfenghou__zhifou"] = "知否", + [":rfenghou__zhifou"] = "锁定技,你使用牌结算后,若此牌与本回合上一张被使用的牌颜色不同,你移去1张“翼”,然后若此牌指定唯一目标,你令其执行以下本阶段未被执行过的一项:", + ["#rfenghou__zhifou-invoke"] = "知否:移去一张“翼”,然后若你使用的牌仅指定唯一目标,令其执行一个效果", + ["rfenghou__zhifou_put"] = "将一张牌置入“翼”", + ["rfenghou__zhifou_discard"] = "弃置两张牌", + ["rfenghou__zhifou_losehp"] = "失去1点体力", + ["#rfenghou__zhifou-put"] = "知否:请将一张牌置入“翼”中", +} + +local luyusheng = General(extension, "ol__luyusheng", "wu", 3, 3, General.Female) +local cangxin = fk.CreateTriggerSkill{ + name = "rfenghou__cangxin", + events = {fk.EventPhaseStart, fk.DamageInflicted}, + frequency = Skill.Compulsory, + mute = true, + can_trigger = function(self, event, target, player, data) + if player:hasSkill(self) and target == player then + if event == fk.DamageInflicted then + return player:getMark("rfenghou__cangxin") > 0 + elseif event == fk.EventPhaseStart then + return target == player and player:hasSkill(self) and player.phase == Player.Draw + end + end + end, + on_use = function(self, event, target, player, data) + local room = player.room + player:broadcastSkillInvoke(self.name) + room:notifySkillInvoked(player, self.name, event == fk.EventPhaseStart and "drawcard" or "defensive") + if event == fk.EventPhaseStart then + local choices = {"ShowAndDiscard", "ShowAndBack"} + local choice = room:askForChoice(player, choices, self.name) + local card_ids = room:getNCards(5, "bottom") + room:moveCards({ + ids = card_ids, + toArea = Card.Processing, + moveReason = fk.ReasonJustMove, + skillName = self.name, + proposer = player.id + }) + room:delay(1500) + local x = 0 + for _, id in ipairs(card_ids) do + if Fk:getCardById(id).suit == Card.Heart then + x = x + 1 + end + end + if x > 0 then + room:drawCards(player, x, self.name) + end + if x < 3 then + room:setPlayerMark(player, "rfenghou__cangxin", 1) + end + if choice == "ShowAndDiscard" then + room:moveCards({ + ids = card_ids, + toArea = Card.DiscardPile, + moveReason = fk.ReasonJustMove, + skillName = self.name, + }) + else + room:moveCards({ + ids = card_ids, + toArea = Card.DrawPile, + moveReason = fk.ReasonJustMove, + skillName = self.name, + drawPilePosition = -1, + }) + end + return true + elseif event == fk.DamageInflicted then + data.damage = 0 + room:setPlayerMark(player, "rfenghou__cangxin", 0) + end + end, +} + +luyusheng:addSkill(cangxin) +luyusheng:addSkill("runwei") + +Fk:loadTranslationTable{ + ["rfenghou__luyusheng"] = "陆郁生", + ["#rfenghou__luyusheng"] = "义姑", + ["designer:ol__luyusheng"] = "zzccll朱古力", + ["illustrator:ol__luyusheng"] = "土豆", + + ["rfenghou__cangxin"] = "藏心", + [":rfenghou__cangxin"] = "锁定技,摸牌阶段,你改为展示或弃置牌堆底五张牌并摸与其中牌数等量张牌。".. + "若你以此法摸牌数小于3,防止你下次受到的伤害。", + + ["ShowAndDiscard"] = "亮出", + ["ShowAndBack"] = "展示", +} return extension -- Gitee