Commit d25c5e68 authored by POLYMER's avatar POLYMER

fix

parent 6c2617e8
...@@ -2,108 +2,55 @@ ...@@ -2,108 +2,55 @@
function c11561016.initial_effect(c) function c11561016.initial_effect(c)
-- --
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE)
e1:SetCountLimit(1,11561016) e1:SetCountLimit(1,11561016)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk) e1:SetCost(c11561016.cost)
local c=e:GetHandler() e1:SetOperation(c11561016.operation)
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) end)
e1:SetTarget(c11561016.xxtg)
e1:SetOperation(c11561016.xxop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if c11561016.counter==nil then Duel.AddCustomActivityCounter(11561016,ACTIVITY_CHAIN,aux.FALSE)
c11561016.counter=true
c11561016[0]=0
c11561016[1]=0
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e3:SetOperation(c11561016.resetcount)
Duel.RegisterEffect(e3,0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_CHAINING)
e4:SetOperation(c11561016.checkop)
Duel.RegisterEffect(e4,0)
end
end
function c11561016.resetcount(e,tp,eg,ep,ev,re,r,rp)
c11561016[0]=0
c11561016[1]=0
end end
function c11561016.checkop(e,tp,eg,ep,ev,re,r,rp) function c11561016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
c11561016[rp]=c11561016[rp]+1 if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end end
function c11561016.xxtg(e,tp,eg,ep,ev,re,r,rp,chk) function c11561016.operation(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return true end local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(c11561016.regop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end end
function c11561016.xxop(e,tp,eg,ep,ev,re,r,rp) function c11561016.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local ct=Duel.GetCustomActivityCount(11561016,1-tp,ACTIVITY_CHAIN)
local e2=Effect.CreateEffect(c) if ct==0 then return end
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetOperation(c11561016.hxop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c11561016.hxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local ct=c11561016[1-tp]
if x==0 or ct<1 then return end
Duel.Hint(HINT_CARD,0,11561016) Duel.Hint(HINT_CARD,0,11561016)
if ct>x then ct=x end if ct>Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) then ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) end
local g=Duel.GetDecktopGroup(tp,ct) local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
if ct>4 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local d=math.floor(ct/4) local tg=g:SelectSubGroup(tp,aux.TRUE,true,0,math.floor(#g/4))
local chk=0 if tg:GetCount()>0 then
local a=0 g:Sub(tg)
local msg=Group.CreateGroup()
for i=1,d do
if chk==0 and g:IsExists(Card.IsAbleToHand,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(11561016,0)) then
local sg=g:Filter(Card.IsAbleToHand,nil):Select(tp,1,1,nil)
g:Sub(sg)
msg:Merge(sg)
a=a+1
else
chk=1
end
end
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.SendtoHand(msg,tp,REASON_EFFECT) Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,msg) Duel.ConfirmCards(1-tp,tg)
if a>0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,a,nil) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,#tg,#tg,nil)
if #sg>0 then
Duel.BreakEffect() Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,a,a,nil)
local a1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local tc=g:GetFirst()
while tc do
Duel.MoveSequence(tc,SEQ_DECKTOP)
tc=g:GetNext()
end
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT) Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
g:Merge(sg)
Duel.SortDecktop(tp,tp,ct) Duel.SortDecktop(tp,tp,ct)
if #sg>=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) and Duel.IsPlayerCanDraw(tp,1) then
local g2=Duel.GetOperatedGroup() Duel.ShuffleHand(tp)
local a2=Group.GetCount(g2) Duel.BreakEffect()
if not (a2<math.floor(a1/2)) then Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(tp,1,REASON_EFFECT) end end
end end
end end
end end
...@@ -6,6 +6,7 @@ function c49811422.initial_effect(c) ...@@ -6,6 +6,7 @@ function c49811422.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,49811422)
e2:SetCondition(c49811422.spcon) e2:SetCondition(c49811422.spcon)
e2:SetCost(c49811422.spcost) e2:SetCost(c49811422.spcost)
e2:SetTarget(c49811422.sptg) e2:SetTarget(c49811422.sptg)
......
...@@ -6,6 +6,7 @@ function c49811441.initial_effect(c) ...@@ -6,6 +6,7 @@ function c49811441.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,49811441)
e2:SetCondition(c49811441.spcon) e2:SetCondition(c49811441.spcon)
e2:SetCost(c49811441.spcost) e2:SetCost(c49811441.spcost)
e2:SetTarget(c49811441.sptg) e2:SetTarget(c49811441.sptg)
......
...@@ -7,6 +7,7 @@ function c49811442.initial_effect(c) ...@@ -7,6 +7,7 @@ function c49811442.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_HAND) e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,49811442)
e3:SetCondition(c49811442.spcon) e3:SetCondition(c49811442.spcon)
e3:SetCost(c49811442.spcost) e3:SetCost(c49811442.spcost)
e3:SetTarget(c49811442.sptg) e3:SetTarget(c49811442.sptg)
......
...@@ -54,13 +54,13 @@ function c98920176.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,13 +54,13 @@ function c98920176.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(p,val,REASON_EFFECT) Duel.Damage(p,val,REASON_EFFECT)
end end
function c98920176.spfilter(c,e,tp) function c98920176.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsLevelAbove(1)
end end
function c98920176.gcheck(sg) function c98920176.gcheck(sg)
return sg:GetSum(Card.GetLevel)<=8 return sg:GetSum(Card.GetLevel)<=8
end end
function c98920176.fselect(g,tp,c) function c98920176.fselect(g,tp,c)
return g:CheckWithSumEqual(Card.GetLevel,8,g:GetCount(),g:GetCount()) and Duel.GetMZoneCount(tp,c)>=g:GetCount() return g:CheckWithSumEqual(Card.GetLevel,8,g:GetCount(),g:GetCount()) and Duel.GetMZoneCount(tp,c)+1>=g:GetCount()
end end
function c98920176.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c98920176.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c98920176.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp) local g=Duel.GetMatchingGroup(c98920176.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
...@@ -87,7 +87,7 @@ function c98920176.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,7 +87,7 @@ function c98920176.spop(e,tp,eg,ep,ev,re,r,rp)
if sg then if sg then
local tc=sg:GetFirst() local tc=sg:GetFirst()
while tc do while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
......
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