Commit 68c2c0d8 authored by mercury233's avatar mercury233

fix

parent 19d9367a
......@@ -25,11 +25,12 @@ function c100204007.initial_effect(c)
c:RegisterEffect(e2)
end
function c100204007.eqfilter(c,tp)
return c:IsRace(RACE_INSECT) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,2,c,c:GetCode())
return c:IsRace(RACE_INSECT) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,2,c,c:GetCode()) and c:CheckUniqueOnField(tp)
end
function c100204007.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100204007.eqfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100204007.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local ct=math.min((Duel.GetLocationCount(tp,LOCATION_SZONE)),3)
......
......@@ -23,7 +23,7 @@ function c100334003.initial_effect(c)
e2:SetCountLimit(1)
e2:SetCondition(c100334003.condition)
e2:SetTarget(c100334003.target)
e2:SetOperation(c100334003.activate)
e2:SetOperation(c100334003.opetation)
c:RegisterEffect(e2)
end
function c100334003.cfilter(c)
......@@ -45,13 +45,13 @@ function c100334003.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c100334003.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return at and at:IsControler(tp) and at:IsRace(RACE_CYBERSE)
return at and at:IsControler(tp) and at:IsFaceup() and at:IsRace(RACE_CYBERSE)
end
function c100334003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.GetAttackTarget():CreateEffectRelation(e)
end
function c100334003.activate(e,tp,eg,ep,ev,re,r,rp)
function c100334003.opetation(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
if at:IsRelateToEffect(e) and at:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -21,35 +21,31 @@ function Auxiliary.GetLinkMaterials(tp,f,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg
end
function Auxiliary.LCheckOtherMaterial(c,sg,lc)
function Auxiliary.LCheckOtherMaterial(c,mg,lc)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL)}
for _,te in pairs(le) do
local f=te:GetValue()
if f and not f(te,lc,sg) then return false end
if f and not f(te,lc,mg) then return false end
end
return true
end
function Auxiliary.LCheckMaterialCompatibility(sg,lc)
for tc in Auxiliary.Next(sg) do
local mg=sg:Filter(aux.TRUE,tc)
local res=Auxiliary.LCheckOtherMaterial(tc,mg,lc)
mg:DeleteGroup()
if not res then return false end
end
return true
function Auxiliary.LUncompatibilityFilter(c,sg,lc)
local mg=sg:Filter(aux.TRUE,c)
return not Auxiliary.LCheckOtherMaterial(c,mg,lc)
end
function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:AddCard(c)
ct=ct+1
local res=Auxiliary.LCheckMaterialCompatibility(sg,lc)
and (Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
or ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc,gf))
local res=Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
or ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:RemoveCard(c)
ct=ct-1
return res
end
function Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc)
end
function Auxiliary.LinkCondition(f,minc,maxc,gf)
return function(e,c)
......@@ -114,12 +110,12 @@ end
e1:SetValue(c100334004.matval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100334004.ctcon)
e2:SetOperation(c100334004.ctop)
c:RegisterEffect(e2)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100334004.ctcon)
e2:SetOperation(c100334004.ctop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100334004,0))
......@@ -134,19 +130,19 @@ end
c:RegisterEffect(e3)
end
function c100334004.matcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100334004)==0
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100334004)==0
end
function c100334004.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function c100334004.matval(e,c,mg)
return c:IsSetCard(0x101) and mg:IsExists(c100334004.mfilter,1,nil)
return c:IsSetCard(0x101) and mg:IsExists(c100334004.mfilter,1,nil)
end
function c100334004.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c100334004.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,100334004,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,100334004,RESET_PHASE+PHASE_END,0,1)
end
function c100334004.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -21,35 +21,31 @@ function Auxiliary.GetLinkMaterials(tp,f,lc)
if mg2:GetCount()>0 then mg:Merge(mg2) end
return mg
end
function Auxiliary.LCheckOtherMaterial(c,sg,lc)
function Auxiliary.LCheckOtherMaterial(c,mg,lc)
local le={c:IsHasEffect(EFFECT_EXTRA_LINK_MATERIAL)}
for _,te in pairs(le) do
local f=te:GetValue()
if f and not f(te,lc,sg) then return false end
if f and not f(te,lc,mg) then return false end
end
return true
end
function Auxiliary.LCheckMaterialCompatibility(sg,lc)
for tc in Auxiliary.Next(sg) do
local mg=sg:Filter(aux.TRUE,tc)
local res=Auxiliary.LCheckOtherMaterial(tc,mg,lc)
mg:DeleteGroup()
if not res then return false end
end
return true
function Auxiliary.LUncompatibilityFilter(c,sg,lc)
local mg=sg:Filter(aux.TRUE,c)
return not Auxiliary.LCheckOtherMaterial(c,mg,lc)
end
function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:AddCard(c)
ct=ct+1
local res=Auxiliary.LCheckMaterialCompatibility(sg,lc)
and (Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
or ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc,gf))
local res=Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
or ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc,gf)
sg:RemoveCard(c)
ct=ct-1
return res
end
function Auxiliary.LCheckGoal(tp,sg,lc,minc,ct,gf)
return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc)
end
function Auxiliary.LinkCondition(f,minc,maxc,gf)
return function(e,c)
......@@ -114,12 +110,12 @@ end
e1:SetValue(c100334006.matval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100334006.ctcon)
e2:SetOperation(c100334006.ctop)
c:RegisterEffect(e2)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(c100334006.ctcon)
e2:SetOperation(c100334006.ctop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100334006,0))
......@@ -134,19 +130,19 @@ end
c:RegisterEffect(e3)
end
function c100334006.matcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100334006)==0
return Duel.GetFlagEffect(e:GetHandlerPlayer(),100334006)==0
end
function c100334006.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
return c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_CYBERSE)
end
function c100334006.matval(e,c,mg)
return c:IsSetCard(0x101) and mg:IsExists(c100334006.mfilter,1,nil)
return c:IsSetCard(0x101) and mg:IsExists(c100334006.mfilter,1,nil)
end
function c100334006.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c100334006.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,100334006,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,100334006,RESET_PHASE+PHASE_END,0,1)
end
function c100334006.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -29,10 +29,11 @@ function c101006001.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetAttack()/2)
e1:SetValue(math.ceil(c:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,101006101,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_WIND) then
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,101006101,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_WIND) then
local token=Duel.CreateToken(tp,101006101)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -59,9 +59,7 @@ function c101006003.cfilter(c)
end
function c101006003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101006003.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c101006003.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.DiscardHand(tp,c101006003.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c101006003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......@@ -70,8 +68,7 @@ function c101006003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c101006003.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(c101006003.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101006003,3)) then
Duel.BreakEffect()
......
......@@ -92,7 +92,7 @@ function c101006025.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101006025.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g1:GetCount()>0 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
elseif e:GetLabel()==2 then
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)<=0 then return end
......
......@@ -8,7 +8,7 @@ function c101006030.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101006030)
e1:SetTarget(c101006030.thtg)
e1:SetOperation(c101006030.tgop)
......@@ -27,8 +27,7 @@ end
function c101006030.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c101006030.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc)
if tc:IsType(TYPE_NORMAL) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(101006030,1)) then
......
......@@ -42,7 +42,7 @@ function c101006033.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(g,REASON_EFFECT)
end
function c101006033.valfilter(c,tp)
return c:IsCode(101006033) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
return c:IsCode(101006033) and c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp)
end
function c101006033.valcheck(e,c)
local g=c:GetMaterial()
......@@ -72,7 +72,7 @@ function c101006033.effop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCondition(c101006033.descon2)
e1:SetTarget(c101006033.destg2)
e1:SetOperation(c101006033.desop2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
......
......@@ -10,7 +10,7 @@ function c101006036.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c101006036.splimit)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
......@@ -40,21 +40,18 @@ function c101006036.chainfilter(re,tp,cid)
return not (re:GetHandler():IsRace(RACE_THUNDER) and re:IsActiveType(TYPE_MONSTER)
and Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_LOCATION)==LOCATION_HAND)
end
function c101006036.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c101006036.spfilter(c,fc,tp)
return c:IsRace(RACE_THUNDER) and c:IsType(TYPE_EFFECT) and not c:IsType(TYPE_FUSION)
and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost() and Duel.GetLocationCountFromEx(tp,tp,c)>0
and c:IsReleasable() and Duel.GetLocationCountFromEx(tp,tp,c,fc)>0
end
function c101006036.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetCustomActivityCount(101006036,tp,ACTIVITY_CHAIN)~=0
and Duel.CheckReleaseGroup(tp,c101006036.spfilter,1,nil,c,tp)
and Duel.CheckReleaseGroup(tp,c101006036.spfilter,1,nil,c,fc,tp)
end
function c101006036.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c101006036.spfilter,1,1,nil,c,tp)
local g=Duel.SelectReleaseGroup(tp,c101006036.spfilter,1,1,nil,c,fc,tp)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
end
......
......@@ -31,7 +31,7 @@ function c101006040.initial_effect(c)
c:RegisterEffect(e3)
end
function c101006040.matfilter(c)
return c:IsType(TYPE_EFFECT) and c:IsAttribute(ATTRIBUTE_FIRE)
return c:IsLinkType(TYPE_EFFECT) and c:IsLinkAttribute(ATTRIBUTE_FIRE)
end
function c101006040.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
......@@ -68,25 +68,27 @@ function c101006040.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
function c101006040.atkfilter(c,tc)
function c101006040.atkfilter1(c,tp)
return c:IsFaceup() and Duel.IsExistingTarget(c101006040.atkfilter2,tp,LOCATION_GRAVE,0,1,nil,tc)
end
function c101006040.atkfilter2(c,tc)
return c:IsType(TYPE_MONSTER) and c:GetAttack()~=tc:GetAttack()
end
function c101006040.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c101006040.atkfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c101006040.atkfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
e:SetLabelObject(g:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101006040.atkfilter,tp,LOCATION_GRAVE,0,1,1,nil,g:GetFirst())
Duel.SelectTarget(tp,c101006040.atkfilter2,tp,LOCATION_GRAVE,0,1,1,nil,g:GetFirst())
end
function c101006040.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
local sc=g:GetNext()
if tc:IsFacedown() or not tc:IsRelateToEffect(e)
or sc:IsFacedown() or not sc:IsRelateToEffect(e) then return end
local sc=g:GetFirst()
if sc==tc then sc=g:GetNext() end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or not sc:IsRelateToEffect(e) then return end
local ac=e:GetLabelObject()
if tc==ac then tc=sc end
local atk=tc:GetAttack()
......
......@@ -76,7 +76,7 @@ function c101006042.descost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c101006042.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsSummonType() end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsSummonType(SUMMON_TYPE_SPECIAL) end
if chk==0 then return Duel.IsExistingTarget(Card.IsSummonType,tp,0,LOCATION_MZONE,1,nil,SUMMON_TYPE_SPECIAL) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsSummonType,tp,0,LOCATION_MZONE,1,1,nil,SUMMON_TYPE_SPECIAL)
......
......@@ -15,39 +15,41 @@ function c101006050.cfilter(c)
return c:GetSequence()>=5
end
function c101006050.filter1(c,e)
return not c:IsImmuneToEffect(e)
return c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
end
function c101006050.filter2(c,e,tp,m,f,chkf,exmg)
local res=nil
if exmg~=nil then
for gc in aux.Next(exmg) do
m:AddCard(gc)
if c:CheckFusionMaterial(m,gc,chkf) then res=true end
m:RemoveCard(gc)
end
end
function c101006050.exfilter0(c)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c101006050.exfilter1(c,e)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c101006050.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_CYBERSE) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and (c:CheckFusionMaterial(m,nil,chkf) or res)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101006050.filter3(c)
return c:IsType(TYPE_LINK) and c:IsRace(RACE_CYBERSE) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
function c101006050.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1
end
function c101006050.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local exmg=nil
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsAbleToGrave,nil)
if not Duel.IsExistingMatchingCard(c101006050.cfilter,tp,LOCATION_MZONE,0,1,nil) then
exmg=Duel.GetMatchingGroup(c101006050.filter3,tp,LOCATION_GRAVE,0,nil)
local sg=Duel.GetMatchingGroup(c101006050.exfilter0,tp,LOCATION_GRAVE,0,nil)
if sg:GetCount()>0 then
mg1:Merge(sg)
Auxiliary.FCheckAdditional=c101006050.fcheck
end
end
local res=Duel.IsExistingMatchingCard(c101006050.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf,exmg)
local res=Duel.IsExistingMatchingCard(c101006050.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c101006050.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf,exmg)
res=Duel.IsExistingMatchingCard(c101006050.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
......@@ -57,11 +59,17 @@ end
function c101006050.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c101006050.filter1,nil,e)
local exmg=nil
local exmat=false
if not Duel.IsExistingMatchingCard(c101006050.cfilter,tp,LOCATION_MZONE,0,1,nil) then
exmg=Duel.GetMatchingGroup(c101006050.filter3,tp,LOCATION_GRAVE,0,nil)
local sg=Duel.GetMatchingGroup(c101006050.exfilter1,tp,LOCATION_GRAVE,0,nil,e)
if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
end
local sg1=Duel.GetMatchingGroup(c101006050.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf,exmg)
if exmat then Auxiliary.FCheckAdditional=c101006050.fcheck end
local sg1=Duel.GetMatchingGroup(c101006050.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
......@@ -69,7 +77,7 @@ function c101006050.activate(e,tp,eg,ep,ev,re,r,rp)
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c101006050.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf,exmg)
sg2=Duel.GetMatchingGroup(c101006050.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
......@@ -77,16 +85,11 @@ function c101006050.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if exmg~=nil then exmg=exmg:Filter(Card.IsCanBeFusionMaterial,nil,tc) end
mg1:RemoveCard(tc)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=nil
if exmg~=nil and (not tc:CheckFusionMaterial(mg1,nil,chkf) or Duel.SelectYesNo(tp,aux.Stringid(101006050,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local gc=exmg:Select(tp,1,1,nil):GetFirst()
mat1=Duel.SelectFusionMaterial(tp,tc,mg1,gc,chkf)
else
mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
end
if exmat then Auxiliary.FCheckAdditional=c101006050.fcheck end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
tc:SetMaterial(mat1)
local rg=mat1:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
mat1:Sub(rg)
......
......@@ -43,7 +43,7 @@ function c101006052.mfilter(c)
return c:GetLevel()>0 and c:IsSetCard(0x220) and c:IsAbleToDeck()
end
function c101006052.cfilter(c)
return c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_FIRE)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_FIRE)
end
function c101006052.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
......
......@@ -23,7 +23,7 @@ function c101006062.initial_effect(c)
e3:SetDescription(aux.Stringid(101006062,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,101006062+100)
......
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