--Dragon Of Evil Vines function c50031158.initial_effect(c) c:EnableReviveLimit() --special summon local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(c50031158.spcon) c:RegisterEffect(e1) --equip local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(50031158,0)) e2:SetCategory(CATEGORY_EQUIP) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetTarget(c50031158.eqtg) e2:SetOperation(c50031158.eqop) c:RegisterEffect(e2) --Destroy replace local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e3:SetRange(LOCATION_MZONE) e3:SetCode(EFFECT_DESTROY_REPLACE) e3:SetTarget(c50031158.desreptg) e3:SetOperation(c50031158.desrepop) e3:SetLabelObject(e2) c:RegisterEffect(e3) --atk/def local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e4:SetRange(LOCATION_MZONE) e4:SetCode(EFFECT_UPDATE_ATTACK) e4:SetCondition(c50031158.adcon) e4:SetValue(c50031158.adval) c:RegisterEffect(e4) --cannot be target local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_SINGLE) e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e5:SetRange(LOCATION_MZONE) e5:SetCondition(c50031158.tgcon) e5:SetValue(c50031158.tgvalue) c:RegisterEffect(e5) --destroy local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(50031158,2)) e6:SetProperty(EFFECT_FLAG_CARD_TARGET) e6:SetCategory(CATEGORY_DESTROY+CATEGORY_COIN) e6:SetType(EFFECT_TYPE_IGNITION) e6:SetRange(LOCATION_MZONE) e6:SetCountLimit(1) e6:SetCondition(c50031158.descon) e6:SetTarget(c50031158.destg) e6:SetOperation(c50031158.desop) c:RegisterEffect(e6) --cannot remove local e7=Effect.CreateEffect(c) e7:SetType(EFFECT_TYPE_FIELD) e7:SetCode(EFFECT_CANNOT_REMOVE) e7:SetRange(LOCATION_MZONE) e7:SetCondition(c50031158.recon) c:RegisterEffect(e7) --cannot be destroyed local e8=Effect.CreateEffect(c) e8:SetType(EFFECT_TYPE_SINGLE) e8:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e8:SetRange(LOCATION_MZONE) e8:SetCondition(c50031158.recon) e8:SetValue(1) c:RegisterEffect(e8) local e9=Effect.CreateEffect(c) e9:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e9:SetType(EFFECT_TYPE_QUICK_O) e9:SetCode(EVENT_CHAINING) e9:SetCountLimit(1) e9:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e9:SetRange(LOCATION_MZONE) e9:SetCondition(c50031158.discon) e9:SetCost(c50031158.cost) e9:SetTarget(c50031158.distg) e9:SetOperation(c50031158.disop) c:RegisterEffect(e9) end function c50031158.spfilter(c) return c:IsSetCard(0x485a) and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_DARK) end function c50031158.spcon(e,c) if c==nil then return true end if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end local g=Duel.GetMatchingGroup(c50031158.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil) local ct=g:GetClassCount(Card.GetCode) return ct>4 end function c50031158.aclimit(e,re,tp) return re:IsHasType(EFFECT_TYPE_ACTIVATE) end function c50031158.filter(c) return c:IsAbleToChangeControler() end function c50031158.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c50031158.filter(chkc) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingTarget(c50031158.filter,tp,0,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) local g=Duel.SelectTarget(tp,c50031158.filter,tp,0,LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) end function c50031158.eqlimit(e,c) return e:GetOwner()==c end function c50031158.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsFaceup() and tc:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then if not Duel.Equip(tp,tc,c,false) then return end --Add Equip limit tc:RegisterFlagEffect(50031158,RESET_EVENT+0x1fe0000,0,0) 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+0x1fe0000) e1:SetValue(c50031158.eqlimit) tc:RegisterEffect(e1) else Duel.SendtoGrave(tc,REASON_EFFECT) end end end function c50031158.desreptg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() local ec=e:GetLabelObject():GetLabelObject() if chk==0 then return c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and ec and ec:IsHasCardTarget(c) and not ec:IsStatus(STATUS_DESTROY_CONFIRMED) and ec:GetFlagEffect(50031158)~=0 end return Duel.SelectYesNo(tp,aux.Stringid(50031158,1)) end function c50031158.desrepop(e,tp,eg,ep,ev,re,r,rp) Duel.Destroy(e:GetLabelObject():GetLabelObject(),REASON_EFFECT+REASON_REPLACE) end function c50031158.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsDestructable() end if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c50031158.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 function c50031158.adcon(e) return e:GetHandler():GetEquipCount()>=1 end function c50031158.adval(e,c) return e:GetHandler():GetEquipCount()*500 end function c50031158.tgcon(e) return e:GetHandler():GetEquipCount()>=2 end function c50031158.tgvalue(e,re,rp) return rp~=e:GetHandlerPlayer() end function c50031158.descon(e) return e:GetHandler():GetEquipCount()==3 end function c50031158.recon(e) return e:GetHandler():GetEquipCount()==4 end function c50031158.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c50031158.filter1,tp,LOCATION_GRAVE,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectMatchingCard(tp,c50031158.filter1,tp,LOCATION_GRAVE,0,2,2,nil) Duel.SendtoDeck(g,nil,2,REASON_COST) end function c50031158.filter1(c) return c:IsSetCard(0x485a) and c:IsType(TYPE_MONSTER) and c:GetCode()~=50031158 and c:IsAbleToDeckAsCost() end function c50031158.discon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and e:GetHandler():GetEquipCount()>=5 and Duel.IsChainNegatable(ev) end function c50031158.distg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function c50031158.disop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) if re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end