global.h 24 KB

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