太阳神三国杀lua吧 关注:2,638贴子:73,391
  • 5回复贴,共1

求测试,求纠正

只看楼主收藏回复

本屌爪机党无电脑,求好心人测试纠正!
--[[
技能名:突袭
相关武将:1v1·张辽1v1
描述:摸牌阶段,若你的手牌数小于对手的手牌数,你可以少摸一张牌并你获得对手的一张手牌。
]]--
LuaKOFTuxi = sgs.CreateDrawCardsSkill
name = "LuaKOFTuxi",
draw_num_func = function(self,player,n)
local room = player:getRoom()
local can_invoke = false
local targets = sgs.SPlayerList()
for _,p in sgs.qlist(room:getOtherPlayers(player)) do
if p:getHandcardNum() > player:getHandcardNum() then
targets:append(p)
end
end
if not targets:isEmpty() then
can_invoke = true
end
if can_invoke then
local target = room:askForPlayerChosen(player, targets, self:objectName(), "koftuxi-invoke", true, true)
if (target) then
target:setFlags("LuaKOFTuxiTarget")
player:setFlags("Luakoftuxi")
return n - 1
else
return n
end
else
return n
end
end
}
LuaKOFTuxiAct = sgs.CreateTriggerSkill{
name = "#Luakoftuxi",
events = {sgs.AfterDrawNCards},
on_trigger = function(self, event, player, data)
if not player:hasFlag("Luakoftuxi") then
return false
end
player:setFlags("-Luakoftuxi")
local target = nil
for _,p in sgs.qlist(room:getOtherPlayers(player)) do
if p:hasFlag("LuaKOFTuxiTarget") then
p:setFlags("-LuaKOFTuxiTarget")
target = p
break
end
end
if not target then return false end
local card_id = room:askForCardChosen(player, target, "h", "koftuxi")
local reason = sgs.CardMoveReason(sgs.CardMoveReason_S_REASON_EXTRACTION, self:objectName())
room:obtainCard(player, sgs.Sanguosha:getCard(card_id), reason, false)
end,
can_trigger = function(self, target)
return target ~= nil
end
}


IP属地:广东来自Android客户端1楼2014-07-30 06:59回复
    --[[
    技能名:普济
    相关武将:1v1·华佗
    描述:出牌阶段限一次,若对手有牌,你可以弃置一张牌:若如此做,你弃置其一张牌,然后以此法弃置♠牌的角色摸一张牌。
    状态:1217
    ]]--
    LuaPujiCard = sgs.CreateSkillCard{
    name = "LuaPujiCard",
    filter = function(self, targets, to_select)
    return #targets == 0 and sgs.Self:canDiscard(to_select,"he") and to_select:objectName() ~= sgs.Self:objectName()
    end,
    on_effect = function(self, effect)
    local room = effect.from:getRoom()
    local id = room:askForCardChosen(effect.from, effect.to, "he", "puji")
    room:throwCard(id, effect.to, effect.from)
    if effect.from:isAlive() and self:getSuit() == sgs.Card_Spade then
    effect.from:drawCards(1)
    end
    if effect.to:isAlive() and sgs.Sanguosha:getCard(id):getSuit() == sgs.Card_Spade then
    effect.to:drawCards(1)
    end
    end
    }
    LuaPuji = sgs.CreateOneCardViewAsSkill{
    name = "LuaPuji",
    filter_pattern = ".!",
    view_as = function(self, cards)
    local card = LuaPujiCard:clone()
    card:addSubcard(cards)
    return card
    end,
    enabled_at_play = function(self,player)
    return player:canDiscard(player, "he") and not player:hasUsed("#LuaPujiCard")
    end
    }


    IP属地:广东来自Android客户端2楼2014-07-30 10:26
    回复
      寂寞如雪
      --[[
      技能名:烈弓
      相关武将:1v1·黄忠1v1
      描述:每当你于出牌阶段内使用【杀】指定对手为目标后,若对手的手牌数大于或等于你的体力值,你可以令该角色不能使用【闪】对此【杀】进行响应。
      状态:1217
      ]]--
      Table2IntList = function(theTable)
      local result = sgs.IntList()
      for i = 1, #theTable, 1 do
      result:append(theTable[i])
      end
      return result
      end
      LuaKOFLiegong = sgs.CreateTriggerSkill{
      name = "LuaKOFLiegong" ,
      events = {sgs.TargetConfirmed} ,
      on_trigger = function(self, event, player, data)
      local use = data:toCardUse()
      if player:objectName() ~= use.from:objectName() or player:getPhase() ~= sgs.Player_Play or not use.card:isKindOf("Slash") then return false end
      local jink_table = sgs.QList2Table(player:getTag("Jink_" .. use.card:toString()):toIntList())
      local index = 1
      for _, p in sgs.qlist(use.to) do
      local _data = sgs.QVariant()
      _data:setValue(p)
      if player:getHp() <= p:getHandcardNum() and player:askForSkillInvoke(self:objectName(), _data) then
      jink_table[index] = 0
      end
      index = index + 1
      end
      local jink_data = sgs.QVariant()
      jink_data:setValue(Table2IntList(jink_table))
      player:setTag("Jink_" .. use.card:toString(), jink_data)
      end
      }


      IP属地:广东来自Android客户端3楼2014-07-30 10:53
      回复
        --[[
        技能名:婉容
        相关武将:1v1·大乔
        描述:每当你成为【杀】的目标后,你可以摸一张牌。
        ]]--
        LuaWanrong = sgs.CreateTriggerSkill{
        name = "LuaWanrong" ,
        events = {sgs.TargetConfirmed} ,
        frequency = sgs.Skill_Frequent,
        on_trigger = function(self, event, player, data)
        local use = data:toCardUse()
        if use.card:isKindOf("Slash") and use.to:contains(player) and room:askForSkillInvoke(player, self:objectName(), data) then
        player:drawCards(1)
        end
        end
        }


        IP属地:广东来自Android客户端4楼2014-07-30 11:14
        收起回复
          TUXIACT 也没获取room 另外我看接口obtaincard那里没有cardmovereason的参数 还有luaskill手册上的sgs_ex.lua drawcardsskill里 is_initial是不是反了


          IP属地:中国澳门5楼2014-07-30 14:10
          回复