Commit db345f40 authored by salix5's avatar salix5

Duel.SetLP()

It can accept negative value by default.
parent 7b91d4b1
...@@ -29,11 +29,7 @@ function c2055403.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,11 +29,7 @@ function c2055403.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA) local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then if ct>0 then
Duel.BreakEffect() Duel.BreakEffect()
if Duel.GetLP(tp)>=ct*1000 then Duel.SetLP(tp,Duel.GetLP(tp)-ct*1000)
Duel.SetLP(tp,Duel.GetLP(tp)-ct*1000)
else
Duel.SetLP(tp,0)
end
end end
end end
end end
...@@ -60,7 +60,5 @@ function c36378044.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +60,5 @@ function c36378044.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function c36378044.desop(e,tp,eg,ep,ev,re,r,rp) function c36378044.desop(e,tp,eg,ep,ev,re,r,rp)
local lp=Duel.GetLP(tp) local lp=Duel.GetLP(tp)
if lp>6000 then lp=lp-6000 Duel.SetLP(tp,lp-6000)
else lp=0 end
Duel.SetLP(tp,lp)
end end
...@@ -46,10 +46,5 @@ function c54447022.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,10 +46,5 @@ function c54447022.spop(e,tp,eg,ep,ev,re,r,rp)
sg=sg:Select(tp,ft,ft,nil) sg=sg:Select(tp,ft,ft,nil)
end end
local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) local ct=Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local lp=Duel.GetLP(tp) Duel.SetLP(tp,lp-ct*1000)
if lp<=ct*1000 then
Duel.SetLP(tp,0)
else
Duel.SetLP(tp,lp-ct*1000)
end
end end
...@@ -34,7 +34,7 @@ function c84677654.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -34,7 +34,7 @@ function c84677654.operation(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext() tc=g:GetNext()
end end
elseif coin1==0 and coin2==0 then elseif coin1==0 and coin2==0 then
local lp=Duel.GetLP(tp)-lv*500 local lp=Duel.GetLP(tp)
Duel.SetLP(tp,lp>0 and lp or 0) Duel.SetLP(tp,lp-lv*500)
end end
end end
...@@ -18,6 +18,6 @@ function c94773007.atop(e,tp,eg,ep,ev,re,r,rp) ...@@ -18,6 +18,6 @@ function c94773007.atop(e,tp,eg,ep,ev,re,r,rp)
local opt=Duel.SelectOption(tp,60,61) local opt=Duel.SelectOption(tp,60,61)
local coin=Duel.TossCoin(tp,1) local coin=Duel.TossCoin(tp,1)
if opt==coin then if opt==coin then
Duel.SetLP(tp,Duel.GetLP(tp)/2) Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
end end
end end
...@@ -107,9 +107,5 @@ function c97433739.checkop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -107,9 +107,5 @@ function c97433739.checkop2(e,tp,eg,ep,ev,re,r,rp)
end end
function c97433739.lpop(e,tp,eg,ep,ev,re,r,rp) function c97433739.lpop(e,tp,eg,ep,ev,re,r,rp)
local lp=Duel.GetLP(tp) local lp=Duel.GetLP(tp)
if lp<=4000 then Duel.SetLP(tp,lp-4000)
Duel.SetLP(tp,0)
else
Duel.SetLP(tp,lp-4000)
end
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