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

【求教】新杀神貂蝉的问题

取消只看楼主收藏回复

shendiaochan = sgs.General(extension, "shendiaochan", "god", 3, false) jiusecard = sgs.CreateSkillCard
{
name = "jiusecard",
filter = function(self, targets, to_select)
if #targets == 0 then
return to_select:getGeneral():isMale()
end
if #targets == 1 then
return targets[1]:inMyAttackRange(to_select)
end
end,
on_use = function(self, room, source, targets)
room:throwCard(self)
local from = targets[1]
local to = targets[2]
local slash = sgs.Sanguosha:getCard(self:getSubcards():first())
room:setPlayerFlag(to, "jiuse")
room:cardEffect(slash, from, to)
end,
} jiusevs = sgs.CreateViewAsSkill
{
name = "jiusevs",
n = 1,
view_filter = function(self, selected, to_select)
return to_select:inherits("Slash") and not to_select:isEquipped()
end,
view_as = function(self, cards)
if #cards ~= 1 then return nil end
local acard = jiusecard:clone()
acard:setSkillName("jiuse")
acard:addSubcard(cards[1])
return acard
end,
enabled_at_play = function(self, player)
return not player:hasUsed("#jiusecard")
end,
} jiuse = sgs.CreateTriggerSkill
{
name = "jiuse",
events = {sgs.SlashHit, sgs.CardFinished},
view_as_skill = jiusevs,
can_trigger = function(self, player)
return player:getRoom():findPlayerBySkillName(self:objectName())
end,
on_trigger = function(self, event, player, data)
local room = player:getRoom()
if event == sgs.SlashHit then
local effect = data:toSlashEffect()
if effect.to:hasFlag("jiuse") then
room:setPlayerFlag(effect.to, "-jiuse")
local damage = sgs.DamageStruct()
damage.card = effect.card
damage.from = effect.from
damage.to = effect.to
damage.damage = 2
damage.nature = effect.nature
room:damage(damage)
return true
end
elseif event == sgs.CardFinished then
local use = data:toCardUse()
for _,p in sgs.qlist(room:getAllPlayers()) do
if p:hasFlag("jiuse") then
room:setPlayerFlag(p, "-jiuse")
end
end
end
end,
} manwucards = {} manwu = sgs.CreateTriggerSkill
{
name = "manwu",
events = {sgs.CardFinished, sgs.PhaseChange},
can_trigger = function(self, player)
return player:getRoom():findPlayerBySkillName(self:objectName())
end,
on_trigger = function(self, event, player, data)
local room = player:getRoom()
local skillowner = room:findPlayerBySkillName(self:objectName())
if not skillowner then return false end
if event == sgs.PhaseChange then
if skillowner:getPhase() == sgs.Player_Finish then
if #manwucards > 0 then
for _, id in ipairs(manwucards) do
if room:getCardPlace(id) ~= sgs.Player_DiscardedPile then
local card = sgs.Sanguosha:getCard(id)
room:throwCard(card)
manwucards:removeOne(id)
end


IP属地:广西1楼2012-12-18 19:33回复
    end
    end
    elseif skillowner:getPhase() == sgs.Player_Start then
    if skillowner:getPile("manwu"):length() > 0 then
    manwucards = sgs.QList2Table(skillowner:getPile("manwu"))
    for _, id in sgs.qlist(skillowner:getPile("manwu")) do
    local card = sgs.Sanguosha:getCard(id)
    room:moveCardTo(card, skillowner, sgs.Player_Hand, true)
    end
    end
    end
    end
    if event == sgs.CardFinished then
    local current = room:getCurrent()
    if current:hasFlag("manwu") then return false end
    local use = data:toCardUse()
    if not use.from:getGeneral():isMale() or use.from:objectName() == skillowner:objectName() then return false end
    if room:getCardPlace(use.card:getEffectiveId()) ~= sgs.Player_DiscardedPile then return false end
    if not skillowner:askForSkillInvoke(self:objectName(), data) then return false end
    if not use.card:isVirtualCard() then
    skillowner:addToPile("manwu", use.card:getEffectiveId(), true)
    else
    local ids = use.card:getSubcards()
    room:fillAG(ids, skillowner)
    local id = room:askForAG(skillowner, ids, false, self:objectName())
    skillowner:invoke("clearAG")
    skillowner:addToPile("manwu", id, true)
    end
    current:setFlags("manwu")
    end
    end,
    } meihuo = sgs.CreateTriggerSkill
    {
    name = "meihuo",
    events = {sgs.CardEffected, sgs.CardFinished},
    frequency = sgs.Skill_Compulsory,
    can_trigger = function(self, player)
    return player:getRoom():findPlayerBySkillName(self:objectName())
    end,
    on_trigger = function(self, event, player, data)
    local room = player:getRoom()
    local skillowner = room:findPlayerBySkillName(self:objectName())
    if not skillowner then return false end
    if event == sgs.CardEffected then
    local effect = data:toCardEffect()
    if not effect.card:inherits("Slash") or not effect.from:getGeneral():isMale() or effect.to:objectName() ~= skillowner:objectName() then return false end
    effect.from:getGeneral():setGender(sgs.General_Female)
    local value = sgs.QVariant()
    value:setValue(effect.from)
    room:setTag("meihuoTarget", value)
    elseif event == sgs.CardFinished then
    local target = room:getTag("meihuoTarget"):toPlayer()
    if target then
    target:getGeneral():setGender(sgs.General_Male)
    end
    end
    end,
    } shenyou = sgs.CreateTriggerSkill
    {
    name = "shenyou",
    events = {sgs.Predamage, sgs.Predamaged},
    on_trigger = function(self, event, player, data)
    local room = player:getRoom()
    local shenlubu = room:findPlayer("shenlubu")
    if not shenlubu then return false end
    local damage = data:toDamage()
    if event == sgs.Predamage then
    if shenlubu:getMark("@wrath") > 0 then
    shenlubu:loseMark("@wrath", math.min(shenlubu:getMark("@wrath"), damage.damage))
    end
    elseif event == sgs.Predamaged then
    shenlubu:gainMark("@wrath", damage.damage)
    end
    end,
    } shendiaochan:addSkill(jiuse)
    shendiaochan:addSkill(manwu)
    shendiaochan:addSkill(meihuo)
    shendiaochan:addSkill(shenyou) sgs.LoadTranslationTable{
    ["shendiaochan"] = "神貂蝉",
    ["jiuse"] = "酒色",
    ["jiusecard"] = "酒色",
    [":jiuse"] = "出牌阶段,你可以弃置一张【杀】并指定任一男性角色攻击范围内的一名角色,视为该男性角色对其使用了该【杀】若该【杀】命中,则造成2点伤害。每阶段限一次。",
    ["manwu"] = "曼舞",
    [":manwu"] = "其他男性角色的回合内,你可获得任意一名男性角色使用过并结算完时进入弃牌堆的一张牌,将该牌置于自己面前,必须在自己下一个回合内使用,否则弃置该牌。每回合限一次。",
    ["shenyou"] = "神佑",
    [":shenyou"] = "<b>锁定技,</b>你每受到或造成1点伤害,神吕布获得或失去一枚暴怒标记。",
    ["meihuo"] = "魅惑",
    [":meihuo"] = "<b>锁定技,</b>当你成为【杀】的目标时,杀的来源始终视为女性。",
    ["designer:shendiaochan"] = "杀神附体"
    }


    IP属地:广西2楼2012-12-18 19:33
    回复
      2026-04-18 17:32:24
      广告
      不感兴趣
      开通SVIP免广告
      上面这个LUA在新杀中无法使用,求助???


      IP属地:广西3楼2012-12-18 19:38
      回复
        需要如何改酒色?


        IP属地:广西4楼2012-12-18 19:40
        回复
          在改之前这后都提示这个37加载


          IP属地:广西6楼2012-12-19 17:40
          收起回复



            IP属地:广西7楼2012-12-19 17:58
            收起回复
              module("extensions.luafemalegod", package.seeall)
              extension = sgs.Package("femalegod") shendiaochan = sgs.General(extension, "shendiaochan", "god", 3, false) jiusecard = sgs.CreateSkillCard
              {
              name = "jiusecard",
              filter = function(self, targets, to_select)
              if #targets == 0 then
              return to_select:getGeneral():isMale()
              end
              if #targets == 1 then
              return targets[1]:inMyAttackRange(to_select)
              end
              end,
              on_use = function(self, room, source, targets)
              room:throwCard(self)
              local from = targets[1]
              local to = targets[2]
              local slash = sgs.Sanguosha:getCard(self:getSubcards():first())
              room:setPlayerFlag(to, "jiuse")
              room:cardEffect(slash, from, to)
              end,
              } jiusevs = sgs.CreateViewAsSkill
              {
              name = "jiusevs",
              n = 1,
              view_filter = function(self, selected, to_select)
              return to_select:isKindOf("Slash") and not to_select:isEquipped()
              end,
              view_as = function(self, cards)
              if #cards ~= 1 then return nil end
              local acard = jiusecard:clone()
              acard:setSkillName("jiuse")
              acard:addSubcard(cards[1])
              return acard
              end,
              enabled_at_play = function(self, player)
              return not player:hasUsed("#jiusecard")
              end,
              } jiuse = sgs.CreateTriggerSkill
              {
              name = "jiuse",
              events = {sgs.SlashHit, sgs.CardFinished},
              view_as_skill = jiusevs,
              can_trigger = function(self, player)
              return player:getRoom():findPlayerBySkillName(self:objectName())
              end,
              on_trigger = function(self, event, player, data)
              local room = player:getRoom()
              if event == sgs.SlashHit then
              local effect = data:toSlashEffect()
              if effect.to:hasFlag("jiuse") then
              room:setPlayerFlag(effect.to, "-jiuse")
              local damage = sgs.DamageStruct()
              damage.card = effect.card
              damage.from = effect.from
              damage.to = effect.to
              damage.damage = 2
              damage.nature = effect.nature
              room:damage(damage)
              return true
              end
              elseif event == sgs.CardFinished then
              local use = data:toCardUse()
              for _,p in sgs.qlist(room:getAllPlayers()) do
              if p:hasFlag("jiuse") then
              room:setPlayerFlag(p, "-jiuse")
              end
              end
              end
              end,
              } manwucards = {} manwu = sgs.CreateTriggerSkill
              {
              name = "manwu",
              events = {sgs.CardFinished, sgs.EventPhaseStart},
              can_trigger = function(self, player)
              return player:getRoom():findPlayerBySkillName(self:objectName())
              end,
              on_trigger = function(self, event, player, data)
              local room = player:getRoom()
              local skillowner = room:findPlayerBySkillName(self:objectName())
              if not skillowner then return false end
              if event == sgs.EventPhaseStart then
              if skillowner:getPhase() == sgs.Player_Finish then
              if #manwucards > 0 then
              for _, id in ipairs(manwucards) do
              if room:getCardPlace(id) ~= sgs.Player_DiscardedPile then
              local card = sgs.Sanguosha:getCard(id)


              IP属地:广西8楼2012-12-19 19:10
              收起回复
                room:throwCard(card)
                manwucards:removeOne(id)
                end
                end
                end
                elseif skillowner:getPhase() == sgs.Player_Start then
                if skillowner:getPile("manwu"):length() > 0 then
                manwucards = sgs.QList2Table(skillowner:getPile("manwu"))
                for _, id in sgs.qlist(skillowner:getPile("manwu")) do
                local card = sgs.Sanguosha:getCard(id)
                room:moveCardTo(card, skillowner, sgs.Player_Hand, true)
                end
                end
                end
                end
                if event == sgs.CardFinished then
                local current = room:getCurrent()
                if current:hasFlag("manwu") then return false end
                local use = data:toCardUse()
                if not use.from:getGeneral():isMale() or use.from:objectName() == skillowner:objectName() then return false end
                if room:getCardPlace(use.card:getEffectiveId()) ~= sgs.Player_DiscardedPile then return false end
                if not skillowner:askForSkillInvoke(self:objectName(), data) then return false end
                if not use.card:isVirtualCard() then
                skillowner:addToPile("manwu", use.card:getEffectiveId(), true)
                else
                local ids = use.card:getSubcards()
                room:fillAG(ids, skillowner)
                local id = room:askForAG(skillowner, ids, false, self:objectName())
                skillowner:invoke("clearAG")
                skillowner:addToPile("manwu", id, true)
                end
                current:setFlags("manwu")
                end
                end,
                } meihuo = sgs.CreateTriggerSkill
                {
                name = "meihuo",
                events = {sgs.CardEffected, sgs.CardFinished},
                frequency = sgs.Skill_Compulsory,
                can_trigger = function(self, player)
                return player:getRoom():findPlayerBySkillName(self:objectName())
                end,
                on_trigger = function(self, event, player, data)
                local room = player:getRoom()
                local skillowner = room:findPlayerBySkillName(self:objectName())
                if not skillowner then return false end
                if event == sgs.CardEffected then
                local effect = data:toCardEffect()
                if not effect.card:isKindOf("Slash") or not effect.from:getGeneral():isMale() or effect.to:objectName() ~= skillowner:objectName() then return false end
                effect.from:getGeneral():setGender(sgs.General_Female)
                local value = sgs.QVariant()
                value:setValue(effect.from)
                room:setTag("meihuoTarget", value)
                elseif event == sgs.CardFinished then
                local target = room:getTag("meihuoTarget"):toPlayer()
                if target then
                target:getGeneral():setGender(sgs.General_Male)
                end
                end
                end,
                } shenyou = sgs.CreateTriggerSkill
                {
                name = "shenyou",
                events = {sgs.Predamage, sgs.DamageForseen},
                on_trigger = function(self, event, player, data)
                local room = player:getRoom()
                local shenlubu = room:findPlayer("shenlubu")
                if not shenlubu then return false end
                local damage = data:toDamage()
                if event == sgs.Predamage then
                if shenlubu:getMark("@wrath") > 0 then
                shenlubu:loseMark("@wrath", math.min(shenlubu:getMark("@wrath"), damage.damage))
                end
                elseif event == sgs.DamageForseen then
                shenlubu:gainMark("@wrath", damage.damage)
                end
                end,
                } shendiaochan:addSkill(jiuse)
                shendiaochan:addSkill(manwu)
                shendiaochan:addSkill(meihuo)
                shendiaochan:addSkill(shenyou) sgs.LoadTranslationTable{
                ["shendiaochan"] = "神貂蝉",
                ["jiuse"] = "酒色",
                ["jiusecard"] = "酒色",
                [":jiuse"] = "出牌阶段,你可以弃置一张【杀】并指定任一男性角色攻击范围内的一名角色,视为该男性角色对其使用了该【杀】若该【杀】命中,则造成2点伤害。每阶段限一次。",
                ["manwu"] = "曼舞",
                [":manwu"] = "其他男性角色的回合内,你可获得任意一名男性角色使用过并结算完时进入弃牌堆的一张牌,将该牌置于自己面前,必须在自己下一个回合内使用,否则弃置该牌。每回合限一次。",
                ["shenyou"] = "神佑",
                [":shenyou"] = "<b>锁定技,</b>你每受到或造成1点伤害,神吕布获得或失去一枚暴怒标记。",
                ["meihuo"] = "魅惑",
                [":meihuo"] = "<b>锁定技,</b>当你成为【杀】的目标时,杀的来源始终视为女性。",
                ["designer:shendiaochan"] = "杀神附体"
                }


                IP属地:广西9楼2012-12-19 19:10
                收起回复