Commit ddab99c3 authored by Grajade's avatar Grajade

Update c33700101.lua

parent a90d5e61
...@@ -9,17 +9,17 @@ function c33700101.initial_effect(c) ...@@ -9,17 +9,17 @@ function c33700101.initial_effect(c)
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)
...@@ -29,16 +29,12 @@ c33700101.card_code_list={33700056} ...@@ -29,16 +29,12 @@ c33700101.card_code_list={33700056}
function c33700101.filter(c) function c33700101.filter(c)
return c:IsSetCard(0x442) return c:IsSetCard(0x442)
end end
function c33700101.filter2(c)
return not c:IsSetCard(0x442)
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
...@@ -63,21 +59,17 @@ function c33700101.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -63,21 +59,17 @@ function c33700101.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
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()>0 then if g:GetCount()<1 then return end
local sg2=g:Filter(c33700101.filter2,nil) local sg=g:Filter(tp,c33700101.filter,nil)
if g:IsExists(c33700101.filter,1,nil) then if sg:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Filter(c33700101.filter,nil)
if sg:GetFirst():IsAbleToHand() then
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
g:Sub(sg)
if sg:GetClassCount(Card.GetCode)<sg:GetCount() then if sg:GetClassCount(Card.GetCode)<sg:GetCount() then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -87,11 +79,7 @@ function c33700101.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,11 +79,7 @@ function c33700101.thop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN) e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
else
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
Duel.MoveSequence(sg2,1)
end end
Duel.MoveSequence(g,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