benilla-re systems structs docs

DisplayedLevel

function · ui · primitive

Address
0x7cbce0 · 111 bytes, up to 0x7cbd4e
Meaning
Returns a unit's level less the drunk reduction when the player can attack it, at least 1 for a positive level
Confidence
verified, proof one
Finding
ui/unitlevels#the-level-on-a-plate
Test
ui::glue_7cbce0_percent_round

Finding: The level on a plate in ui: unit levels and the gray range

0x7cbce0(player, unit) is the plate's copy of the same reduction: it returns the unit's level, less trunc(min(drunk, 100) * 0.05 + 0.5) when the level is above 0, the player exists, its drunkenness is nonzero and it can attack the unit; never below 1. It has no -1 leg, so the plate shows the real level where the Lua function pushes -1.

The derivation is in the doc.

Callers 1

Callees 2

Calls and jumps by a bare address, from tables/calls.tsv.