Commit aa4ac186 authored by xiaoye's avatar xiaoye

fix

parent f5cc8415
...@@ -9,7 +9,7 @@ function cm.initial_effect(c) ...@@ -9,7 +9,7 @@ function cm.initial_effect(c)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject() local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanBeCalled(e,tp) then if c:IsRelateToEffect(e) and c:IsCanBeCalled(e,tp) then
vgf.Sendto(LOCATION_CIRCLE,c,0,tp) vgf.Sendto(LOCATION_CIRCLE,c,0,tp)
end end
......
...@@ -1513,50 +1513,28 @@ function VgD.Action.AbilityAutoRided(c, m, filter, op, cost, con, tg, id) ...@@ -1513,50 +1513,28 @@ function VgD.Action.AbilityAutoRided(c, m, filter, op, cost, con, tg, id)
local desc = VgF.Stringid(m, id or 2) local desc = VgF.Stringid(m, id or 2)
-- set effect -- set effect
local e = Effect.CreateEffect(c) local e = Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS) e:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
e:SetCode(EVENT_BE_MATERIAL) e:SetDescription(desc)
e:SetProperty(EFFECT_FLAG_EVENT_PLAYER) e:SetCode(EVENT_SPSUMMON)
e:SetRange(LOCATION_SOUL)
e:SetCondition(VgD.AbilityAutoRidedCondition(con, filter)) e:SetCondition(VgD.AbilityAutoRidedCondition(con, filter))
e:SetOperation(VgD.AbilityAutoRidedOperation(desc, op, cost, tg)) if cost then e:SetCost(cost) end
if tg then e:SetTarget(tg) end
if op then e:SetOperation(op) end
c:RegisterEffect(e) c:RegisterEffect(e)
return e return e
end end
function VgD.AbilityAutoRidedCondition(con, filter) function VgD.AbilityAutoRidedCondition(con, filter)
return function (e, tp, eg, ep, ev, re, r, rp) return function (e, tp, eg, ep, ev, re, r, rp)
if r ~= REASON_RIDEUP or (con and not con(e, tp, eg, ep, ev, re, r, rp)) then return false end filter = vgf.GetValueType(filter) == 'function' and filter
local c, rc = e:GetHandler(), e:GetHandler():GetReasonCard() or vgf.GetValueType(filter) == 'number' and function (c)
filter = filter or VgF.True return c:IsCode(filter)
if type(filter) == "number" then end or VgF.True
return rc:IsCode(filter) con = con or VgF.True
end return eg:GetCount() == 1 and eg:GetFirst():GetOverlayGroup():IsContains(e:GetHandler())
return filter(rc, c) and filter(eg:GetFirst()) and con(e, tp, eg, ep, ev, re, r, rp)
end end
end end
function VgD.AbilityAutoRidedOperation(desc, op, cost, tg)
return function(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local rc = c:GetReasonCard()
local typ = cost and EFFECT_TYPE_TRIGGER_O or EFFECT_TYPE_TRIGGER_F
local e1 = Effect.CreateEffect(rc)
e1:SetDescription(desc)
e1:SetType(typ + EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1)
e1:SetLabelObject(c)
e1:SetRange(LOCATION_CIRCLE)
e1:SetCondition(VgD.AbilityAutoRidedOpCondtion)
if cost then e1:SetCost(cost) end
if tg then e1:SetTarget(tg) end
if op then e1:SetOperation(op) end
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
rc:RegisterEffect(e1)
end
end
function VgD.AbilityAutoRidedOpCondtion(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetLabelObject()
return eg:GetFirst() == e:GetHandler() and e:GetHandler():GetOverlayGroup():IsContains(c)
end
--起相关---------------------------------------------------------------------------------------- --起相关----------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment