mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-08-13 00:45:11 +09:00
Assert optional api results across the scenario modules
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,11 +26,12 @@ local function on_entity_damaged(event)
|
||||
|
||||
-- Outputs the message as floating text
|
||||
if message then
|
||||
local entity_position = entity.position --[[@as MapPosition.struct]]
|
||||
local entity_radius = max(1, entity.get_radius())
|
||||
local offset = (random() - 0.5) * entity_radius * config.damage_location_variance
|
||||
local position = { x = entity.position.x + offset, y = entity.position.y - entity_radius }
|
||||
local position = { x = entity_position.x + offset, y = entity_position.y - entity_radius }
|
||||
|
||||
local health_percentage = entity.get_health_ratio()
|
||||
local health_percentage = assert(entity.get_health_ratio())
|
||||
local color = { r = 1 - health_percentage, g = health_percentage, b = 0 }
|
||||
|
||||
FlyingText.create{
|
||||
|
||||
Reference in New Issue
Block a user