Commit 10704565 authored by VanillaSalt's avatar VanillaSalt

fix

parent ef47b28e
......@@ -15,7 +15,7 @@ function c15397015.initial_effect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c15397015.counterop1)
e3:SetOperation(c15397015.counterop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
......@@ -23,44 +23,37 @@ function c15397015.initial_effect(c)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetCondition(c15397015.econ1)
e4:SetCondition(c15397015.econ)
e4:SetValue(c15397015.elimit)
e4:SetLabel(0)
c:RegisterEffect(e4)
--
local e5=e3:Clone()
e5:SetOperation(c15397015.counterop2)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCondition(c15397015.econ2)
e6:SetTargetRange(0,1)
e6:SetLabel(1)
c:RegisterEffect(e6)
end
function c15397015.sumcon(e)
return Duel.GetFieldGroupCount(e:GetHandler():GetControler(),LOCATION_MZONE,0)>0
end
function c15397015.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)
end
function c15397015.typecount(c)
return bit.band(c:GetType(),TYPE_FUSION+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)
end
function c15397015.counterop1(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp or not re:IsActiveType(TYPE_MONSTER) then return end
e:GetHandler():RegisterFlagEffect(15397015,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
function c15397015.econ1(e)
local g=Duel.GetMatchingGroup(c15397015.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=g:GetClassCount(c15397015.typecount)
return e:GetHandler():GetFlagEffect(15397015)>=ct
end
function c15397015.counterop2(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not re:IsActiveType(TYPE_MONSTER) then return end
e:GetHandler():RegisterFlagEffect(15397016,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
function c15397015.econ2(e)
local g=Duel.GetMatchingGroup(c15397015.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=g:GetClassCount(c15397015.typecount)
return e:GetHandler():GetFlagEffect(15397016)>=ct
function c15397015.counterop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsActiveType(TYPE_MONSTER) then return end
if ep==tp then
e:GetHandler():RegisterFlagEffect(15397015,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
else
e:GetHandler():RegisterFlagEffect(15397016,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c15397015.cfilter(c,type)
return c:IsFaceup() and c:IsType(type)
end
function c15397015.econ(e)
local ct=0
for type in {TYPE_FUSION,TYPE_RITUAL,TYPE_SYNCHRO,TYPE_XYZ,TYPE_PENDULUM,TYPE_LINK} do
if Duel.IsExistingMatchingCard(c15397015.cfilter,0,LOCATION_MZONE,LOCATION_MZONE,nil,type) then
ct=ct+1
end
end
return e:GetHandler():GetFlagEffect(15397015+e:GetLabel())>=ct
end
function c15397015.elimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
......
......@@ -89,7 +89,7 @@ function c61665245.spop2(e,tp,eg,ep,ev,re,r,rp)
and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp,zone[tp]) or Duel.SelectYesNo(tp,aux.Stringid(61665245,2))) then
sump=1-tp
end
if Duel.SpecialSummon(tc,0,tp,sump,false,false,POS_FACEUP_DEFENSE,zone[sump])~=0 then
if Duel.SpecialSummonStep(tc,0,tp,sump,false,false,POS_FACEUP_DEFENSE,zone[sump]) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
......@@ -100,6 +100,7 @@ function c61665245.spop2(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
end
......@@ -89,14 +89,17 @@ end
function c66719533.poscon(e,tp,eg,ep,ev,re,r,rp)
return c66719533.effcon(e,tp,eg,ep,ev,re,r,rp) and Duel.GetTurnPlayer()~=tp
end
function c66719533.posfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x105)
end
function c66719533.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c66719533.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local g=Duel.GetMatchingGroup(c66719533.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c66719533.posop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local sg=Duel.GetMatchingGroup(c66719533.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local sg=Duel.GetMatchingGroup(c66719533.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if sg:GetCount()>0 then
Duel.ChangePosition(sg,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
......
......@@ -26,7 +26,7 @@ end
function c69270537.fcheck(sp)
return function(tp,g,c)
local ct=g:GetCount()
return Duel.GetMZoneCount(sp)>=g:GetCount() and not (ct>1 and Duel.IsPlayerAffectedByEffect(tp,59822133))
return Duel.GetMZoneCount(sp)>=ct and not (ct>1 and Duel.IsPlayerAffectedByEffect(tp,59822133))
end
end
function c69270537.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -45,7 +45,6 @@ function c92394653.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
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