--Sigrun, Cascad Gunner --Script by XGlitchy30 function c31231303.initial_effect(c) --change position local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(31231303,0)) e1:SetCategory(CATEGORY_POSITION) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetTarget(c31231303.postg) e1:SetOperation(c31231303.posop) c:RegisterEffect(e1) local e2=e1:Clone() e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) c:RegisterEffect(e2) local e3=e1:Clone() e3:SetCode(EVENT_SPSUMMON_SUCCESS) c:RegisterEffect(e3) --mill deck local e4=Effect.CreateEffect(c) e4:SetDescription(aux.Stringid(31231302,1)) e4:SetCategory(CATEGORY_DECKDES+CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetCode(EVENT_REMOVE) e4:SetCountLimit(1,31231303) e4:SetCondition(c31231303.millcon) e4:SetTarget(c31231303.milltg) e4:SetOperation(c31231303.millop) c:RegisterEffect(e4) --effect gain local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(31231303,2)) e5:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_TRIGGER_O) e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) e5:SetCode(EVENT_SPSUMMON_SUCCESS) e5:SetCountLimit(1) e5:SetCondition(c31231303.atkcon) e5:SetTarget(c31231303.atktg) e5:SetOperation(c31231303.atkop) c:RegisterEffect(e5) end --filters function c31231303.posfilter(c) return not c:IsPosition(POS_FACEUP_DEFENSE) and c:IsCanChangePosition() end --change position function c31231303.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c31231303.posfilter(chkc) end if chk==0 then return Duel.IsExistingTarget(c31231303.posfilter,tp,0,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) Duel.SelectTarget(tp,c31231303.posfilter,tp,0,LOCATION_MZONE,1,1,nil) end function c31231303.posop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and not tc:IsPosition(POS_FACEUP_DEFENSE) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) end end --mill deck function c31231303.millcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsAttribute(ATTRIBUTE_WATER) end function c31231303.milltg(e,tp,eg,ep,ev,re,r,rp,chk) local g=Duel.GetDecktopGroup(1-tp,3) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) and g:FilterCount(Card.IsAbleToRemove,nil)==3 end Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,1-tp,LOCATION_DECK) end function c31231303.millop(e,tp,eg,ep,ev,re,r,rp) local sd=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local od=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0) if sd<=2 or od<=2 then return end if sd>=3 then sd=3 end Duel.DiscardDeck(tp,sd,REASON_EFFECT) local g=Duel.GetOperatedGroup() if g:GetCount()==3 then local mill=Duel.GetDecktopGroup(1-tp,g:GetCount()) Duel.DisableShuffleCheck() Duel.Remove(mill,POS_FACEUP,REASON_EFFECT) end end --gain effect function c31231303.atkcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) and e:GetHandler():IsSetCard(0x3233) end function c31231303.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler()) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) end function c31231303.atkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(600) e1:SetReset(RESET_EVENT+0x1ff0000) c:RegisterEffect(e1) end end