123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- #ifndef BATTLE_H
- #define BATTLE_H
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- #include "global.h"
- #include "uibattle.h"
- #define BATTLE_FPS 25
- #define BATTLE_FRAME_TIME (1000 / BATTLE_FPS)
- typedef enum tagBATTLERESULT
- {
- kBattleResultWon = 3,
- kBattleResultLost = 1,
- kBattleResultFleed = 0xFFFF,
- kBattleResultTerminated = 0,
- kBattleResultOnGoing = 1000,
- kBattleResultPreBattle = 1001,
- kBattleResultPause = 1002,
- } BATTLERESULT;
- typedef enum tagFIGHTERSTATE
- {
- kFighterWait,
- kFighterCom,
- kFighterAct,
- } FIGHTERSTATE;
- typedef enum tagBATTLEACTIONTYPE
- {
- kBattleActionPass,
- kBattleActionDefend,
- kBattleActionAttack,
- kBattleActionMagic,
- kBattleActionCoopMagic,
- kBattleActionFlee,
- kBattleActionThrowItem,
- kBattleActionUseItem,
- kBattleActionAttackMate,
- } BATTLEACTIONTYPE;
- typedef struct tagBATTLEACTION
- {
- BATTLEACTIONTYPE ActionType;
- WORD wActionID;
- SHORT sTarget;
- FLOAT flRemainingTime;
- } BATTLEACTION;
- typedef struct tagBATTLEENEMY
- {
- WORD wObjectID;
- ENEMY e;
- WORD rgwStatus[kStatusAll];
- FLOAT flTimeMeter;
- POISONSTATUS rgPoisons[MAX_POISONS];
- LPSPRITE lpSprite;
- PAL_POS pos;
- PAL_POS posOriginal;
- WORD wCurrentFrame;
- FIGHTERSTATE state;
- BOOL fTurnStart;
- BOOL fFirstMoveDone;
- BOOL fDualMove;
- WORD wScriptOnTurnStart;
- WORD wScriptOnBattleEnd;
- WORD wScriptOnReady;
- WORD wPrevHP;
- INT iColorShift;
- } BATTLEENEMY;
- typedef struct tagBATTLEPLAYER
- {
- INT iColorShift;
- FLOAT flTimeMeter;
- FLOAT flTimeSpeedModifier;
- WORD wHidingTime;
- LPSPRITE lpSprite;
- PAL_POS pos;
- PAL_POS posOriginal;
- WORD wCurrentFrame;
- FIGHTERSTATE state;
- BATTLEACTION action;
- BOOL fDefending;
- WORD wPrevHP;
- WORD wPrevMP;
- #ifndef PAL_CLASSIC
- SHORT sTurnOrder;
- #endif
- } BATTLEPLAYER;
- typedef struct tagSUMMON
- {
- LPSPRITE lpSprite;
- WORD wCurrentFrame;
- } SUMMON;
- #define MAX_BATTLE_ACTIONS 256
- #define MAX_KILLED_ENEMIES 256
- #ifdef PAL_CLASSIC
- typedef enum tabBATTLEPHASE
- {
- kBattlePhaseSelectAction,
- kBattlePhasePerformAction
- } BATTLEPHASE;
- typedef struct tagACTIONQUEUE
- {
- BOOL fIsEnemy;
- WORD wDexterity;
- WORD wIndex;
- } ACTIONQUEUE;
- #define MAX_ACTIONQUEUE_ITEMS (MAX_PLAYERS_IN_PARTY + MAX_ENEMIES_IN_TEAM * 2)
- #endif
- typedef struct tagBATTLE
- {
- BATTLEPLAYER rgPlayer[MAX_PLAYERS_IN_PARTY];
- BATTLEENEMY rgEnemy[MAX_ENEMIES_IN_TEAM];
- WORD wMaxEnemyIndex;
- SDL_Surface *lpSceneBuf;
- SDL_Surface *lpBackground;
- SHORT sBackgroundColorShift;
- LPSPRITE lpSummonSprite;
- PAL_POS posSummon;
- INT iSummonFrame;
- INT iExpGained;
- INT iCashGained;
- BOOL fIsBoss;
- BOOL fEnemyCleared;
- BATTLERESULT BattleResult;
- FLOAT flTimeChargingUnit;
- BATTLEUI UI;
- LPBYTE lpEffectSprite;
- BOOL fEnemyMoving;
- INT iHidingTime;
- WORD wMovingPlayerIndex;
- int iBlow;
- #ifdef PAL_CLASSIC
- BATTLEPHASE Phase;
- ACTIONQUEUE ActionQueue[MAX_ACTIONQUEUE_ITEMS];
- int iCurAction;
- BOOL fRepeat;
- BOOL fForce;
- BOOL fFlee;
- #endif
- } BATTLE;
- extern BATTLE g_Battle;
- VOID
- PAL_LoadBattleSprites(
- VOID
- );
- VOID
- PAL_BattleMakeScene(
- VOID
- );
- VOID
- PAL_BattleBackupScene(
- VOID
- );
- VOID
- PAL_BattleFadeScene(
- VOID
- );
- VOID
- PAL_BattleEnemyEscape(
- VOID
- );
- VOID
- PAL_BattlePlayerEscape(
- VOID
- );
- BATTLERESULT
- PAL_StartBattle(
- WORD wEnemyTeam,
- BOOL fIsBoss
- );
- #ifdef __cplusplus
- }
- #endif
- #endif
|