Commit 35b23b32 authored by VanillaSalt's avatar VanillaSalt

Merge pull request #725 from salix5/patch

Patch
parents 145062d8 f6592788
......@@ -3908,7 +3908,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
}
case 2: {
// Draw, new ruling
if(!(core.duel_options & DUEL_OBSOLETE_RULING) || (infos.turn_id > 1)) {
if((core.duel_options & DUEL_OBSOLETE_RULING) || (infos.turn_id > 1)) {
int32 count = get_draw_count(infos.turn_player);
if(count > 0) {
draw(0, REASON_RULE, turn_player, turn_player, count);
......
......@@ -23,10 +23,11 @@ function c74845897.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c74845897.filter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp)
if g:GetCount()>0 then
local fid=e:GetHandler():GetFieldID()
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(74845897,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
tc:RegisterFlagEffect(74845897,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,fid)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
......@@ -36,17 +37,18 @@ function c74845897.op(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetOperation(c74845897.rmop)
Duel.RegisterEffect(e1,tp)
end
end
function c74845897.rmfilter(c)
return c:GetFlagEffect(74845897)>0
function c74845897.rmfilter(c,fid)
return c:GetFlagEffectLabel(74845897)==fid
end
function c74845897.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c74845897.rmfilter,nil)
local tg=g:Filter(c74845897.rmfilter,nil,e:GetLabel())
g:DeleteGroup()
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
......@@ -39,25 +39,33 @@ function c83054225.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()<ct then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,ct,ct,nil)
local fid=e:GetHandler():GetFieldID()
local tc=sg:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(83054225,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
tc:RegisterFlagEffect(83054225,RESET_EVENT+0x1fe0000,0,1,fid)
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
sg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(sg)
e1:SetOperation(c83054225.retop)
Duel.RegisterEffect(e1,tp)
end
function c83054225.retfilter(c)
return c:GetFlagEffect(83054225)>0
function c83054225.retfilter(c,fid)
return c:GetFlagEffectLabel(83054225)==fid
end
function c83054225.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c83054225.retfilter,tp,LOCATION_MZONE,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local g=e:GetLabelObject()
local tg=g:Filter(c83054225.retfilter,nil,e:GetLabel())
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
if not g:IsExists(c83054225.retfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
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