1 /* 2 * XPilot NG, a multiplayer space war game. 3 * 4 * Copyright (C) 1991-2001 by 5 * 6 * Bj�rn Stabell <bjoern@xpilot.org> 7 * Ken Ronny Schouten <ken@xpilot.org> 8 * Bert Gijsbers <bert@xpilot.org> 9 * Dick Balaska <dick@xpilot.org> 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 */ 25 26 #ifndef OPTION_H 27 #define OPTION_H 28 29 extern struct options { 30 int maxRobots; 31 int minRobots; 32 char *robotFile; 33 int robotsTalk; 34 int robotsLeave; 35 int robotLeaveLife; 36 int robotTeam; 37 bool restrictRobots; 38 bool reserveRobotTeam; 39 int robotTicksPerSecond; 40 list_t expandList; /* Predefined settings. */ 41 double shotMass; 42 double shipMass; 43 double shotSpeed; 44 double gravity; 45 double ballMass; 46 double minItemMass; 47 int maxPlayerShots; 48 double shotLife; 49 double pulseSpeed; 50 double pulseLength; 51 double pulseLife; 52 bool shotsGravity; 53 bool shotHitFuelDrainUsesKineticEnergy; 54 double ballCollisionFuelDrain; 55 double playerCollisionFuelDrain; 56 bool treasureCollisionKills; 57 double fireRepeatRate; 58 double laserRepeatRate; 59 bool Log; 60 bool RawMode; 61 bool NoQuit; 62 bool logRobots; 63 int framesPerSecond; 64 char *mapFileName; 65 char *mapData; 66 int mapWidth; 67 int mapHeight; 68 char *mapName; 69 char *mapAuthor; 70 int contactPort; 71 char *serverHost; 72 char *greeting; 73 bool allowPlayerCrashes; 74 bool allowPlayerBounces; 75 bool allowPlayerKilling; 76 bool allowShields; 77 bool playerStartsShielded; 78 bool shotsWallBounce; 79 bool ballsWallBounce; 80 bool ballCollisionDetaches; 81 bool ballCollisions; 82 bool ballSparkCollisions; 83 bool minesWallBounce; 84 bool itemsWallBounce; 85 bool missilesWallBounce; 86 bool sparksWallBounce; 87 bool debrisWallBounce; 88 bool asteroidsWallBounce; 89 bool pulsesWallBounce; 90 bool cloakedExhaust; 91 bool ecmsReprogramMines; 92 bool ecmsReprogramRobots; 93 double maxObjectWallBounceSpeed; 94 double maxSparkWallBounceSpeed; 95 double maxShieldedWallBounceSpeed; 96 double maxUnshieldedWallBounceSpeed; 97 int playerWallBounceType; 98 double playerWallBounceBrakeFactor; 99 double playerBallBounceBrakeFactor; 100 double playerWallFriction; 101 double objectWallBounceBrakeFactor; 102 double objectWallBounceLifeFactor; 103 double wallBounceDestroyItemProb; 104 double afterburnerPowerMult; 105 106 bool limitedVisibility; 107 double minVisibilityDistance; 108 double maxVisibilityDistance; 109 bool limitedLives; 110 int worldLives; 111 bool endOfRoundReset; 112 int resetOnHuman; 113 bool allowAlliances; 114 bool announceAlliances; 115 bool teamPlay; 116 bool teamFuel; 117 bool teamCannons; 118 int cannonSmartness; 119 bool cannonsPickupItems; 120 bool cannonFlak; 121 double cannonDeadTicks; 122 double minCannonShotLife; 123 double maxCannonShotLife; 124 double survivalScore; 125 double cannonShotSpeed; 126 bool keepShots; 127 bool teamImmunity; 128 bool tagGame; 129 bool timing; 130 bool ballrace; 131 bool ballrace_connect; 132 bool edgeWrap; 133 bool edgeBounce; 134 bool extraBorder; 135 ipos_t gravityPoint; 136 double gravityAngle; 137 bool gravityPointSource; 138 bool gravityClockwise; 139 bool gravityAnticlockwise; 140 bool gravityVisible; 141 bool wormholeVisible; 142 bool itemConcentratorVisible; 143 bool asteroidConcentratorVisible; 144 double wormholeStableTicks; 145 char *defaultsFileName; 146 char *passwordFileName; 147 int nukeMinSmarts; 148 int nukeMinMines; 149 double nukeClusterDamage; 150 double nukeDebrisLife; 151 double mineFuseTicks; 152 double mineLife; 153 double minMineSpeed; 154 double missileLife; 155 double baseMineRange; 156 double mineShotDetonateDistance; 157 158 double shotKillScoreMult; 159 double torpedoKillScoreMult; 160 double smartKillScoreMult; 161 double heatKillScoreMult; 162 double clusterKillScoreMult; 163 double laserKillScoreMult; 164 double tankKillScoreMult; 165 double runoverKillScoreMult; 166 double ballKillScoreMult; 167 double explosionKillScoreMult; 168 double shoveKillScoreMult; 169 double crashScoreMult; 170 double mineScoreMult; 171 double selfKillScoreMult; 172 double selfDestructScoreMult; 173 double unownedKillScoreMult; 174 double cannonKillScoreMult; 175 double tagItKillScoreMult; 176 double tagKillItScoreMult; 177 bool zeroSumScoring; 178 179 double destroyItemInCollisionProb; 180 bool allowSmartMissiles; 181 bool allowHeatSeekers; 182 bool allowTorpedoes; 183 bool allowNukes; 184 bool allowClusters; 185 bool allowModifiers; 186 bool allowLaserModifiers; 187 bool allowShipShapes; 188 189 bool shieldedItemPickup; 190 bool shieldedMining; 191 bool laserIsStunGun; 192 bool targetKillTeam; 193 bool targetSync; 194 double targetDeadTicks; 195 bool reportToMetaServer; 196 int metaUpdateMaxSize; 197 bool searchDomainForXPilot; 198 char *denyHosts; 199 200 bool playersOnRadar; 201 bool missilesOnRadar; 202 bool minesOnRadar; 203 bool nukesOnRadar; 204 bool treasuresOnRadar; 205 bool asteroidsOnRadar; 206 bool identifyMines; 207 bool distinguishMissiles; 208 int maxMissilesPerPack; 209 int maxMinesPerPack; 210 bool targetTeamCollision; 211 bool treasureKillTeam; 212 bool captureTheFlag; 213 int specialBallTeam; 214 bool treasureCollisionDestroys; 215 bool treasureCollisionMayKill; 216 bool wreckageCollisionMayKill; 217 bool asteroidCollisionMayKill; 218 219 double ballConnectorSpringConstant; 220 double ballConnectorDamping; 221 double maxBallConnectorRatio; 222 double ballConnectorLength; 223 bool connectorIsString; 224 double ballRadius; 225 bool multipleConnectors; 226 227 double dropItemOnKillProb; 228 double detonateItemOnKillProb; 229 double movingItemProb; 230 double randomItemProb; 231 double rogueHeatProb; 232 double rogueMineProb; 233 double itemProbMult; 234 double cannonItemProbMult; 235 double asteroidItemProb; 236 int asteroidMaxItems; 237 double maxItemDensity; 238 double maxAsteroidDensity; 239 double itemConcentratorRadius; 240 double itemConcentratorProb; 241 double asteroidConcentratorRadius; 242 double asteroidConcentratorProb; 243 double gameDuration; 244 bool baselessPausing; 245 double pauseTax; 246 int pausedFPS; 247 int waitingFPS; 248 int deadFPS; 249 250 char *motdFileName; 251 char *scoreTableFileName; 252 char *adminMessageFileName; 253 int adminMessageFileSizeLimit; 254 char *rankFileName; 255 char *rankWebpageFileName; 256 char *rankWebpageCSS; 257 double frictionSetting; 258 double blockFriction; 259 bool blockFrictionVisible; 260 double coriolis; 261 double checkpointRadius; 262 int raceLaps; 263 bool lockOtherTeam; 264 bool loseItemDestroys; 265 int maxOffensiveItems; 266 int maxDefensiveItems; 267 268 int maxVisibleObject; 269 bool pLockServer; 270 bool sound; 271 int timerResolution; 272 273 int maxRoundTime; 274 int roundsToPlay; 275 276 bool useDebris; 277 bool useWreckage; 278 bool ignore20MaxFPS; 279 char *password; 280 281 char *robotUserName; 282 char *robotHostName; 283 284 char *tankUserName; 285 char *tankHostName; 286 double tankScoreDecrement; 287 288 bool selfImmunity; 289 290 char *defaultShipShape; 291 char *tankShipShape; 292 293 int clientPortStart; 294 int clientPortEnd; 295 296 int maxPauseTime; 297 int maxIdleTime; 298 int maxClientsPerIP; 299 300 int playerLimit; 301 int playerLimit_orig; 302 int recordMode; 303 int recordFlushInterval; 304 int constantScoring; 305 int eliminationRace; 306 char *dataURL; 307 char *recordFileName; 308 double gameSpeed; 309 bool ngControls; 310 double turnPushPersistence; 311 double turnGrip; 312 double thrustWidth; 313 double thrustMass; 314 double sparkSpeed; 315 double constantSpeed; 316 bool legacyMode; 317 bool ballStyles; 318 bool ignoreMaxFPS; 319 bool polygonMode; 320 bool fastAim; 321 bool teamcup; 322 char *teamcupName; 323 char *teamcupMailAddress; 324 char *teamcupScoreFileNamePrefix; 325 int teamcupMatchNumber; 326 327 double mainLoopTime; 328 int cellGetObjectsThreshold; 329 } options; 330 331 /* 332 * Prototypes for option.c 333 */ 334 void Options_parse(void); 335 void Options_free(void); 336 bool Convert_string_to_int(const char *value_str, int *int_ptr); 337 bool Convert_string_to_float(const char *value_str, double *float_ptr); 338 bool Convert_string_to_bool(const char *value_str, bool *bool_ptr); 339 void Convert_list_to_string(list_t list, char **string); 340 void Convert_string_to_list(const char *value, list_t *list_ptr); 341 342 #endif 343