Commit ddab99c3 authored by Grajade's avatar Grajade

Update c33700101.lua

parent a90d5e61
Pipeline #4338 passed with stages
in 32 minutes and 8 seconds
--狩猎游戏 --狩猎游戏
function c33700101.initial_effect(c) function c33700101.initial_effect(c)
--Activate --Activate
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE) e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN) e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--self destroy --self destroy
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_SZONE)
e1:SetCode(EFFECT_SELF_TOGRAVE) e1:SetCode(EFFECT_SELF_TOGRAVE)
e1:SetCondition(c33700101.con) e1:SetCondition(c33700101.con)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--tohand --tohand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(45950291,0)) e2:SetDescription(aux.Stringid(33700101,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW) e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c33700101.thcon) e2:SetCondition(c33700101.thcon)
e2:SetTarget(c33700101.thtg) e2:SetTarget(c33700101.thtg)
e2:SetOperation(c33700101.thop) e2:SetOperation(c33700101.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c33700101.card_code_list={33700056} c33700101.card_code_list={33700056}
function c33700101.filter(c) function c33700101.filter(c)
return c:IsSetCard(0x442) return c:IsSetCard(0x442)
end
function c33700101.filter2(c)
return not c:IsSetCard(0x442)
end end
function c33700101.con(e) function c33700101.con(e)
local g=Duel.GetMatchingGroup(nil,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil) local g=Duel.GetFieldGroup(e:GetHandlerPlayer(),LOCATION_GRAVE,0)
return g:GetClassCount(Card.GetCode)<g:GetCount() or not Duel.IsExistingMatchingCard(c33700101.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil) return g:GetClassCount(Card.GetCode)<g:GetCount() or not Duel.IsExistingMatchingCard(c33700101.filter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil)
end end
function c33700101.thcon(e,tp,eg,ep,ev,re,r,rp) function c33700101.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 return Duel.GetTurnPlayer()==tp and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 and Duel.GetDrawCount(tp)>0
and Duel.GetDrawCount(tp)>0
end end
function c33700101.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700101.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local g=Duel.GetDecktopGroup(tp,3) local g=Duel.GetDecktopGroup(tp,3)
local result=g:FilterCount(Card.IsAbleToHand,nil)>0 local result=g:FilterCount(Card.IsAbleToHand,nil)>0
return result return result
end end
local dt=Duel.GetDrawCount(tp) local dt=Duel.GetDrawCount(tp)
if dt~=0 then if dt~=0 then
_replace_count=0 _replace_count=0
_replace_max=dt _replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT) e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW) e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0) e1:SetValue(0)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end end
function c33700101.thop(e,tp,eg,ep,ev,re,r,rp) function c33700101.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end _replace_count=_replace_count+1
_replace_count=_replace_count+1 if _replace_count<=_replace_max then
if _replace_count<=_replace_max then Duel.ConfirmDecktop(tp,3)
Duel.ConfirmDecktop(tp,3) local g=Duel.GetDecktopGroup(tp,3)
local g=Duel.GetDecktopGroup(tp,3) if g:GetCount()<1 then return end
if g:GetCount()>0 then local sg=g:Filter(tp,c33700101.filter,nil)
local sg2=g:Filter(c33700101.filter2,nil) if sg:GetCount()>0 then
if g:IsExists(c33700101.filter,1,nil) then Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.DisableShuffleCheck() Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.ShuffleHand(tp)
local sg=g:Filter(c33700101.filter,nil) g:Sub(sg)
if sg:GetFirst():IsAbleToHand() then if sg:GetClassCount(Card.GetCode)<sg:GetCount() then
Duel.SendtoHand(sg,nil,REASON_EFFECT) local e1=Effect.CreateEffect(e:GetHandler())
Duel.ConfirmCards(1-tp,sg) e1:SetType(EFFECT_TYPE_FIELD)
Duel.ShuffleHand(tp) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
if sg:GetClassCount(Card.GetCode)<sg:GetCount() then e1:SetTargetRange(1,0)
local e1=Effect.CreateEffect(e:GetHandler()) e1:SetCode(EFFECT_SKIP_DP)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) Duel.RegisterEffect(e1,tp)
e1:SetTargetRange(1,0) end
e1:SetCode(EFFECT_SKIP_DP) end
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN) Duel.MoveSequence(g,1)
Duel.RegisterEffect(e1,tp) end
end
else
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
Duel.MoveSequence(sg2,1)
end
end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment