Commit 4251f035 authored by mercury233's avatar mercury233 Committed by GitHub

add count limit for player effect (#1668)

* fix & update EFFECT_EXTRA_PENDULUM_SUMMON

* update Palace of the Elemental Lords
parent e5e84bb8
...@@ -31,24 +31,15 @@ function c18214905.costfilter(c) ...@@ -31,24 +31,15 @@ function c18214905.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c18214905.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function c18214905.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c18214905.costfilter,tp,loc,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c18214905.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c18214905.costfilter,tp,loc,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c18214905.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -26,24 +26,15 @@ function c19036557.costfilter(c,tp) ...@@ -26,24 +26,15 @@ function c19036557.costfilter(c,tp)
and Duel.IsExistingMatchingCard(c19036557.thfilter,tp,LOCATION_DECK,0,1,c) and Duel.IsExistingMatchingCard(c19036557.thfilter,tp,LOCATION_DECK,0,1,c)
end end
function c19036557.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c19036557.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c19036557.costfilter,tp,loc,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c19036557.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c19036557.costfilter,tp,loc,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c19036557.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -93,6 +93,7 @@ function c29432356.penop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,6 +93,7 @@ function c29432356.penop(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON) e2:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0) e2:SetTargetRange(1,0)
e2:SetCountLimit(1,29432356)
e2:SetValue(c29432356.pendvalue) e2:SetValue(c29432356.pendvalue)
e2:SetReset(RESET_PHASE+PHASE_END) e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
......
...@@ -94,7 +94,7 @@ function c31531170.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og) ...@@ -94,7 +94,7 @@ function c31531170.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
if #g==0 then return end if #g==0 then return end
if ce then if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode()) Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset() ce:UseCountLimit(tp)
else else
aux.PendulumChecklist=aux.PendulumChecklist|(0x1<<tp) aux.PendulumChecklist=aux.PendulumChecklist|(0x1<<tp)
end end
......
...@@ -105,6 +105,7 @@ function c34884015.expop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,6 +105,7 @@ function c34884015.expop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON) e1:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetCountLimit(1,29432356)
e1:SetValue(aux.TRUE) e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
......
...@@ -28,24 +28,15 @@ function c45702014.costfilter(c) ...@@ -28,24 +28,15 @@ function c45702014.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c45702014.setcost(e,tp,eg,ep,ev,re,r,rp,chk) function c45702014.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c45702014.costfilter,tp,loc,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c45702014.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c45702014.costfilter,tp,loc,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c45702014.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -26,24 +26,15 @@ function c46425662.costfilter(c) ...@@ -26,24 +26,15 @@ function c46425662.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c46425662.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c46425662.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c46425662.costfilter,tp,loc,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c46425662.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c46425662.costfilter,tp,loc,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c46425662.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -33,13 +33,9 @@ function c61557074.initial_effect(c) ...@@ -33,13 +33,9 @@ function c61557074.initial_effect(c)
e5:SetCode(61557074) e5:SetCode(61557074)
e5:SetRange(LOCATION_FZONE) e5:SetRange(LOCATION_FZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCountLimit(1)
e5:SetTargetRange(1,0) e5:SetTargetRange(1,0)
e5:SetCondition(c61557074.condition)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_CLIENT_HINT)
c:RegisterEffect(e6)
end end
function c61557074.atkval(e,c) function c61557074.atkval(e,c)
return Duel.GetMatchingGroup(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_MONSTER):GetClassCount(Card.GetAttribute)*200 return Duel.GetMatchingGroup(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_MONSTER):GetClassCount(Card.GetAttribute)*200
...@@ -76,6 +72,3 @@ end ...@@ -76,6 +72,3 @@ end
function c61557074.skipcon(e) function c61557074.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel() return Duel.GetTurnCount()~=e:GetLabel()
end end
function c61557074.condition(e)
return e:GetHandler():GetFlagEffect(61557074)==0
end
...@@ -29,24 +29,15 @@ function c71797713.regfilter(c,attr) ...@@ -29,24 +29,15 @@ function c71797713.regfilter(c,attr)
return c:IsSetCard(0x400d) and bit.band(c:GetOriginalAttribute(),attr)~=0 return c:IsSetCard(0x400d) and bit.band(c:GetOriginalAttribute(),attr)~=0
end end
function c71797713.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c71797713.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c71797713.costfilter,tp,loc,0,2,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c71797713.costfilter,tp,loc,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c71797713.costfilter,tp,loc,0,2,2,e:GetHandler()) local g=Duel.SelectMatchingCard(tp,c71797713.costfilter,tp,loc,0,2,2,e:GetHandler())
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
local flag=0 local flag=0
if g:IsExists(c71797713.regfilter,1,nil,ATTRIBUTE_EARTH+ATTRIBUTE_WIND) then flag=bit.bor(flag,0x1) end if g:IsExists(c71797713.regfilter,1,nil,ATTRIBUTE_EARTH+ATTRIBUTE_WIND) then flag=bit.bor(flag,0x1) end
......
...@@ -26,24 +26,15 @@ function c72819261.costfilter(c,tp) ...@@ -26,24 +26,15 @@ function c72819261.costfilter(c,tp)
and Duel.IsExistingMatchingCard(c72819261.filter,tp,LOCATION_DECK,0,1,c) and Duel.IsExistingMatchingCard(c72819261.filter,tp,LOCATION_DECK,0,1,c)
end end
function c72819261.sgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c72819261.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c72819261.costfilter,tp,loc,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c72819261.costfilter,tp,loc,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c72819261.costfilter,tp,loc,0,1,1,nil,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c72819261.costfilter,tp,loc,0,1,1,nil,tp):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -26,24 +26,15 @@ function c83032858.costfilter(c) ...@@ -26,24 +26,15 @@ function c83032858.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end end
function c83032858.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c83032858.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup() local fe=Duel.IsPlayerAffectedByEffect(tp,61557074)
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end if fe then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c83032858.costfilter,tp,loc,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c83032858.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c83032858.costfilter,tp,loc,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,c83032858.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then if tc:IsLocation(LOCATION_DECK) then
local fc=nil Duel.Hint(HINT_CARD,0,61557074)
if fg:GetCount()==1 then fe:UseCountLimit(tp)
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end end
Duel.SendtoGrave(tc,REASON_COST) Duel.SendtoGrave(tc,REASON_COST)
end end
......
...@@ -1865,7 +1865,7 @@ function Auxiliary.PendOperation() ...@@ -1865,7 +1865,7 @@ function Auxiliary.PendOperation()
if not g then return end if not g then return end
if ce then if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode()) Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset() ce:UseCountLimit(tp)
else else
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp) Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
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