Commit ca3e021c authored by wind2009's avatar wind2009

Fix extra summon effect

parent 336b4afb
......@@ -29,7 +29,7 @@ function c40441990.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,c40441990.costfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c40441990.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) end
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,40441990)==0 end
end
function c40441990.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,40441990)~=0 then return end
......
......@@ -61,13 +61,16 @@ function c42472002.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c42472002.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42472002,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetFlagEffect(tp,42472002)==0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42472002,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,42472002,RESET_PHASE+PHASE_END,0,1)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -76,7 +79,6 @@ function c42472002.sumop(e,tp,eg,ep,ev,re,r,rp)
e2:SetTarget(c42472002.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,42472002,RESET_PHASE+PHASE_END,0,1)
end
function c42472002.splimit(e,c)
return not c:IsSetCard(0x107a) and c:IsLocation(LOCATION_EXTRA)
......
......@@ -9,7 +9,8 @@ function c52112003.initial_effect(c)
c:RegisterEffect(e1)
end
function c52112003.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.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,52112003)==0 end
end
function c52112003.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=math.min(5,Duel.GetFieldGroupCount(tp,LOCATION_DECK,0))
......
......@@ -37,9 +37,10 @@ function c5795882.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,500)
end
function c5795882.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,5795882)==0 end
end
function c5795882.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,5795882)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(5795882,2))
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -75,9 +75,10 @@ function c61322713.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
c61322713.cost1(e,tp,eg,ep,ev,re,r,rp,1)
end
function c61322713.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,61322713)==0 end
end
function c61322713.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,61322713)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(61322713,2))
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -37,7 +37,7 @@ function s.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x95) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -25,7 +25,8 @@ function c78665705.filter(c)
return c:IsCode(10000010) and c:IsAbleToHand()
end
function c78665705.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c78665705.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(c78665705.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
and Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,78665705)==0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c78665705.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -26,7 +26,7 @@ function c80529459.initial_effect(c)
c:RegisterEffect(e2)
end
function c80529459.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
......
......@@ -31,9 +31,10 @@ function c8567955.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1000)
end
function c8567955.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,8567955)==0 end
end
function c8567955.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,8567955)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(8567955,2))
e1:SetType(EFFECT_TYPE_FIELD)
......
......@@ -29,18 +29,20 @@ function c99328137.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,99328137)==0
end
function c99328137.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) end
if chk==0 then return Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,99328137)==0 end
end
function c99328137.sumop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(99328137,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(c99328137.extrasumtg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,99328137,RESET_PHASE+PHASE_END,0,1)
if Duel.GetFlagEffect(tp,94076521)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(99328137,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(c99328137.extrasumtg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,99328137,RESET_PHASE+PHASE_END,0,1)
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SUMMON)
......
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