--Voilé Gramnad, Queen of Ichyaltas --Scripted by: XGlitchy30 local s,id=GetID() function s.initial_effect(c) aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),aux.NonTuner(Card.IsSetCard,0x2a7),1) c:EnableReviveLimit() --add protection local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.tncon) e1:SetOperation(s.tnop) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_MATERIAL_CHECK) e2:SetValue(s.valcheck) e2:SetLabelObject(e1) c:RegisterEffect(e2) --negate local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1,id) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL) e3:SetCondition(s.ngcon) e3:SetCost(s.ngcost) e3:SetTarget(s.ngtg) e3:SetOperation(s.ngop) c:RegisterEffect(e3) end function s.valcheck(e,c) local flag=0 local g=c:GetMaterial() if g:IsExists(Card.IsCode,1,nil,11110115) then flag=1 end e:GetLabelObject():SetLabel(flag) end function s.mfilter(c) return not c:IsType(TYPE_SYNCHRO) end function s.tncon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and e:GetLabel()>0 end function s.tnop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(aux.tgoval) c:RegisterEffect(e1) end function s.ngcon(e,tp,eg,ep,ev,re,r,rp) return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) end function s.ngfilter(c,tp) return not c:IsOnField() or (c:IsControler(tp) or c:IsFaceup()) end function s.ngcost(e,tp,eg,ep,ev,re,r,rp,chk) local g1=Duel.GetReleaseGroup(tp,true):Filter(s.ngfilter,nil,tp) local g2=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD+LOCATION_HAND,0,g1) g1:Merge(g2) if chk==0 then return #g1>0 end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local rg=g1:Select(tp,1,1,nil) local tc=rg:GetFirst() aux.UseExtraReleaseCount(rg,tp) Duel.Release(tc,REASON_COST) end function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() then Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0) end end function s.ngop(e,tp,eg,ep,ev,re,r,rp) if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then Duel.Destroy(eg,REASON_EFFECT) end end