太阳神三国杀吧 关注:38,399贴子:469,060
  • 4回复贴,共1

看破ex的LUA

只看楼主收藏回复

下面这个教程里的LUA好像和真正的看破差距挺大,似乎不能无懈对自己的顺,拆,铁索,更不能无懈对别人的锦囊,有什么解决办法吗?
askedtmp={}
kanpoex=sgs.CreateViewAsSkill{
name="kanpoex",
n=1,
view_filter=function(self, selected,
to_select)
return to_select:isRed()
end,
view_as=function(self, cards)
if #cards==1 then
local
acard=sgs.Sanguosha:cloneCard(askedtmp[1],cards[1]:getSuit(),cards[1]:getNumber())
acard:addSubcard(cards[1])
acard:setSkillName(self:objectName())
return acard
end
end,
enabled_at_play=function()
return false
end,
enabled_at_response=function(self,player,pattern)
if #askedtmp==1 then table.remove(askedtmp) end
table.insert(askedtmp,pattern)
return not player:isKongcheng() and( pattern=="slash" or pattern=="jink" or pattern=="peach")
end}



1楼2012-10-25 13:02回复
    enabled_at_nullification = function()
    return true
    end,


    IP属地:中国澳门2楼2012-10-25 13:07
    收起回复
      kanpoex=sgs.CreateViewAsSkill{
      name="kanpoex",
      n=1,
      view_filter=function(self, selected,
      to_select)
      return to_select:isRed()
      end,
      view_as=function(self, cards)
      if #cards==1 then
      local acard=sgs.Sanguosha:cloneCard("nullification",cards[1]:getSuit(),cards[1]:getNumber())
      acard:addSubcard(cards[1])
      acard:setSkillName(self:objectName())
      return acard
      end
      end,
      enabled_at_play=function()
      return false
      end,
      enabled_at_response=function(self,player,pattern)
      return pattern=="nullification" and not player:isKongcheng()
      end,
      enabled_at_nullification = function()
      return not sgs.Self:isKongcheng()
      end,
      }
      


      IP属地:中国澳门3楼2012-10-25 17:22
      收起回复