Commit 569fce73 authored by VanillaSalt's avatar VanillaSalt

fix

parent 1a3e23b4
......@@ -72,6 +72,6 @@ function c15449853.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()==0 then return end
if Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)==0 then return end
local ct=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_DECK):GetCount()
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK)
if ct>0 then Duel.SortDecktop(tp,tp,ct) end
end
......@@ -26,7 +26,7 @@ end
function c16255442.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
local ct=sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE):GetCount()
local ct=sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
local tg=Duel.GetMatchingGroup(c16255442.filter,tp,LOCATION_GRAVE,0,nil)
if ct>0 and tg:GetCount()>=ct then
Duel.BreakEffect()
......
......@@ -10,21 +10,18 @@ function c22802010.initial_effect(c)
e1:SetOperation(c22802010.activate)
c:RegisterEffect(e1)
end
function c22802010.filter1(c)
return c:IsFaceup() and (c:IsLevelBelow(11) or c:IsRankBelow(11))
function c22802010.filter(c,lv)
return c:IsFaceup() and (c:IsLevelBelow(lv) or c:IsRankBelow(lv))
end
function c22802010.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22802010.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c22802010.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c22802010.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,11) end
local g=Duel.GetMatchingGroup(c22802010.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,1)
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c22802010.filter2(c,lv)
return c:IsFaceup() and (c:IsLevelBelow(lv) or c:IsRankBelow(lv))
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c22802010.activate(e,tp,eg,ep,ev,re,r,rp)
local d1,d2=Duel.TossDice(tp,2)
local g=Duel.GetMatchingGroup(c22802010.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,d1+d2)
local g=Duel.GetMatchingGroup(c22802010.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,d1+d2-1)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
......
......@@ -9,23 +9,23 @@ function c26285788.initial_effect(c)
e1:SetTarget(c26285788.target)
e1:SetOperation(c26285788.activate)
c:RegisterEffect(e1)
if c26285788.global_effect==nil then
c26285788.global_effect=true
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_RELEASE)
e1:SetOperation(c26285788.addcount)
Duel.RegisterEffect(e1,0)
if not c26285788.global_check then
c26285788.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_RELEASE)
ge1:SetOperation(c26285788.addcount)
Duel.RegisterEffect(ge1,0)
end
end
function c26285788.addcount(e,tp,eg,ep,ev,re,r,rp)
local c=eg:GetFirst()
while c~=nil do
if not c:IsType(TYPE_TOKEN) then
local p=c:GetReasonPlayer()
local tc=eg:GetFirst()
while tc do
if tc:IsType(TYPE_MONSTER) and not tc:IsType(TYPE_TOKEN) then
local p=tc:GetReasonPlayer()
Duel.RegisterFlagEffect(p,26285789,RESET_PHASE+PHASE_END,0,1)
end
c=eg:GetNext()
tc=eg:GetNext()
end
end
function c26285788.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -29,7 +29,7 @@ function c43839002.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c43839002.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)>0 then
if tc:IsRelateToEffect(e) and Duel.Remove(tc,0,REASON_EFFECT+REASON_TEMPORARY)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
......@@ -39,6 +39,7 @@ function c43839002.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCondition(c43839002.retcon)
e1:SetOperation(c43839002.retop)
Duel.RegisterEffect(e1,tp)
if tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c43839002.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc)
if g:GetCount()>0 then
......
......@@ -8,6 +8,7 @@ function c58383100.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c58383100.spcon)
e1:SetCost(c58383100.spcost)
e1:SetTarget(c58383100.sptg)
e1:SetOperation(c58383100.spop)
......@@ -31,38 +32,43 @@ function c58383100.initial_effect(c)
e3:SetOperation(c58383100.thop)
c:RegisterEffect(e3)
end
function c58383100.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c58383100.cfilter(c,e,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousSetCard(0xe5)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58383100.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and c58383100.cfilter(eg:GetFirst(),e,tp)
end
function c58383100.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c58383100.filter(c,ft)
return c:IsAbleToGrave() and (ft>0 or c:GetSequence()<5)
end
function c58383100.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and eg:IsExists(c58383100.cfilter,1,nil,e,tp)
and eg:GetCount()==1
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_MZONE,0,1,e:GetHandler()) end
local g=eg:Filter(c58383100.cfilter,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local loc=LOCATION_HAND+LOCATION_ONFIELD
if ft==0 then loc=LOCATION_MZONE end
if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(c58383100.filter,tp,loc,0,1,e:GetHandler(),ft) end
local ec=eg:GetFirst()
Duel.SetTargetCard(ec)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,loc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0)
end
function c58383100.spop(e,tp,eg,ep,ev,re,r,rp)
local tg=nil
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<0 then return end
local loc=LOCATION_HAND+LOCATION_ONFIELD
if ft==0 then loc=LOCATION_MZONE end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
tg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,1,nil)
else
tg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
end
local tg=Duel.SelectMatchingCard(tp,c58383100.filter,tp,loc,0,1,1,nil,ft)
local tc=tg:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local ec=Duel.GetFirstTarget()
if ec:IsRelateToEffect(e) then
Duel.SpecialSummon(ec,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......
......@@ -40,7 +40,7 @@ end
function c76224717.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsSummonType(SUMMON_TYPE_ADVANCE) then
c76224717[ep]=c76224717[ep]+tc:GetMaterialCount()
c76224717[ep]=c76224717[ep]+tc:GetMaterial():FilterCount(Card.IsType,nil,TYPE_MONSTER)
end
end
function c76224717.clear(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -45,7 +45,7 @@ function c82257940.thfilter(c,fid)
end
function c82257940.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if g:Filter(c82257940.thfilter,nil,e:GetLabel()):GetCount()<2 then
if g:FilterCount(c82257940.thfilter,nil,e:GetLabel())<2 then
g:DeleteGroup()
return false
else return true end
......
......@@ -76,14 +76,15 @@ function c87609391.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsAttackable() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(1)
e1:SetCondition(c87609391.damcon)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetLabelObject(tc)
c:GetEquipTarget():RegisterEffect(e1,true)
Duel.RegisterEffect(e1,tp)
end
end
end
......
......@@ -427,8 +427,8 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat)
if le then
local lct=g:GetCount()-1
if lloc then
local lg=g:Filter(Card.IsLocation,c,lloc)
if lg:GetCount()~=lct then return false end
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(Auxiliary.SynLimitFilter,1,c,lf,le) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
......@@ -437,7 +437,7 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat)
return true
end
function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,op)
return alterf(c) and c:IsCanBeXyzMaterial(xyzc) and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c),xyzc)>0 and (not op or op(e,tp,0,c))
return alterf(c) and c:IsCanBeXyzMaterial(xyzc) and Duel.GetLocationCountFromEx(tp,tp,c,xyzc)>0 and (not op or op(e,tp,0,c))
end
--Xyz monster, lv k*n
function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,desc,maxct,op)
......
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