--Full Moon function c9945575.initial_effect(c) --ExSpell local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE) e0:SetCode(EFFECT_REMOVE_TYPE) e0:SetRange(LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA+LOCATION_REMOVED+LOCATION_OVERLAY) e0:SetValue(TYPE_FUSION) c:RegisterEffect(e0) --Cannot Trigger local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetCondition(c9945575.condition) c:RegisterEffect(e1) --Activate local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER) e2:SetCode(EVENT_FREE_CHAIN) e2:SetCountLimit(1,9945575+EFFECT_COUNT_CODE_OATH) e2:SetTarget(c9945575.sptg) e2:SetOperation(c9945575.spop) c:RegisterEffect(e2) --Set local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(9945575,0)) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetCode(EVENT_DESTROYED) e3:SetTarget(c9945575.settg) e3:SetCountLimit(1,9945576) e3:SetOperation(c9945575.setop) c:RegisterEffect(e3) end function c9945575.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() return not (c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY)) end function c9945575.spfilter(c,e,tp) return c:IsSetCard(0x12D7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c9945575.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c9945575.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end local ct=Duel.GetMatchingGroupCount(c9945575.atkfilter,tp,LOCATION_MZONE,0,nil) Duel.SetTargetPlayer(tp) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*500) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) end function c9945575.atkfilter(c) return c:IsFaceup() and c:IsSetCard(0x12D7) end function c9945575.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,c9945575.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g2=Duel.GetMatchingGroup(c9945575.atkfilter,tp,LOCATION_MZONE,0,nil) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local ct=Duel.GetMatchingGroupCount(c9945575.atkfilter,p,LOCATION_MZONE,0,nil) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end local g2=Duel.GetMatchingGroup(c9945575.atkfilter,tp,LOCATION_MZONE,0,nil) tc=g2:GetFirst() local tc=g2:GetFirst() if not tc then return end while tc do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetValue(500) tc:RegisterEffect(e1) tc=g2:GetNext() end if ct>0 then Duel.BreakEffect() Duel.Recover(p,ct*500,REASON_EFFECT) end end function c9945575.setfilter(c) return c:IsSetCard(0x12D7) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() end function c9945575.settg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c9945575.setfilter,tp,LOCATION_DECK,0,1,nil) end end function c9945575.setop(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) local g=Duel.SelectMatchingCard(tp,c9945575.setfilter,tp,LOCATION_DECK,0,1,1,nil) if g:GetCount()>0 then Duel.SSet(tp,g:GetFirst()) Duel.ConfirmCards(1-tp,g) end end