Commit ac6ba53b authored by Nemo Ma's avatar Nemo Ma

fix

parent 64e2f9f7
...@@ -59,19 +59,19 @@ function cm.costchk(e,te_or_c,tp) ...@@ -59,19 +59,19 @@ function cm.costchk(e,te_or_c,tp)
return Duel.IsExistingMatchingCard(Card.IsAbleToDeckOrExtraAsCost,tp,0,LOCATION_GRAVE,1,nil) return Duel.IsExistingMatchingCard(Card.IsAbleToDeckOrExtraAsCost,tp,0,LOCATION_GRAVE,1,nil)
end end
function cm.costop(e,tp,eg,ep,ev,re,r,rp) function cm.costop(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckOrExtraAsCost,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckOrExtraAsCost,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST) Duel.SendtoDeck(g,nil,2,REASON_COST)
cm[0]=true
end end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp) function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(1)~=0 and ep==tp return e:GetHandler():GetFlagEffect(1)~=0 and ep==tp
end end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if cm[0] then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT) Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
cm[0]=true
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp return rp==1-tp
......
...@@ -11,7 +11,7 @@ function cm.initial_effect(c) ...@@ -11,7 +11,7 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SUMMON_COST) e1:SetCode(EFFECT_SUMMON_COST)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,0xff) e1:SetTargetRange(0xff,0xff)
e1:SetCondition(cm.costcon) e1:SetCondition(cm.costcon)
e1:SetCost(cm.costchk) e1:SetCost(cm.costchk)
e1:SetOperation(cm.costop) e1:SetOperation(cm.costop)
...@@ -38,19 +38,31 @@ function cm.matfilter(c) ...@@ -38,19 +38,31 @@ function cm.matfilter(c)
end end
function cm.costcon(e) function cm.costcon(e)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
if Duel.GetFieldGroupCount(tp,0,LOCATION_GRAVE)==0 then return false end if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)==0 then return false end
cm[0]=false
return true return true
end end
function cm.costchk(e,te_or_c,tp) function cm.costchk(e,te_or_c,tp)
return Duel.IsExistingMatchingCard(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_GRAVE,0,1,nil) local p=e:GetHandlerPlayer()
if p==tp then
return true
elseif cm[0] and (cm[0]:IsStatus(STATUS_SPSUMMON_STEP) or cm[0]:IsStatus(STATUS_SUMMONING)) then
return true
elseif Duel.IsExistingMatchingCard(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_GRAVE,0,1,te_or_c) then
e:SetLabelObject(te_or_c)
cm[0]=nil
return true
end
return false
end end
function cm.costop(e,tp,eg,ep,ev,re,r,rp) function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandlerPlayer()
if p==tp then return end
local tc=e:GetLabelObject()
if cm[0] then return end if cm[0] then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_GRAVE,0,1,1,nil) local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_GRAVE,0,1,1,tc)
Duel.SendtoDeck(g,nil,2,REASON_COST) Duel.SendtoDeck(sg,nil,2,REASON_COST)
cm[0]=true cm[0]=tc
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp return rp==1-tp
......
--守护天使 急诊天马 --守护天使 急诊天马
local m=40009101 local m=40009106
local cm=_G["c"..m] local cm=_G["c"..m]
cm.named_with_ProtectorSpirit=1 cm.named_with_ProtectorSpirit=1
function cm.ProtectorSpirit(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_ProtectorSpirit
end
function cm.initial_effect(c) function cm.initial_effect(c)
--summon --summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -37,10 +41,6 @@ function cm.initial_effect(c) ...@@ -37,10 +41,6 @@ function cm.initial_effect(c)
e3:SetOperation(cm.sumop) e3:SetOperation(cm.sumop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cm.ProtectorSpirit(c)
local m=_G["c"..c:GetCode()]
return m and m.named_with_ProtectorSpirit
end
function cm.sumcon1(e,tp,eg,ep,ev,re,r,rp) function cm.sumcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(e:GetHandlerPlayer())<=10000 or Duel.GetLP(1-tp)<=10000 return Duel.GetLP(e:GetHandlerPlayer())<=10000 or Duel.GetLP(1-tp)<=10000
end 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