--Johanna, l'Amministrale Illuminata --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,s.matfilter,1,1) --atkup local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetRange(LOCATION_MZONE) e1:SetValue(s.val) c:RegisterEffect(e1) --place local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:HOPT() e2:SetCondition(aux.LinkSummonedCond) e2:SetTarget(s.pltg) e2:SetOperation(s.plop) c:RegisterEffect(e2) --shuffle local e3=Effect.CreateEffect(c) e3:Desc(2) e3:SetCategory(CATEGORY_TODECK) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCode(EVENT_TO_GRAVE) e3:HOPT() e3:SetCondition(s.tdcon) e3:SetTarget(s.tdtg) e3:SetOperation(s.tdop) c:RegisterEffect(e3) end function s.matfilter(c) return c:IsLinkSetCard(0xd7c) and not c:IsLinkCode(id) end function s.valfilter(c) return c:GetSequence()<5 end function s.val(e,c) return Duel.GetMatchingGroupCount(s.valfilter,c:GetControler(),LOCATION_SZONE,0,nil)*100 end function s.pltg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end end function s.thfil(c) return c:IsSetCard(0xd7c) and c:IsMonster() and c:IsAbleToHand() end function s.plop(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end local c=e:GetHandler() if c and c:IsRelateToChain() and Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) and c:IsLocation(LOCATION_SZONE) and c:IsFaceup() then local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_IGNORE_IMMUNE) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) c:RegisterEffect(e1) if c:IsLocation(LOCATION_SZONE) and c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS) and Duel.IsExistingMatchingCard(s.thfil,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectMatchingCard(tp,s.thfil,tp,LOCATION_DECK,0,1,1,nil) if #g>0 then Duel.Search(g,tp) end end end end function s.tdcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():GetPreviousSequence()<5 and re:IsHasType(0x7e0) and re:GetHandler():IsSetCard(0xd7c) end function s.filter(c,chk) if not c:IsAbleToDeck() then return false end return (not chk and c:IsMonster() and c:IsSetCard(0xd7c)) or (chk and c:IsCode(id)) end function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc~=e:GetHandler() and s.filter(chkc) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,2,e:GetHandler()) local tg=g:Clone() local sg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,0,nil,true) if e:IsActivated() and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,3,nil,id) then e:SetLabel(1) if #sg>0 then tg:Merge(sg) end else e:SetLabel(0) end Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,#tg,0,0) end function s.tdop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetTargetCards() if #g>0 then Duel.ShuffleIntoDeck(g) end if e:GetLabel()==0 then return end local sg=Duel.GetMatchingGroup(aux.NecroValleyFilter(s.filter),tp,LOCATION_GRAVE,0,nil,true) if #sg>0 then Duel.ShuffleIntoDeck(sg) end end