--created by Meedogh, coded by Jack & Lyris local cid,id=GetID() function cid.initial_effect(c) --pendulum summon aux.EnablePendulumAttribute(c) --recover local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetRange(LOCATION_PZONE) e1:SetCountLimit(1,id) e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetCategory(CATEGORY_RECOVER) e1:SetCondition(function(e,tp,eg) local tc=eg:GetFirst() return #eg==1 and tc:IsFaceup() and tc:IsType(TYPE_BIGBANG) end) e1:SetTarget(cid.rctg) e1:SetOperation(cid.rcop) c:RegisterEffect(e1) --scale change local e2=Effect.CreateEffect(c) e2:SetDescription(1074) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_PZONE) e2:SetCountLimit(1,id+100) e2:SetCondition(cid.sccon) e2:SetCost(cid.sccost) e2:SetTarget(cid.sctg) e2:SetOperation(cid.scop) c:RegisterEffect(e2) --burn/recover local e3=Effect.CreateEffect(c) e3:SetDescription(1122) e3:SetCategory(CATEGORY_DAMAGE+CATEGORY_RECOVER) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id+200) e3:SetTarget(cid.damtg) e3:SetOperation(cid.damop) c:RegisterEffect(e3) --spsummon local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,id+300) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetDescription(1152) e4:SetTarget(cid.target) e4:SetOperation(cid.operation) c:RegisterEffect(e4) if not cid.global_check then cid.global_check=true cid[0]=0 cid[1]=0 local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW) ge1:SetOperation(function(e) cid[0]=0 cid[1]=0 end) Duel.RegisterEffect(ge1,0) local ge2=Effect.CreateEffect(c) ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge2:SetCode(EVENT_DAMAGE) ge2:SetOperation(function(e,tp,eg,ep,ev) cid[ep]=cid[ep]+ev end) Duel.RegisterEffect(ge2,0) end end function cid.rctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetCard(eg) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0) end function cid.rcop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not e:GetHandler():IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end Duel.Recover(Duel.GetChainInfo(CHAININFO_TARGET_PLAYER),tc:GetAttack(),REASON_EFFECT) end function cid.scfilter(c) return (c:IsSetCard(0x1da2) or c:IsCode(id-2)) end function cid.sccon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(cid.scfilter,tp,LOCATION_PZONE,0,1,e:GetHandler()) end function cid.sccost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,800) end Duel.PayLPCost(tp,800) end function cid.sctg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():GetLeftScale()~=8 end end function cid.scop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or c:GetLeftScale()==8 then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CHANGE_LSCALE) e1:SetValue(8) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_CHANGE_RSCALE) c:RegisterEffect(e2) end function cid.damfilter(c) return c:IsFaceup() and (c:IsLevelAbove(1) or c:IsRankAbove(1)) end function cid.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and cid.damfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(cid.damfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local tc=Duel.SelectTarget(tp,cid.damfilter,tp,0,LOCATION_MZONE,1,1,nil):GetFirst() local lv=0 if tc:IsType(TYPE_XYZ) then lv=tc:GetRank() else lv=tc:GetLevel() end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,lv*200) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,lv*200) end function cid.damop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local atk=0 if tc:IsType(TYPE_XYZ) then atk=tc:GetRank() else atk=tc:GetLevel() end Duel.Damage(1-tp,atk*200,REASON_EFFECT,true) Duel.Recover(tp,atk*200,REASON_EFFECT,true) Duel.RDComplete() end end function cid.filter(c,e,tp) return c:IsSetCard(0x1da2) and c:IsAttackBelow(cid[tp]) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) end function cid.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if Duel.SpecialSummon(Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp),0,tp,tp,false,false,POS_FACEUP)<=0 then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetTargetRange(1,0) e1:SetTarget(aux.TargetBoolFunction(aux.NOT(Card.IsSetCard),0xda2)) e1:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e1,tp) end