Commit bfcf52a3 authored by DailyShana's avatar DailyShana Committed by GitHub

apply ceil/floor when divided by 2 (#1295)

parent b223c44b
......@@ -28,11 +28,11 @@ function c1036974.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c1036974.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c1036974.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetBaseAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(g:GetFirst():GetBaseAttack()/2))
end
function c1036974.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Damage(1-tp,tc:GetBaseAttack()/2,REASON_EFFECT)
Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/2),REASON_EFFECT)
end
end
......@@ -37,13 +37,13 @@ function c11264180.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(tc:GetDefense()/2)
e2:SetValue(math.ceil(tc:GetDefense()/2))
tc:RegisterEffect(e2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c11264180.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
......
......@@ -24,12 +24,12 @@ function c13574687.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c13574687.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,g:GetFirst():GetControler(),g:GetFirst():GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,g:GetFirst():GetControler(),math.floor(g:GetFirst():GetAttack()/2))
end
function c13574687.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local dam=tc:GetAttack()/2
local dam=math.floor(tc:GetAttack()/2)
local p=tc:GetControler()
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(p,dam,REASON_EFFECT)
......
......@@ -52,5 +52,5 @@ function c13611090.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c13611090.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -48,12 +48,12 @@ function c13647631.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(def/2)
e2:SetValue(math.ceil(def/2))
c:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
......
......@@ -55,10 +55,10 @@ function c14258627.adtg(e,c)
return c==e:GetHandler():GetBattleTarget()
end
function c14258627.atkval(e,c)
return c:GetAttack()/2
return math.ceil(c:GetAttack()/2)
end
function c14258627.defval(e,c)
return c:GetDefense()/2
return math.ceil(c:GetDefense()/2)
end
function c14258627.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
......
......@@ -62,7 +62,7 @@ function c15013468.damcon(e,tp,eg,ep,ev,re,r,rp)
end
function c15013468.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetHandler():GetBattleTarget():GetBaseAttack()/2
local dam=math.floor(e:GetHandler():GetBattleTarget():GetBaseAttack()/2)
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -29,7 +29,7 @@ function c15552258.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
tc=g:GetNext()
......
......@@ -41,7 +41,7 @@ function c16304628.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
if c:IsRelateToEffect(e) and c:IsFaceup() then
......@@ -49,7 +49,7 @@ function c16304628.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(atk/2)
e2:SetValue(math.ceil(atk/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
......
......@@ -42,7 +42,7 @@ function c16625614.operation(e,tp,eg,ep,ev,re,r,rp)
local coin=Duel.TossCoin(tp,1)
if coin==1 then
if Duel.NegateAttack() then
Duel.Damage(1-tp,math.ceil(tc:GetAttack()/2),REASON_EFFECT)
Duel.Damage(1-tp,math.floor(tc:GetAttack()/2),REASON_EFFECT)
end
end
end
......@@ -97,5 +97,5 @@ function c17132130.lpc(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c17132130.lpcop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end
......@@ -33,7 +33,7 @@ function c18271561.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
dg=dg:Select(tp,1,1,nil)
end
local atk=dg:GetFirst():GetAttack()/2
local atk=math.floor(dg:GetFirst():GetAttack()/2)
if Duel.Destroy(dg,REASON_EFFECT)>0 then
Duel.Damage(tp,atk,REASON_EFFECT,true)
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
......
......@@ -41,13 +41,13 @@ function c2009101.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(tc:GetDefense()/2)
e2:SetValue(math.ceil(tc:GetDefense()/2))
tc:RegisterEffect(e2)
end
end
......@@ -46,7 +46,7 @@ function c20281581.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c20281581.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,ev/2)
Duel.ChangeBattleDamage(tp,math.floor(ev/2))
end
function c20281581.filter(c)
return c:IsFacedown()
......
......@@ -43,5 +43,5 @@ function c20349913.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c20349913.damval(e,re,val,r,rp,rc)
return val/2
return math.floor(val/2)
end
......@@ -38,7 +38,7 @@ function c2137678.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
end
end
......@@ -54,7 +54,7 @@ function c21435914.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
local atk=g:GetFirst():GetAttack()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.ceil(atk/2))
end
function c21435914.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -64,8 +64,8 @@ function c21435914.damop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e1)
Duel.Damage(1-tp,atk/2,REASON_EFFECT)
Duel.Damage(1-tp,math.ceil(atk/2),REASON_EFFECT)
end
end
......@@ -38,7 +38,7 @@ function c2148918.spop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
......
......@@ -45,6 +45,6 @@ function c22046459.value(e,c)
if Duel.GetLP(p)<Duel.GetLP(1-p) then
return c:GetBaseAttack()*2
elseif Duel.GetLP(p)>Duel.GetLP(1-p) then
return c:GetBaseAttack()/2
return math.ceil(c:GetBaseAttack()/2)
end
end
......@@ -62,7 +62,7 @@ function c22359980.atktg(e,c)
return c:GetFlagEffect(22359980)~=0 and e:GetLabelObject():IsContains(c)
end
function c22359980.atkval(e,c)
return c:GetAttack()/2
return math.ceil(c:GetAttack()/2)
end
function c22359980.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
......
......@@ -94,7 +94,7 @@ function c23187256.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c23187256.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return dam/2
return math.floor(dam/2)
else return dam end
end
function c23187256.indfilter(c)
......
......@@ -49,7 +49,7 @@ function c23770284.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
......
......@@ -48,8 +48,8 @@ function c23792058.tdop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c23792058.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,math.ceil(ev/2),false)
Duel.ChangeBattleDamage(1-ep,math.ceil(ev/2),false)
Duel.ChangeBattleDamage(ep,math.floor(ev/2),false)
Duel.ChangeBattleDamage(1-ep,math.floor(ev/2),false)
end
function c23792058.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_PZONE)
......
......@@ -22,12 +22,12 @@ function c2396042.adop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetValue(c:GetDefense()/2)
e1:SetValue(math.ceil(c:GetDefense()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(c:GetAttack()/2)
e2:SetValue(math.ceil(c:GetAttack()/2))
c:RegisterEffect(e2)
end
end
......@@ -27,7 +27,7 @@ function c24025620.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
......
......@@ -31,7 +31,7 @@ function c24673894.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.BreakEffect()
local val=tc:GetAttack()/2
local op=Duel.SelectOption(1-tp,aux.Stringid(24673894,0),aux.Stringid(24673894,1))
if op==0 then Duel.Recover(1-tp,val,REASON_EFFECT)
else Duel.Damage(tp,val,REASON_EFFECT) end
if op==0 then Duel.Recover(1-tp,math.ceil(val),REASON_EFFECT)
else Duel.Damage(tp,math.floor(val),REASON_EFFECT) end
end
end
......@@ -49,7 +49,7 @@ function c24731391.initial_effect(c)
c:RegisterEffect(e5)
end
function c24731391.val(e,re,dam,r,rp,rc)
return dam/2
return math.floor(dam/2)
end
function c24731391.filter(c)
return c:IsType(TYPE_LINK)
......
......@@ -50,7 +50,7 @@ function c26211048.eqop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(c26211048.eqlimit)
tc:RegisterEffect(e1)
if tc:IsFaceup() then
local atk=tc:GetTextAttack()/2
local atk=math.ceil(tc:GetTextAttack()/2)
if atk<0 then atk=0 end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
......@@ -58,7 +58,7 @@ function c26211048.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
tc:RegisterEffect(e2)
local def=tc:GetTextDefense()/2
local def=math.ceil(tc:GetTextDefense()/2)
if def<0 then def=0 end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
......
......@@ -54,7 +54,7 @@ function c27352108.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c27352108.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c27352108.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -69,7 +69,7 @@ function c27548199.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk/2)
e2:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e2)
end
end
......
......@@ -49,7 +49,7 @@ function c28427869.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c28427869.halfop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,math.ceil(ev/2))
Duel.ChangeBattleDamage(tp,math.floor(ev/2))
end
function c28427869.skipop(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
......
......@@ -62,7 +62,7 @@ function c28429121.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
tc:RegisterEffect(e1)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
......
......@@ -29,7 +29,7 @@ function c28890974.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
......
......@@ -64,7 +64,7 @@ function c2948263.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c2948263.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c2948263.discon(e,tp,eg,ep,ev,re,r,rp)
local tgp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION)
......
......@@ -48,7 +48,7 @@ function c30086349.damop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c30086349.damfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Damage(1-tp,math.ceil(g:GetFirst():GetBaseAttack()/2),REASON_EFFECT)
Duel.Damage(1-tp,math.floor(g:GetFirst():GetBaseAttack()/2),REASON_EFFECT)
end
end
function c30086349.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -40,7 +40,7 @@ function c31444249.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and ac:IsControler(tp) and ac:IsSetCard(0xbb) and ac:GetOriginalLevel()>=2 and not ac:IsImmuneToEffect(e)
end
function c31444249.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c31444249.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
......
......@@ -102,5 +102,5 @@ function c31801517.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and not e:GetHandler():GetOverlayGroup():IsExists(Card.IsCode,1,nil,93717133)
end
function c31801517.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -50,7 +50,7 @@ function c32446630.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(Duel.GetLP(1-tp)/2)
e1:SetValue(math.ceil(Duel.GetLP(1-tp)/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1)
local e2=e1:Clone()
......
......@@ -42,5 +42,5 @@ function c32933942.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c32933942.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -38,8 +38,8 @@ function c33460840.eqop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33460840.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,c)
local tc=g:GetFirst()
if not (tc and Duel.Equip(tp,tc,c)) then return end
local atk=tc:GetTextAttack()/2
local def=tc:GetTextDefense()/2
local atk=math.ceil(tc:GetTextAttack()/2)
local def=math.ceil(tc:GetTextDefense()/2)
if atk<0 then atk=0 end
if def<0 then def=0 end
--Add Equip limit
......
......@@ -41,7 +41,7 @@ function c33537328.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.SelectEffectYesNo(tp,c,96) then
local g=Duel.SelectReleaseGroup(tp,Card.IsReleasableByEffect,1,1,c)
Duel.Release(g,REASON_EFFECT)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
return true
else return false end
end
......@@ -30,13 +30,13 @@ function c34016756.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
if hc:RegisterEffect(e1) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(atk/2)
e2:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e2)
end
end
......
......@@ -52,7 +52,7 @@ function c3429238.datop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetAttack()/2)
e1:SetValue(math.ceil(c:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
......
......@@ -132,7 +132,7 @@ function c34487429.rdcon(e,tp,eg,ep,ev,re,r,rp)
end
function c34487429.rdop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.ChangeBattleDamage(tp,ev/2)
Duel.ChangeBattleDamage(tp,math.floor(ev/2))
e:GetHandler():RegisterFlagEffect(34487429,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
......@@ -51,7 +51,7 @@ function c35058588.atkop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(hc:GetAttack()/2)
e2:SetValue(math.ceil(hc:GetAttack()/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
hc:RegisterEffect(e2)
end
......
......@@ -52,7 +52,7 @@ function c35268887.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c35268887.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then
return dam/2
return math.floor(dam/2)
else return dam end
end
function c35268887.tokentg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -50,7 +50,7 @@ end
function c35842855.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)==1 then
local atk=tc:GetTextAttack()/2
local atk=math.floor(tc:GetTextAttack()/2)
if atk>0 then
Duel.Damage(tp,atk,REASON_EFFECT,true)
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
......
......@@ -48,6 +48,6 @@ function c36076683.atkop(e,tp,eg,ep,ev,re,r,rp)
end
function c36076683.damval(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 and rc==e:GetHandler() then
return dam/2
return math.floor(dam/2)
else return dam end
end
......@@ -34,13 +34,13 @@ function c3642509.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(def/2)
e2:SetValue(math.ceil(def/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc=tg:GetNext()
......
......@@ -77,13 +77,13 @@ function c36956512.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(def/2)
e2:SetValue(math.ceil(def/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc=tg:GetNext()
......
......@@ -36,7 +36,7 @@ function c3701074.recop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=eg:GetFirst()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local rec=tc:GetAttack()/2
local rec=math.ceil(tc:GetAttack()/2)
Duel.Recover(1-tp,rec,REASON_EFFECT)
end
end
......@@ -57,6 +57,6 @@ function c3701074.recop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=g:Select(tp,1,1,nil)
end
Duel.Recover(1-tp,g:GetFirst():GetAttack()/2,REASON_EFFECT)
Duel.Recover(1-tp,math.ceil(g:GetFirst():GetAttack()/2),REASON_EFFECT)
end
end
......@@ -18,5 +18,5 @@ function c37057012.atkcon(e)
and e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()~=nil
end
function c37057012.atkval(e,c)
return Duel.GetAttackTarget():GetAttack()/2
return math.ceil(Duel.GetAttackTarget():GetAttack()/2)
end
......@@ -80,6 +80,6 @@ function c3897065.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
c:RegisterEffect(e1)
end
......@@ -93,7 +93,7 @@ function c39299733.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c39299733.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c39299733.eqlimit(e,c)
return c:IsRace(RACE_FAIRY) or e:GetHandler():GetEquipTarget()==c
......
......@@ -30,13 +30,13 @@ function c39823987.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetReasonCard()
if tc:IsRelateToBattle() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(tc:GetAttack()/2))
end
end
function c39823987.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetReasonCard()
if not tc:IsRelateToBattle() then return end
local atk=tc:GetAttack()/2
local atk=math.floor(tc:GetAttack()/2)
if atk<0 then atk=0 end
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
......
......@@ -23,5 +23,5 @@ function c40473581.dcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
end
function c40473581.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -80,6 +80,6 @@ function c40634253.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=g:Select(tp,1,1,nil)
end
Duel.Damage(1-tp,math.ceil(g:GetFirst():GetBaseAttack()/2),REASON_EFFECT)
Duel.Damage(1-tp,math.floor(g:GetFirst():GetBaseAttack()/2),REASON_EFFECT)
end
end
......@@ -89,6 +89,6 @@ function c41546.desop(e,tp,eg,ep,ev,re,r,rp)
end
function c41546.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return math.ceil(dam/2)
return math.floor(dam/2)
else return dam end
end
......@@ -32,7 +32,7 @@ end
function c42421606.efop(e,tp,eg,ep,ev,re,r,rp)
local dc=Duel.TossDice(tp,1)
if dc==1 then
Duel.SetLP(tp,Duel.GetLP(tp)/2)
Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
elseif dc==2 then
Duel.Draw(tp,1,REASON_EFFECT)
elseif dc==3 then
......
......@@ -52,7 +52,7 @@ end
function c4266839.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ec=e:GetHandler():GetEquipTarget()
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ec:GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,math.ceil(ec:GetAttack()/2))
end
function c4266839.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -60,6 +60,6 @@ function c4266839.reop(e,tp,eg,ep,ev,re,r,rp)
local ec=c:GetEquipTarget()
if ec then
local atk=ec:GetAttack()
Duel.Recover(tp,atk/2,REASON_EFFECT)
Duel.Recover(tp,math.ceil(atk/2),REASON_EFFECT)
end
end
......@@ -49,7 +49,7 @@ function c4290468.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
end
function c4290468.dacon(e,tp,eg,ep,ev,re,r,rp)
......@@ -70,7 +70,7 @@ function c4290468.daop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c:GetAttack()/2)
e1:SetValue(math.ceil(c:GetAttack()/2))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -36,13 +36,13 @@ function c43530283.atkval(e,c)
if c:GetFlagEffect(43530283)==0 then
return c:GetBaseAttack()*2
else
return c:GetBaseAttack()/2
return math.ceil(c:GetBaseAttack()/2)
end
end
function c43530283.defval(e,c)
if c:GetFlagEffect(43530283)==0 then
return c:GetBaseDefense()*2
else
return c:GetBaseDefense()/2
return math.ceil(c:GetBaseDefense()/2)
end
end
......@@ -25,7 +25,7 @@ function c4446672.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Damage(1-tp,tc:GetBaseAttack()/2,REASON_EFFECT)
Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/2),REASON_EFFECT)
end
end
end
......@@ -54,7 +54,7 @@ function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c44505297.eqlimit)
tc:RegisterEffect(e1)
local atk=tc:GetTextAttack()/2
local atk=math.ceil(tc:GetTextAttack()/2)
if atk<0 then atk=0 end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
......@@ -62,7 +62,7 @@ function c44505297.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
tc:RegisterEffect(e2)
local def=tc:GetTextDefense()/2
local def=math.ceil(tc:GetTextDefense()/2)
if def<0 then def=0 end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
......
......@@ -29,7 +29,7 @@ function c45313993.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
......
......@@ -72,7 +72,7 @@ function c4545683.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c4545683.val(e,c)
return Duel.GetLP(c:GetControler())/2
return math.ceil(Duel.GetLP(c:GetControler())/2)
end
function c4545683.eqfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsAbleToChangeControler()
......
......@@ -41,7 +41,7 @@ function c46195773.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(d:GetAttack()/2)
e1:SetValue(math.ceil(d:GetAttack()/2))
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
d:RegisterEffect(e1)
end
......
......@@ -63,7 +63,7 @@ function c46895036.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
end
end
......
......@@ -46,5 +46,5 @@ function c47737087.atkcon(e)
return c:IsDefensePos() and c==Duel.GetAttacker() and Duel.GetAttackTarget()==nil and c:GetEffectCount(EFFECT_DIRECT_ATTACK)==1
end
function c47737087.atkval(e,c)
return c:GetAttack()/2
return math.ceil(c:GetAttack()/2)
end
......@@ -52,7 +52,7 @@ function c4820694.lpop(e,tp,eg,ep,ev,re,r,rp)
local og2=tc2:GetOverlayGroup()
og1:Merge(og2)
if Duel.SendtoGrave(og1,REASON_EFFECT)<og1:GetCount() then return end
Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end
end
function c4820694.tgfilter(c)
......
......@@ -29,7 +29,7 @@ function c49202331.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetHandler():GetBattleTarget()
Duel.SetTargetCard(bc)
local dam=bc:GetAttack()/2
local dam=math.floor(bc:GetAttack()/2)
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......@@ -39,7 +39,7 @@ function c49202331.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=tc:GetAttack()/2
local dam=math.floor(tc:GetAttack()/2)
if dam<0 then dam=0 end
Duel.Damage(p,dam,REASON_EFFECT)
end
......
......@@ -64,6 +64,6 @@ function c49456901.operation(e,tp,eg,ep,ev,re,r,rp)
and Duel.SelectYesNo(tp,aux.Stringid(49456901,2)) then
local g=Duel.GetFieldGroup(1-tp,LOCATION_HAND,0):RandomSelect(1-tp,1)
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)/2)
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end
end
......@@ -46,7 +46,7 @@ function c49678559.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
......@@ -80,6 +80,6 @@ function c49678559.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c49678559.damval(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return dam/2
return math.floor(dam/2)
else return dam end
end
......@@ -48,7 +48,7 @@ function c50065971.dirop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(c:GetBaseDefense()/2)
e1:SetValue(math.ceil(c:GetBaseDefense()/2))
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
......
......@@ -62,7 +62,7 @@ function c51402177.damcon(e,tp,eg,ep,ev,re,r,rp)
end
function c51402177.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetHandler():GetBattleTarget():GetBaseDefense()/2
local dam=math.floor(e:GetHandler():GetBattleTarget():GetBaseDefense()/2)
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -62,5 +62,5 @@ function c52977572.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c52977572.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -19,7 +19,7 @@ function c53025096.damcon(e,tp,eg,ep,ev,re,r,rp)
end
function c53025096.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetHandler():GetBattleTarget():GetAttack()/2
local dam=math.floor(e:GetHandler():GetBattleTarget():GetAttack()/2)
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -38,7 +38,7 @@ function c53701457.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c53701457.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c53701457.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
......
......@@ -42,7 +42,7 @@ function c53950487.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
end
end
......
......@@ -42,7 +42,7 @@ end
function c53956001.daop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=math.floor(tc:GetAttack()/2)
local atk=math.ceil(tc:GetAttack()/2)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
......
......@@ -24,7 +24,7 @@ function c53981499.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local dam=bc:GetAttack()/2
local dam=math.floor(bc:GetAttack()/2)
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -56,7 +56,7 @@ function c54569495.spop(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c54569495.damop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,math.ceil(ev/2))
Duel.ChangeBattleDamage(tp,math.floor(ev/2))
end
function c54569495.damcon1(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
......
......@@ -28,7 +28,7 @@ function c55713623.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetBaseAttack()/2)
e1:SetValue(math.ceil(tc:GetBaseAttack()/2))
tc:RegisterEffect(e1)
end
end
......@@ -29,7 +29,7 @@ function c55727845.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local atk=tc:GetAttack()/2
local atk=math.ceil(tc:GetAttack()/2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -31,7 +31,7 @@ function c56339050.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc==tc end
if chk==0 then return tc:IsOnField() and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
local dam=tc:GetAttack()/2
local dam=math.floor(tc:GetAttack()/2)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
......@@ -39,7 +39,7 @@ end
function c56339050.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackable() then
local atk=tc:GetAttack()/2
local atk=math.floor(tc:GetAttack()/2)
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
......
......@@ -66,7 +66,7 @@ function c56535497.operation(e,tp,eg,ep,ev,re,r,rp)
local tc2=g:GetFirst()
if tc1==tc2 then tc2=g:GetNext() end
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2:IsFaceup() and tc2:IsRelateToEffect(e) then
local atk=tc1:GetAttack()/2
local atk=math.ceil(tc1:GetAttack()/2)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
......@@ -48,5 +48,5 @@ function c56574543.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c56574543.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -34,7 +34,7 @@ function c59042331.atkop(e,tp,eg,ep,ev,re,r,rp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(tc:GetAttack()/2)
e2:SetValue(math.ceil(tc:GetAttack()/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
......
......@@ -36,7 +36,7 @@ function c59642500.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c59642500.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c59642500.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -44,7 +44,7 @@ function c60312997.operation(e,tp,eg,ep,ev,re,r,rp)
end
function c60312997.damval(e,re,val,r,rp,rc)
if r==REASON_BATTLE then
return val/2
return math.floor(val/2)
else return val end
end
function c60312997.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -82,7 +82,7 @@ function c60953118.rdcon2(e)
end
function c60953118.rdval(e,re,val,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return val/2
return math.floor(val/2)
else
return val
end
......
......@@ -38,13 +38,13 @@ function c61420130.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(tc:GetDefense()/2)
e2:SetValue(math.ceil(tc:GetDefense()/2))
tc:RegisterEffect(e2)
end
end
......
......@@ -23,14 +23,14 @@ function c6142213.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c6142213.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=Duel.GetAttackTarget():GetAttack()/2
local dam=math.floor(Duel.GetAttackTarget():GetAttack()/2)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,dam)
end
function c6142213.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,Duel.GetAttackTarget():GetAttack()/2,REASON_EFFECT)
Duel.Damage(p,math.floor(Duel.GetAttackTarget():GetAttack()/2),REASON_EFFECT)
end
function c6142213.indcon(e)
return e:GetHandler()==Duel.GetAttacker()
......
......@@ -38,7 +38,7 @@ function c62070231.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()/2)
e1:SetValue(math.ceil(tc:GetAttack()/2))
if Duel.GetTurnPlayer()~=tp then
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
else
......
......@@ -39,5 +39,5 @@ function c62325062.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c62325062.atkval(e,c)
return c:GetBaseAttack()/2
return math.ceil(c:GetBaseAttack()/2)
end
......@@ -34,7 +34,7 @@ end
function c62742651.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetHandler():GetBattleTarget()
local dam=bc:GetAttack()/2
local dam=math.floor(bc:GetAttack()/2)
if dam<0 then dam=0 end
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,dam)
......
......@@ -44,7 +44,7 @@ function c63364266.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
......
......@@ -36,5 +36,5 @@ function c63630268.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c63630268.damval(e,re,val,r,rp,rc)
return val/2
return math.floor(val/2)
end
......@@ -12,5 +12,5 @@ function c64145892.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c64145892.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -19,7 +19,7 @@ function c64238008.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.GetCustomActivityCount(64238008,tp,ACTIVITY_CHAIN)==0 and Duel.CheckReleaseGroup(tp,nil,1,nil) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
local atk=g:GetFirst():GetTextAttack()/2
local atk=math.floor(g:GetFirst():GetTextAttack()/2)
if atk<0 then atk=0 end
e:SetLabel(atk)
Duel.Release(g,REASON_COST)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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