--Xyz-Hunter's Time Freeze function c249000738.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCondition(c249000738.condition) e1:SetTarget(c249000738.target) e1:SetOperation(c249000738.activate) c:RegisterEffect(e1) --material local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(19310321,0)) e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetRange(LOCATION_GRAVE) e2:SetCost(c249000738.cost) e2:SetTarget(c249000738.target2) e2:SetOperation(c249000738.operation2) c:RegisterEffect(e2) end function c249000738.cfilter1(c) return c:IsFaceup() and c:IsSetCard(0x4073) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) end function c249000738.cfilter2(c) return c:IsFaceup() and c:IsCode(249000004) end function c249000738.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsExistingMatchingCard(c249000738.cfilter1,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) and (Duel.GetTurnPlayer()==tp or Duel.IsExistingMatchingCard(c249000738.cfilter2,tp,LOCATION_MZONE,0,1,nil)) end function c249000738.filter(c) return c:IsFaceup() and (c:IsSetCard(0x4073) or c:IsType(TYPE_XYZ)) end function c249000738.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and c249000738.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(c249000738.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.SelectTarget(tp,c249000738.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local op=Duel.SelectOption(tp,aux.Stringid(53839837,1),aux.Stringid(53839837,2),aux.Stringid(53839837,3)) e:SetLabel(opt) end function c249000738.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsFaceup() then local ty if e:GetLabel()==0 then ty=TYPE_MONSTER elseif e:GetLabel()==1 then ty=TYPE_SPELL else ty=TYPE_TRAP end local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetRange(LOCATION_MZONE) e2:SetCode(EFFECT_IMMUNE_EFFECT) e2:SetLabel(ty) e2:SetValue(c249000738.efilter) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) tc:RegisterEffect(e2) end end function c249000738.efilter(e,te) return te:IsActiveType(e:GetLabel()) and te:GetOwner()~=e:GetOwner() and te:GetOwner()~=e:GetHandler() end function c249000738.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) end function c249000738.filter1(c) return c:IsFaceup() and c:IsType(TYPE_XYZ) end function c249000738.filter2(c) return c:IsSetCard(0x4073) end function c249000738.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return false end if chk==0 then return Duel.IsExistingTarget(c249000738.filter1,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(c249000738.filter2,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19310321,1)) local g1=Duel.SelectTarget(tp,c249000738.filter1,tp,LOCATION_MZONE,0,1,1,nil) e:SetLabelObject(g1:GetFirst()) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(19310321,2)) local g2=Duel.SelectTarget(tp,c249000738.filter2,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g2,1,0,0) end function c249000738.operation2(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetLabelObject() if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,tc,e) if g:GetCount()>0 then Duel.Overlay(tc,g) end end