--Judgment Mistress of Gust Vine function c160009696.initial_effect(c) c:EnableReviveLimit() local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e0:SetCode(EFFECT_FUSION_MATERIAL) e0:SetCondition(c160009696.fscondition) e0:SetOperation(c160009696.fsoperation) c:RegisterEffect(e0) --spsummon condition local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetValue(c160009696.splimit) c:RegisterEffect(e1) --negate local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetCountLimit(1) e3:SetProperty(EFFECT_FLAG2_XMDETACH+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCondition(c160009696.negcon) e3:SetCost(c160009696.negcost) e3:SetTarget(c160009696.negtg) e3:SetOperation(c160009696.negop) c:RegisterEffect(e3) --Special Summon local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(160009696,1)) e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(c160009696.sumcon) e4:SetTarget(c160009696.sumtg) e4:SetOperation(c160009696.sumop) c:RegisterEffect(e4) local e5=e4:Clone() e5:SetCode(EVENT_REMOVE) c:RegisterEffect(e5) local e6=e4:Clone() e6:SetCode(EVENT_TO_DECK) c:RegisterEffect(e6) end end function c160009696.ffilter(c) return c:IsSetCard(0x885a) and c:IsLocation(LOCATION_MZONE) end function c160009696.fscondition(e,g,gc) if g==nil then return true end if gc then return false end return g:IsExists(c160009696.ffilter,2,nil) and (g:IsExists(Card.IsType,1,nil,TYPE_FUSION)) end function c160009696.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.SetFusionMaterial(eg:FilterSelect(tp,c160009696.ffilter,3,63,nil)) end function c160009696.splimit(e,se,sp,st) return not e:GetHandler():IsLocation(LOCATION_EXTRA) or bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION or bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION +0x786 end function c160009696.mfilterx(c) return c:IsCode(16000789) and not c:IsCode(160009696) and c:IsLocation(LOCATION_ONFIELD) end function c160009696.ffilter(c) return c:IsLocation(LOCATION_ONFIELD) and (c:GetLevel()>=5 and c:GetCode()~=160009696 or c:IsHasEffect(500317451)) end function c160009696.cfilter(c) return c:IsFaceup() and c:IsSetCard(0x885a) end function c160009696.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:GetHandler()~=e:GetHandler() and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) end function c160009696.costfilter(c) return c:IsSetCard(0x885a) and c:IsAbleToRemoveAsCost() end function c160009696.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c160009696.costfilter,tp,LOCATION_GRAVE,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c160009696.costfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c160009696.negtg(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():IsAbleToRemove() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0) end end function c160009696.negop(e,tp,eg,ep,ev,re,r,rp) Duel.NegateActivation(ev) if re:GetHandler():IsRelateToEffect(re) then Duel.SendtoDeck(eg,nil,2,REASON_EFFECT) end end function c160009696.sumcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function c160009696.filter(c,e,tp) return c:IsCode(500318103) and c:IsCanBeSpecialSummoned(e,0,tp,false,true) end function c160009696.sumtg(e,tp,eg,ep,ev,re,r,rp,chk) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c17412721.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c17412721.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c17412721.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c160009696.sumop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e2:SetValue(1) tc:RegisterEffect(e2,true) Duel.SpecialSummonComplete() end end