Commit db9c00e7 authored by DailyShana's avatar DailyShana
parent 108c7f4b
...@@ -29,13 +29,13 @@ function c10406322.initial_effect(c) ...@@ -29,13 +29,13 @@ function c10406322.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c10406322.target(e,tp,eg,ep,ev,re,r,rp,chk) function c10406322.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
local ac=Duel.AnnounceCard(tp) local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac) e:SetLabel(ac)
end end
function c10406322.operation(e,tp,eg,ep,ev,re,r,rp) function c10406322.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -49,10 +49,10 @@ function c10530913.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,10 +49,10 @@ function c10530913.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c10530913.target(e,tp,eg,ep,ev,re,r,rp,chk) function c10530913.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c10530913.operation(e,tp,eg,ep,ev,re,r,rp) function c10530913.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -23,9 +23,10 @@ function c10753491.initial_effect(c) ...@@ -23,9 +23,10 @@ function c10753491.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c10753491.target(e,tp,eg,ep,ev,re,r,rp,chk) function c10753491.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c10753491.operation(e,tp,eg,ep,ev,re,r,rp) function c10753491.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end if ct==0 then return end
local ac=1 local ac=1
......
...@@ -21,10 +21,10 @@ function c11682713.initial_effect(c) ...@@ -21,10 +21,10 @@ function c11682713.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c11682713.target(e,tp,eg,ep,ev,re,r,rp,chk) function c11682713.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c11682713.operation(e,tp,eg,ep,ev,re,r,rp) function c11682713.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -24,11 +24,11 @@ function c15381252.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -24,11 +24,11 @@ function c15381252.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end end
function c15381252.target(e,tp,eg,ep,ev,re,r,rp,chk) function c15381252.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c15381252.activate(e,tp,eg,ep,ev,re,r,rp) function c15381252.activate(e,tp,eg,ep,ev,re,r,rp)
local count=8 local count=8
while count>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.GetLP(1-tp)>0 do while count>0 and Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.GetLP(1-tp)>0 do
if count<8 then Duel.BreakEffect() end if count<8 then Duel.BreakEffect() end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
......
...@@ -46,7 +46,7 @@ function c18631392.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -46,7 +46,7 @@ function c18631392.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.SendtoGrave(g1,REASON_COST) Duel.SendtoGrave(g1,REASON_COST)
end end
function c18631392.anctg(e,tp,eg,ep,ev,re,r,rp,chk) function c18631392.anctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
local ac1=Duel.AnnounceCard(tp) local ac1=Duel.AnnounceCard(tp)
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
...@@ -62,6 +62,7 @@ end ...@@ -62,6 +62,7 @@ end
function c18631392.retop(code1,code2,code3) function c18631392.retop(code1,code2,code3)
return return
function (e,tp,eg,ep,ev,re,r,rp) function (e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,3) then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.ConfirmDecktop(tp,3) Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3) local g=Duel.GetDecktopGroup(tp,3)
......
...@@ -28,13 +28,13 @@ function c20579538.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,13 +28,13 @@ function c20579538.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
end end
function c20579538.target(e,tp,eg,ep,ev,re,r,rp,chk) function c20579538.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c20579538.tdfilter(c) function c20579538.tdfilter(c)
return c:IsSetCard(0xa6) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck() return c:IsSetCard(0xa6) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end end
function c20579538.operation(e,tp,eg,ep,ev,re,r,rp) function c20579538.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
......
...@@ -21,13 +21,14 @@ function c22796548.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -21,13 +21,14 @@ function c22796548.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,500) Duel.PayLPCost(tp,500)
end end
function c22796548.target(e,tp,eg,ep,ev,re,r,rp,chk) function c22796548.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,0)
local ac=Duel.AnnounceCard(tp) local ac=Duel.AnnounceCard(tp)
e:SetLabel(ac) e:SetLabel(ac)
end end
function c22796548.operation(e,tp,eg,ep,ev,re,r,rp) function c22796548.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not e:GetHandler():IsRelateToEffect(e) or not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -19,10 +19,10 @@ function c25824484.initial_effect(c) ...@@ -19,10 +19,10 @@ function c25824484.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c25824484.target(e,tp,eg,ep,ev,re,r,rp,chk) function c25824484.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c25824484.operation(e,tp,eg,ep,ev,re,r,rp) function c25824484.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -23,9 +23,10 @@ function c36046926.initial_effect(c) ...@@ -23,9 +23,10 @@ function c36046926.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c36046926.target(e,tp,eg,ep,ev,re,r,rp,chk) function c36046926.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c36046926.operation(e,tp,eg,ep,ev,re,r,rp) function c36046926.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end if ct==0 then return end
local ac=1 local ac=1
......
...@@ -27,10 +27,10 @@ function c47077318.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,10 +27,10 @@ function c47077318.condition(e,tp,eg,ep,ev,re,r,rp)
and c:GetPreviousControler()==tp and c:GetPreviousControler()==tp
end end
function c47077318.target(e,tp,eg,ep,ev,re,r,rp,chk) function c47077318.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c47077318.operation(e,tp,eg,ep,ev,re,r,rp) function c47077318.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -17,10 +17,10 @@ function c47741109.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -17,10 +17,10 @@ function c47741109.condition(e,tp,eg,ep,ev,re,r,rp)
(c:IsReason(REASON_REVEAL) or c:GetPreviousPosition()==POS_FACEUP_DEFENCE or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))) (c:IsReason(REASON_REVEAL) or c:GetPreviousPosition()==POS_FACEUP_DEFENCE or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK)))
end end
function c47741109.target(e,tp,eg,ep,ev,re,r,rp,chk) function c47741109.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c47741109.operation(e,tp,eg,ep,ev,re,r,rp) function c47741109.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -36,16 +36,16 @@ end ...@@ -36,16 +36,16 @@ end
function c49838105.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c49838105.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(49838105,2)) then and Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(49838105,2)) then
e:SetLabel(1) e:SetLabel(1)
else e:SetLabel(0) end else e:SetLabel(0) end
end end
function c49838105.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c49838105.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c49838105.operation(e,tp,eg,ep,ev,re,r,rp) function c49838105.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -30,12 +30,12 @@ function c60990740.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -30,12 +30,12 @@ function c60990740.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c60990740.target(e,tp,eg,ep,ev,re,r,rp,chk) function c60990740.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SSET) end and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SSET) end
end end
function c60990740.operation(e,tp,eg,ep,ev,re,r,rp) function c60990740.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local tc=Duel.GetDecktopGroup(tp,1):GetFirst() local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
......
...@@ -17,6 +17,7 @@ function c62017867.initial_effect(c) ...@@ -17,6 +17,7 @@ function c62017867.initial_effect(c)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c62017867.atkcon) e2:SetCondition(c62017867.atkcon)
e2:SetCost(c62017867.atkcost) e2:SetCost(c62017867.atkcost)
e2:SetTarget(c62017867.atktg)
e2:SetOperation(c62017867.atkop) e2:SetOperation(c62017867.atkop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -38,8 +39,11 @@ function c62017867.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,8 +39,11 @@ function c62017867.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c62017867.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end
function c62017867.atkop(e,tp,eg,ep,ev,re,r,rp) function c62017867.atkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -21,10 +21,10 @@ function c62434031.initial_effect(c) ...@@ -21,10 +21,10 @@ function c62434031.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c62434031.target(e,tp,eg,ep,ev,re,r,rp,chk) function c62434031.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c62434031.operation(e,tp,eg,ep,ev,re,r,rp) function c62434031.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -26,10 +26,10 @@ function c63257623.initial_effect(c) ...@@ -26,10 +26,10 @@ function c63257623.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c63257623.target(e,tp,eg,ep,ev,re,r,rp,chk) function c63257623.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c63257623.operation(e,tp,eg,ep,ev,re,r,rp) function c63257623.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -6,18 +6,18 @@ function c63942761.initial_effect(c) ...@@ -6,18 +6,18 @@ function c63942761.initial_effect(c)
e1:SetCategory(CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCondition(c63942761.condition) e1:SetTarget(c63942761.target)
e1:SetOperation(c63942761.operation) e1:SetOperation(c63942761.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c63942761.condition(e,tp,eg,ep,ev,re,r,rp) function c63942761.target(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) end
end end
function c63942761.filter(c) function c63942761.filter(c)
return c:GetType()==0x82 or (c:IsSetCard(0x3a) and c:IsType(TYPE_MONSTER)) return c:GetType()==0x82 or (c:IsSetCard(0x3a) and c:IsType(TYPE_MONSTER))
end end
function c63942761.operation(e,tp,eg,ep,ev,re,r,rp) function c63942761.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<5 then return end if not Duel.IsPlayerCanDiscardDeck(tp,5) then return end
Duel.ConfirmDecktop(tp,5) Duel.ConfirmDecktop(tp,5)
local g=Duel.GetDecktopGroup(tp,5) local g=Duel.GetDecktopGroup(tp,5)
local sg=g:Filter(c63942761.filter,nil) local sg=g:Filter(c63942761.filter,nil)
......
...@@ -53,11 +53,11 @@ function c70222318.tgcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,11 +53,11 @@ function c70222318.tgcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() return tp~=Duel.GetTurnPlayer()
end end
function c70222318.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c70222318.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c70222318.tgop(e,tp,eg,ep,ev,re,r,rp) function c70222318.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1) local g=Duel.GetDecktopGroup(tp,1)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -25,12 +25,12 @@ end ...@@ -25,12 +25,12 @@ end
function c73136204.target(e,tp,eg,ep,ev,re,r,rp,chk) function c73136204.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
return ac>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=ac return ac>0 and Duel.IsPlayerCanDiscardDeck(tp,ac)
end end
end end
function c73136204.operation(e,tp,eg,ep,ev,re,r,rp) function c73136204.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) local ac=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if ac==0 or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<ac then return end if ac==0 or not Duel.IsPlayerCanDiscardDeck(tp,ac) then return end
Duel.ConfirmDecktop(tp,ac) Duel.ConfirmDecktop(tp,ac)
local g=Duel.GetDecktopGroup(tp,ac) local g=Duel.GetDecktopGroup(tp,ac)
local sg=g:Filter(Card.IsRace,nil,RACE_PLANT) local sg=g:Filter(Card.IsRace,nil,RACE_PLANT)
......
...@@ -46,11 +46,12 @@ function c95239444.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -46,11 +46,12 @@ function c95239444.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c95239444.target(e,tp,eg,ep,ev,re,r,rp,chk) function c95239444.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
end end
function c95239444.operation(e,tp,eg,ep,ev,re,r,rp) function c95239444.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end if ct==0 then return end
if ct>3 then ct=3 end if ct>3 then ct=3 end
......
...@@ -23,9 +23,10 @@ function c99429730.initial_effect(c) ...@@ -23,9 +23,10 @@ function c99429730.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c99429730.target(e,tp,eg,ep,ev,re,r,rp,chk) function c99429730.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c99429730.operation(e,tp,eg,ep,ev,re,r,rp) function c99429730.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end if ct==0 then return end
if ct>3 then ct=3 end if ct>3 then ct=3 end
......
...@@ -23,9 +23,10 @@ function c99641328.initial_effect(c) ...@@ -23,9 +23,10 @@ function c99641328.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c99641328.target(e,tp,eg,ep,ev,re,r,rp,chk) function c99641328.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end end
function c99641328.operation(e,tp,eg,ep,ev,re,r,rp) function c99641328.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end if ct==0 then return end
if ct>5 then ct=5 end if ct>5 then ct=5 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