1 /* bzflag 2 * Copyright (c) 1993-2021 Tim Riker 3 * 4 * This package is free software; you can redistribute it and/or 5 * modify it under the terms of the license found in the file 6 * named COPYING that should have accompanied this file. 7 * 8 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11 */ 12 13 #ifndef BZF_GLOBAL_H 14 #define BZF_GLOBAL_H 15 16 /* 17 * Global constants 18 */ 19 20 #include "common.h" 21 22 /* system headers */ 23 #include <math.h> 24 25 /* common headers */ 26 #include "StateDatabase.h" 27 28 29 // values affecting struct and class layout 30 const int CallSignLen = 32; // including terminating NUL 31 const int PasswordLen = 32; // including terminating NUL 32 const int MottoLen = 128; // including terminating NUL 33 const int TokenLen = 22; // opaque string (now int(10)) and terminating NUL 34 const int VersionLen = 60; // including terminating NUL 35 const int MessageLen = 128; // including terminating NUL 36 37 // types of things we can be 38 enum PlayerType 39 { 40 TankPlayer, 41 ComputerPlayer 42 }; 43 44 // types of text messages 45 enum MessageType 46 { 47 ChatMessage, 48 ActionMessage 49 }; 50 51 // team info 52 const int NumTeams = 8; 53 const int CtfTeams = 5; 54 enum TeamColor 55 { 56 AutomaticTeam = -2, 57 NoTeam = -1, 58 RogueTeam = 0, 59 RedTeam = 1, 60 GreenTeam = 2, 61 BlueTeam = 3, 62 PurpleTeam = 4, 63 ObserverTeam = 5, 64 RabbitTeam = 6, 65 HunterTeam = 7 66 }; 67 68 #ifdef ROBOT 69 // robots 70 #define MAX_ROBOTS 100 71 #else 72 #define MAX_ROBOTS 0 73 #endif 74 75 // epsilon and very far for ray intersections 76 const float Epsilon = ZERO_TOLERANCE; // arbitrary 77 const float Infinity = MAXFLOAT; // arbitrary 78 79 #define DEFAULT_WORLD 800 80 81 // readout stuff 82 const int MaxMessages = 20; // msg. history length 83 const int MinX = 256; 84 const int MinY = 192; 85 const int NoMotionSize = 10; // no motion zone size 86 const int MaxMotionSize = 37; // motion zone size 87 88 // game types 89 enum GameType 90 { 91 TeamFFA, // normal teamed FFA 92 ClassicCTF, // your normal CTF 93 OpenFFA, // teamless FFA 94 RabbitChase // hunt the rabbit mode 95 }; 96 // game styles 97 enum GameOptions 98 { 99 SuperFlagGameStyle = 0x0002, // superflags allowed 100 JumpingGameStyle = 0x0008, // jumping allowed 101 InertiaGameStyle = 0x0010, // momentum for all 102 RicochetGameStyle = 0x0020, // all shots ricochet 103 ShakableGameStyle = 0x0040, // can drop bad flags 104 AntidoteGameStyle = 0x0080, // anti-bad flags 105 HandicapGameStyle = 0x0100, // handicap players based on score (eek! was TimeSyncGameStyle) 106 NoTeamKillsGameStyle = 0x0400 107 // add here before reusing old ones above 108 }; 109 110 // map object flags 111 #define _DRIVE_THRU ( 1 << 0 ) 112 #define _SHOOT_THRU ( 1 << 1 ) 113 #define _FLIP_Z ( 1 << 2 ) 114 #define _RICOCHET ( 1 << 3 ) 115 116 const int mapVersion = 1; 117 118 struct GlobalDBItem 119 { 120 public: 121 const char* name; 122 const char* value; 123 bool persistent; 124 StateDatabase::Permission permission; 125 }; 126 extern const unsigned int numGlobalDBItems; 127 extern const struct GlobalDBItem globalDBItems[]; 128 129 #endif // BZF_GLOBAL_H 130 131 // Local Variables: *** 132 // mode: C++ *** 133 // tab-width: 4 *** 134 // c-basic-offset: 4 *** 135 // indent-tabs-mode: nil *** 136 // End: *** 137 // ex: shiftwidth=4 tabstop=4 138