--Fiber VINE Bloom Witch local cid,id=GetID() function cid.initial_effect(c) --atk up local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetOperation(cid.operation) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e2) --tohand local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e4:SetCode(EVENT_BE_MATERIAL) e4:SetCountLimit(1,id) e4:SetCondition(cid.thcon) e4:SetTarget(cid.thtg) e4:SetOperation(cid.thop) c:RegisterEffect(e4) --spsummon local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(id,0)) e7:SetCategory(CATEGORY_SPECIAL_SUMMON) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e7:SetCode(EVENT_TO_GRAVE) -- e1:SetProperty(EFFECT_FLAG_DELAY) e7:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e7:SetCondition(cid.spcon) e7:SetTarget(cid.sptg) e7:SetOperation(cid.spop) c:RegisterEffect(e7) local e8=e7:Clone() e8:SetCondition(cid.spcon2) c:RegisterEffect(e8) end function cid.atktg(e,c) return c:GetFieldID()<=e:GetLabel() and c:IsSetCard(0x57b) end function cid.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and c:IsFaceup() then local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) local mg,fid=g:GetMaxGroup(Card.GetFieldID) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTarget(cid.atktg) e1:SetValue(500) e1:SetLabel(fid) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) c:RegisterEffect(e1) end end function cid.filterx(c) return c:IsFaceup() and c:IsAbleToRemove() end function cid.thcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return c:IsLocation(LOCATION_GRAVE) and r==REASON_EVOLUTE end function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) end function cid.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND) and bit.band(r,REASON_DISCARD)~=0 end function cid.spcon2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_DECK) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) then Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end end