--Dea Lattea the Cosmic Guidance --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --gemini local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_DUAL_SUMMONABLE) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_ADD_TYPE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE+LOCATION_DECK) e2:SetCondition(cid.gemini) e2:SetValue(TYPE_NORMAL) c:RegisterEffect(e2) local e3=e2:Clone() e3:SetCode(EFFECT_REMOVE_TYPE) e3:SetValue(TYPE_EFFECT) c:RegisterEffect(e3) --spsummon from hand local e4=Effect.CreateEffect(c) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e4:SetType(EFFECT_TYPE_FIELD) e4:SetRange(LOCATION_HAND) e4:SetCode(EFFECT_SPSUMMON_PROC) e4:SetCondition(cid.hspcon) e4:SetOperation(cid.hspop) c:RegisterEffect(e4) --banish local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(id,0)) e5:SetCategory(CATEGORY_REMOVE) e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetCode(EVENT_FREE_CHAIN) e5:SetRange(LOCATION_MZONE) e5:SetHintTiming(0,0x11e0) e5:SetCountLimit(1,id) e5:SetCondition(cid.condition) e5:SetCost(cid.cost) e5:SetTarget(cid.target) e5:SetOperation(cid.operation) c:RegisterEffect(e5) --spsummon local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,1)) e6:SetCategory(CATEGORY_SPECIAL_SUMMON) e6:SetType(EFFECT_TYPE_IGNITION) e6:SetRange(LOCATION_REMOVED) e6:SetCountLimit(1,id) e6:SetCondition(cid.spcon) e6:SetCost(cid.spcost) e6:SetTarget(cid.sptg) e6:SetOperation(cid.spop) c:RegisterEffect(e6) end function cid.gemini(e) local c=e:GetHandler() return not c:IsDualState() and (c:IsFaceup() or c:IsLocation(LOCATION_DECK)) end --SPSUMMON FROM HAND function cid.hspfilter(c,tp) return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and Duel.GetMZoneCount(tp,c)>0 end function cid.hspcon(e,c) if c==nil then return true end local tp=c:GetControler() return Duel.CheckReleaseGroup(tp,cid.hspfilter,1,nil,tp) end function cid.hspop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.SelectReleaseGroup(tp,cid.hspfilter,1,1,nil,tp) Duel.Release(g,REASON_COST) end --BANISH function cid.confilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and c:GetSummonLocation()&LOCATION_GRAVE>0 and c:IsSummonType(SUMMON_TYPE_SPECIAL) end function cid.condition(e,tp,eg,ep,ev,re,r,rp) return aux.IsDualState(e) and Duel.IsExistingMatchingCard(cid.confilter,tp,LOCATION_MZONE,0,1,nil) end function cid.cfilter(c) return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) and c:IsRace(RACE_FAIRY) and c:IsAbleToRemoveAsCost() end function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.Remove(g,POS_FACEUP,REASON_COST) end end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:GetControler()~=tp and chkc:GetLocation()==LOCATION_GRAVE and chkc:IsAbleToRemove() end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE) end function cid.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then local val=tc:GetType()&(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e2:SetLabel(val) e2:SetValue(cid.value) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e3:SetLabel(val) e3:SetValue(cid.value) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e3) end end function cid.value(e,re,rp) return rp==1-e:GetHandlerPlayer() and re:IsActiveType(e:GetLabel()) end --SPSUMMON function cid.spcon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnCount()~=e:GetHandler():GetTurnID() end function cid.spcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_RETURN) end function cid.filter(c,e,tp) return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_NORMAL) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(id) end function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp) if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end