--Psychostizia Risonanza, Potenziamento! --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) --activate aux.ActivateST(c) --extra pandemonium zone local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_FIELD) e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e0:SetCode(EFFECT_ALLOW_EXTRA_PANDEMONIUM_ZONE) e0:SetRange(LOCATION_SZONE) e0:SetTargetRange(0xff,0) e0:SetCondition(s.actcon) e0:SetTarget(s.acttg) c:RegisterEffect(e0) --draw local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DRAW+CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e3:SetRange(LOCATION_SZONE) e3:SetCode(EVENT_CUSTOM+id) e3:SetCountLimit(1,id) e3:SetCondition(s.tdcon) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) if not s.global_check then s.global_check=true local ge1=Effect.CreateEffect(c) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetCode(EVENT_DESTROYED) ge1:SetCondition(s.regcon) ge1:SetOperation(s.regop) Duel.RegisterEffect(ge1,0) end end function s.cfilter(c,tp,r) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(0x2c2) end function s.regcon(e,tp,eg,ep,ev,re,r,rp) local v=0 if eg:IsExists(s.cfilter,1,nil,0,r) then v=v+1 end if eg:IsExists(s.cfilter,1,nil,1,r) then v=v+2 end if v==0 then return false end e:SetLabel(({0,1,PLAYER_ALL})[v]) return true end function s.regop(e,tp,eg,ep,ev,re,r,rp) Duel.RaiseEvent(eg,EVENT_CUSTOM+id,re,r,rp,ep,e:GetLabel()) end function s.activebb(c) return c:IsFaceup() and c:IsType(TYPE_BIGBANG) end function s.actcon(e,tp) local ct1=Duel.GetMatchingGroupCount(aux.PaCheckFilter,tp,LOCATION_SZONE,0,nil) local ct2=Duel.GetMatchingGroupCount(s.activebb,tp,LOCATION_MZONE,0,nil) return ct1<=ct2 end function s.acttg(e,c) return c:IsType(TYPE_PANDEMONIUM) and c:IsSetCard(0x2c2) end function s.tdcon(e,tp,eg,ep,ev,re,r,rp) return ev==tp or ev==PLAYER_ALL end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) end function s.spfilter(c,e,tp) return c:IsSetCard(0x2c2) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and (not c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or c:IsLocation(LOCATION_EXTRA) and c:IsFaceup() and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0) end function s.egcheck(c,r) return r&REASON_EFFECT==0 end function s.tdop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) and Duel.Draw(tp,1,REASON_EFFECT)>0 then local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp) if eg:IsExists(s.egcheck,1,nil,r) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.BreakEffect() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local sg=g:Select(tp,1,1,nil) Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) end end end