From ce68b4ab0fc67125ba0467c37fcbb453d5b0b896 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 28 Nov 2013 21:18:11 +0000 Subject: [PATCH] Lunatic: document a couple of player members, especially some 'bool' ones. Important because in Lua, a value of zero yields true in a boolean context. BUILD_LUNATIC. git-svn-id: https://svn.eduke32.com/eduke32@4184 1a8010ca-5511-0410-912e-c29ae57300e0 --- .../eduke32/source/lunatic/doc/lunatic.txt | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/lunatic/doc/lunatic.txt b/polymer/eduke32/source/lunatic/doc/lunatic.txt index 0be83931f..f096fba89 100644 --- a/polymer/eduke32/source/lunatic/doc/lunatic.txt +++ b/polymer/eduke32/source/lunatic/doc/lunatic.txt @@ -1125,7 +1125,13 @@ ps.ammo_amount.PISTOL = ps.ammo_amount[ps.curr_weapon] The inventory names are the same as the keys of <>, those for the weapons coincide with the keys of <>. -Each `player` element has the following members: +.Boolean members + +Player members marked _`bool`_ in the listing below yield Lua true or false on +reading and expect one of these values when assigned to. + + +===== `player` members <> `vel`:: The vector of the player's current velocity, accounted each time a player's @@ -1143,6 +1149,22 @@ most 8192. `curr_weapon`:: The index of the player's currently selected weapon. +_`i16`_ +ammo_amount[_weapon_]+:: + +The current ammo amount for each weapon. + +_`i16`_ +max_ammo_amount[_weapon_]+:: + +The maximum ammo amount for each weapon. Because `ammo_amount` amount and +`max_ammo_amount` are writable without restriction, it is the user's +responsibility to make sure that the former never exceeds the latter and that +both are non-negative at all times. Otherwise, erratic behavior may ensue. + +_`bool`_ `jetpack_on`, {nbsp} `scuba_on`, {nbsp} `heat_on`:: + +Whether the player currently has the jetpack, scuba gear, or night vision +goggles activated, respectively. + ===== `player` methods