Commit d8701b13 authored by VanillaSalt's avatar VanillaSalt

fix

parent b5e591cf
...@@ -4,7 +4,7 @@ function c33327029.initial_effect(c) ...@@ -4,7 +4,7 @@ function c33327029.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DESTROYED) e1:SetCode(EVENT_CUSTOM+33327029)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCondition(c33327029.condition) e1:SetCondition(c33327029.condition)
e1:SetTarget(c33327029.target) e1:SetTarget(c33327029.target)
...@@ -21,12 +21,32 @@ function c33327029.initial_effect(c) ...@@ -21,12 +21,32 @@ function c33327029.initial_effect(c)
e2:SetTarget(c33327029.thtg) e2:SetTarget(c33327029.thtg)
e2:SetOperation(c33327029.thop) e2:SetOperation(c33327029.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not c33327029.global_check then
c33327029.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(c33327029.regcon)
ge1:SetOperation(c33327029.regop)
Duel.RegisterEffect(ge1,0)
end
end end
function c33327029.cfilter(c,tp) function c33327029.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD) return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_ONFIELD)
end end
function c33327029.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(c33327029.cfilter,1,nil,0) then v=v+1 end
if eg:IsExists(c33327029.cfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function c33327029.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,EVENT_CUSTOM+33327029,re,r,rp,ep,e:GetLabel())
end
function c33327029.condition(e,tp,eg,ep,ev,re,r,rp) function c33327029.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33327029.cfilter,1,nil,tp) return ev==tp or ev==PLAYER_ALL
end end
function c33327029.filter(c,e,tp) function c33327029.filter(c,e,tp)
return c:IsSetCard(0xe1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xe1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -33,6 +33,25 @@ function c76794549.initial_effect(c) ...@@ -33,6 +33,25 @@ function c76794549.initial_effect(c)
e3:SetTarget(c76794549.hntg) e3:SetTarget(c76794549.hntg)
e3:SetOperation(c76794549.hnop) e3:SetOperation(c76794549.hnop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
if not c76794549.global_check then
c76794549.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetOperation(c76794549.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c76794549.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) then
tc:RegisterFlagEffect(76794549,RESET_EVENT+0x1f20000+RESET_PHASE+PHASE_END,0,1)
elseif tc:IsLocation(LOCATION_EXTRA) then
tc:RegisterFlagEffect(76794549,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
tc=eg:GetNext()
end
end end
function c76794549.rpfilter(c,e,tp) function c76794549.rpfilter(c,e,tp)
return c:IsCode(94415058) and (not c:IsForbidden() return c:IsCode(94415058) and (not c:IsForbidden()
...@@ -75,7 +94,7 @@ function c76794549.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -75,7 +94,7 @@ function c76794549.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end end
function c76794549.thfilter1(c,tp,id) function c76794549.thfilter1(c,tp,id)
return c:IsType(TYPE_MONSTER) and c:IsReason(REASON_DESTROY) and c:GetTurnID()==id return c:IsType(TYPE_MONSTER) and c:GetFlagEffect(76794549)~=0
and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c76794549.thfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode()) and Duel.IsExistingMatchingCard(c76794549.thfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
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