Commit f2d7d487 authored by Tianchenglipu's avatar Tianchenglipu

Update c57707471.lua

parent 10116470
...@@ -2,7 +2,16 @@ ...@@ -2,7 +2,16 @@
function c57707471.initial_effect(c) function c57707471.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,6,2,c57707471.ovfilter,aux.Stringid(57707471,0),2,c57707471.xyzop) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c57707471.xyzcon)
e1:SetTarget(c57707471.xyztg)
e1:SetOperation(c57707471.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
--atk --atk
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
...@@ -21,16 +30,72 @@ function c57707471.initial_effect(c) ...@@ -21,16 +30,72 @@ function c57707471.initial_effect(c)
e3:SetTarget(c57707471.destg) e3:SetTarget(c57707471.destg)
e3:SetOperation(c57707471.desop) e3:SetOperation(c57707471.desop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
if not c57707471.xyz_filter then
c57707471.xyz_filter=function(mc) return mc:IsXyzLevel(c,6) end
end
end end
c57707471.xyz_number=21 c57707471.xyz_number=21
c57707471.xyz_count=2
function c57707471.ovfilter(c,tp,xyzc) function c57707471.ovfilter(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetRank()==5 and c:IsCanBeXyzMaterial(xyzc) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetRank()==5 and c:IsCanBeXyzMaterial(xyzc)
and c:CheckRemoveOverlayCard(tp,1,REASON_COST) and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
end end
function c57707471.xyzop(e,tp,chk,mc) function c57707471.xyzcon(e,c,og,min,max)
if chk==0 then return true end if c==nil then return true end
mc:RemoveOverlayCard(tp,1,1,REASON_COST) local tp=c:GetControler()
end local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
if 2<=ct then return false end
if min and (min>2 or max<2) then return false end
if ct<1 and not og and Duel.IsExistingMatchingCard(c57707471.ovfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,nil,6,2,2,og)
end
function c57707471.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local b1=Duel.CheckXyzMaterial(c,nil,6,2,2,og)
local b2=ct<1 and not og and Duel.IsExistingMatchingCard(c57707471.ovfilter,tp,LOCATION_MZONE,0,1,nil)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(57707471,0))) then
e:SetLabel(1)
return true
else
e:SetLabel(0)
local g=Duel.SelectXyzMaterial(tp,c,nil,6,2,2,og)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function c57707471.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,c57707471.ovfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
mg:GetFirst():RemoveOverlayCard(tp,1,1,REASON_COST)
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
else
local mg=e:GetLabelObject()
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
function c57707471.atkval(e,c) function c57707471.atkval(e,c)
return c:GetOverlayCount()*1000 return c:GetOverlayCount()*1000
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