太阳神三国杀lua吧 关注:2,642贴子:73,432
  • 7回复贴,共1

【求助】触发视为技的触发技部分转为隐藏技能后响应无效

只看楼主收藏回复

这是一个类似于“醇醪”的结束阶段把红桃牌放入私人牌堆的技能
目前下面的代码正常运行没有问题
SkillNameCard = sgs.CreateSkillCard{
name = "SkillNameCard" ,
will_throw = false ,
target_fixed = true ,
on_use = function(self, room, source, targets)
source:addToPile("xxxx", self)
end
}
LuaSkillNameVS = sgs.CreateViewAsSkill{
name = "LuaSkillNameFill" ,
n = 2,
view_filter = function(self, cards, to_select)
return to_select:getSuit() == sgs.Card_Heart
end ,
view_as = function(self, cards)
if #cards == 0 then return nil end
local acard = SkillNameCard:clone()
for _, c in ipairs(cards) do
acard:addSubcard(c)
end
acard:setSkillName(self:objectName())
return acard
end ,
enabled_at_play = function()
return false
end ,
enabled_at_response = function(self, player, pattern)
return pattern == "@@LuaSkillName"
end
}
LuaSkillName = sgs.CreateTriggerSkill{
name = "LuaSkillName",
events = {sgs.EventPhaseStart} ,
view_as_skill = LuaSkillNameVS ,
on_trigger = function(self, event, player, data)
if (event == sgs.EventPhaseStart) and (player:getPhase() == sgs.Player_Finish) and (not player:isKongcheng()) and player:getPile("xxxx"):isEmpty() then
player:getRoom():askForUseCard(player, "@@LuaSkillName", "@skillname-card")
end
return false
end
}
但是想要把这个技能通过insertRelatedSkills()整合到其他主动技能中,在触发技部分把name = "#LuaSkillName",变成隐藏后,这个技能依然会触发askForUseCard()但是手中有红桃也用不了。把VS技能名也改成"#LuaSkillName",也是不好用。
猜测是响应条件的问题,但是不知道怎么改


IP属地:辽宁1楼2014-09-29 17:00回复
    另外顺便问下askForUseCard()我一直就只用到前3个参数player、响应条件、提示信息,但是看到很多后面还有参数的情况,后面的参数是干嘛的啊


    IP属地:辽宁2楼2014-09-29 17:05
    收起回复
      2025-07-22 00:25:42
      广告
      不感兴趣
      开通SVIP免广告
      ....帮顶


      IP属地:广东3楼2014-10-09 13:03
      回复
        SkillNameCard = sgs.CreateSkillCard{
        name = "SkillNameCard" ,
        will_throw = false ,
        target_fixed = true ,
        on_use = function(self, room, source, targets)
        source:addToPile("xxxx", self)
        end
        }
        LuaSkillNameVS = sgs.CreateViewAsSkill{
        name = "LuaSkillName" ,
        n = 2,
        view_filter = function(self, cards, to_select)
        return to_select:getSuit() == sgs.Card_Heart
        end ,
        view_as = function(self, cards)
        if #cards == 0 then return nil end
        local acard = SkillNameCard:clone()
        for _, c in ipairs(cards) do
        acard:addSubcard(c)
        end
        acard:setSkillName(self:objectName())
        return acard
        end ,
        enabled_at_play = function()
        return false
        end ,
        enabled_at_response = function(self, player, pattern)
        return pattern == "@@LuaSkillName"
        end
        }
        LuaSkillName = sgs.CreateTriggerSkill{
        name = "LuaSkillName",
        events = {sgs.EventPhaseStart} ,
        view_as_skill = LuaSkillNameVS ,
        on_trigger = function(self, event, player, data)
        if (event == sgs.EventPhaseStart) and (player:getPhase() == sgs.Player_Finish) and (not player:isKongcheng()) and player:getPile("xxxx"):isEmpty() then
        player:getRoom():askForUseCard(player, "@@LuaSkillName", "@skillname-card")
        end
        return false
        end
        }
        @医治永恒
        这个问题挂了3周多了...还得麻烦大神你了,楼上的码有一丢丢问题,这层的这个是对的。但是问题还是上面那个问题。把主技能变成隐藏后可以触发结束阶段选牌 但是不会触发视为技的技能卡,猜测是响应问题


        IP属地:辽宁4楼2014-10-20 10:41
        回复
          @@LuaSkillName
          好像这个也要改。


          IP属地:江苏5楼2014-10-20 11:18
          收起回复
            没用的,这是没办法的!嗯,就是没办法的!


            6楼2014-10-30 17:31
            回复