Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetPlayerMoraleLevel

From RoR Wiki
Revision as of 19:44, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Ability functions
Version: WAR 1.4.8

Returns the player's current morale level.

moraleLevel = GetPlayerMoraleLevel()

Arguments

None.

Returns

moraleLevel
number – The player's current morale level. The stock morale bar compares it with the level of each morale slot (1 to GameData.NUM_MORALE_LEVELS).

Details

  • If there is no player object, or the Lua state is not available, the function returns nothing.
  • The stock morale bar mostly uses the values passed with the PLAYER_MORALE_UPDATED event; it calls this function when an ability has just been placed in a slot.

Errors

None.

Example

From ea_moralewindow/source/moralewindow.lua:

if (abilityWasJustSlotted == true)
then
    buttonFrame:UpdateActiveState (0, GetPlayerMoraleLevel ())
end

See also