Commit 8f3d271d authored by POLYMER's avatar POLYMER

fix

parent bcba57ae
...@@ -58,16 +58,22 @@ if not Duel.GetMustMaterial then ...@@ -58,16 +58,22 @@ if not Duel.GetMustMaterial then
end end
end end
function cm.spfilter(c,sc) function cm.spfilter(c,sc)
return c:IsCanBeXyzMaterial(sc) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and (c:IsXyzLevel(sc,8) or c:IsRank(8) or (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FAIRY)))) or (c:IsLocation(LOCATION_HAND) and (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FAIRY))) or (not c:IsLocation(LOCATION_MZONE+LOCATION_HAND) and c:IsXyzLevel(sc,8) or c:IsRank(8))) return c:IsCanBeXyzMaterial(sc) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and (c:IsXyzLevel(sc,8) or c:IsRank(8) or (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FAIRY)))) or (c:IsLocation(LOCATION_HAND) and (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FAIRY))))
end
function cm.spfilter2(c,sc)
return c:IsCanBeXyzMaterial(sc) and (c:IsXyzLevel(sc,8) or c:IsRank(8) or (c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_MZONE+LOCATION_HAND)))
end end
function cm.hand(g) function cm.hand(g)
return g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1 return g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
end end
function cm.hand2(g)
return g:FilterCount(function(c) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_HAND) and not c:IsXyzLevel(sc,8) and not c:IsRank(8) end,nil)<=1
end
function cm.spcon(e,c,og,min,max) function cm.spcon(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2 local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2
local maxc=2 local maxc=Duel.GetFlagEffect(tp,11451926)>0 and 3 or 2
if min then if min then
minc=math.max(minc,min) minc=math.max(minc,min)
maxc=math.min(maxc,max) maxc=math.min(maxc,max)
...@@ -77,8 +83,8 @@ function cm.spcon(e,c,og,min,max) ...@@ -77,8 +83,8 @@ function cm.spcon(e,c,og,min,max)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c)
local exchk=cm.hand local exchk=cm.hand
if og then if og then
mg=og:Filter(cm.spfilter,c,c) mg=og:Filter(cm.spfilter2,c,c)
exchk=aux.TRUE exchk=cm.hand2
else else
mg=g mg=g
end end
...@@ -93,7 +99,7 @@ end ...@@ -93,7 +99,7 @@ end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then return true end if og and not min then return true end
local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2 local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2
local maxc=2 local maxc=Duel.GetFlagEffect(tp,11451926)>0 and 3 or 2
if min then if min then
if min>minc then minc=min end if min>minc then minc=min end
if max<maxc then maxc=max end if max<maxc then maxc=max end
...@@ -102,8 +108,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) ...@@ -102,8 +108,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
local exchk=cm.hand local exchk=cm.hand
local mg=nil local mg=nil
if og then if og then
mg=og:Filter(cm.spfilter,c,c) mg=og:Filter(cm.spfilter2,c,c)
exchk=aux.TRUE exchk=cm.hand2
else else
mg=g mg=g
end end
...@@ -130,7 +136,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max) ...@@ -130,7 +136,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
Duel.SendtoGrave(sg,REASON_RULE) Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og) c:SetMaterial(og)
Duel.Overlay(c,og) Duel.Overlay(c,og)
if #og==1 and Duel.GetFlagEffect(tp,11451926)>0 then if #og~=2 and Duel.GetFlagEffect(tp,11451926)>0 then
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451926)} local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451926)}
local g=Group.CreateGroup() local g=Group.CreateGroup()
for _,te in pairs(eset) do g:AddCard(te:GetHandler()) end for _,te in pairs(eset) do g:AddCard(te:GetHandler()) end
......
...@@ -56,16 +56,22 @@ if not Duel.GetMustMaterial then ...@@ -56,16 +56,22 @@ if not Duel.GetMustMaterial then
end end
end end
function cm.spfilter(c,sc) function cm.spfilter(c,sc)
return c:IsCanBeXyzMaterial(sc) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and (c:IsXyzLevel(sc,8) or c:IsRank(8) or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_FAIRY)))) or (c:IsLocation(LOCATION_HAND) and (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_FAIRY))) or (not c:IsLocation(LOCATION_MZONE+LOCATION_HAND) and c:IsXyzLevel(sc,8) or c:IsRank(8))) return c:IsCanBeXyzMaterial(sc) and ((c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and (c:IsXyzLevel(sc,8) or c:IsRank(8) or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_FAIRY)))) or (c:IsLocation(LOCATION_HAND) and (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_FAIRY))))
end
function cm.spfilter2(c,sc)
return c:IsCanBeXyzMaterial(sc) and (c:IsXyzLevel(sc,8) or c:IsRank(8) or (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_MZONE+LOCATION_HAND)))
end end
function cm.hand(g) function cm.hand(g)
return g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1 return g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1
end end
function cm.hand2(g)
return g:FilterCount(function(c) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_HAND) and not c:IsXyzLevel(sc,8) and not c:IsRank(8) end,nil)<=1
end
function cm.spcon(e,c,og,min,max) function cm.spcon(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2 local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2
local maxc=2 local maxc=Duel.GetFlagEffect(tp,11451926)>0 and 3 or 2
if min then if min then
minc=math.max(minc,min) minc=math.max(minc,min)
maxc=math.min(maxc,max) maxc=math.min(maxc,max)
...@@ -75,8 +81,8 @@ function cm.spcon(e,c,og,min,max) ...@@ -75,8 +81,8 @@ function cm.spcon(e,c,og,min,max)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c) local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c,c)
local exchk=cm.hand local exchk=cm.hand
if og then if og then
mg=og:Filter(cm.spfilter,c,c) mg=og:Filter(cm.spfilter2,c,c)
exchk=aux.TRUE exchk=cm.hand2
else else
mg=g mg=g
end end
...@@ -91,7 +97,7 @@ end ...@@ -91,7 +97,7 @@ end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then return true end if og and not min then return true end
local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2 local minc=Duel.GetFlagEffect(tp,11451926)>0 and 1 or 2
local maxc=2 local maxc=Duel.GetFlagEffect(tp,11451926)>0 and 3 or 2
if min then if min then
if min>minc then minc=min end if min>minc then minc=min end
if max<maxc then maxc=max end if max<maxc then maxc=max end
...@@ -100,8 +106,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) ...@@ -100,8 +106,8 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
local exchk=cm.hand local exchk=cm.hand
local mg=nil local mg=nil
if og then if og then
mg=og:Filter(cm.spfilter,c,c) mg=og:Filter(cm.spfilter2,c,c)
exchk=aux.TRUE exchk=cm.hand2
else else
mg=g mg=g
end end
...@@ -128,7 +134,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max) ...@@ -128,7 +134,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
Duel.SendtoGrave(sg,REASON_RULE) Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og) c:SetMaterial(og)
Duel.Overlay(c,og) Duel.Overlay(c,og)
if #og==1 and Duel.GetFlagEffect(tp,11451926)>0 then if #og~=2 and Duel.GetFlagEffect(tp,11451926)>0 then
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451926)} local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_FLAG_EFFECT+11451926)}
local g=Group.CreateGroup() local g=Group.CreateGroup()
for _,te in pairs(eset) do g:AddCard(te:GetHandler()) end for _,te in pairs(eset) do g:AddCard(te:GetHandler()) end
......
...@@ -32,10 +32,11 @@ function cm.initial_effect(c) ...@@ -32,10 +32,11 @@ function cm.initial_effect(c)
e3:SetRange(LOCATION_FZONE+LOCATION_GRAVE) e3:SetRange(LOCATION_FZONE+LOCATION_GRAVE)
e3:SetTarget(cm.mattg) e3:SetTarget(cm.mattg)
e3:SetOperation(cm.matop) e3:SetOperation(cm.matop)
--c:RegisterEffect(e3) --c:RegisterEffect(e3)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_GRAVE,0,nil)
return not c:IsLocation(LOCATION_GRAVE) or (g:IsContains(c) and #g>=3) return not c:IsLocation(LOCATION_GRAVE) or (g:IsContains(c) and #g>=3)
end end
......
...@@ -27,7 +27,7 @@ function c28326245.atkfilter(c,atk) ...@@ -27,7 +27,7 @@ function c28326245.atkfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk-1) return c:IsFaceup() and c:IsAttackBelow(atk-1)
end end
function c28326245.atkval(e,c) function c28326245.atkval(e,c)
return Duel.GetMatchingGroup(c28326245.atkfilter,c:GetControler(),0,LOCATION_MZONE,nil,c:GetBaseAttack())*1000 return Duel.GetMatchingGroupCount(c28326245.atkfilter,c:GetControler(),0,LOCATION_MZONE,nil,c:GetBaseAttack())*1000
end end
function c28326245.thcon(e,tp,eg,ep,ev,re,r,rp) function c28326245.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) return eg:IsContains(e:GetHandler())
......
...@@ -6,7 +6,7 @@ function c75005123.initial_effect(c) ...@@ -6,7 +6,7 @@ function c75005123.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
--e1:SetCondition(c75005123.ttcon) e1:SetCondition(c75005123.ttcon)
e1:SetCost(c75005123.ttcost) e1:SetCost(c75005123.ttcost)
e1:SetOperation(c75005123.ttop) e1:SetOperation(c75005123.ttop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -29,15 +29,16 @@ function c75005123.ttop(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,15 +29,16 @@ function c75005123.ttop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c75005123.tgfilter(c,type) function c75005123.tgfilter(c,typ)
return bit.band(c:GetType(),type)~=0 and c:IsAbleToGrave() return bit.band(c:GetType(),typ)~=0 and c:IsFaceupEx() and c:IsAbleToGrave()
end end
function c75005123.operation(e,tp,eg,ep,ev,re,r,rp) function c75005123.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,75005123) Duel.Hint(HINT_CARD,0,75005123)
local type=e:GetLabel() local typ=e:GetLabel()
if Duel.IsExistingMatchingCard(c75005123.tgfilter,tp,0,LOCATION_HAND+LOCATION_ONFIELD,1,nil,type) and Duel.SelectYesNo(tp,aux.Stringid(75005123,0)) then local p=1-tp
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) if Duel.IsExistingMatchingCard(c75005123.tgfilter,p,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,typ) and Duel.SelectYesNo(p,aux.Stringid(75005123,0)) then
local g=Duel.SelectMatchingCard(tp,c75005123.tgfilter,tp,0,LOCATION_HAND+LOCATION_ONFIELD,1,1,nil,type) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(p,c75005123.tgfilter,p,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,typ)
if #g>0 then if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT) Duel.SendtoGrave(g,REASON_EFFECT)
end end
......
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