--Magnificent Vine Metaphys Clear Hime function c160004545.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x285a),8,3) c:EnableReviveLimit() -- --spsummon limit -- local e1=Effect.CreateEffect(c) -- e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) -- e1:SetType(EFFECT_TYPE_SINGLE) -- e1:SetCode(EFFECT_SPSUMMON_CONDITION) -- e1:SetValue(aux.xyzlimit) -- c:RegisterEffect(e1) --material local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1) e4:SetTarget(c160004545.target) e4:SetOperation(c160004545.operation) c:RegisterEffect(e4) --negate local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetCode(EVENT_CHAINING) e5:SetCountLimit(1) e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e5:SetRange(LOCATION_MZONE) e5:SetCondition(c160004545.discon) e5:SetCost(c160004545.discost) e5:SetTarget(c160004545.distg) e5:SetOperation(c160004545.disop) c:RegisterEffect(e5) end function c160004545.rmcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():GetSummonType()==SUMMON_TYPE_XYZ end function c160004545.cfilter2(c) return c:IsSetCard(0x285a) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() end function c160004545.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c160004545.cfilter2,tp,LOCATION_HAND,0,1,e:GetHandler()) end local rt=Duel.GetTargetCount(c160004545.filter,tp,0,LOCATION_ONFIELD,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local cg=Duel.SelectMatchingCard(tp,c160004545.cfilter2,tp,LOCATION_HAND,0,1,rt,nil) Duel.SendtoGrave(cg,REASON_EFFECT) e:SetLabel(cg:GetCount()) end function c160004545.rmfilter(c) return c:IsFaceup() and c:IsAbleToRemove() end function c160004545.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(c160004545.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end local ct=e:GetLabel() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local eg=Duel.SelectTarget(tp,c160004545.rmfilter,tp,0,LOCATION_ONFIELD,ct,ct,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,ct,0,0) end function c160004545.rmop(e,tp,eg,ep,ev,re,r,rp,chk) local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local rg=tg:Filter(Card.IsRelateToEffect,nil,e) if rg:GetCount()>0 then Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) end end function c160004545.filter(c,tp) return bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0 and c:IsAbleToChangeControler() and not c:IsType(TYPE_TOKEN) end function c160004545.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c160004545.filter(chkc,tp) and chkc~=e:GetHandler() end if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingTarget(c160004545.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler(),tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,c160004545.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler(),tp) end function c160004545.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then local og=tc:GetOverlayGroup() if og:GetCount()>0 then Duel.SendtoGrave(og,REASON_RULE) end Duel.Overlay(c,Group.FromCards(tc)) end end function c160004545.discon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonCount(tp,2) and Duel.IsPlayerCanSpecialSummonMonster(tp,160005414,0,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH,POS_FACEUP,1-tp) end function c160004545.discost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) end function c160004545.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 c160004545.disop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) -- if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end Duel.BreakEffect() --for i=1,2 do -- Duel.Hint(HINT_CARD,PLAYER_ALL,160005414) -- local token=Duel.CreateToken(1-tp,160005414) -- Duel.SpecialSummon(token,0,1-tp,1-tp,false,false,POS_FACEUP) --end -- Duel.SpecialSummonComplete() Duel.Recover(1-tp,1000,REASON_EFFECT) end end