Debian Codegraph @

netgames/monsterball/monsterball.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/monsterball/monsterball.h $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003/08/26 03:58:29 $
23 * $Author: kevinb $
24 *
25 * Monsterball multiplayer game
26 *
27 * $Log: monsterball.h,v $
28 * Revision 1.1.1.1 2003/08/26 03:58:29 kevinb
29 * initial 1.5 import
30 *
31 *
32 * 7 10/21/99 2:46p Kevin
33 * Macintosh merge!
34 *
35 * 6 3/22/99 5:51p Matt
36 * Removed some includes from one file and added some to other files, to
37 * reduce the amount of rebuilding when headers change.
38 *
39 * 5 3/19/99 12:54p Jeff
40 * base support for requesting the number of teams for a multiplayer game
41 *
42 * 4 3/17/99 12:23p Jeff
43 * converted DMFC to be COM interface
44 *
45 * 3 1/24/99 8:32p Jeff
46 * a bunch of updates to get 100% up to date, added individual scoring.
47 *
48 * $NoKeywords: $
49 */
50
51 #ifndef __DMFC_APP_H_
52 #define __DMFC_APP_H_cxx . . $ `netgames/monsterball/monsterball.h:52:9`!
53
54 #include "osiris_share.h"cxx . . $ `<file>/Descent3/osiris_share.h`/
55 #include "d3events.h"cxx . . $ `<file>/lib/d3events.h`/
56
57 //!!!!!!!ADD YOUR EVENT HANDLER OVERRIDES HERE!!!!!!!!!!!
58 bool OnCanChangeTeamcxx . . $ OnCanChangeTeam(cf9ef193275fa6d8).(int pnum, int newteam);
59 void OnClientPlayerDisconnectcxx . . $ OnClientPlayerDisconnect(d4f767463ce0a6b3).(int player_num);
60 void OnPlayerEntersObservercxx . . $ OnPlayerEntersObserver(14473714f2cc5bd2).(int pnum, objectcxx . . $ object# *piggy);
61 void OnClientPlayerKilledcxx . . $ OnClientPlayerKilled(766a1b7183ffa4b4).(objectcxx . . $ object# *killer_obj, int victim_pnum);
62
63 void OnServerObjectShieldsChangedcxx . . $ OnServerObjectShieldsChanged(4ebbd0c3cbf1b78a).(objectcxx . . $ object# *obj, float amount);
64 void OnGameStateRequestcxx . . $ OnGameStateRequest(d4f767463ce0a6b3).(int pnum);
65 void OnServerGameCreatedcxx . . $ OnServerGameCreated(49f6e7a06ebc5aa8).(void);
66 void OnClientLevelStartcxx . . $ OnClientLevelStart(49f6e7a06ebc5aa8).(void);
67 void OnPlayerConnectcxx . . $ OnPlayerConnect(d4f767463ce0a6b3).(int player_num);
68 void OnIntervalcxx . . $ OnInterval(49f6e7a06ebc5aa8).(void);
69 void OnHUDIntervalcxx . . $ OnHUDInterval(49f6e7a06ebc5aa8).(void);
70 void OnKeypresscxx . . $ OnKeypress(d4f767463ce0a6b3).(int key);
71 void OnServerCollidecxx . . $ OnServerCollide(584c77d2760d8df8).(objectcxx . . $ object# *me_obj, objectcxx . . $ object# *it_obj, vectorcxx . . $ vector# *point, vectorcxx . . $ vector# *normal);
72 void OnClientCollidecxx . . $ OnClientCollide(584c77d2760d8df8).(objectcxx . . $ object# *me_obj, objectcxx . . $ object# *it_obj, vectorcxx . . $ vector# *point, vectorcxx . . $ vector# *normal);
73 void OnServerPlayerChangeSegmentcxx . . $ OnServerPlayerChangeSegment(b1146eedae1e1d0b).(int player_num, int newseg, int oldseg);
74 void OnClientPlayerChangeSegmentcxx . . $ OnClientPlayerChangeSegment(b1146eedae1e1d0b).(int player_num, int newseg, int oldseg);
75 void OnServerObjectChangeSegmentcxx . . $ OnServerObjectChangeSegment(a7790401ac9fc765).(objectcxx . . $ object# *obj, int newseg, int oldseg);
76 void OnClientObjectChangeSegmentcxx . . $ OnClientObjectChangeSegment(a7790401ac9fc765).(objectcxx . . $ object# *obj, int newseg, int oldseg);
77 void OnSaveStatsToFilecxx . . $ OnSaveStatsToFile(49f6e7a06ebc5aa8).(void);
78 void OnLevelEndSaveStatsToFilecxx . . $ OnLevelEndSaveStatsToFile(49f6e7a06ebc5aa8).(void);
79 void OnDisconnectSaveStatsToFilecxx . . $ OnDisconnectSaveStatsToFile(49f6e7a06ebc5aa8).(void);
80 void OnPLRIntervalcxx . . $ OnPLRInterval(49f6e7a06ebc5aa8).(void);
81 void OnPLRInitcxx . . $ OnPLRInit(49f6e7a06ebc5aa8).(void);
82 void OnPrintScorescxx . . $ OnPrintScores(d4f767463ce0a6b3).(int level);
83 extern IDMFCcxx . . $ IDMFC# *DMFCBasecxx . . $ DMFCBase.;
84
85 // These next two function prototypes MUST appear in the extern "C" block if called
86 // from a CPP file.
87 extern "C" {
88 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameInit(int *api_func, uint8_tcxx . . $ uint8_t# *all_ok, int num_teams_to_use);
89 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameCall(int eventnum, dllinfocxx . . $ dllinfo# *data);
90 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameClose();
91 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGetGameInfo(tDLLOptionscxx . . $ tDLLOptions# *options);
92 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! GetGOScriptID(const char *name, uint8_tcxx . . $ uint8_t# isdoor);
93 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLPTRcxx . . $ `lib/module.h:94:10`! CreateInstance(int id);
94 DLLEXPORTcxx . . $ `lib/module.h:114:9`! void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DestroyInstance(int id, void *ptr);
95 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int16_t DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data);
96 DLLEXPORTcxx . . $ `lib/module.h:114:9`! int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! SaveRestoreState(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state);
97 }
98
99 // The main entry point where the game calls the dll
100 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DLLGameCallcxx . . $ DLLGameCall(32ca0c0c7dbc2fcf).(int eventnum, dllinfocxx . . $ dllinfo# *data) {
101 if ((eventnum < EVT_CLIENT_INTERVALcxx . . $ `lib/d3events.h:85:9`!) && (DMFCBasecxx . . $ DMFCBase.->GetLocalRolecxx . . $ IDMFC#GetLocalRole(b126dc7c1de90089).() != LR_SERVERcxx . . $ `Descent3/multi_external.h:129:9`!)) {
102 return;
103 }
104
105 DMFCBasecxx . . $ DMFCBase.->TranslateEventcxx . . $ IDMFC#TranslateEvent(32ca0c0c7dbc2fcf).(eventnum, data);
106 }
107
108 // GetGOScriptID
109 // Purpose:
110 // Given the name of the object (from it's pagename), this function will search through it's
111 // list of General Object Scripts for a script with a matching name (to see if there is a script
112 // for that type/id of object within this DLL). If a matching scriptname is found, a UNIQUE ID
113 // is to be returned back to Descent 3. This ID will be used from here on out for all future
114 // interaction with the DLL. Since doors are not part of the generic object's, it's possible
115 // for a door to have the same name as a generic object (OBJ_POWERUP, OBJ_BUILDING, OBJ_CLUTTER
116 // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a
117 // door, else it is a 0. The return value is the unique identifier, else -1 if the script
118 // does not exist in the DLL.
119 int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! GetGOScriptIDcxx . . $ GetGOScriptID(a2648ab7e2ef960e).(const char *name, uint8_tcxx . . $ uint8_t# isdoor) { return -1; }
120
121 // CreateInstance
122 // Purpose:
123 // Given an ID from a call to GetGOScriptID(), this function will create a new instance for that
124 // particular script (by allocating and initializing memory, etc.). A pointer to this instance
125 // is to be returned back to Descent 3. This pointer will be passed around, along with the ID
126 // for CallInstanceEvent() and DestroyInstance(). Return NULL if there was an error.
127 void DLLFUNCCALLPTRcxx . . $ `lib/module.h:94:10`! CreateInstancecxx . . $ CreateInstance(d1680a912d714170).(int id) { return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!; }
128
129 // DestroyInstance
130 // Purpose:
131 // Given an ID, and a pointer to a particular instance of a script, this function will delete and
132 // destruct all information associated with that script, so it will no longer exist.
133 void DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! DestroyInstancecxx . . $ DestroyInstance(6ca3d68f5c5f0975).(int id, void *ptr) {}
134
135 // CallInstanceEvent
136 // Purpose:
137 // Given an ID, a pointer to a script instance, an event and a pointer to the struct of
138 // information about the event, this function will translate who this event belongs to and
139 // passes the event to that instance of the script to be handled. Return a combination of
140 // CONTINUE_CHAIN and CONTINUE_DEFAULT, to give instructions on what to do based on the
141 // event. CONTINUE_CHAIN means to continue through the chain of scripts (custom script, level
142 // script, mission script, and finally default script). If CONTINUE_CHAIN is not specified,
143 // than the chain is broken and those scripts of lower priority will never get the event. Return
144 // CONTINUE_DEFAULT in order to tell D3 if you want process the normal action that is built into
145 // the game for that event. This only pertains to certain events. If the chain continues
146 // after this script, than the CONTINUE_DEFAULT setting will be overridden by lower priority
147 // scripts return value.
148 int16_t DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! CallInstanceEventcxx . . $ CallInstanceEvent(79be2a5a01598f29).(int id, void *ptr, int event, tOSIRISEventInfocxx . . $ tOSIRISEventInfo# *data) {
149 return CONTINUE_CHAINcxx . . $ `scripts/osiris_common.h:357:9`! | CONTINUE_DEFAULTcxx . . $ `scripts/osiris_common.h:358:9`!;
150 }
151
152 // SaveRestoreState
153 // Purpose:
154 // This function is called when Descent 3 is saving or restoring the game state. In this function
155 // you should save/restore any global data that you want preserved through load/save (which includes
156 // demos). You must be very careful with this function, corrupting the file (reading or writing too
157 // much or too little) may be hazardous to the game (possibly making it impossible to restore the
158 // state). It would be best to use version information to keep older versions of saved states still
159 // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE
160 // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should
161 // write data to the file_ptr, 0 when you should read in the data.
162 int DLLFUNCCALLcxx . . $ `lib/module.h:93:10`! SaveRestoreStatecxx . . $ SaveRestoreState(5276b51c10b71c09).(void *file_ptr, uint8_tcxx . . $ uint8_t# saving_state) { return 0; }
163
164 #endif