annotate src/pl_gen4.c @ 19:de685799a432

Made torps wobbly when going through nebulous terrain. Only happens if nebula_effect contains photon.
author darius
date Wed, 24 Dec 1997 12:40:04 +0000
parents aa38447a4b21
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
1 /*--------------------------------------------------------------------------
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
2 NETREK II -- Paradise
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
3
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
4 Permission to use, copy, modify, and distribute this software and its
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
5 documentation, or any derivative works thereof, for any NON-COMMERCIAL
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
6 purpose and without fee is hereby granted, provided that this copyright
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
7 notice appear in all copies. No representations are made about the
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
8 suitability of this software for any purpose. This software is provided
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
9 "as is" without express or implied warranty.
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
10
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
11 Xtrek Copyright 1986 Chris Guthrie
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
12 Netrek (Xtrek II) Copyright 1989 Kevin P. Smith
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
13 Scott Silvey
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
14 Paradise II (Netrek II) Copyright 1993 Larry Denys
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
15 Kurt Olsen
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
16 Brandon Gillespie
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
17 --------------------------------------------------------------------------*/
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
18 #include "config.h"
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
19 #include <math.h>
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
20 #include <memory.h>
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
21
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
22 #include "defs.h"
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
23 #include "struct.h"
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
24 #include "data.h"
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
25 #include "shmem.h"
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
26 #include "planets.h"
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
27
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
28 #if 0
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
29 #define SYSWIDTH (GWIDTH/5.75) /* width of a system */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
30 #endif
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
31
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
32 #define SYSTEMS 0 /* number of planetary systems */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
33
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
34 /* atmosphere chances form a cascade win rand()%100 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
35 #define PATMOS1 100 /* chance for normal atmosphere */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
36 #define PATMOS2 100 /* chance for thin atmosphere */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
37 #define PATMOS3 100 /* chance for slightly toxic stmos */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
38 #define PPOISON 100 /* chance for poison atmos */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
39
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
40 /* defines that deal with planets resources and types */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
41 #define NMETAL 8 /* number of metal deposits */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
42 #define NDILYTH 12 /* number of dilythium deposits */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
43 #define NARABLE 8 /* number of arable land planets */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
44
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
45 #define MINARMY 8 /* min numer of armies on a planet */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
46 #define MAXARMY 15 /* max number of armies on a planet */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
47
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
48 /* other defines */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
49 #define HOMEARMIES 30 /* number of armies on home planets */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
50 #define COLONYARMIES 10 /* number of armies for colony planet */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
51
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
52
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
53 /* defines dealing with growth timers */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
54 #define PLGFUEL configvals->plgrow.fuel /* time for growth of fuel
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
55 * depot */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
56 #define PLGAGRI configvals->plgrow.agri /* time for growth of agri */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
57 #define PLGREPAIR configvals->plgrow.repair /* time for growth of
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
58 * repair */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
59 #define PLGSHIP configvals->plgrow.shipyard /* time for growth of
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
60 * shipyard */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
61
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
62
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
63 /*-------------------------------INITBRONCO------------------------------*/
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
64 /*
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
65 * Initializes the planet array the way normaltrek did it -- not much
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
66 * variety, but some people dig playing chess from the same setup over and
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
67 * over again too. :)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
68 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
69 static void
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
70 initbronco()
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
71 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
72 int i, j;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
73
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
74 static struct planet pdata[MAXPLANETS] = {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
75 {0, (FED | PLHOME | PLCORE | PLFUEL | PLREPAIR | PLSHIPYARD | PLMETAL | PLARABLE | PLDILYTH),
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
76 FED, 20000, 80000, 0, 0, 0, "Earth", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
77 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
78 {1, FED | PLCORE, FED, 30000, 90000, 0, 0, 0, "Deneb", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
79 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
80 {2, FED | PLCORE, FED, 11000, 75000, 0, 0, 0, "Altair", 6,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
81 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
82 {3, FED | PLCORE, FED, 8000, 93000, 0, 0, 0, "Vega", 4,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
83 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
84 {4, FED, FED, 10000, 60000, 0, 0, 0, "Rigel", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
85 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
86 {5, FED, FED, 25000, 60000, 0, 0, 0, "Canopus", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
87 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
88 {6, FED, FED, 44000, 81000, 0, 0, 0, "Beta Crucis", 11,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
89 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
90 {7, FED, FED, 39000, 55000, 0, 0, 0, "Organia", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
91 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
92 {8, FED, FED, 45000, 66000, 0, 0, 0, "Ceti Alpha V", 12,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
93 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
94 {9, FED, FED, 32000, 74000, 0, 0, 0, "Alpha Centauri", 14,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
95 (ROM | KLI | ORI), 0, 0, 0, 30, 0, FED},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
96 {10, (ROM | PLHOME | PLCORE | PLFUEL | PLREPAIR | PLSHIPYARD | PLMETAL | PLARABLE | PLDILYTH),
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
97 ROM, 20000, 20000, 0, 0, 0, "Romulus", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
98 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
99 {11, ROM | PLCORE, ROM, 28000, 8000, 0, 0, 0, "Tauri", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
100 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
101 {12, ROM | PLCORE, ROM, 28000, 23000, 0, 0, 0, "Draconis", 8,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
102 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
103 {13, ROM | PLCORE, ROM, 4000, 12000, 0, 0, 0, "Aldeberan", 9,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
104 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
105 {14, ROM, ROM, 45000, 7000, 0, 0, 0, "Eridani", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
106 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
107 {15, ROM, ROM, 42000, 44000, 0, 0, 0, "Regulus", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
108 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
109 {16, ROM, ROM, 13000, 45000, 0, 0, 0, "Capella", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
110 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
111 {17, ROM, ROM, 40000, 25000, 0, 0, 0, "Sirius", 6,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
112 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
113 {18, ROM, ROM, 25000, 44000, 0, 0, 0, "Indi", 4,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
114 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
115 {19, ROM, ROM, 8000, 29000, 0, 0, 0, "Hydrae", 6,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
116 (FED | KLI | ORI), 0, 0, 0, 30, 0, ROM},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
117 {20, (KLI | PLHOME | PLCORE | PLFUEL | PLREPAIR | PLSHIPYARD | PLMETAL | PLARABLE | PLDILYTH),
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
118 KLI, 80000, 20000, 0, 0, 0, "Klingus", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
119 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
120 {21, KLI | PLCORE, KLI, 88000, 12000, 0, 0, 0, "Pollux", 6,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
121 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
122 {22, KLI | PLCORE, KLI, 69000, 31000, 0, 0, 0, "Scorpii", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
123 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
124 {23, KLI | PLCORE, KLI, 73000, 5000, 0, 0, 0, "Castor", 6,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
125 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
126 {24, KLI, KLI, 70000, 40000, 0, 0, 0, "Pleiades V", 10,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
127 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
128 {25, KLI, KLI, 60000, 10000, 0, 0, 0, "Andromeda", 9,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
129 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
130 {26, KLI, KLI, 54000, 40000, 0, 0, 0, "Lalande", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
131 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
132 {27, KLI, KLI, 90000, 37000, 0, 0, 0, "Lyrae", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
133 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
134 {28, KLI, KLI, 83000, 48000, 0, 0, 0, "Mira", 4,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
135 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
136 {29, KLI, KLI, 54000, 21000, 0, 0, 0, "Cygni", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
137 (FED | ROM | ORI), 0, 0, 0, 30, 0, KLI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
138 {30, (ORI | PLHOME | PLCORE | PLFUEL | PLREPAIR | PLSHIPYARD | PLMETAL | PLARABLE | PLDILYTH),
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
139 ORI, 80000, 80000, 0, 0, 0, "Orion", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
140 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
141 {31, ORI | PLCORE, ORI, 72000, 69000, 0, 0, 0, "Procyon", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
142 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
143 {32, ORI | PLCORE, ORI, 91000, 94000, 0, 0, 0, "Ursae Majoris", 13,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
144 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
145 {33, ORI | PLCORE, ORI, 85000, 70000, 0, 0, 0, "Antares", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
146 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
147 {34, ORI, ORI, 92000, 59000, 0, 0, 0, "Cassiopia", 9,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
148 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
149 {35, ORI, ORI, 65000, 55000, 0, 0, 0, "El Nath", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
150 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
151 {36, ORI, ORI, 52000, 60000, 0, 0, 0, "Spica", 5,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
152 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
153 {37, ORI, ORI, 64000, 80000, 0, 0, 0, "Polaris", 7,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
154 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
155 {38, ORI, ORI, 56000, 89000, 0, 0, 0, "Arcturus", 8,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
156 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI},
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
157 {39, ORI, ORI, 70000, 93000, 0, 0, 0, "Herculis", 8,
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
158 (FED | ROM | KLI), 0, 0, 0, 30, 0, ORI}
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
159 };
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
160 for (i = 0; i < NUMPLANETS; i++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
161 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
162 for (j = 0; j < MAXTEAM + 1; j++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
163 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
164 pdata[i].pl_tinfo[j].owner = pdata[i].pl_owner;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
165 pdata[i].pl_tinfo[j].armies = pdata[i].pl_armies;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
166 pdata[i].pl_tinfo[j].flags = pdata[i].pl_flags;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
167 pdata[i].pl_tinfo[j].timestamp = 0;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
168 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
169 pdata[i].pl_trevolt = 0;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
170 pdata[i].pl_next = 0;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
171 pdata[i].pl_prev = 0;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
172 pdata[i].pl_gridnum = 0;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
173 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
174 memcpy((char *) planets, (char *) pdata, MAXPLANETS * sizeof(struct planet));
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
175 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
176 /*-------------------------------GENRESOURCES----------------------------*/
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
177 /*
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
178 * This function goes through the planets structure and determines what kind
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
179 * of atmosphere and what kind of surface the planets have. It generates the
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
180 * stars that will be used as system centers ans then places atmospheres on
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
181 * the other planets. It then distributes the resources on the planet
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
182 * surfaces. This version's been bronco-ified. :)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
183 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
184
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
185 static void
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
186 genresources_bronco()
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
187 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
188 int i, j; /* looping vars */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
189 int t; /* temp var */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
190
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
191 for (i = SYSTEMS; i < NUMPLANETS; i++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
192 { /* generate atmospheres */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
193 t = lrand48() % 100; /* random # 0-99 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
194 if (t < PATMOS1) /* is it atmosphere type 1 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
195 planets[i].pl_flags |= PLATYPE1;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
196 else if (t < PATMOS2) /* is it atmosphere type 2 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
197 planets[i].pl_flags |= PLATYPE2;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
198 else if (t < PATMOS3) /* is it atmosphere type 3 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
199 planets[i].pl_flags |= PLATYPE3;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
200 else if (t < PPOISON) /* is it poison atmosphere */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
201 planets[i].pl_flags |= PLPOISON;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
202 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
203 for (i = 0; i < NMETAL; i++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
204 { /* place the metal deposits */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
205 t = lrand48() % ((NUMPLANETS - SYSTEMS) / 4) + SYSTEMS +
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
206 ((i / (NMETAL / 4)) * ((NUMPLANETS - SYSTEMS) / 4));
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
207 if (!(planets[t].pl_flags & PLMETAL & PLSURMASK))
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
208 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
209 planets[t].pl_flags |= PLMETAL; /* OR in the metal flag */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
210 planets[t].pl_flags |= PLREPAIR;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
211 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
212 else
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
213 i--;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
214 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
215 for (i = 0; i < NDILYTH; i++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
216 { /* place the crystals */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
217 t = lrand48() % ((NUMPLANETS - SYSTEMS) / 4) + SYSTEMS +
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
218 ((i / (NDILYTH / 4)) * ((NUMPLANETS - SYSTEMS) / 4));
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
219 if (!(planets[t].pl_flags & PLDILYTH & PLSURMASK))
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
220 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
221 planets[t].pl_flags |= PLDILYTH; /* OR in the dilyth flag */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
222 planets[t].pl_flags |= PLFUEL;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
223 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
224 else
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
225 i--;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
226 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
227 for (i = 0; i < NARABLE; i++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
228 { /* place the farms */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
229 t = lrand48() % ((NUMPLANETS - SYSTEMS) / 4) + SYSTEMS +
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
230 ((i / (NARABLE / 4)) * ((NUMPLANETS - SYSTEMS) / 4));
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
231 if (!(planets[t].pl_flags & PLARABLE & PLSURMASK) &&
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
232 !(planets[t].pl_flags & PLHOME))
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
233 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
234 planets[t].pl_flags |= PLARABLE | PLATYPE1; /* OR in the arable flag */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
235 planets[t].pl_flags |= PLAGRI;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
236 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
237 else
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
238 i--;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
239 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
240 for (i = 0; i < NUMPLANETS; i++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
241 for (j = 0; j < MAXTEAM + 1; j++)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
242 if (j == planets[i].pl_owner)
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
243 planets[i].pl_tinfo[j].flags = planets[i].pl_flags;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
244 }
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
245
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
246
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
247
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
248 /*
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
249 * Generate a complete galaxy. Uses ye old bronco planet setup.
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
250 */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
251
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
252 void
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
253 gen_galaxy_4()
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
254 {
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
255 GWIDTH = 100000;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
256 NUMPLANETS = 40;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
257 initbronco(); /* initialize planet structures */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
258 genresources_bronco(); /* place the resources */
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
259 return;
aa38447a4b21 First entry of Paradise Server 2.9 patch 10 Beta
darius
parents:
diff changeset
260 }