--Woodland Bow function c79854544.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(c79854544.target) e1:SetOperation(c79854544.operation) c:RegisterEffect(e1) --Direct Attack local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_DIRECT_ATTACK) c:RegisterEffect(e2) --Damage halved local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e3:SetCode(EVENT_PRE_BATTLE_DAMAGE) e3:SetRange(LOCATION_SZONE) e3:SetCondition(c79854544.atkcon) e3:SetOperation(c79854544.atkop) c:RegisterEffect(e3) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(79854544,0)) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetCategory(CATEGORY_DESTROY) e4:SetCode(EVENT_BATTLE_DAMAGE) e4:SetRange(LOCATION_SZONE) e4:SetCondition(c79854544.descon) e4:SetTarget(c79854544.destg) e4:SetOperation(c79854544.desop) c:RegisterEffect(e4) --special summon local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(79854544,1)) e5:SetCategory(CATEGORY_SPECIAL_SUMMON) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e5:SetCode(EVENT_TO_GRAVE) e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e5:SetCondition(c79854544.spcon) e5:SetTarget(c79854544.sptg) e5:SetOperation(c79854544.spop) c:RegisterEffect(e5) --Equip limit local e6=Effect.CreateEffect(c) e6:SetType(EFFECT_TYPE_SINGLE) e6:SetCode(EFFECT_EQUIP_LIMIT) e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e6:SetValue(c79854544.eqlimit) c:RegisterEffect(e6) end --Equip Limit function c79854544.eqlimit(e,c) return c:IsRace(RACE_PLANT) end --Equip function c79854544.filter(c) return c:IsFaceup() and c:IsRace(RACE_PLANT) end function c79854544.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c79854544.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c79854544.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c79854544.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) end function c79854544.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 tc:IsFaceup() then Duel.Equip(tp,c,tc) end end --Halve battle damage function c79854544.atkcon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ep~=tp and Duel.GetAttacker()==ec and ec:GetAttack()>1000 and Duel.GetAttackTarget()==nil and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end function c79854544.atkop(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() Duel.ChangeBattleDamage(ep,ev/2) end --Destroy monsters function c79854544.descon(e,tp,eg,ep,ev,re,r,rp) local ec=e:GetHandler():GetEquipTarget() return ec and eg:IsContains(ec) and ep~=tp end function c79854544.desfilter(c,ev) return c:IsFaceup() and c:IsAttackBelow(ev) end function c79854544.destg(e,tp,eg,ep,ev,re,r,rp,chk) local ec=e:GetHandler():GetEquipTarget() if chk==0 then return Duel.IsExistingMatchingCard(c79854544.desfilter,tp,0,LOCATION_MZONE,1,ec,ev) end local g=Duel.GetMatchingGroup(c79854544.desfilter,tp,0,LOCATION_MZONE,ec,ev) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) end function c79854544.desop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local ec=e:GetHandler():GetEquipTarget() local g=Duel.GetMatchingGroup(c79854544.desfilter,tp,0,LOCATION_MZONE,ec,ev) if g:GetCount()>0 then Duel.Destroy(g,REASON_EFFECT) end end --Special Summon a Plant tuner function c79854544.spcon(e,tp,eg,ep,ev,re,r,rp) return (re:IsActiveType(TYPE_MONSTER) and e:GetHandler():IsReason(REASON_COST)) or (re:IsActiveType(TYPE_MONSTER) and bit.band(r,REASON_EFFECT)~=0) end function c79854544.spfilter(c,e,tp) return c:IsRace(RACE_PLANT) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c79854544.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c79854544.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c79854544.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,c79854544.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function c79854544.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end