--Oniritron Furrower of the Skies local s,id=GetID() function s.initial_effect(c) --xyz summon aux.AddXyzProcedure(c,nil,1,3) c:EnableReviveLimit() --gain atk x material local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.atkval) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --attach as material local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,0)) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_FREE_CHAIN) e3:SetRange(LOCATION_MZONE) e3:SetHintTiming(0,TIMING_MAIN_END+TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e3:SetCountLimit(1,{id,0}) e3:SetCondition(s.condition) e3:SetTarget(s.target) e3:SetOperation(s.operation) c:RegisterEffect(e3) --tohand local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCategory(CATEGORY_TOHAND) e4:SetType(EFFECT_TYPE_IGNITION) e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1,{id,1}) e4:SetCost(s.thcost) e4:SetTarget(s.thtarget) e4:SetOperation(s.thoperation) c:RegisterEffect(e4) end function s.atkval(e,c) return c:GetOverlayCount()*500 end function s.filter(c) return c:IsAbleToChangeControler() and c:IsFaceup() end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_SZONE,1,nil) and e:GetHandler():IsType(TYPE_XYZ) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_SZONE,1,1,nil) end function s.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 Duel.Overlay(c,tc,true) end end function s.thcost(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 s.thtarget(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(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function s.thoperation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end