--Mysterious Solar Panel function c53313905.initial_effect(c) aux.AddOrigPandemoniumType(c) --During your Main Phase: You can destroy this card from your Spell/Trap Zone, and if you do, Special Summon 1 Level 5 or higher "Mysterious" monster from your Hand, except "Mysterious Solar Panel". You can only use this effect of "Mysterious Solar Panel" once per turn. local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(53313905,0)) e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetCode(EVENT_FREE_CHAIN) e1:SetRange(LOCATION_SZONE) e1:SetCountLimit(1,53313905) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e1:SetCondition(function(e,tp) local ph=Duel.GetCurrentPhase() return aux.PandActCheck(e) and Duel.GetTurnPlayer()==tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) end) e1:SetTarget(c53313905.sptg) e1:SetOperation(c53313905.spop) c:RegisterEffect(e1) aux.EnablePandemoniumAttribute(c,e1) --During the turn this card was activated, you take no damage. local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetCode(EVENT_CHAINING) e0:SetOperation(aux.chainreg) c:RegisterEffect(e0) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetOperation(c53313905.ndop) c:RegisterEffect(e2) --When an opponent's monster declares a direct attack: You can Special Summon this face-up card from your Extra Deck, then end the Battle Phase, but banish it if it leaves the field. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetCode(EVENT_ATTACK_ANNOUNCE) e3:SetRange(LOCATION_EXTRA) e3:SetCondition(c53313905.condition) e3:SetTarget(c53313905.target) e3:SetOperation(c53313905.operation) c:RegisterEffect(e3) --stats boost local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(53313905,1)) e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetRange(LOCATION_SZONE) e4:SetCode(EVENT_SPSUMMON_SUCCESS) e4:SetCondition(c53313905.statcon) e4:SetTarget(c53313905.stattg) e4:SetOperation(c53313905.statop) c:RegisterEffect(e4) end function c53313905.filter(c,e,tp) return c:IsSetCard(0xcf6) and c:IsLevelAbove(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function c53313905.sptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsDestructable() and Duel.IsExistingMatchingCard(c53313905.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) end function c53313905.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,c53313905.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end function c53313905.ndop(e,tp,eg,ep,ev,re,r,rp) if not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_FIELD) e3:SetCode(EFFECT_CHANGE_DAMAGE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetTargetRange(1,0) e3:SetValue(0) e3:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e3,tp) local e4=e3:Clone() e4:SetCode(EFFECT_NO_EFFECT_DAMAGE) e4:SetReset(RESET_PHASE+PHASE_END) Duel.RegisterEffect(e4,tp) end function c53313905.condition(e,tp,eg,ep,ev,re,r,rp) local at=Duel.GetAttacker() return at:GetControler()~=tp and Duel.GetAttackTarget()==nil and e:GetHandler():IsFaceup() end function c53313905.target(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) end function c53313905.operation(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.BreakEffect() Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetReset(RESET_EVENT+0xfe0000) e1:SetValue(LOCATION_REMOVED) c:RegisterEffect(e1) end end --stats boost function c53313905.statfilter(c,tp) return c:GetSummonPlayer()==1-tp end function c53313905.statcon(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(c53313905.statfilter,1,nil,tp) and aux.PandActCheck(e) end function c53313905.stattg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end end function c53313905.statop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) if g:GetCount()>0 then local sc=g:GetFirst() while sc do local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(100) sc:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) sc:RegisterEffect(e2) sc=g:GetNext() end end end