--Oniritron Ruler of the Vulcano 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:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e3:SetRange(LOCATION_MZONE) e3:SetCode(EVENT_TO_HAND) e3:SetCountLimit(1,{id,0}) e3:SetCondition(s.condition) e3:SetTarget(s.target) e3:SetOperation(s.activate) c:RegisterEffect(e3) --destroy local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(id,0)) e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetCategory(CATEGORY_DESTROY) 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,tp) return c:IsAbleToChangeControler() and c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) end function s.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()~=tp and Duel.GetCurrentPhase()~=PHASE_DRAW and eg:IsExists(s.filter,1,nil,1-tp) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND) if #g>0 then local sg=g:RandomSelect(1-tp,1) Duel.Overlay(e:GetHandler(),sg,REASON_EFFECT) 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:IsControler(1-tp) end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end function s.thoperation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,500,REASON_EFFECT) end end