Commit d25c5e68 authored by POLYMER's avatar POLYMER

fix

parent 6c2617e8
--散华
function c11561016.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,11561016)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) end)
e1:SetTarget(c11561016.xxtg)
e1:SetOperation(c11561016.xxop)
e1:SetCost(c11561016.cost)
e1:SetOperation(c11561016.operation)
c:RegisterEffect(e1)
if c11561016.counter==nil then
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
Duel.AddCustomActivityCounter(11561016,ACTIVITY_CHAIN,aux.FALSE)
end
function c11561016.checkop(e,tp,eg,ep,ev,re,r,rp)
c11561016[rp]=c11561016[rp]+1
function c11561016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c11561016.operation(e,tp,eg,ep,ev,re,r,rp)
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
function c11561016.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetCustomActivityCount(11561016,1-tp,ACTIVITY_CHAIN)
if ct==0 then return end
Duel.Hint(HINT_CARD,0,11561016)
if ct>Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) then ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=g:SelectSubGroup(tp,aux.TRUE,true,0,math.floor(#g/4))
if tg:GetCount()>0 then
g:Sub(tg)
Duel.DisableShuffleCheck()
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
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.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
g:Merge(sg)
Duel.SortDecktop(tp,tp,ct)
if #sg>=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleHand(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
function c11561016.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c11561016.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
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)
if ct>x then ct=x end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmCards(tp,g)
if ct>4 then
local d=math.floor(ct/4)
local chk=0
local a=0
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.SendtoHand(msg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,msg)
if a>0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,a,nil) then
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.SortDecktop(tp,tp,ct)
local g2=Duel.GetOperatedGroup()
local a2=Group.GetCount(g2)
if not (a2<math.floor(a1/2)) then
Duel.Draw(tp,1,REASON_EFFECT) end
end
end
end
......@@ -6,6 +6,7 @@ function c49811422.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,49811422)
e2:SetCondition(c49811422.spcon)
e2:SetCost(c49811422.spcost)
e2:SetTarget(c49811422.sptg)
......
......@@ -6,6 +6,7 @@ function c49811441.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,49811441)
e2:SetCondition(c49811441.spcon)
e2:SetCost(c49811441.spcost)
e2:SetTarget(c49811441.sptg)
......
......@@ -7,6 +7,7 @@ function c49811442.initial_effect(c)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,49811442)
e3:SetCondition(c49811442.spcon)
e3:SetCost(c49811442.spcost)
e3:SetTarget(c49811442.sptg)
......
......@@ -54,13 +54,13 @@ function c98920176.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(p,val,REASON_EFFECT)
end
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
function c98920176.gcheck(sg)
return sg:GetSum(Card.GetLevel)<=8
end
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
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)
......@@ -87,7 +87,7 @@ function c98920176.spop(e,tp,eg,ep,ev,re,r,rp)
if sg then
local tc=sg:GetFirst()
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())
e1:SetType(EFFECT_TYPE_SINGLE)
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