--created by ZEN, coded by TaxingCorn117 local s,id=GetID() function s.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(math.floor(id/100),0)) e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetType(EFFECT_TYPE_IGNITION) e1:SetRange(LOCATION_HAND) e1:SetCondition(s.sumcon) e1:SetTarget(s.sumtg) e1:SetOperation(s.sumop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1,id) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(math.floor(id/100),0)) e3:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_SUMMON_SUCCESS) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetTarget(s.sptg) e3:SetOperation(s.spop) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e4) local e8=Effect.CreateEffect(c) e8:SetDescription(aux.Stringid(math.floor(id/100),1)) e8:SetCategory(CATEGORY_ATKCHANGE) e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e8:SetRange(LOCATION_MZONE) e8:SetCode(EVENT_DAMAGE) e8:SetCondition(s.atkcon) e8:SetOperation(s.atkop) c:RegisterEffect(e8) if not s.global_check then s.global_check=true s[0]=0 s[1]=0 local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e2:SetCode(EVENT_PHASE_START+PHASE_DRAW) e2:SetOperation(function(e) s[0]=0 s[1]=0 end) Duel.RegisterEffect(e2,0) local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetCode(EVENT_DAMAGE) e5:SetOperation(s.count) Duel.RegisterEffect(e5,0) end end function s.count(e,tp,eg,ep,ev,re,r,rp) s[ep]=s[ep]+ev end function s.cfilter(c) return c:IsSetCard(0x52f) end function s.sumcon(e,c) return s[e:GetHandlerPlayer()]>=1000 and Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) end function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function s.sumop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end end function s.spfilter(c,e,tp,lv) return c:IsSetCard(0x52f) and c:IsLevel(lv) and not c:IsType(TYPE_LINK) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,100) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_HAND+LOCATION_REMOVED) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local dc=Duel.TossDice(tp,1) local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_HAND+LOCATION_REMOVED,LOCATION_REMOVED,nil,e,tp,dc) if Duel.Damage(tp,dc*100,REASON_EFFECT)~=0 and Duel.GetLP(tp)>0 and #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end function s.atkcon(e,tp,eg,ep,ev,re,r,rp) return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 end function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetCard(eg) end function s.atkop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_CARD,0,id) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local tc=g:GetFirst() while tc do local atk=tc:GetAttack() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(-200) e1:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e1) local e2=e1:Clone(e:GetHandler()) e2:SetCode(EFFECT_UPDATE_DEFENSE) tc:RegisterEffect(e2) if (atk>0 and tc:IsAttack(e:GetHandler())<=2000) then local e3=Effect.CreateEffect(e:GetHandler()) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_DISABLE_EFFECT) e3:SetReset(RESET_EVENT+RESETS_STANDARD) tc:RegisterEffect(e3) end end end