Commit 9d67371c authored by wind2009's avatar wind2009

Fix ガガガガール-ゼロゼロコール

parent 52835795
Pipeline #43398 passed with stages
in 3 minutes and 38 seconds
No preview for this file type
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
100256008 100256008
100256010 100256010
100256011 100256011
100256012
100256013 100256013
100256014 100256014
100256015 100256015
......
--ガガガガール --ガガガガール-ゼロゼロコール
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--special summon --special summon
...@@ -33,21 +33,32 @@ end ...@@ -33,21 +33,32 @@ end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,1-tp) return eg:IsExists(s.cfilter,1,nil,1-tp)
end end
function s.xyzfilter(c,tp,mc) function s.CreateTempLevelEffect(ec,level_source,reset)
if not c:IsFaceup() or not c:IsLevelAbove(1) then return false end local reset_flag=reset and RESET_EVENT+RESETS_STANDARD or 0
local mg=Group.FromCards(c,mc) local e1=Effect.CreateEffect(ec)
local e1=Effect.CreateEffect(mc)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_XYZ_LEVEL) e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetValue(s.xyzlv) e1:SetValue(s.xyzlv)
e1:SetLabel(c:GetLevel()) e1:SetLabel(level_source:GetLevel())
mc:RegisterEffect(e1,true) e1:SetReset(reset_flag)
local res=Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,mg,2,2) ec:RegisterEffect(e1,true)
return e1
end
function s.SetTempLevel(ec,level_source,reset,callback)
local e1=s.CreateTempLevelEffect(ec,level_source,reset)
local res=callback()
if e1 then e1:Reset() end if e1 then e1:Reset() end
return res return res
end end
function s.xyzlv(e,c,rc) function s.xyzlv(e,c,rc)
return e:GetHandler():GetLevel()+e:GetLabel()*0x10000 return e:GetHandler():GetLevel() | (e:GetLabel() << 16)
end
function s.xyzfilter(c,tp,mc)
if not c:IsFaceup() or not c:IsLevelAbove(1) then return false end
local mg=Group.FromCards(c,mc)
return s.SetTempLevel(mc,c,false,function()
return Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,mg,2,2)
end)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -65,24 +76,17 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,24 +76,17 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToChain() or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end if not c:IsRelateToChain() or Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToChain() or tc:IsFacedown() or not tc:IsControler(tp) then return end if not tc:IsRelateToChain() or tc:IsFacedown() or not tc:IsControler(tp) then return end
Duel.AdjustAll()
local mg=Group.FromCards(c,tc) local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local e1=Effect.CreateEffect(c) s.SetTempLevel(c,tc,true,function()
e1:SetType(EFFECT_TYPE_SINGLE) Duel.AdjustAll()
e1:SetCode(EFFECT_XYZ_LEVEL) local xyzg=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,mg,2,2)
e1:SetValue(s.xyzlv) if xyzg:GetCount()>0 then
e1:SetLabel(tc:GetLevel()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
c:RegisterEffect(e1,true) Duel.XyzSummon(tp,xyz,mg)
local xyzg=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,mg,2,2) end
if xyzg:GetCount()>0 then end)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,mg)
else
if e1 then e1:Reset() end
end
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -102,9 +106,10 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,9 +106,10 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g) Duel.HintSelection(g)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0) e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
\ No newline at end of file
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