太阳神三国杀lua吧 关注:2,637贴子:73,368
  • 3回复贴,共1

国战1.1.0添加隐藏技能的问题

只看楼主收藏回复

在弄武将隐藏技能的时候,参考了别的的技能写法,大致如下:
Luaflip = sgs.CreateTriggerSkill{
name = "#Luaflip",
events = {sgs.PreCardUsed, sgs.PreDamageDone, sgs.DamageComplete},
frequency = sgs.Skill_Frequent,
priority = 2,
武将姓名:addSkill(LuaJiushiflip)
但是游戏里就是不发动,好像就没有这个技能似的
把 name = "#Luaflip",里的#号去掉,就能生效了,这个技能究竟该如何藏?
请各位高人点拨 ,谢谢
@Fsu0413


IP属地:广西1楼2015-03-22 12:55回复
    can_preshow=false


    IP属地:辽宁来自Android客户端2楼2015-03-22 14:59
    收起回复
      曹植酒诗:
      LuaJiushi = sgs.CreateZeroCardViewAsSkill{
      name = "LuaJiushi",
      view_filter = function(self, selected, to_select)
      return false
      end ,
      view_as = function(self, card)
      local analeptic = sgs.Sanguosha:cloneCard("analeptic", sgs.Card_NoSuit, 0)
      analeptic:setSkillName(self:objectName())
      analeptic:setShowSkill(self:objectName())
      return analeptic
      end,
      enabled_at_play = function(self, player)
      return sgs.Analeptic_IsAvailable(player) and player:faceUp()
      end,
      enabled_at_response = function(self, player, pattern)
      return string.find(pattern, "analeptic") and player:faceUp()
      end,
      }
      LuaJiushiflip = sgs.CreateTriggerSkill{
      name = "#LuaJiushiflip",
      events = {sgs.PreCardUsed, sgs.PreDamageDone, sgs.DamageComplete},
      frequency = sgs.Skill_Frequent,
      can_preshow = false,
      can_trigger = function(self, event, room, player, data)
      if not player or player:isDead() or not player:hasSkill(self:objectName()) then return false end
      if event == sgs.PreDamageDone then
      room:setTag("PredamagedFace", sgs.QVariant(player:faceUp()))
      return false
      end
      return self:objectName()
      end,
      on_cost = function(self, event, room, player, data)
      if event == sgs.PreCardUsed then
      local use = data:toCardUse()
      local card = use.card
      if (card:getSkillName() == "LuaJiushi") then
      return true
      end
      elseif event == sgs.DamageComplete and not (faceup or player:faceUp()) then --在翻面状态下并且暗将状态可以选择发动
      if player:hasShownSkill(self:objectName()) or player:askForSkillInvoke("@LuaJiushi", data) then
      return true
      end
      end
      return false
      end ,
      on_effect = function(self, event, room, player, data)
      local room = player:getRoom()
      if event == sgs.PreCardUsed then
      player:turnOver()
      elseif event == sgs.DamageComplete then
      local faceup = room:getTag("PredamagedFace"):toBool()
      room:removeTag("PredamagedFace")
      if not (faceup or player:faceUp()) then
      player:turnOver()
      room:broadcastSkillInvoke("LuaJiushi")
      room:notifySkillInvoked(player, "LuaJiushi")
      end
      end
      end,
      priority = 2
      }
      jycaozhi:addSkill(LuaJiushiflip)
      jycaozhi:addSkill(LuaJiushi)
      yijiangchengming:insertRelatedSkills("LuaJiushi", "#LuaJiushiflip")


      IP属地:广西3楼2015-03-22 16:05
      回复