From 9df33010b4adbbdbcdfe0bc59c19f8f87d1f5ddf Mon Sep 17 00:00:00 2001 From: lL1l1 <82986251+lL1l1@users.noreply.github.com> Date: Wed, 24 Apr 2024 22:11:42 -0700 Subject: [PATCH] Fix UnitViewDetail beam damage calculation --- lua/ui/game/unitviewDetail.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/ui/game/unitviewDetail.lua b/lua/ui/game/unitviewDetail.lua index b913de8317..d63a8dc77c 100644 --- a/lua/ui/game/unitviewDetail.lua +++ b/lua/ui/game/unitviewDetail.lua @@ -12,6 +12,8 @@ local armorDefinition = import("/lua/armordefinition.lua").armordefinition local controls = import("/lua/ui/controls.lua").Get() +local MathFloor = math.floor + View = controls.View or false MapView = controls.MapView or false ViewState = "full" @@ -44,7 +46,7 @@ function GetTechLevelString(bp) end function FormatTime(seconds) - return string.format("%02d:%02d", math.floor(seconds / 60), math.mod(seconds, 60)) + return string.format("%02d:%02d", MathFloor(seconds / 60), math.mod(seconds, 60)) end function GetAbilityList(bp) @@ -565,7 +567,7 @@ function WrapAndPlaceText(bp, builder, descID, control) Damage = math.max(Damage, info.DamageToShields) end if info.BeamLifetime > 0 then - Damage = Damage * (MATH_IRound(10 * info.BeamLifetime) + 1) + Damage = Damage * (1 + MathFloor(MATH_IRound(info.BeamLifetime)/(info.BeamCollisionDelay+0.1))) else Damage = Damage * (info.DoTPulses or 1) + (info.InitialDamage or 0) local ProjectilePhysics = __blueprints[info.ProjectileId].Physics