--Arcane Dimension-Blader function c249001186.initial_effect(c) c:EnableReviveLimit() --atk and def local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCondition(c249001186.atkcon) e1:SetValue(c249001186.atkval) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) c:RegisterEffect(e2) --special summon local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_SPSUMMON_PROC) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e3:SetRange(LOCATION_HAND) e3:SetCondition(c249001186.spcon) e3:SetOperation(c249001186.spop) c:RegisterEffect(e3) --tohand on spsummon local e4=Effect.CreateEffect(c) e4:SetDescription(505) e4:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e4:SetCountLimit(1,249001186) e4:SetCondition(c249001186.tdcon) e4:SetTarget(c249001186.tdtg) e4:SetOperation(c249001186.tdop) c:RegisterEffect(e4) --must attack local e5=Effect.CreateEffect(c) e5:SetType(EFFECT_TYPE_FIELD) e5:SetCode(EFFECT_MUST_ATTACK) e5:SetRange(LOCATION_MZONE) e5:SetTargetRange(0,LOCATION_MZONE) c:RegisterEffect(e5) local e6=e5:Clone() e6:SetCode(EFFECT_MUST_ATTACK_MONSTER) e6:SetValue(c249001186.atklimit) c:RegisterEffect(e6) --to hand battle local e7=Effect.CreateEffect(c) e7:SetCategory(CATEGORY_TOHAND) e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e7:SetCode(EVENT_BATTLED) e7:SetProperty(EFFECT_FLAG_CARD_TARGET) e7:SetCondition(c249001186.thcon) e7:SetTarget(c249001186.thtg) e7:SetOperation(c249001186.thop) c:RegisterEffect(e7) end function c249001186.atkcon(e) local c=e:GetHandler() local ph=Duel.GetCurrentPhase() local bc=c:GetBattleTarget() return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and c:IsRelateToBattle() and bc end function c249001186.atkval(e,c) return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_REMOVED,0)*200 end function c249001186.spfilter(c) return c:IsSetCard(0x230) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() end function c249001186.spcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c249001186.spfilter,tp,LOCATION_GRAVE,0,2,nil) end function c249001186.spop(e,tp,eg,ep,ev,re,r,rp,c) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,c249001186.spfilter,tp,LOCATION_GRAVE,0,2,2,nil) Duel.Remove(g,POS_FACEUP,REASON_COST) end function c249001186.tdconfilter(c) return c:IsSetCard(0x230) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) end function c249001186.tdcon(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(c249001186.tdconfilter,tp,LOCATION_GRAVE+LOCATION_MZONE+LOCATION_HAND,0,nil) local ct=g:GetClassCount(Card.GetCode) return ct>1 end function c249001186.tdfilter(c) return c:IsAbleToHand() and c:IsAbleToDeck() end function c249001186.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToHand() and chkc:IsAbleToDeck() end if chk==0 then return Duel.IsExistingTarget(c249001186.tdfilter,tp,LOCATION_REMOVED,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,c249001186.tdfilter,tp,LOCATION_REMOVED,0,2,2,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_TODECK,g,2,0,0) end function c249001186.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local sg=g:Filter(Card.IsRelateToEffect,nil,e) if sg:GetCount()>1 then local tc=g:RandomSelect(1-tp,1):GetFirst() if tc:IsAbleToHand() then Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc) end sg:RemoveCard(tc) Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) end end function c249001186.atklimit(e,c) return c==e:GetHandler() end function c249001186.thconfilter(c) return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsSetCard(0x230) and not c:IsCode(249001186) end function c249001186.thcon(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c249001186.thconfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end function c249001186.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and chkc:IsAbleToHand() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_REMOVED,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_REMOVED,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) end function c249001186.thop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) then Duel.SendtoHand(tc,nil,REASON_EFFECT) end end