--Hehy, fangsword Maiden of Gust Vine --Scripted and Created by Chadook function c160002228.initial_effect(c) --end battle phase local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(160002228,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_ATTACK_ANNOUNCE) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,160002228) e1:SetCondition(c160002228.condition) e1:SetTarget(c160002228.target) e1:SetOperation(c160002228.operation) c:RegisterEffect(e1) --search local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(160002228,0)) e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e5:SetCode(EVENT_TO_GRAVE) e5:SetCountLimit(1,160002229) e5:SetCondition(c160002228.condition2) e5:SetTarget(c160002228.target2) e5:SetOperation(c160002228.operation2) c:RegisterEffect(e5) end function c160002228.condition(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttacker() return at:GetControler()~=tp end function c160002228.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c160002228.sfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function c160002228.sfilter(c) return c:IsSetCard(0x885a) and c:IsType(TYPE_MONSTER) end function c160002228.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c160002228.sfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler()) if g:GetCount()>0 then Duel.SendtoGrave(g,REASON_EFFECT) end if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.BreakEffect() Duel.NegateAttack() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetReset(RESET_PHASE+PHASE_END) e1:SetTargetRange(0,1) Duel.RegisterEffect(e1,tp) end end function c160002228.condition2(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_EFFECT) and not e:GetHandler():IsReason(REASON_RETURN) end function c160002228.filter(c) return c:IsSetCard(0x885a) and c:IsType(TYPE_MONSTER) and not c:IsCode(160002228) and c:IsAbleToHand() end function c160002228.target2(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(c160002228.filter,tp,LOCATION_DECK,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) end function c160002228.operation2(e,tp,eg,ep,ev,re,r,rp,chk) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,c160002228.filter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,g) end end