Stat()

From OHRRPGCE-Wiki
Jump to navigation Jump to search
Obsolete.png
This article (or part thereof) is obsolete. It may have made sense in the past, but it does not make sense now. It is kept here only for historic curiosity and/or posterity.

stat() Is a memory buffer used internally in the OHRRPGCE for storing various data, mostly, but not entirely related to stats.

It is documented here for the purpose of facilitating its eventual removal. Update: stat() is dead! Long live gam.hero(i).stat.cur|max.*!

stat() is a multidimentional array. It is used in the format stat(hero,curmax,statnum) where hero is the hero part slot number, curmax is 0 for current stats and 1 for max stats, and statnum is an arbitrary number representing a particular stat (or other data)

stat() has 41 elements. 0-3 represent heroes in the active party, and 4-41 represent reserve heros.

Inside battle, data from stat() is used to populate the hero data in the bstat() array. At the end of battle, stat() is updated for any changes that occurred in the battle. Some of the non-stat data in stat() is used in battles via the exstat() array reference.

Element Meaning
stat(hero, 0, 0) current HP
stat(hero, 1, 0) max HP
stat(hero, 0, 1) current MP
stat(hero, 1, 1) max MP
stat(hero, 0, 2) current strength
stat(hero, 1, 2) max strength
stat(hero, 0, 3) current accuracy
stat(hero, 1, 3) max accuracy
stat(hero, 0, 4) current defense
stat(hero, 1, 4) max defense
stat(hero, 0, 5) current dodge
stat(hero, 1, 5) max dodge
stat(hero, 0, 6) current magic
stat(hero, 1, 6) max magic
stat(hero, 0, 7) current will
stat(hero, 1, 7) max will
stat(hero, 0, 8) current speed
stat(hero, 1, 8) max speed
stat(hero, 0, 9) current counter
stat(hero, 1, 9) max counter
stat(hero, 0, 10) current focus
stat(hero, 1, 10) max focus
stat(hero, 0, 11) current hits
stat(hero, 1, 11) max hits
stat(hero, 0, 12) Current level
stat(hero, 1, 12) Levels gained this battle
stat(hero, 0, 13) weapon picture
stat(hero, 1, 13) weapon palette
stat(hero, 0, 14) battle sprite
stat(hero, 1, 14) walkabout sprite
stat(hero, 0, 15) battle palette
stat(hero, 1, 15) walkabout palette
stat(hero, 0, 16) default weapon + 1
stat(hero, 1, 16) unused