Commit b75f1ffd authored by DailyShana's avatar DailyShana

update special summoning to specific zone

for monster determined to summon before chain solving,
check zone is non empty before summoning to avoid sent to grave;
for selecting monster to summon in chain solving,
check location count before selecting
parent 37ac21d4
......@@ -26,10 +26,8 @@ function c15627227.initial_effect(c)
c:RegisterEffect(e2)
end
function c15627227.spfilter1(c,e,tp)
if c:IsFaceup() and c:IsType(TYPE_LINK) then
local zone=c:GetLinkedZone(tp)
return zone~=0 and Duel.IsExistingMatchingCard(c15627227.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp,zone)
else return false end
return c:IsFaceup() and c:IsType(TYPE_LINK)
and Duel.IsExistingMatchingCard(c15627227.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp,c:GetLinkedZone(tp))
end
function c15627227.spfilter2(c,e,tp,zone)
return c:IsSetCard(0x102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
......@@ -47,7 +45,7 @@ function c15627227.spop(e,tp,eg,ep,ev,re,r,rp)
local lc=Duel.GetFirstTarget()
if lc:IsRelateToEffect(e) and lc:IsFaceup() then
local zone=lc:GetLinkedZone(tp)
if zone==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c15627227.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP,zone) then
......
......@@ -20,8 +20,8 @@ function c28174796.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c28174796.cfilter,tp,LOCATION_MZONE,0,2,nil)
end
function c28174796.spfilter(c,e,tp,ec)
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_LINK) and zone>0 and ec:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
local zone=c:GetLinkedZone(tp)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_LINK) and ec:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c28174796.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
......@@ -34,9 +34,9 @@ end
function c28174796.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local zone=bit.band(tc:GetLinkedZone(tp),0x1f)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone)>0 then
local zone=tc:GetLinkedZone(tp)
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and zone&0x1f~=0
and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......@@ -45,5 +45,4 @@ function c28174796.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
end
......@@ -42,14 +42,13 @@ function c40216089.spfilter1(c,e,tp,zone)
return c:IsRace(RACE_MACHINE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c40216089.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c40216089.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end
local zone=e:GetHandler():GetLinkedZone(tp)
if chk==0 then return Duel.IsExistingMatchingCard(c40216089.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c40216089.spop1(e,tp,eg,ep,ev,re,r,rp)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or zone<=0 then return end
local zone=e:GetHandler():GetLinkedZone(tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c40216089.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
......
......@@ -24,14 +24,14 @@ function c45462149.filter(c,e,tp,zone)
end
function c45462149.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local zone=e:GetHandler():GetLinkedZone(tp)&0x1f
return zone~=0 and Duel.IsExistingMatchingCard(c45462149.filter,tp,LOCATION_HAND,0,1,nil,e,tp,zone)
local zone=e:GetHandler():GetLinkedZone(tp)
return Duel.IsExistingMatchingCard(c45462149.filter,tp,LOCATION_HAND,0,1,nil,e,tp,zone)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c45462149.operation(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)&0x1f
if zone~=0 then
local zone=e:GetHandler():GetLinkedZone(tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c45462149.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
......
......@@ -68,7 +68,7 @@ end
function c4709881.spop1(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and zone&0x1f~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
......
......@@ -54,6 +54,7 @@ function c56003780.spop(e,tp,eg,ep,ev,re,r,rp)
zone=bit.bor(zone,tc:GetLinkedZone(tp))
end
zone=bit.band(zone,0x1f)
if zone==0 then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP,zone)
end
end
......@@ -32,8 +32,7 @@ end
function c66015185.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c66015185.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c66015185.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
if chk==0 then return Duel.IsExistingTarget(c66015185.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c66015185.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......@@ -42,7 +41,7 @@ function c66015185.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP,zone) then
if tc:IsRelateToEffect(e) and zone&0x1f~=0 and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
......
......@@ -67,19 +67,17 @@ end
function c71278040.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if eg:GetCount()~=1 then return false end
local tc=eg:GetFirst()
local zone=bit.band(tc:GetLinkedZone(tp),0x1f)
local zone=tc:GetLinkedZone(tp)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c71278040.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local zone=bit.band(tc:GetLinkedZone(tp),0x1f)
local zone=tc:GetLinkedZone(tp)
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and zone&0x1f~=0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
......
......@@ -45,7 +45,7 @@ function c76685519.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
if tc:IsRelateToEffect(e) and zone&0x1f~=0 and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
......
......@@ -38,13 +38,12 @@ function c86148577.spfilter(c,e,tp,zone)
end
function c86148577.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=aux.GetMultiLinkedZone(tp)
if chk==0 then return zone~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c86148577.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,zone) end
if chk==0 then return Duel.IsExistingMatchingCard(c86148577.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c86148577.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=aux.GetMultiLinkedZone(tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or zone==0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c86148577.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
......
......@@ -43,10 +43,9 @@ function c86926989.filter(c,e,tp,zone)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsRace(RACE_ZOMBIE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c86926989.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=e:GetHandler():GetLinkedZone(tp)&0x1f
local zone=e:GetHandler():GetLinkedZone(tp)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c86926989.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c86926989.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp,zone) end
if chk==0 then return Duel.IsExistingTarget(c86926989.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c86926989.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......@@ -54,8 +53,8 @@ end
function c86926989.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local zone=c:GetLinkedZone(tp)&0x1f
if tc and tc:IsRelateToEffect(e) and zone~=0 then
local zone=c:GetLinkedZone(tp)
if tc:IsRelateToEffect(e) and zone&0x1f~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
......@@ -47,7 +47,7 @@ end
function c96380700.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and zone&0x1f~=0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
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