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)
......
......@@ -42,12 +42,12 @@ function c65472618.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(bc:GetAttack()/2)
e1:SetValue(math.ceil(bc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
bc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(bc:GetDefense()/2)
e2:SetValue(math.ceil(bc:GetDefense()/2))
bc:RegisterEffect(e2)
end
end
......
......@@ -28,12 +28,12 @@ function c66818682.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=Duel.GetAttacker()
tc:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,tc:GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,math.ceil(tc:GetAttack()/2))
end
function c66818682.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Recover(tp,tc:GetAttack()/2,REASON_EFFECT)
Duel.Recover(tp,math.ceil(tc:GetAttack()/2),REASON_EFFECT)
end
end
function c66818682.spcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -82,7 +82,7 @@ function c67508932.rmop(e,tp,eg,ep,ev,re,r,rp)
end
function c67508932.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
function c67508932.spfilter(c,e,tp)
......
......@@ -24,7 +24,7 @@ function c67951831.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_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
......
......@@ -27,7 +27,7 @@ function c67959180.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
if opt==coin then
e1:SetValue(c:GetAttack()/2)
e1:SetValue(math.ceil(c:GetAttack()/2))
else
e1:SetValue(c:GetAttack()*2)
end
......
......@@ -29,7 +29,7 @@ function c6799227.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk/2)
e1:SetValue(math.ceil(atk/2))
tc:RegisterEffect(e1)
end
end
......@@ -94,5 +94,5 @@ function c68540058.atkcon(e)
and Duel.GetAttacker()==e:GetHandler():GetEquipTarget() and Duel.GetAttackTarget()
end
function c68540058.atkval(e,c)
return Duel.GetAttackTarget():GetAttack()/2
return math.ceil(Duel.GetAttackTarget():GetAttack()/2)
end
......@@ -74,5 +74,5 @@ function c69073023.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function c69073023.damval(e,re,val,r,rp,rc)
return val/2
return math.floor(val/2)
end
......@@ -57,7 +57,7 @@ function c69931927.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c69931927.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=e:GetHandler():GetDefense()/2
local dam=math.floor(e:GetHandler():GetDefense()/2)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
......
......@@ -37,7 +37,7 @@ function c71625222.desop(e,tp,eg,ep,ev,re,r,rp)
sum=sum+math.max(c:GetAttack(),0)
end
if sum>0 then
Duel.Damage(tp,sum/2,REASON_EFFECT)
Duel.Damage(tp,math.floor(sum/2),REASON_EFFECT)
end
end
end
......@@ -58,5 +58,5 @@ function c72083436.rdcon(e,tp,eg,ep,ev,re,r,rp)
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and c:GetFlagEffect(72083436)>0
end
function c72083436.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -87,12 +87,12 @@ function c72283691.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetAttacker()
Duel.SetTargetCard(tc)
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
function c72283691.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
local atk=math.ceil(tc:GetAttack()/2)
local atk=math.floor(tc:GetAttack()/2)
if tc:IsRelateToEffect(e) and not tc:IsStatus(STATUS_ATTACK_CANCELED) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
......
......@@ -38,7 +38,7 @@ function c72896720.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local atk=0
if d:IsFaceup() then atk=d:GetAttack() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(atk/2))
end
function c72896720.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -46,6 +46,6 @@ function c72896720.desop(e,tp,eg,ep,ev,re,r,rp)
local atk=0
if tc:IsFaceup() then atk=tc:GetAttack() end
if Duel.Destroy(tc,REASON_EFFECT)==0 then return end
Duel.Damage(1-tp,atk/2,REASON_EFFECT)
Duel.Damage(1-tp,math.floor(atk/2),REASON_EFFECT)
end
end
......@@ -43,7 +43,7 @@ function c72926163.valcheck(e,c)
local tc=g:GetFirst()
if tc:IsCode(89943723) or tc:CheckFusionSubstitute(c) then tc=g:GetNext() end
if not tc:IsCode(89943723) then
atk=tc:GetTextAttack()/2
atk=math.ceil(tc:GetTextAttack()/2)
end
e:SetLabel(atk)
end
......
......@@ -29,7 +29,7 @@ function c73048641.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))
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -53,7 +53,7 @@ function c74003290.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.AdjustInstantly(tc)
local e3=e1:Clone()
e3:SetCode(EFFECT_SET_BASE_ATTACK)
e3:SetValue(tc:GetBaseAttack()/2)
e3:SetValue(math.ceil(tc:GetBaseAttack()/2))
tc:RegisterEffect(e3)
end
end
......
......@@ -75,7 +75,7 @@ function c74069667.spop1(e,tp,eg,ep,ev,re,r,rp)
end
function c74069667.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 c74069667.spfilter2(c,e,tp)
......
......@@ -34,7 +34,7 @@ function c75249652.activate(e,tp,eg,ep,ev,re,r,rp)
if tatk>0 then atk=atk+tatk end
tc=dg:GetNext()
end
local dam=Duel.Damage(tp,atk/2,REASON_EFFECT)
local dam=Duel.Damage(tp,math.floor(atk/2),REASON_EFFECT)
if Duel.GetLP(tp)>0 and dam>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,dam,REASON_EFFECT)
......
......@@ -52,6 +52,6 @@ function c75253697.desop(e,tp,eg,ep,ev,re,r,rp)
end
function c75253697.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
......@@ -38,7 +38,7 @@ function c75672051.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(math.floor(tc:GetAttack()/2))
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
Duel.BreakEffect()
......
......@@ -17,14 +17,14 @@ end
function c75902998.target(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttacker()
if chk==0 then return at:IsRelateToBattle() end
local dam=math.max(at:GetBaseAttack()/2,0)
local dam=math.max(math.floor(at:GetBaseAttack()/2),0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,at,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c75902998.activate(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
if at:IsRelateToBattle() and Duel.Destroy(at,REASON_EFFECT)~=0 then
local atk=at:GetBaseAttack()/2
local atk=math.floor(at:GetBaseAttack()/2)
if atk>0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
......
......@@ -35,7 +35,7 @@ end
function c76004142.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetAttack()/2
local atk=math.floor(tc:GetAttack()/2)
local val=Duel.Damage(tp,atk,REASON_EFFECT)
if val>0 and Duel.GetLP(tp)>0 then
Duel.BreakEffect()
......
......@@ -13,8 +13,8 @@ function c7700132.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if Duel.GetCurrentPhase()==PHASE_DAMAGE and e:GetHandler()==Duel.GetAttackTarget() then
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(Duel.GetAttacker():GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,Duel.GetAttacker():GetAttack()/2)
Duel.SetTargetParam(math.floor(Duel.GetAttacker():GetAttack()/2))
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(Duel.GetAttacker():GetAttack()/2))
end
end
function c7700132.damop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -79,5 +79,5 @@ function c77625948.atkcon(e)
and e:GetHandler():GetEffectCount(EFFECT_DIRECT_ATTACK)==1
end
function c77625948.atkval(e,c)
return c:GetAttack()/2
return math.ceil(c:GetAttack()/2)
end
......@@ -31,7 +31,7 @@ function c7845138.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(Duel.GetLP(1-tp)/2)
e1:SetValue(math.ceil(Duel.GetLP(1-tp)/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
......
......@@ -57,7 +57,7 @@ function c79068663.damop(e,tp,eg,ep,ev,re,r,rp)
local des=eg:GetFirst()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if des:IsRelateToEffect(e) then
local dam=des:GetAttack()/2
local dam=math.floor(des:GetAttack()/2)
if dam<0 then dam=0 end
Duel.Damage(p,dam,REASON_EFFECT)
end
......
......@@ -22,7 +22,7 @@ function c81332143.activate(e,tp,eg,ep,ev,re,r,rp)
opt=Duel.SelectOption(1-tp,aux.Stringid(81332143,0))
end
if opt==0 then
local lp=(Duel.GetLP(tp)+Duel.GetLP(1-tp))/2
local lp=math.ceil((Duel.GetLP(tp)+Duel.GetLP(1-tp))/2)
Duel.SetLP(tp,lp)
Duel.SetLP(1-tp,lp)
end
......
......@@ -82,12 +82,12 @@ function c81927732.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,g:GetFirst():GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(g:GetFirst():GetAttack()/2))
end
function c81927732.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local dam=tc:GetAttack()/2
local dam=math.floor(tc:GetAttack()/2)
if dam<0 or tc:IsFacedown() then dam=0 end
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,dam,REASON_EFFECT)
......
......@@ -45,7 +45,7 @@ function c82458280.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)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......
......@@ -62,7 +62,7 @@ function c83866861.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()
......
......@@ -89,7 +89,7 @@ function c83965310.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()/2
local atk=math.ceil(tc:GetTextAttack()/2)
if tc:IsFacedown() then atk=0 end
if atk<0 then atk=0 end
if not Duel.Equip(tp,tc,c,false) then return end
......
......@@ -50,7 +50,7 @@ function c85008676.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function c85008676.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 c85008676.damcon2(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and aux.damcon1(e,tp,eg,ep,ev,re,r,rp)
......@@ -71,7 +71,7 @@ function c85008676.damval2(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel() and math.ceil(val/2) or val
return cid==e:GetLabel() and math.floor(val/2) or val
end
function c85008676.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
......
......@@ -38,7 +38,7 @@ function c85121942.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:GetTextAttack()/2
local dam=math.floor(bc:GetTextAttack()/2)
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
......
......@@ -22,12 +22,12 @@ function c85636437.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c85636437.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c85636437.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.ceil(g:GetFirst():GetBaseAttack()/2))
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(g:GetFirst():GetBaseAttack()/2))
end
function c85636437.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,math.ceil(tc:GetBaseAttack()/2),REASON_EFFECT)
Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/2),REASON_EFFECT)
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
......
......@@ -25,7 +25,7 @@ function c86915847.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
......@@ -51,7 +51,7 @@ function c8763963.dcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
end
function c8763963.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c8763963.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -33,7 +33,7 @@ function c89448140.condition(e)
return Duel.IsExistingMatchingCard(c89448140.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c89448140.val(e,re,dam,r,rp,rc)
return math.ceil(dam/2)
return math.floor(dam/2)
end
function c89448140.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
......
......@@ -24,12 +24,12 @@ function c89662736.nacost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c89662736.natg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttacker():IsOnField() end
local dam=Duel.GetAttacker():GetAttack()/2
local dam=math.floor(Duel.GetAttacker():GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c89662736.naop(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
if Duel.NegateAttack() then
Duel.Damage(1-tp,a:GetAttack()/2,REASON_EFFECT)
Duel.Damage(1-tp,math.floor(a:GetAttack()/2),REASON_EFFECT)
end
end
......@@ -66,7 +66,7 @@ function c89743495.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
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))
tc:RegisterEffect(e1)
end
end
......@@ -43,7 +43,7 @@ function c89870349.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)
tc:RegisterEffect(e1)
end
......
......@@ -39,7 +39,7 @@ function c90020065.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c90020065.desop(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local dam=g:GetSum(Card.GetAttack)/2
local dam=math.floor(g:GetSum(Card.GetAttack)/2)
Duel.Destroy(g,REASON_EFFECT)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
......@@ -55,7 +55,7 @@ function c9161357.eqop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c9161357.eqlimit)
tc:RegisterEffect(e1)
local atk=tc:GetBaseAttack()/2
local atk=math.ceil(tc:GetBaseAttack()/2)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
......@@ -86,5 +86,5 @@ function c9161357.lpcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp)
end
function c9161357.lpop(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
......@@ -50,7 +50,7 @@ function c92246806.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 c92246806.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
function c92246806.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -69,7 +69,7 @@ function c92362073.atkop(e,tp,eg,ep,ev,re,r,rp)
end
function c92362073.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 c92362073.tpcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,7 +25,7 @@ function c94156050.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))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
......
......@@ -33,12 +33,12 @@ function c94538053.atkop(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(c:GetBaseAttack()/2)
e1:SetValue(math.ceil(c:GetBaseAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(c:GetBaseDefense()/2)
e2:SetValue(math.ceil(c:GetBaseDefense()/2))
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_LEVEL)
......
......@@ -35,7 +35,7 @@ function c95026693.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c95026693.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local dam=g:GetFirst():GetAttack()/2
local dam=math.floor(g:GetFirst():GetAttack()/2)
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
......@@ -93,7 +93,7 @@ function c95090813.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetProperty(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)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
......
......@@ -45,6 +45,6 @@ function c95448692.activate2(e,tp,eg,ep,ev,re,r,rp)
end
function c95448692.val(e,re,dam,r,rp,rc)
if c95448692[e:GetOwnerPlayer()]==1 or bit.band(r,REASON_EFFECT)~=0 then
return dam/2
return math.floor(dam/2)
else return dam end
end
......@@ -28,12 +28,12 @@ function c95463814.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c95463814.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c95463814.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.ceil(g:GetFirst():GetBaseAttack()/2))
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,math.floor(g:GetFirst():GetBaseAttack()/2))
end
function c95463814.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Damage(1-tp,math.ceil(tc:GetBaseAttack()/2),REASON_EFFECT)
Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/2),REASON_EFFECT)
end
end
function c95463814.cfilter(c,tp)
......
......@@ -54,7 +54,7 @@ function c95685352.atkop1(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
......
......@@ -16,7 +16,7 @@ end
function c95727991.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
e:SetLabel(sg:GetFirst():GetAttack()/2)
e:SetLabel(math.floor(sg:GetFirst():GetAttack()/2))
Duel.Release(sg,REASON_COST)
end
function c95727991.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -52,5 +52,5 @@ function c9603356.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler()==Duel.GetAttacker()
end
function c9603356.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 c97342942.operation(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local rg=Duel.SelectReleaseGroup(tp,c97342942.rfilter,1,1,e:GetHandler(),e)
if Duel.Release(rg,REASON_EFFECT)>0 then
local atk=rg:GetFirst():GetBaseAttack()/2
local atk=math.floor(rg:GetFirst():GetBaseAttack()/2)
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
......@@ -38,5 +38,5 @@ function c981540.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep==e:GetOwnerPlayer()
end
function c981540.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -38,5 +38,5 @@ function c98637386.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c98637386.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
Duel.ChangeBattleDamage(ep,math.floor(ev/2))
end
......@@ -41,12 +41,12 @@ function c99427357.rectg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c99427357.recfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c99427357.recfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,math.ceil(g:GetFirst():GetAttack()/2))
end
function c99427357.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
Duel.Recover(tp,tc:GetAttack()/2,REASON_EFFECT)
Duel.Recover(tp,math.ceil(tc:GetAttack()/2),REASON_EFFECT)
end
end
function c99427357.negcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -36,6 +36,6 @@ function c99795159.dirtg(e,c)
end
function c99795159.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 or (rc and not rc:IsSetCard(0x8d)) then
return dam/2
return math.floor(dam/2)
else return dam 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