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

已经被这段代码虐瞎

取消只看楼主收藏回复

YangyanCard = sgs.CreateSkillCard{
name = "YangyanCard",
target_fixed = false,
will_throw = false,
on_use = function(self, room, source, targets)
local fire = source:getPile("fire")
room:fillAG(fire, source)
local id = room:askForAG(source, fire, false, "LuaYangyan")
room:throwCard(id, source)
source:invoke("clearAG")
local card = sgs.Sanguosha:getCard(id)
local number = card:getNumber()
local list = room:getAlivePlayers()
local dest = room:askForPlayerChosen(source, list, "LuaYangyan")
local count = (number+1) / 2
local theDamage = sgs.DamageStruct()
theDamage.from = source
theDamage.to = dest
theDamage.damage_Fire = count
theDamage.nature = sgs.DamageStruct_Normal
room:damage(theDamage)
end
}
这个技能卡我到底写错了什么为何到了clearAG就失效


1楼2015-08-22 08:04回复
    LuaXvshi = sgs.CreateTriggerSkill{
    name = "LuaXvshi",
    frequency = sgs.Skill_NotFrequent,
    events = {sgs.DrawNCards, sgs.EventPhaseStart},
    on_trigger = function(self, event, player, data)
    local room = player:getRoom()
    if event == sgs.DrawNCards then
    local count = data:toInt()
    if count > 0 then
    if room:askForSkillInvoke(player, "LuaXvshi", data) then
    data:setValue(count - 1)
    local judge = sgs.JudgeStruct()
    judge.who = player
    judge.pattern = "."
    judge.good = true
    judge.reason = "LuaXvshi"
    room:judge(judge)
    local card = judge.card
    if card:isKindOf("BasicCard") then
    room:setTag("Xvshi_count", sgs.QVariant(card:getNumber()))
    end
    end
    end
    elseif event == sgs.PhaseStart then
    local phase = player:getPhase()
    if phase == sgs.Player_Finish then
    local tag = room:getTag("Xvshi_count")
    room:drawCards(player, tag:toInt(), "LuaXvshi")
    room:removeTag("Xvshi_count")
    end
    end
    end
    }


    5楼2015-08-22 18:27
    回复