Commit 81986892 authored by Nemo Ma's avatar Nemo Ma

fix

parent daced1b3
...@@ -72,8 +72,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -72,8 +72,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
else else
res=(c:CheckActivateEffect(false,false,false)~=nil) res=(c:CheckActivateEffect(false,false,false)~=nil)
end end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return res and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsLocation(LOCATION_HAND)) or (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLocation(LOCATION_EXTRA)))
return res and ((ft>0 and c:IsLocation(LOCATION_HAND)) or (((Duel.GetLocationCountFromEx(tp,tp,nil,c,0x60)>0 and ft>0) or (Duel.GetLocationCountFromEx(tp,tp,nil,c,0x1f)>0 and ft>1)) and c:IsLocation(LOCATION_EXTRA)))
end end
end end
function cm.ngfilter(c) function cm.ngfilter(c)
...@@ -161,7 +160,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -161,7 +160,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local te=e:GetLabelObject() local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false) Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
c:CreateEffectRelation(te) c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE) e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE) e0:SetCode(EFFECT_ADD_TYPE)
...@@ -171,6 +170,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -171,6 +170,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te2=te:Clone() local te2=te:Clone()
e:SetLabelObject(te2) e:SetLabelObject(te2)
te:SetType(26) te:SetType(26)
c:RegisterEffect(te2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
...@@ -189,7 +189,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -189,7 +189,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
local te2=e:GetLabelObject() local te2=e:GetLabelObject()
re:Reset() re:Reset()
rc:RegisterEffect(te2,true)
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:CancelToGrave(false) rc:CancelToGrave(false)
if KOISHI_CHECK then if KOISHI_CHECK then
...@@ -220,7 +219,7 @@ end ...@@ -220,7 +219,7 @@ end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(cm.desfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
......
...@@ -154,6 +154,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -154,6 +154,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te2=te:Clone() local te2=te:Clone()
e:SetLabelObject(te2) e:SetLabelObject(te2)
te:SetType(26) te:SetType(26)
c:RegisterEffect(te2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
...@@ -172,7 +173,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -172,7 +173,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
local te2=e:GetLabelObject() local te2=e:GetLabelObject()
re:Reset() re:Reset()
rc:RegisterEffect(te2,true)
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:CancelToGrave(false) rc:CancelToGrave(false)
if KOISHI_CHECK then if KOISHI_CHECK then
......
...@@ -116,6 +116,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -116,6 +116,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te2=te:Clone() local te2=te:Clone()
e:SetLabelObject(te2) e:SetLabelObject(te2)
te:SetType(26) te:SetType(26)
c:RegisterEffect(te2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
...@@ -134,7 +135,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -134,7 +135,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
local te2=e:GetLabelObject() local te2=e:GetLabelObject()
re:Reset() re:Reset()
rc:RegisterEffect(te2,true)
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:CancelToGrave(false) rc:CancelToGrave(false)
if KOISHI_CHECK then if KOISHI_CHECK then
......
...@@ -122,6 +122,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -122,6 +122,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te2=te:Clone() local te2=te:Clone()
e:SetLabelObject(te2) e:SetLabelObject(te2)
te:SetType(26) te:SetType(26)
c:RegisterEffect(te2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
...@@ -140,7 +141,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -140,7 +141,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
local te2=e:GetLabelObject() local te2=e:GetLabelObject()
re:Reset() re:Reset()
rc:RegisterEffect(te2,true)
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:CancelToGrave(false) rc:CancelToGrave(false)
if KOISHI_CHECK then if KOISHI_CHECK then
......
...@@ -57,6 +57,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,6 +57,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te2=te:Clone() local te2=te:Clone()
e:SetLabelObject(te2) e:SetLabelObject(te2)
te:SetType(26) te:SetType(26)
c:RegisterEffect(te2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
...@@ -75,7 +76,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +76,6 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
local te2=e:GetLabelObject() local te2=e:GetLabelObject()
re:Reset() re:Reset()
rc:RegisterEffect(te2,true)
end end
function cm.condition(e,tp,eg,ep,ev,re,r,rp) function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetCurrentChain()==0 return Duel.GetCurrentPhase()==PHASE_END and Duel.GetCurrentChain()==0
......
...@@ -43,14 +43,8 @@ function c22348013.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -43,14 +43,8 @@ function c22348013.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c22348013.costfilter,tp,LOCATION_HAND,0,nil,tp) local g=Duel.GetMatchingGroup(c22348013.costfilter,tp,LOCATION_HAND,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,nil):GetFirst() local tc=g:Select(tp,1,1,nil):GetFirst()
if te then Duel.Release(e:GetHandler(),REASON_COST)
te:UseCountLimit(tp) Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST)
else
Duel.Release(e:GetHandler(),REASON_COST)
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end end
function c22348013.spfilter(c,e,tp) function c22348013.spfilter(c,e,tp)
return c:IsSetCard(0x613) and not c:IsCode(22348013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x613) and not c:IsCode(22348013) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -50,7 +50,7 @@ function cm.initial_effect(c) ...@@ -50,7 +50,7 @@ function cm.initial_effect(c)
e6:SetOperation(cm.drop) e6:SetOperation(cm.drop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c) local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_SINGLE) e7:SetType(EFFECT_TYPE_XMATERIAL)
e7:SetCode(EFFECT_ADD_TYPE) e7:SetCode(EFFECT_ADD_TYPE)
e7:SetValue(TYPE_EFFECT) e7:SetValue(TYPE_EFFECT)
c:RegisterEffect(e7) c:RegisterEffect(e7)
......
...@@ -19,13 +19,14 @@ function cm.initial_effect(c) ...@@ -19,13 +19,14 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(3,m+100) e2:SetCountLimit(3,m+10000
)
e2:SetTarget(cm.seqtg) e2:SetTarget(cm.seqtg)
e2:SetOperation(cm.seqop) e2:SetOperation(cm.seqop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.tdfilter(c,tp) function cm.tdfilter(c,tp)
return c:IsSetCard(0x156) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHandAsCost() and Duel.IsExistingMatchingCard(cm.thcheck,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,c) return c:IsSetCard(0x156) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHandAsCost() and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,c)
end end
function cm.thfilter(c) function cm.thfilter(c)
return c:IsSetCard(0x156) and c:IsAbleToDeckAsCost() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) return c:IsSetCard(0x156) and c:IsAbleToDeckAsCost() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
...@@ -37,7 +38,7 @@ function cm.spcon(e,c) ...@@ -37,7 +38,7 @@ function cm.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler(),tp) and Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler(),tp)
end end
function cm.check(c) function cm.check(c)
return c:IsSetCard(0x156) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) return c:IsSetCard(0x156) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
......
...@@ -45,7 +45,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function s.thfilter(c) function s.thfilter(c)
return c.setname=="Zx02" and not c:IsForbidden() return c.setname=="Zx02" and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end end
function s.mfilter(c) function s.mfilter(c)
return c.setname=="Zx02" and c:IsPreviousLocation(LOCATION_MZONE) and c:IsType(TYPE_MONSTER) return c.setname=="Zx02" and c:IsPreviousLocation(LOCATION_MZONE) and c:IsType(TYPE_MONSTER)
......
...@@ -50,7 +50,7 @@ function cm.filter(c) ...@@ -50,7 +50,7 @@ function cm.filter(c)
return c:IsSetCard(0x29b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x29b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function cm.intg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.intg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end end
function cm.inop(e,tp,eg,ep,ev,re,r,rp) function cm.inop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -50,7 +50,7 @@ function cm.filter(c) ...@@ -50,7 +50,7 @@ function cm.filter(c)
return c:IsSetCard(0x29b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x29b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function cm.intg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.intg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.inop(e,tp,eg,ep,ev,re,r,rp) function cm.inop(e,tp,eg,ep,ev,re,r,rp)
......
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