local cid,id=GetID() function cid.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xcd01),aux.NonTuner(nil),1) c:EnableReviveLimit() --change name local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e0:SetCode(EFFECT_ADD_CODE) e0:SetRange(LOCATION_MZONE+LOCATION_GRAVE) e0:SetValue(2403771) c:RegisterEffect(e0) --Equip local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_EQUIP+CATEGORY_LEAVE_GRAVE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id) e1:SetTarget(cid.eqtg) e1:SetOperation(cid.eqop) c:RegisterEffect(e1) --atk local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetValue(cid.atkval) c:RegisterEffect(e2) --destroy local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCost(cid.descost) e3:SetTarget(cid.destg) e3:SetOperation(cid.desop) e3:SetCountLimit(1,id+100) c:RegisterEffect(e3) --Destroy replace local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_DESTROY_REPLACE) e4:SetCountLimit(1,id+200) e4:SetTarget(cid.desreptg) e4:SetOperation(cid.desrepop) c:RegisterEffect(e4) end --EQUIP function cid.CanEquipMonster(c) return true end function cid.eqfilter(c) return c:IsType(TYPE_MONSTER) and (not c:IsLocation(LOCATION_MZONE) or c:IsAbleToChangeControler()) and not c:IsForbidden() end function cid.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and cid.eqfilter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(cid.eqfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(cid.eqfilter),tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil) if #g<=0 then return end Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,#g,0,0) if g:GetFirst():IsLocation(LOCATION_GRAVE) then Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g:GetFirst(),1,0,0) end end function cid.eqlimit(e,c) return e:GetOwner()==c end function cid.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsFaceup() and c:IsRelateToEffect(e) and (not tc:IsOnField() or tc:IsFaceup()) and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then if not Duel.Equip(tp,tc,c,false) then return end e:SetLabelObject(tc) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_EQUIP_LIMIT) e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(cid.eqlimit) tc:RegisterEffect(e1) end end --ATK function cid.atkval(e,c) local atk=0 local g=c:GetEquipGroup() local tc=g:GetFirst() while tc do if tc:IsFaceup() and tc:GetOriginalType()&TYPE_MONSTER>0 and tc:GetOriginalLevel()>=0 then atk=atk+tc:GetOriginalLevel() end tc=g:GetNext() end return atk*100 end --DESTROY function cid.costfilter(c,tc) return c:IsAbleToGraveAsCost() and tc:GetEquipGroup():IsContains(c) end function cid.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.costfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cid.costfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e:GetHandler()) Duel.SendtoGrave(g,REASON_COST) end function cid.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function cid.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.Destroy(tc,REASON_EFFECT) end end --REPLACE function cid.repfilter(c) return bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER and c:IsLocation(LOCATION_SZONE) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and c:IsAbleToGrave() end function cid.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then local g=c:GetEquipGroup() return not c:IsReason(REASON_REPLACE) and c:IsOnField() and c:IsFaceup() and g:IsExists(cid.repfilter,1,nil) end if Duel.SelectYesNo(tp,c,96) then local g=c:GetEquipGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local sg=g:FilterSelect(tp,cid.repfilter,1,1,nil) Duel.SetTargetCard(sg) return true else return false end end function cid.desrepop(e,tp,eg,ep,ev,re,r,rp) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) Duel.SendtoGrave(tg,REASON_EFFECT+REASON_REPLACE) end