Skip to content

Commit

Permalink
Fix UnitViewDetail beam damage calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
lL1l1 committed Apr 25, 2024
1 parent f404996 commit 9df3301
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/ui/game/unitviewDetail.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9df3301

Please sign in to comment.