--Gimmick Puppet Scarlet Doom local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,9,s.sumcon,s.tlfilter) c:EnableReviveLimit() --Each time a monster(s) on the field is destroyed by a card effect, this card gains 800 ATK. local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_ATKCHANGE) e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) e1:SetCode(EVENT_DESTROYED) e1:SetRange(LOCATION_MZONE) e1:SetCondition(s.atkcon) e1:SetTarget(s.atktg) e1:SetOperation(s.atkop) c:RegisterEffect(e1) --If a monster(s) is Special Summoned to your opponent's field (except during the Damage Step): You can destroy that monster(s), and if you do, inflict 800 damage to your opponent. You can use this effect of "Gimmick Puppet Scarlet Doom" up to twice per turn. local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,0)) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(2,id) e2:SetCondition(s.descond) e2:SetTarget(s.destg) e2:SetOperation(s.desop) c:RegisterEffect(e2) aux.GlobalCheck(s,function() local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DESTROY) ge1:SetLabel(id) ge1:SetCondition(s.regcon) ge1:SetOperation(s.regop) Duel.RegisterEffect(ge1,0) end) end function s.sumcon(e,c) return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0 end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and c:IsAttribute(ATTRIBUTE_DARK) end function s.cfilter(c,r) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT) end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.cfilter,1,nil,r) end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsFaceup() end end function s.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsFaceup() and c:IsRelateToEffect(e) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(800) c:RegisterEffect(e1) end end function s.descond(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(Card.IsControler,1,nil,1-tp) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return #eg>0 end Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,#eg,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800) end function s.desop(e,tp,eg,ep,ev,re,r,rp) if Duel.Destroy(eg,REASON_EFFECT)>0 then Duel.Damage(1-tp,800,REASON_EFFECT) end end function s.regfilter(c,r) return c:IsType(TYPE_MONSTER) and (r&REASON_EFFECT+REASON_BATTLE)~=0 end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.regfilter,1,nil,r) end function s.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(1-tp,id,RESET_PHASE+PHASE_END,0,1) end