--Arcarum EXTRA - THE IDEAL WORLD --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) c:EnableReviveLimit() --special summon local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_HAND) e1:SetCondition(cid.spcon) e1:SetOperation(cid.spop) c:RegisterEffect(e1) --spsummon from GY local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCountLimit(1,id) e2:SetTarget(cid.sptg2) e2:SetOperation(cid.spop2) c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id+100) e3:SetCondition(cid.negcon) e3:SetCost(cid.negcost) e3:SetTarget(cid.negtg) e3:SetOperation(cid.negop) c:RegisterEffect(e3) end --SPECIAL SUMMON --filters function cid.gfilter(c,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5477) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_GRAVE) or Duel.IsExistingMatchingCard(cid.gfilter,tp,LOCATION_GRAVE,0,1,c,tp)) end --------- function cid.spcon(e,c) if c==nil then return true end local tp=c:GetControler() local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) return ft>0 and Duel.IsExistingMatchingCard(cid.gfilter,tp,LOCATION_HAND,0,1,nil,tp) end function cid.spop(e,tp,eg,ep,ev,re,r,rp,c) local ft,lv=Duel.GetLocationCount(tp,LOCATION_MZONE),0 if ft<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g1=Duel.SelectMatchingCard(tp,cid.gfilter,tp,LOCATION_HAND,0,1,1,nil,tp) if g1:GetFirst():GetLevel()>0 then lv=lv+g1:GetFirst():GetLevel() end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g2=Duel.SelectMatchingCard(tp,cid.gfilter,tp,LOCATION_GRAVE,0,1,1,g1:GetFirst(),tp) if g2:GetFirst():GetLevel()>0 then lv=lv+g2:GetFirst():GetLevel() end g1:Merge(g2) Duel.Remove(g1,POS_FACEUP,REASON_COST) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK) e1:SetValue(lv*300) e1:SetReset(RESET_EVENT+0xff0000) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_SET_DEFENSE) c:RegisterEffect(e2) end --SPSUMMON FROM GY --filters function cid.spfilter(c,e,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5477) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end --------- function cid.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cid.spfilter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cid.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,aux.NecroValleyFilter(cid.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) end function cid.spop2(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end end --NEGATE function cid.negcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and Duel.IsChainNegatable(ev) end function cid.negcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD) end function cid.negtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) if re:GetHandler():IsAbleToDeck() and re:GetHandler():IsRelateToEffect(re) then Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0) end end function cid.negop(e,tp,eg,ep,ev,re,r,rp) if not Duel.NegateActivation(ev) then return end if re:GetHandler():IsRelateToEffect(re) then Duel.SendtoDeck(eg,nil,2,REASON_EFFECT) end end