Commit 241c18ce authored by mercury233's avatar mercury233 Committed by GitHub

update must pay lp cost (#1719)

parent 5ea2a0c5
......@@ -81,10 +81,10 @@ function c10000010.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(c10000010.genchainlm(e:GetHandler()))
end
function c10000010.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>100 end
local lp=Duel.GetLP(tp)
if chk==0 then return Duel.CheckLPCost(tp,lp-100,true) end
e:SetLabel(lp-100)
Duel.PayLPCost(tp,lp-100)
Duel.PayLPCost(tp,lp-100,true)
end
function c10000010.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -17,7 +17,7 @@ function c17078030.initial_effect(c)
e1:SetLabelObject(e2)
end
function c17078030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
if chk==0 then return Duel.CheckLPCost(tp,1000,true) end
local lp=Duel.GetLP(tp)
local t={}
local f=math.floor((lp)/1000)
......@@ -28,7 +28,7 @@ function c17078030.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(17078030,0))
local announce=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,announce)
Duel.PayLPCost(tp,announce,true)
e:GetLabelObject():SetLabel(announce)
e:GetHandler():SetHint(CHINT_NUMBER,announce)
end
......
......@@ -7,15 +7,11 @@ function c17956906.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,17956906+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c17956906.condition)
e1:SetCost(c17956906.cost)
e1:SetTarget(c17956906.target)
e1:SetOperation(c17956906.operation)
c:RegisterEffect(e1)
end
function c17956906.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,EFFECT_LPCOST_CHANGE)
end
function c17956906.spfilter(c,e,tp)
return c:IsSetCard(0x122) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeEffectTarget(e)
end
......@@ -32,7 +28,7 @@ function c17956906.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return ft>0 and g:GetCount()>0 and Duel.CheckLPCost(tp,1000)
return ft>0 and g:GetCount()>0 and Duel.CheckLPCost(tp,1000,true)
end
e:SetLabel(0)
local ct=math.min(g:GetClassCount(Card.GetCode),ft)
......@@ -41,11 +37,11 @@ function c17956906.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
local pay_list = {}
for p=1,ct do
if Duel.CheckLPCost(tp,1000*p) then table.insert(pay_list,p) end
if Duel.CheckLPCost(tp,1000*p,true) then table.insert(pay_list,p) end
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(17956906,0))
local pay=Duel.AnnounceNumber(tp,table.unpack(pay_list))
Duel.PayLPCost(tp,pay*1000)
Duel.PayLPCost(tp,pay*1000,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,pay,pay)
......
......@@ -30,7 +30,7 @@ function c21454943.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c21454943.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return Duel.CheckLPCost(tp,100) and e:GetHandler():GetFlagEffect(21454943)==0
if chk==0 then return Duel.CheckLPCost(tp,100,true) and e:GetHandler():GetFlagEffect(21454943)==0
and (bc:IsAttackAbove(100) or bc:IsDefenseAbove(100)) end
local lp=Duel.GetLP(tp)-1
local alp=100
......@@ -44,7 +44,7 @@ function c21454943.cost(e,tp,eg,ep,ev,re,r,rp,chk)
elseif lp>=300 then alp=Duel.AnnounceNumber(tp,100,200,300)
elseif lp>=200 then alp=Duel.AnnounceNumber(tp,100,200)
end
Duel.PayLPCost(tp,alp)
Duel.PayLPCost(tp,alp,true)
e:SetLabel(alp)
e:GetHandler():RegisterFlagEffect(21454943,RESET_PHASE+PHASE_DAMAGE,0,1)
end
......
......@@ -59,8 +59,8 @@ function c28265983.descon2(e,tp,eg,ep,ev,re,r,rp)
end
function c28265983.descost2(e,tp,eg,ep,ev,re,r,rp,chk)
local lp=Duel.GetLP(tp)-Duel.GetLP(1-tp)
if chk==0 then return Duel.CheckLPCost(tp,lp) end
Duel.PayLPCost(tp,lp)
if chk==0 then return Duel.CheckLPCost(tp,lp,true) end
Duel.PayLPCost(tp,lp,true)
e:SetLabel(lp)
end
function c28265983.desfilter2(c,num)
......
......@@ -21,8 +21,9 @@ function c31712840.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c31712840.cfilter,1,e:GetHandler(),tp)
end
function c31712840.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>10 end
Duel.PayLPCost(tp,Duel.GetLP(tp)-10)
local lp=Duel.GetLP(tp)
if chk==0 then return Duel.CheckLPCost(tp,lp-10,true) end
Duel.PayLPCost(tp,lp-10,true)
end
function c31712840.spfilter(c,e,tp)
return c:IsSetCard(0x107f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
......
......@@ -11,8 +11,9 @@ function c32603633.initial_effect(c)
c:RegisterEffect(e1)
end
function c32603633.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>100 end
Duel.PayLPCost(tp,Duel.GetLP(tp)-100)
local lp=Duel.GetLP(tp)
if chk==0 then return Duel.CheckLPCost(tp,lp-100,true) end
Duel.PayLPCost(tp,lp-100,true)
end
function c32603633.filter(c,e,tp)
return c:IsSetCard(0x3d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -30,7 +30,7 @@ function c41925941.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c41925941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return Duel.CheckLPCost(tp,100) and (bc:IsAttackAbove(100) or bc:IsDefenseAbove(100)) end
if chk==0 then return Duel.CheckLPCost(tp,100,true) and (bc:IsAttackAbove(100) or bc:IsDefenseAbove(100)) end
local maxc=Duel.GetLP(tp)
local maxpay=bc:GetAttack()
local def=bc:GetDefense()
......@@ -43,7 +43,7 @@ function c41925941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
t[i]=i*100
end
local cost=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,cost)
Duel.PayLPCost(tp,cost,true)
e:SetLabel(cost)
end
function c41925941.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -59,7 +59,7 @@ function c6039967.atkcon(e,tp,eg,ep,ev,re,r,rp)
end
function c6039967.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(6039967)==0
and Duel.CheckLPCost(tp,100) end
and Duel.CheckLPCost(tp,100,true) end
local lp=Duel.GetLP(tp)
local m=math.floor(math.min(lp,3000)/100)
local t={}
......@@ -67,7 +67,7 @@ function c6039967.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
t[i]=i*100
end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,ac)
Duel.PayLPCost(tp,ac,true)
e:SetLabel(ac)
e:GetHandler():RegisterFlagEffect(6039967,RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
......
......@@ -10,11 +10,8 @@ function c67196946.initial_effect(c)
e1:SetOperation(c67196946.op)
c:RegisterEffect(e1)
end
function c67196946.con(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,EFFECT_LPCOST_CHANGE)
end
function c67196946.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
if chk==0 then return Duel.CheckLPCost(tp,500,true) end
local lp=Duel.GetLP(tp)
local g=Duel.GetMatchingGroup(Card.IsLevelAbove,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,2)
local tg=g:GetMaxGroup(Card.GetLevel)
......@@ -27,7 +24,7 @@ function c67196946.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(67196946,0))
local announce=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,announce)
Duel.PayLPCost(tp,announce,true)
e:SetLabel(announce/500)
end
function c67196946.tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -35,7 +35,7 @@ function c68299524.filter(c)
return c:IsFaceup() and c:IsAttackAbove(100)
end
function c68299524.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,100)
if chk==0 then return Duel.CheckLPCost(tp,100,true)
and Duel.IsExistingMatchingCard(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c68299524.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local tg,atk=g:GetMaxGroup(Card.GetAttack)
......@@ -46,7 +46,7 @@ function c68299524.cost(e,tp,eg,ep,ev,re,r,rp,chk)
t[i]=i*100
end
local cost=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,cost)
Duel.PayLPCost(tp,cost,true)
e:SetLabel(cost)
end
function c68299524.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -66,7 +66,7 @@ function c70219023.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return off>1 end
local op=0
local pay=0
while pay<6000 and Duel.CheckLPCost(tp,pay+2000) do
while pay<6000 and Duel.CheckLPCost(tp,pay+2000,true) do
local sel
local selval
if Duel.GetLP(tp)-pay-2000-Duel.GetLP(1-tp)~=0 then
......@@ -91,7 +91,7 @@ function c70219023.target(e,tp,eg,ep,ev,re,r,rp,chk)
op=op|selval
pay=pay+2000
end
Duel.PayLPCost(tp,pay)
Duel.PayLPCost(tp,pay,true)
e:SetLabel(op)
e:GetHandler():RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(70219023,0))
end
......
......@@ -29,7 +29,7 @@ function c75539614.initial_effect(c)
c:RegisterEffect(e4)
end
function c75539614.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,100) end
if chk==0 then return Duel.CheckLPCost(tp,100,true) end
local lp=Duel.GetLP(tp)
local m=math.floor(math.min(lp,2000)/100)
local t={}
......@@ -37,7 +37,7 @@ function c75539614.cost(e,tp,eg,ep,ev,re,r,rp,chk)
t[i]=i*100
end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,ac)
Duel.PayLPCost(tp,ac,true)
e:GetHandler():RegisterFlagEffect(75539614,RESET_EVENT+RESETS_STANDARD,0,1,ac)
end
function c75539614.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -52,10 +52,10 @@ end
function c77432167.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0)
local c=e:GetHandler()
if chk==0 then return Duel.GetLP(tp)>100 and c:GetFlagEffect(77432168)==0 end
local lp=Duel.GetLP(tp)
if chk==0 then return Duel.CheckLPCost(tp,lp-100,true) and c:GetFlagEffect(77432168)==0 end
e:SetLabel(100,lp-100)
Duel.PayLPCost(tp,lp-100)
Duel.PayLPCost(tp,lp-100,true)
c:RegisterFlagEffect(77432167,RESET_CHAIN,0,1)
end
function c77432167.atkfilter(c)
......
......@@ -32,7 +32,7 @@ function c84389640.condition(e,tp,eg,ep,ev,re,r,rp)
and d:IsFaceup() and d:IsRelateToBattle()
end
function c84389640.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(84389640)==0 and Duel.CheckLPCost(tp,100)
if chk==0 then return e:GetHandler():GetFlagEffect(84389640)==0 and Duel.CheckLPCost(tp,100,true)
and e:GetLabelObject():IsAttackAbove(100) end
local lp=Duel.GetLP(tp)
local atk=e:GetLabelObject():GetAttack()
......@@ -44,7 +44,7 @@ function c84389640.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(84389640,1))
local pay=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,pay)
Duel.PayLPCost(tp,pay,true)
e:SetLabel(pay)
e:GetHandler():RegisterFlagEffect(84389640,RESET_PHASE+PHASE_DAMAGE,0,1)
end
......
......@@ -24,9 +24,10 @@ function c86532744.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=Duel.GetLP(1-tp)-3000
end
function c86532744.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>10 and e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end
local lp=Duel.GetLP(tp)
if chk==0 then return Duel.CheckLPCost(tp,lp-10,true) and e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST)
Duel.PayLPCost(tp,Duel.GetLP(tp)-10)
Duel.PayLPCost(tp,lp-10,true)
end
function c86532744.filter(c)
return c:IsAbleToRemove()
......
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