Commit 36daa032 authored by DailyShana's avatar DailyShana

simplify #785 and #788

parent 35851216
...@@ -88,6 +88,7 @@ function c21377582.regcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,6 +88,7 @@ function c21377582.regcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c21377582.regop(e,tp,eg,ep,ev,re,r,rp) function c21377582.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local typ=e:GetLabelObject():GetLabel()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -95,9 +96,8 @@ function c21377582.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -95,9 +96,8 @@ function c21377582.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c21377582.efilter) e1:SetValue(c21377582.efilter)
e1:SetLabelObject(e:GetLabelObject()) e1:SetLabel(typ)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local typ=e:GetLabelObject():GetLabel()
if bit.band(typ,TYPE_MONSTER)~=0 then if bit.band(typ,TYPE_MONSTER)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(21377582,3)) c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(21377582,3))
end end
...@@ -109,7 +109,7 @@ function c21377582.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,7 +109,7 @@ function c21377582.regop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c21377582.efilter(e,te) function c21377582.efilter(e,te)
return te:IsActiveType(e:GetLabelObject():GetLabel()) and te:GetOwner()~=e:GetOwner() return te:IsActiveType(e:GetLabel()) and te:GetOwner()~=e:GetOwner()
end end
function c21377582.descon(e,tp,eg,ep,ev,re,r,rp) function c21377582.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_ADVANCE)==SUMMON_TYPE_ADVANCE
......
...@@ -74,10 +74,8 @@ function c30539496.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,10 +74,8 @@ function c30539496.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
return
else
return
end end
return
end end
local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil) local rg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil)
if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(30539496,2)) then if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(30539496,2)) then
......
...@@ -92,6 +92,7 @@ function c57761191.regcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,6 +92,7 @@ function c57761191.regcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c57761191.regop(e,tp,eg,ep,ev,re,r,rp) function c57761191.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local typ=e:GetLabelObject():GetLabel()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -99,9 +100,8 @@ function c57761191.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,9 +100,8 @@ function c57761191.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c57761191.efilter) e1:SetValue(c57761191.efilter)
e1:SetLabelObject(e:GetLabelObject()) e1:SetLabel(typ)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local typ=e:GetLabelObject():GetLabel()
if bit.band(typ,TYPE_MONSTER)~=0 then if bit.band(typ,TYPE_MONSTER)~=0 then
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(57761191,2)) c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(57761191,2))
end end
...@@ -113,7 +113,7 @@ function c57761191.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -113,7 +113,7 @@ function c57761191.regop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c57761191.efilter(e,te) function c57761191.efilter(e,te)
return te:IsActiveType(e:GetLabelObject():GetLabel()) and te:GetOwner()~=e:GetOwner() return te:IsActiveType(e:GetLabel()) and te:GetOwner()~=e:GetOwner()
end end
function c57761191.spcon(e,tp,eg,ep,ev,re,r,rp) function c57761191.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -75,10 +75,8 @@ function c82321037.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,10 +75,8 @@ function c82321037.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
return
else
return
end end
return
end end
local rg=Duel.GetMatchingGroup(c82321037.rmfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil) local rg=Duel.GetMatchingGroup(c82321037.rmfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(82321037,0)) then if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(82321037,0)) then
......
...@@ -74,10 +74,8 @@ function c94160895.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,10 +74,8 @@ function c94160895.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
return
else
return
end end
return
end end
local rg=Duel.GetDecktopGroup(1-tp,4) local rg=Duel.GetDecktopGroup(1-tp,4)
if rm and rg:GetCount()>0 and rg:FilterCount(Card.IsAbleToRemove,nil)==4 if rm and rg:GetCount()>0 and rg:FilterCount(Card.IsAbleToRemove,nil)==4
......
...@@ -75,10 +75,8 @@ function c96746083.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,10 +75,8 @@ function c96746083.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SendtoGrave(c,REASON_RULE) Duel.SendtoGrave(c,REASON_RULE)
return
else
return
end end
return
end end
local rg=Duel.GetMatchingGroup(c96746083.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,tp) local rg=Duel.GetMatchingGroup(c96746083.rmfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,nil,tp)
if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96746083,0)) then if rm and rg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(96746083,0)) then
......
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