Commit ea2d864c authored by nanahira's avatar nanahira

unfinished

parent febeb6e3
local m=37564351
local cm=_G["c"..m]
Duel.LoadScript("c37564765.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
c:SetSPSummonOnce(m)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(function(e,se,sp,st)
return se and se:GetHandler()==e:GetHandler()
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(0x14000+EFFECT_FLAG_SET_AVAILABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(function(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetFlagEffect(m)>0 and c:GetPreviousControler()==tp and c:IsLocation(LOCATION_GRAVE)
end,1,nil)
end)
e2:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:Filter(function(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:GetFlagEffect(m)>0 and c:GetPreviousControler()==tp and c:IsLocation(LOCATION_GRAVE) and c:IsAbleToRemoveAsCost()
end,nil):GetFirst()
if chk==0 then return tc end
Duel.Remove(tc,POS_FACEDOWN,REASON_COST)
end)
e2:SetTarget(cm.SelfSpsummonTarget)
e2:SetOperation(cm.SelfSpsummonOperation)
c:RegisterEffect(e2)
if not cm.gchk then
cm.gchk=true
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_LEAVE_FIELD_P)
ex:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
if Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==1 then
local g=eg:Filter(function(c)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end)
for tc in aux.Next(g) do
tc:RegisterFlagEffect(m,0x47e1000,0,1)
end
end
end
end)
Duel.RegisterEffect(ex,0)
end
end
...@@ -621,7 +621,7 @@ function cm.SawawaSpsummonCost(ct,exf) ...@@ -621,7 +621,7 @@ function cm.SawawaSpsummonCost(ct,exf)
end end
end end
function cm.SelfSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk) function cm.SelfSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return cm.CheckSummonLocation(c,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
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