| 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 | |
| 19 | #ifndef __ENTROPY_AUX_H__ |
| 20 | #define __ENTROPY_AUX_H__ |
| 21 | |
| 22 | /* |
| 23 | ===================================================================== |
| 24 | Entropy Special Packet IDs |
| 25 | ===================================================================== |
| 26 | */ |
| 27 | #define SPID_NEWPLAYER 0 |
| 28 | #define SPID_TAKEOVER 1 |
| 29 | #define SPID_MATCHOBJNUM 2 |
| 30 | #define SPID_ROOMINFO 3 |
| 31 | #define SPID_PICKUPVIRUS 4 |
| 32 | #define SPID_VIRUSCREATE 5 |
| 33 | |
| 34 | /* |
| 35 | ===================================================================== |
| 36 | Some general defines for Entropy |
| 37 | ===================================================================== |
| 38 | */ |
| 39 | #define MAX_VIRII 16 // maximum number of virii for each team not picked up |
| 40 | #define MAX_VIRII_PER_ROOM 4 // maximum number of virii allowed to be alive in a lab at once |
| 41 | #define NUM_TEAMS 2 // Only 2 teams supported in this game |
| 42 | |
| 43 | // the following are control message code (when the server sends status info to the client) |
| 44 | #define VIRUS_NOTENOUGHKILLS 0 |
| 45 | #define VIRUS_CANTKILL 1 |
| 46 | #define VIRUS_DESTROYED 2 |
| 47 | |
| 48 | /* |
| 49 | ===================================================================== |
| 50 | Some common function prototypes |
| 51 | ===================================================================== |
| 52 | */ |
| 53 | void SendRoomInfo(int pnum); |
| 54 | void ReceiveRoomInfo(uint8_t *data); |
| 55 | void SendClientPickupVirus(int player_num); |
| 56 | void ReceivePickupVirus(uint8_t *data); |
| 57 | void SendGameStartPacket(int pnum); |
| 58 | void GetGameStartPacket(uint8_t *data); |
| 59 | void SendTakeOverPacket(int newteam, int oldteam, int room, int victor); |
| 60 | void ReceiveTakeOverPacket(uint8_t *data); |
| 61 | void DoVirusCreate(uint8_t *data); |
| 62 | void SendVirusCreate(object *obj); |
| 63 | bool IsPlayerInEnemy(int pnum); |
| 64 | void RemoveVirusFromPlayer(int player_num, bool remove_all); |
| 65 | |
| 66 | // Functions in EntropyRoom.cpp |
| 67 | int SpewObjectInRoom(int type, int id, int roomnum); |
| 68 | bool PaintRoomWithTexture(int texture, int roomnum); |
| 69 | |
| 70 | // Take over functions |
| 71 | void TakeOverRoom(int newteam, int oldteam, int room, int victor); |
| 72 | void SendTakeOverPacket(int newteam, int oldteam, int room, int victor); |
| 73 | void ReceiveTakeOverPacket(uint8_t *data); |
| 74 | |
| 75 | /* |
| 76 | ===================================================================== |
| 77 | Externed globals needed throughout Entropy |
| 78 | ===================================================================== |
| 79 | */ |
| 80 | extern int NumberOfKillsSinceLastDeath[DLLMAX_PLAYERS]; //'kills in a row' for a player |
| 81 | extern int TeamScore[NUM_TEAMS]; // team scores |
| 82 | extern int TeamOwnedRooms[NUM_TEAMS]; // Number of rooms each team has |
| 83 | extern int EnergyText[NUM_TEAMS]; // texture handles to Energy room textures |
| 84 | extern int RepairText[NUM_TEAMS]; // texture handles to Repair room textures |
| 85 | extern int LabText[NUM_TEAMS]; // texture handles to Lab room textures |
| 86 | extern int virus_id; // Object ID of the Virus object |
| 87 | extern int *RoomList; // List of room index's that are special for Entropy (i.e. all the labs, repairs and energy rooms) |
| 88 | extern int RoomCount; // Size of RoomList when it's finally allocated |
| 89 | extern room *dRooms; |
| 90 | extern object *dObjects; |
| 91 | |
| 92 | #endif |