Commit df33ef84 authored by VanillaSalt's avatar VanillaSalt

fix

parent e9861e43
......@@ -52,7 +52,7 @@ function c13035077.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(c13035077.thfilter,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c13035077.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,5 +14,7 @@ function c3366982.filter(c)
return c:IsFaceup() and c:IsAttribute(0xf8)
end
function c3366982.dircon(e)
return not Duel.IsExistingMatchingCard(c3366982.filter,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
and not Duel.IsExistingMatchingCard(c3366982.filter,tp,0,LOCATION_MZONE,1,nil)
end
......@@ -101,6 +101,7 @@ function c39373426.cntg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
end
function c39373426.cnop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp,PHASE_END,1) then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -23,9 +23,7 @@ function c5026221.initial_effect(c)
end
function c5026221.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tn=Duel.GetTurnPlayer()
local ph=Duel.GetCurrentPhase()
if ((tn==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)) or (tn~=tp and (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE)))
if c5026221.condition(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c5026221.filter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,94) then
......@@ -39,14 +37,14 @@ function c5026221.condition(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
else
return ph==PHASE_BATTLE
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
end
function c5026221.filter(c,e,tp)
return c:IsSetCard(0x9c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c5026221.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(5026221)==0
if chk==0 then return e:GetHandler():GetFlagEffect(5026221)==0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c5026221.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
e:GetHandler():RegisterFlagEffect(5026221,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
......
......@@ -29,8 +29,8 @@ function c53701457.initial_effect(c)
c:RegisterEffect(e3)
end
c53701457.xyz_number=28
function c53701457.dircon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<=1
function c53701457.dircon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)<=1
end
function c53701457.rdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -25,9 +25,9 @@ function c60349525.indval(e,c)
return c:IsLevelBelow(e:GetHandler():GetLevel())
end
function c60349525.condition(e,tp,eg,ep,ev,re,r,rp)
if tp==rp or eg:GetCount()~=1 then return false end
local c=eg:GetFirst()
return c:GetLevel()>0 and c:IsAttackAbove(c:GetLevel()*200)
if eg:GetCount()~=1 then return false end
local tc=eg:GetFirst()
return tc~=e:GetHandler() and tc:IsFaceup() and tc:GetLevel()>0 and tc:GetSummonPlayer()==1-tp
end
function c60349525.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -14,6 +14,7 @@ function c62473983.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c62473983.spcon)
e2:SetTarget(c62473983.sptg)
e2:SetOperation(c62473983.spop)
......
......@@ -82,12 +82,12 @@ function c72709014.spfilter(c,e,tp,code)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c72709014.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>-1
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c72709014.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,e:GetHandler():GetEquipTarget():GetCode()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c72709014.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c72709014.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
if g:GetCount()~=0 then
......
......@@ -14,7 +14,7 @@ function c74416026.filter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0xad)
end
function c74416026.condition(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
if rp==tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c74416026.filter,1,nil,tp)
and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
......
......@@ -624,11 +624,14 @@ function Auxiliary.FOperationMixRep(insf,sub,fun1,minc,maxc,...)
if gc then sg:AddCard(gc) end
while sg:GetCount()<maxc+#funs do
local cg=mg:Filter(Auxiliary.FSelectMixRep,sg,tp,mg,sg,c,sub,chkf,fun1,minc,maxc,table.unpack(funs))
if cg:GetCount()==0
or (Auxiliary.FCheckMixRepGoal(tp,sg,c,sub,chkf,fun1,minc,maxc,table.unpack(funs))
and not Duel.SelectYesNo(tp,210)) then break end
if cg:GetCount()==0 then break end
local minct=1
if Auxiliary.FCheckMixRepGoal(tp,sg,c,sub,chkf,fun1,minc,maxc,table.unpack(funs)) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=cg:Select(tp,1,1,nil)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
end
Duel.SetFusionMaterial(sg)
......@@ -1205,9 +1208,13 @@ function Auxiliary.LinkOperation(f,minc,maxc)
local sg=Group.CreateGroup()
for i=0,maxc-1 do
local cg=mg:Filter(Auxiliary.LCheckRecursive,sg,tp,sg,mg,c,i,minc,maxc)
if cg:GetCount()==0
or (Auxiliary.LCheckGoal(tp,sg,c,minc,i) and not Duel.SelectYesNo(tp,210)) then break end
local g=cg:Select(tp,1,1,nil)
if cg:GetCount()==0 then break end
local minct=1
if Auxiliary.LCheckGoal(tp,sg,c,minc,i) then
minct=0
end
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
end
c:SetMaterial(sg)
......
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