Commit 8f3d271d authored by POLYMER's avatar POLYMER

fix

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