1 #ifndef MEANWHILE_H
2 #define MEANWHILE_H
3 
4 #include "Types.h"
5 
6 
7 enum
8 {
9 	END_OF_PLAYERS_FIRST_BATTLE,
10 	DRASSEN_LIBERATED,
11 	CAMBRIA_LIBERATED,
12 	ALMA_LIBERATED,
13 	GRUMM_LIBERATED,
14 	CHITZENA_LIBERATED,
15 	NW_SAM,
16 	NE_SAM,
17 	CENTRAL_SAM,
18 	FLOWERS,
19 	LOST_TOWN,
20 	INTERROGATION,
21 	CREATURES,
22 	KILL_CHOPPER,
23 	AWOL_SCIENTIST,
24 	OUTSKIRTS_MEDUNA,
25 	BALIME_LIBERATED,
26 	NUM_MEANWHILES
27 };
28 
29 
30 struct MEANWHILE_DEFINITION
31 {
32 	INT16				sSectorX;
33 	INT16				sSectorY;
34 	UINT16			usTriggerEvent;
35 
36 	UINT8				ubMeanwhileID;
37 	UINT8				ubNPCNumber;
38 };
39 
40 
41 void ScheduleMeanwhileEvent(INT16 x, INT16 y, UINT16 trigger_event, UINT8 meanwhile_id, UINT8 npc_profile, UINT32 time);
42 
43 void BeginMeanwhile(UINT8 ubMeanwhileID);
44 
45 void CheckForMeanwhileOKStart(void);
46 void EndMeanwhile(void);
47 
48 
49 
50 bool AreInMeanwhile();
51 UINT8 GetMeanwhileID(void);
52 BOOLEAN AreReloadingFromMeanwhile(void);
53 
54 void LocateToMeanwhileCharacter(void);
55 
56 // post meanwhile event for town liberation
57 void HandleMeanWhileEventPostingForTownLiberation( UINT8 bTownId );
58 
59 // post meanwhile event for SAM liberation
60 void HandleMeanWhileEventPostingForSAMLiberation( INT8 bSAMId );
61 
62 // trash world has been called, should we do the first meanwhile?
63 void HandleFirstMeanWhileSetUpWithTrashWorld( void );
64 
65 // battle ended, check if we should set up a meanwhile?
66 void HandleFirstBattleEndingWhileInTown( INT16 sSectorX, INT16 sSectorY, INT16 bSectorZ, BOOLEAN fFromAutoResolve );
67 
68 // lost an entire town to the enemy!
69 void HandleMeanWhileEventPostingForTownLoss();
70 
71 // handle short cutting past a meanwhilescene while it is being handled
72 void HandleShortCuttingOfMeanwhileSceneByPlayer( UINT8 ubMeanwhileID, INT32 iLastProfileId, INT32 iLastProfileAction );
73 
74 // handle release of creatures meanwhile
75 void HandleCreatureRelease( void );
76 
77 // handle sending flowers to the queen
78 void HandleFlowersMeanwhileScene( INT8 bTimeCode );
79 
80 // player reaches the outskirts of Meduna
81 void HandleOutskirtsOfMedunaMeanwhileScene( void );
82 
83 // let player know about Madlab after certain status % reached
84 void HandleScientistAWOLMeanwhileScene( void );
85 
86 // handle chopper used meanwhile
87 void HandleKillChopperMeanwhileScene( void );
88 
89 extern	MEANWHILE_DEFINITION	gCurrentMeanwhileDef;
90 extern	MEANWHILE_DEFINITION	gMeanwhileDef[NUM_MEANWHILES];
91 extern	BOOLEAN								gfMeanwhileTryingToStart;
92 extern	BOOLEAN								gfInMeanwhile;
93 extern	UINT32								uiMeanWhileFlags;
94 
95 #endif
96