global.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. /* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
  2. //
  3. // Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
  4. // Copyright (c) 2011-2017, SDLPAL development team.
  5. // All rights reserved.
  6. //
  7. // This file is part of SDLPAL.
  8. //
  9. // SDLPAL is free software: you can redistribute it and/or modify
  10. // it under the terms of the GNU General Public License as published by
  11. // the Free Software Foundation, either version 3 of the License, or
  12. // (at your option) any later version.
  13. //
  14. // This program is distributed in the hope that it will be useful,
  15. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. // GNU General Public License for more details.
  18. //
  19. // You should have received a copy of the GNU General Public License
  20. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. //
  22. #ifndef GLOBAL_H
  23. #define GLOBAL_H
  24. #include "common.h"
  25. #include "palcommon.h"
  26. #include "map.h"
  27. #include "ui.h"
  28. //
  29. // SOME NOTES ON "AUTO SCRIPT" AND "TRIGGER SCRIPT":
  30. //
  31. // Auto scripts are executed automatically in each frame.
  32. //
  33. // Trigger scripts are only executed when the event is triggered (player touched
  34. // an event object, player triggered an event script by pressing Spacebar).
  35. //
  36. // status of characters
  37. typedef enum tagSTATUS
  38. {
  39. kStatusConfused = 0, // attack friends randomly
  40. #ifdef PAL_CLASSIC
  41. kStatusParalyzed, // paralyzed
  42. #else
  43. kStatusSlow, // slower
  44. #endif
  45. kStatusSleep, // not allowed to move
  46. kStatusSilence, // cannot use magic
  47. kStatusPuppet, // for dead players only, continue attacking
  48. kStatusBravery, // more power for physical attacks
  49. kStatusProtect, // more defense value
  50. kStatusHaste, // faster
  51. kStatusDualAttack, // dual attack
  52. kStatusAll
  53. } STATUS;
  54. #ifndef PAL_CLASSIC
  55. #define kStatusParalyzed kStatusSleep
  56. #endif
  57. // body parts of equipments
  58. typedef enum tagBODYPART
  59. {
  60. kBodyPartHead = 0,
  61. kBodyPartBody,
  62. kBodyPartShoulder,
  63. kBodyPartHand,
  64. kBodyPartFeet,
  65. kBodyPartWear,
  66. kBodyPartExtra,
  67. } BODYPART;
  68. // state of event object, used by the sState field of the EVENTOBJECT struct
  69. typedef enum tagOBJECTSTATE
  70. {
  71. kObjStateHidden = 0,
  72. kObjStateNormal = 1,
  73. kObjStateBlocker = 2
  74. } OBJECTSTATE, *LPOBJECTSTATE;
  75. typedef enum tagTRIGGERMODE
  76. {
  77. kTriggerNone = 0,
  78. kTriggerSearchNear = 1,
  79. kTriggerSearchNormal = 2,
  80. kTriggerSearchFar = 3,
  81. kTriggerTouchNear = 4,
  82. kTriggerTouchNormal = 5,
  83. kTriggerTouchFar = 6,
  84. kTriggerTouchFarther = 7,
  85. kTriggerTouchFarthest = 8
  86. } TRIGGERMODE;
  87. typedef struct tagEVENTOBJECT
  88. {
  89. SHORT sVanishTime; // vanish time (?)
  90. WORD x; // X coordinate on the map
  91. WORD y; // Y coordinate on the map
  92. SHORT sLayer; // layer value
  93. WORD wTriggerScript; // Trigger script entry
  94. WORD wAutoScript; // Auto script entry
  95. SHORT sState; // state of this object
  96. WORD wTriggerMode; // trigger mode
  97. WORD wSpriteNum; // number of the sprite
  98. USHORT nSpriteFrames; // total number of frames of the sprite
  99. WORD wDirection; // direction
  100. WORD wCurrentFrameNum; // current frame number
  101. USHORT nScriptIdleFrame; // count of idle frames, used by trigger script
  102. WORD wSpritePtrOffset; // FIXME: ???
  103. USHORT nSpriteFramesAuto; // total number of frames of the sprite, used by auto script
  104. WORD wScriptIdleFrameCountAuto; // count of idle frames, used by auto script
  105. } EVENTOBJECT, *LPEVENTOBJECT;
  106. typedef struct tagSCENE
  107. {
  108. WORD wMapNum; // number of the map
  109. WORD wScriptOnEnter; // when entering this scene, execute script from here
  110. WORD wScriptOnTeleport; // when teleporting out of this scene, execute script from here
  111. WORD wEventObjectIndex; // event objects in this scene begins from number wEventObjectIndex + 1
  112. } SCENE, *LPSCENE;
  113. // object including system strings, players, items, magics, enemies and poison scripts.
  114. // system strings and players
  115. typedef struct tagOBJECT_PLAYER
  116. {
  117. WORD wReserved[2]; // always zero
  118. WORD wScriptOnFriendDeath; // when friends in party dies, execute script from here
  119. WORD wScriptOnDying; // when dying, execute script from here
  120. } OBJECT_PLAYER;
  121. typedef enum tagITEMFLAG
  122. {
  123. kItemFlagUsable = (1 << 0),
  124. kItemFlagEquipable = (1 << 1),
  125. kItemFlagThrowable = (1 << 2),
  126. kItemFlagConsuming = (1 << 3),
  127. kItemFlagApplyToAll = (1 << 4),
  128. kItemFlagSellable = (1 << 5),
  129. kItemFlagEquipableByPlayerRole_First = (1 << 6)
  130. } ITEMFLAG;
  131. // items
  132. typedef struct tagOBJECT_ITEM_DOS
  133. {
  134. WORD wBitmap; // bitmap number in BALL.MKF
  135. WORD wPrice; // price
  136. WORD wScriptOnUse; // script executed when using this item
  137. WORD wScriptOnEquip; // script executed when equipping this item
  138. WORD wScriptOnThrow; // script executed when throwing this item to enemy
  139. WORD wFlags; // flags
  140. } OBJECT_ITEM_DOS;
  141. // items
  142. typedef struct tagOBJECT_ITEM
  143. {
  144. WORD wBitmap; // bitmap number in BALL.MKF
  145. WORD wPrice; // price
  146. WORD wScriptOnUse; // script executed when using this item
  147. WORD wScriptOnEquip; // script executed when equipping this item
  148. WORD wScriptOnThrow; // script executed when throwing this item to enemy
  149. WORD wScriptDesc; // description script
  150. WORD wFlags; // flags
  151. } OBJECT_ITEM;
  152. typedef enum tagMAGICFLAG
  153. {
  154. kMagicFlagUsableOutsideBattle = (1 << 0),
  155. kMagicFlagUsableInBattle = (1 << 1),
  156. kMagicFlagUsableToEnemy = (1 << 3),
  157. kMagicFlagApplyToAll = (1 << 4),
  158. } MAGICFLAG;
  159. // magics
  160. typedef struct tagOBJECT_MAGIC_DOS
  161. {
  162. WORD wMagicNumber; // magic number, according to DATA.MKF #3
  163. WORD wReserved1; // always zero
  164. WORD wScriptOnSuccess; // when magic succeed, execute script from here
  165. WORD wScriptOnUse; // when use this magic, execute script from here
  166. WORD wReserved2; // always zero
  167. WORD wFlags; // flags
  168. } OBJECT_MAGIC_DOS;
  169. // magics
  170. typedef struct tagOBJECT_MAGIC
  171. {
  172. WORD wMagicNumber; // magic number, according to DATA.MKF #3
  173. WORD wReserved1; // always zero
  174. WORD wScriptOnSuccess; // when magic succeed, execute script from here
  175. WORD wScriptOnUse; // when use this magic, execute script from here
  176. WORD wScriptDesc; // description script
  177. WORD wReserved2; // always zero
  178. WORD wFlags; // flags
  179. } OBJECT_MAGIC;
  180. // enemies
  181. typedef struct tagOBJECT_ENEMY
  182. {
  183. WORD wEnemyID; // ID of the enemy, according to DATA.MKF #1.
  184. // Also indicates the bitmap number in ABC.MKF.
  185. WORD wResistanceToSorcery; // resistance to sorcery and poison (0 min, 10 max)
  186. WORD wScriptOnTurnStart; // script executed when turn starts
  187. WORD wScriptOnBattleEnd; // script executed when battle ends
  188. WORD wScriptOnReady; // script executed when the enemy is ready
  189. } OBJECT_ENEMY;
  190. // poisons (scripts executed in each round)
  191. typedef struct tagOBJECT_POISON
  192. {
  193. WORD wPoisonLevel; // level of the poison
  194. WORD wColor; // color of avatars
  195. WORD wPlayerScript; // script executed when player has this poison (per round)
  196. WORD wReserved; // always zero
  197. WORD wEnemyScript; // script executed when enemy has this poison (per round)
  198. } OBJECT_POISON;
  199. typedef union tagOBJECT_DOS
  200. {
  201. WORD rgwData[6];
  202. OBJECT_PLAYER player;
  203. OBJECT_ITEM_DOS item;
  204. OBJECT_MAGIC_DOS magic;
  205. OBJECT_ENEMY enemy;
  206. OBJECT_POISON poison;
  207. } OBJECT_DOS, *LPOBJECT_DOS;
  208. typedef union tagOBJECT
  209. {
  210. WORD rgwData[7];
  211. OBJECT_PLAYER player;
  212. OBJECT_ITEM item;
  213. OBJECT_MAGIC magic;
  214. OBJECT_ENEMY enemy;
  215. OBJECT_POISON poison;
  216. } OBJECT, *LPOBJECT;
  217. typedef struct tagSCRIPTENTRY
  218. {
  219. WORD wOperation; // operation code
  220. WORD rgwOperand[3]; // operands
  221. } SCRIPTENTRY, *LPSCRIPTENTRY;
  222. typedef struct tagINVENTORY
  223. {
  224. WORD wItem; // item object code
  225. USHORT nAmount; // amount of this item
  226. USHORT nAmountInUse; // in-use amount of this item
  227. } INVENTORY, *LPINVENTORY;
  228. typedef struct tagSTORE
  229. {
  230. WORD rgwItems[MAX_STORE_ITEM];
  231. } STORE, *LPSTORE;
  232. typedef struct tagENEMY
  233. {
  234. WORD wIdleFrames; // total number of frames when idle
  235. WORD wMagicFrames; // total number of frames when using magics
  236. WORD wAttackFrames; // total number of frames when doing normal attack
  237. WORD wIdleAnimSpeed; // speed of the animation when idle
  238. WORD wActWaitFrames; // FIXME: ???
  239. WORD wYPosOffset;
  240. SHORT wAttackSound; // sound played when this enemy uses normal attack
  241. SHORT wActionSound; // FIXME: ???
  242. SHORT wMagicSound; // sound played when this enemy uses magic
  243. SHORT wDeathSound; // sound played when this enemy dies
  244. SHORT wCallSound; // sound played when entering the battle
  245. WORD wHealth; // total HP of the enemy
  246. WORD wExp; // How many EXPs we'll get for beating this enemy
  247. WORD wCash; // how many cashes we'll get for beating this enemy
  248. WORD wLevel; // this enemy's level
  249. WORD wMagic; // this enemy's magic number
  250. WORD wMagicRate; // chance for this enemy to use magic
  251. WORD wAttackEquivItem; // equivalence item of this enemy's normal attack
  252. WORD wAttackEquivItemRate;// chance for equivalence item
  253. WORD wStealItem; // which item we'll get when stealing from this enemy
  254. WORD nStealItem; // total amount of the items which can be stolen
  255. WORD wAttackStrength; // normal attack strength
  256. WORD wMagicStrength; // magical attack strength
  257. WORD wDefense; // resistance to all kinds of attacking
  258. WORD wDexterity; // dexterity
  259. WORD wFleeRate; // chance for successful fleeing
  260. WORD wPoisonResistance; // resistance to poison
  261. WORD wElemResistance[NUM_MAGIC_ELEMENTAL]; // resistance to elemental magics
  262. WORD wPhysicalResistance; // resistance to physical attack
  263. WORD wDualMove; // whether this enemy can do dual move or not
  264. WORD wCollectValue; // value for collecting this enemy for items
  265. } ENEMY, *LPENEMY;
  266. typedef struct tagENEMYTEAM
  267. {
  268. WORD rgwEnemy[MAX_ENEMIES_IN_TEAM];
  269. } ENEMYTEAM, *LPENEMYTEAM;
  270. typedef WORD PLAYERS[MAX_PLAYER_ROLES];
  271. typedef struct tagPLAYERROLES
  272. {
  273. PLAYERS rgwAvatar; // avatar (shown in status view)
  274. PLAYERS rgwSpriteNumInBattle; // sprite displayed in battle (in F.MKF)
  275. PLAYERS rgwSpriteNum; // sprite displayed in normal scene (in MGO.MKF)
  276. PLAYERS rgwName; // name of player class (in WORD.DAT)
  277. PLAYERS rgwAttackAll; // whether player can attack everyone in a bulk or not
  278. PLAYERS rgwUnknown1; // FIXME: ???
  279. PLAYERS rgwLevel; // level
  280. PLAYERS rgwMaxHP; // maximum HP
  281. PLAYERS rgwMaxMP; // maximum MP
  282. PLAYERS rgwHP; // current HP
  283. PLAYERS rgwMP; // current MP
  284. WORD rgwEquipment[MAX_PLAYER_EQUIPMENTS][MAX_PLAYER_ROLES]; // equipments
  285. PLAYERS rgwAttackStrength; // normal attack strength
  286. PLAYERS rgwMagicStrength; // magical attack strength
  287. PLAYERS rgwDefense; // resistance to all kinds of attacking
  288. PLAYERS rgwDexterity; // dexterity
  289. PLAYERS rgwFleeRate; // chance of successful fleeing
  290. PLAYERS rgwPoisonResistance; // resistance to poison
  291. WORD rgwElementalResistance[NUM_MAGIC_ELEMENTAL][MAX_PLAYER_ROLES]; // resistance to elemental magics
  292. PLAYERS rgwUnknown2; // FIXME: ???
  293. PLAYERS rgwUnknown3; // FIXME: ???
  294. PLAYERS rgwUnknown4; // FIXME: ???
  295. PLAYERS rgwCoveredBy; // who will cover me when I am low of HP or not sane
  296. WORD rgwMagic[MAX_PLAYER_MAGICS][MAX_PLAYER_ROLES]; // magics
  297. PLAYERS rgwWalkFrames; // walk frame (???)
  298. PLAYERS rgwCooperativeMagic; // cooperative magic
  299. PLAYERS rgwUnknown5; // FIXME: ???
  300. PLAYERS rgwUnknown6; // FIXME: ???
  301. PLAYERS rgwDeathSound; // sound played when player dies
  302. PLAYERS rgwAttackSound; // sound played when player attacks
  303. PLAYERS rgwWeaponSound; // weapon sound (???)
  304. PLAYERS rgwCriticalSound; // sound played when player make critical hits
  305. PLAYERS rgwMagicSound; // sound played when player is casting a magic
  306. PLAYERS rgwCoverSound; // sound played when player cover others
  307. PLAYERS rgwDyingSound; // sound played when player is dying
  308. } PLAYERROLES, *LPPLAYERROLES;
  309. typedef enum tagMAGIC_TYPE
  310. {
  311. kMagicTypeNormal = 0,
  312. kMagicTypeAttackAll = 1, // draw the effect on each of the enemies
  313. kMagicTypeAttackWhole = 2, // draw the effect on the whole enemy team
  314. kMagicTypeAttackField = 3, // draw the effect on the battle field
  315. kMagicTypeApplyToPlayer = 4, // the magic is used on one player
  316. kMagicTypeApplyToParty = 5, // the magic is used on the whole party
  317. kMagicTypeTrance = 8, // trance the player
  318. kMagicTypeSummon = 9, // summon
  319. } MAGIC_TYPE;
  320. typedef struct tagMAGIC
  321. {
  322. WORD wEffect; // effect sprite
  323. WORD wType; // type of this magic
  324. WORD wXOffset;
  325. WORD wYOffset;
  326. WORD wSummonEffect; // summon effect sprite (in F.MKF)
  327. SHORT wSpeed; // speed of the effect
  328. WORD wKeepEffect; // FIXME: ???
  329. WORD wFireDelay; // start frame of the magic fire stage
  330. WORD wEffectTimes; // total times of effect
  331. WORD wShake; // shake screen
  332. WORD wWave; // wave screen
  333. WORD wUnknown; // FIXME: ???
  334. WORD wCostMP; // MP cost
  335. WORD wBaseDamage; // base damage
  336. WORD wElemental; // elemental (0 = No Elemental, last = poison)
  337. SHORT wSound; // sound played when using this magic
  338. } MAGIC, *LPMAGIC;
  339. typedef struct tagBATTLEFIELD
  340. {
  341. WORD wScreenWave; // level of screen waving
  342. SHORT rgsMagicEffect[NUM_MAGIC_ELEMENTAL]; // effect of attributed magics
  343. } BATTLEFIELD, *LPBATTLEFIELD;
  344. // magics learned when level up
  345. typedef struct tagLEVELUPMAGIC
  346. {
  347. WORD wLevel; // level reached
  348. WORD wMagic; // magic learned
  349. } LEVELUPMAGIC, *LPLEVELUPMAGIC;
  350. typedef struct tagLEVELUPMAGIC_ALL
  351. {
  352. LEVELUPMAGIC m[MAX_PLAYABLE_PLAYER_ROLES];
  353. } LEVELUPMAGIC_ALL, *LPLEVELUPMAGIC_ALL;
  354. typedef struct tagPALPOS
  355. {
  356. WORD x;
  357. WORD y;
  358. } PALPOS;
  359. typedef struct tagENEMYPOS
  360. {
  361. PALPOS pos[MAX_ENEMIES_IN_TEAM][MAX_ENEMIES_IN_TEAM];
  362. } ENEMYPOS, *LPENEMYPOS;
  363. // Exp. points needed for the next level
  364. typedef WORD LEVELUPEXP, *LPLEVELUPEXP;
  365. // game data which is available in data files.
  366. typedef struct tagGAMEDATA
  367. {
  368. LPEVENTOBJECT lprgEventObject;
  369. int nEventObject;
  370. SCENE rgScene[MAX_SCENES];
  371. OBJECT rgObject[MAX_OBJECTS];
  372. LPSCRIPTENTRY lprgScriptEntry;
  373. int nScriptEntry;
  374. LPSTORE lprgStore;
  375. int nStore;
  376. LPENEMY lprgEnemy;
  377. int nEnemy;
  378. LPENEMYTEAM lprgEnemyTeam;
  379. int nEnemyTeam;
  380. PLAYERROLES PlayerRoles;
  381. LPMAGIC lprgMagic;
  382. int nMagic;
  383. LPBATTLEFIELD lprgBattleField;
  384. int nBattleField;
  385. LPLEVELUPMAGIC_ALL lprgLevelUpMagic;
  386. int nLevelUpMagic;
  387. ENEMYPOS EnemyPos;
  388. LEVELUPEXP rgLevelUpExp[MAX_LEVELS + 1];
  389. WORD rgwBattleEffectIndex[10][2];
  390. } GAMEDATA, *LPGAMEDATA;
  391. typedef struct tagFILES
  392. {
  393. FILE *fpFBP; // battlefield background images
  394. FILE *fpMGO; // sprites in scenes
  395. FILE *fpBALL; // item bitmaps
  396. FILE *fpDATA; // misc data
  397. FILE *fpF; // player sprites during battle
  398. FILE *fpFIRE; // fire effect sprites
  399. FILE *fpRGM; // character face bitmaps
  400. FILE *fpSSS; // script data
  401. } FILES, *LPFILES;
  402. // player party
  403. typedef struct tagPARTY
  404. {
  405. WORD wPlayerRole; // player role
  406. SHORT x, y; // position
  407. WORD wFrame; // current frame number
  408. WORD wImageOffset; // FIXME: ???
  409. } PARTY, *LPPARTY;
  410. // player trail, used for other party members to follow the main party member
  411. typedef struct tagTRAIL
  412. {
  413. WORD x, y; // position
  414. WORD wDirection; // direction
  415. } TRAIL, *LPTRAIL;
  416. typedef struct tagEXPERIENCE
  417. {
  418. WORD wExp; // current experience points
  419. WORD wReserved;
  420. WORD wLevel; // current level
  421. WORD wCount;
  422. } EXPERIENCE, *LPEXPERIENCE;
  423. typedef struct tagALLEXPERIENCE
  424. {
  425. EXPERIENCE rgPrimaryExp[MAX_PLAYER_ROLES];
  426. EXPERIENCE rgHealthExp[MAX_PLAYER_ROLES];
  427. EXPERIENCE rgMagicExp[MAX_PLAYER_ROLES];
  428. EXPERIENCE rgAttackExp[MAX_PLAYER_ROLES];
  429. EXPERIENCE rgMagicPowerExp[MAX_PLAYER_ROLES];
  430. EXPERIENCE rgDefenseExp[MAX_PLAYER_ROLES];
  431. EXPERIENCE rgDexterityExp[MAX_PLAYER_ROLES];
  432. EXPERIENCE rgFleeExp[MAX_PLAYER_ROLES];
  433. } ALLEXPERIENCE, *LPALLEXPERIENCE;
  434. typedef struct tagPOISONSTATUS
  435. {
  436. WORD wPoisonID; // kind of the poison
  437. WORD wPoisonScript; // script entry
  438. } POISONSTATUS, *LPPOISONSTATUS;
  439. typedef struct tagGLOBALVARS
  440. {
  441. FILES f;
  442. GAMEDATA g;
  443. int iCurMainMenuItem; // current main menu item number
  444. int iCurSystemMenuItem; // current system menu item number
  445. int iCurInvMenuItem; // current inventory menu item number
  446. int iCurPlayingRNG; // current playing RNG animation
  447. BYTE bCurrentSaveSlot; // current save slot (1-5)
  448. BOOL fInMainGame; // TRUE if in main game
  449. BOOL fGameStart; // TRUE if the has just started
  450. BOOL fEnteringScene; // TRUE if entering a new scene
  451. BOOL fNeedToFadeIn; // TRUE if need to fade in when drawing scene
  452. BOOL fInBattle; // TRUE if in battle
  453. BOOL fAutoBattle; // TRUE if auto-battle
  454. #ifndef PAL_CLASSIC
  455. BYTE bBattleSpeed; // Battle Speed (1 = Fastest, 5 = Slowest)
  456. #endif
  457. WORD wLastUnequippedItem; // last unequipped item
  458. PLAYERROLES rgEquipmentEffect[MAX_PLAYER_EQUIPMENTS + 1]; // equipment effects
  459. WORD rgPlayerStatus[MAX_PLAYER_ROLES][kStatusAll]; // player status
  460. PAL_POS viewport; // viewport coordination
  461. PAL_POS partyoffset;
  462. WORD wLayer;
  463. WORD wMaxPartyMemberIndex;// max index of members in party (0 to MAX_PLAYERS_IN_PARTY - 1)
  464. PARTY rgParty[MAX_PLAYABLE_PLAYER_ROLES]; // player party
  465. TRAIL rgTrail[MAX_PLAYABLE_PLAYER_ROLES]; // player trail
  466. WORD wPartyDirection; // direction of the party
  467. WORD wNumScene; // current scene number
  468. WORD wNumPalette; // current palette number
  469. BOOL fNightPalette; // TRUE if use the darker night palette
  470. WORD wNumMusic; // current music number
  471. WORD wNumBattleMusic; // current music number in battle
  472. WORD wNumBattleField; // current battle field number
  473. WORD wCollectValue; // value of "collected" items
  474. WORD wScreenWave; // level of screen waving
  475. SHORT sWaveProgression;
  476. WORD wChaseRange;
  477. WORD wChasespeedChangeCycles;
  478. USHORT nFollower;
  479. DWORD dwCash; // amount of cash
  480. ALLEXPERIENCE Exp; // experience status
  481. POISONSTATUS rgPoisonStatus[MAX_POISONS][MAX_PLAYABLE_PLAYER_ROLES]; // poison status
  482. INVENTORY rgInventory[MAX_INVENTORY]; // inventory status
  483. LPOBJECTDESC lpObjectDesc;
  484. DWORD dwFrameNum;
  485. } GLOBALVARS, *LPGLOBALVARS;
  486. PAL_C_LINKAGE_BEGIN
  487. extern GLOBALVARS * const gpGlobals;
  488. BOOL
  489. PAL_IsWINVersion(
  490. BOOL *pfIsWIN95
  491. );
  492. INT
  493. PAL_InitGlobals(
  494. VOID
  495. );
  496. VOID
  497. PAL_FreeGlobals(
  498. VOID
  499. );
  500. VOID
  501. PAL_SaveGame(
  502. LPCSTR szFileName,
  503. WORD wSavedTimes
  504. );
  505. VOID
  506. PAL_InitGameData(
  507. INT iSaveSlot
  508. );
  509. BOOL
  510. PAL_AddItemToInventory(
  511. WORD wObjectID,
  512. INT iNum
  513. );
  514. BOOL
  515. PAL_IncreaseHPMP(
  516. WORD wPlayerRole,
  517. SHORT sHP,
  518. SHORT sMP
  519. );
  520. INT
  521. PAL_GetItemAmount(
  522. WORD wItem
  523. );
  524. VOID
  525. PAL_UpdateEquipments(
  526. VOID
  527. );
  528. VOID
  529. PAL_CompressInventory(
  530. VOID
  531. );
  532. VOID
  533. PAL_RemoveEquipmentEffect(
  534. WORD wPlayerRole,
  535. WORD wEquipPart
  536. );
  537. VOID
  538. PAL_AddPoisonForPlayer(
  539. WORD wPlayerRole,
  540. WORD wPoisonID
  541. );
  542. VOID
  543. PAL_CurePoisonByKind(
  544. WORD wPlayerRole,
  545. WORD wPoisonID
  546. );
  547. VOID
  548. PAL_CurePoisonByLevel(
  549. WORD wPlayerRole,
  550. WORD wMaxLevel
  551. );
  552. BOOL
  553. PAL_IsPlayerPoisonedByLevel(
  554. WORD wPlayerRole,
  555. WORD wMinLevel
  556. );
  557. BOOL
  558. PAL_IsPlayerPoisonedByKind(
  559. WORD wPlayerRole,
  560. WORD wPoisonID
  561. );
  562. WORD
  563. PAL_GetPlayerAttackStrength(
  564. WORD wPlayerRole
  565. );
  566. WORD
  567. PAL_GetPlayerMagicStrength(
  568. WORD wPlayerRole
  569. );
  570. WORD
  571. PAL_GetPlayerDefense(
  572. WORD wPlayerRole
  573. );
  574. WORD
  575. PAL_GetPlayerDexterity(
  576. WORD wPlayerRole
  577. );
  578. WORD
  579. PAL_GetPlayerFleeRate(
  580. WORD wPlayerRole
  581. );
  582. WORD
  583. PAL_GetPlayerPoisonResistance(
  584. WORD wPlayerRole
  585. );
  586. WORD
  587. PAL_GetPlayerElementalResistance(
  588. WORD wPlayerRole,
  589. INT iAttrib
  590. );
  591. WORD
  592. PAL_GetPlayerBattleSprite(
  593. WORD wPlayerRole
  594. );
  595. WORD
  596. PAL_GetPlayerCooperativeMagic(
  597. WORD wPlayerRole
  598. );
  599. BOOL
  600. PAL_PlayerCanAttackAll(
  601. WORD wPlayerRole
  602. );
  603. BOOL
  604. PAL_AddMagic(
  605. WORD wPlayerRole,
  606. WORD wMagic
  607. );
  608. VOID
  609. PAL_RemoveMagic(
  610. WORD wPlayerRole,
  611. WORD wMagic
  612. );
  613. VOID
  614. PAL_SetPlayerStatus(
  615. WORD wPlayerRole,
  616. WORD wStatusID,
  617. WORD wNumRound
  618. );
  619. VOID
  620. PAL_RemovePlayerStatus(
  621. WORD wPlayerRole,
  622. WORD wStatusID
  623. );
  624. VOID
  625. PAL_ClearAllPlayerStatus(
  626. VOID
  627. );
  628. VOID
  629. PAL_PlayerLevelUp(
  630. WORD wPlayerRole,
  631. WORD wNumLevel
  632. );
  633. PAL_C_LINKAGE_END
  634. #endif