以下是根据你的需求编写的琉璃版无名杀技能代码: ```lua skills["琉璃"] = { name = "琉璃", enable = "phaseUse", -- 出牌阶段可用 card_filter = function(self, card, to_use) return true -- 可以用任意牌当【杀】使用 end, on_use = function(self, event, target, player, data) if event == "useCard" then local card = data.card if card and card.trueName ~= "slash" then -- 将当前牌当作【杀】使用 card.trueName = "slash" card.name = "杀" card.nature = "normal" end return data end end, on_target = function(self, event, target, player, data) if event == "targetConfirming" then -- 令目标的防具无效 target:setFlags("琉璃_防具无效") -- 让玩家选择效果 local choices = {"摸一张牌", "弃置一张牌"} local choice = player:askForChoice("琉璃", choices) if choice == 1 then player:drawCards(1, "琉璃") else if player:getCardCount("h") > 0 then local card = player:askForDiscard("琉璃", 1, 1, false, false) if card then player:throwCard(card, "琉璃") end end end end return data end, on_damage = function(self, event, target, player, data) if event == "damage" and data.card and data.card.trueName == "slash" then -- 造成伤害时的效果 local choices = {"回复1点体力", "摸一张牌"} local choice = player:askForChoice("琉璃", choices) if choice == 1 then player:recover(1) else player:drawCards(1, "琉璃") end -- 弃置目标一张牌 if target:getCardCount("h") > 0 then local card = target:getRandomCard("h") if card then target:throwCard(card, "琉璃") end end -- 目标没有手牌时伤害+1 if target:getCardCount("h") == 0 then data.damage = data.damage + 1 end end return data end, on_reset = function(self, event, target, player, data) if event == "targetConfirmed" then -- 重置防具无效标志 target:setFlags("-琉璃_防具无效") end end } ``` 注意事项: 1. 代码中使用了`target:setFlags`来标记防具无效状态,需要确保游戏引擎支持此功能 2. 伤害加成效果在目标没有手牌时触发,注意检查手牌数量的时机 3. 技能使用了多个事件回调,确保它们按正确的顺序执行 [2025-04-27 01:11:02 | AI写代码神器 | 690点数解答]