Proper Subversion configuration.
[newkind] / elite.c
CommitLineData
84bbd123 1/*
2 * Elite - The New Kind.
3 *
4 * Reverse engineered from the BBC disk version of Elite.
5 * Additional material by C.J.Pinder.
6 *
7 * The original Elite code is (C) I.Bell & D.Braben 1984.
8 * This version re-engineered in C by C.J.Pinder 1999-2001.
9 *
10 * email: <christian@newkind.co.uk>
11 *
12 *
13 */
14
15#include <stdlib.h>
16
17#include "config.h"
18#include "elite.h"
19#include "vector.h"
20#include "planet.h"
21#include "shipdata.h"
22
23
24struct galaxy_seed docked_planet;
25
26struct galaxy_seed hyperspace_planet;
27
28struct planet_data current_planet_data;
29
30int curr_galaxy_num = 1;
31int curr_fuel = 70;
32int carry_flag = 0;
33int current_screen = 0;
34int witchspace;
35
36int wireframe = 0;
37int anti_alias_gfx = 0;
38int hoopy_casinos = 0;
39int speed_cap = 75;
40int instant_dock = 0;
41
42
43char scanner_filename[256];
44int scanner_cx;
45int scanner_cy;
46int compass_centre_x;
47int compass_centre_y;
48
49int planet_render_style = 0;
50
51int game_over;
52int docked;
53int finish;
54int flight_speed;
55int flight_roll;
56int flight_climb;
57int front_shield;
58int aft_shield;
59int energy;
60int laser_temp;
61int detonate_bomb;
62int auto_pilot;
1a8abebd 63int prefer_window;
64int condition_x, condition_y, condition_r;
65int zoom_x, zoom_y;
84bbd123 66
1a8abebd 67int condition = COND_DOCKED;
84bbd123 68
69struct commander saved_cmdr =
70{
71 "JAMESON", /* Name */
72 0, /* Mission Number */
73 0x14,0xAD, /* Ship X,Y */
74 {0x4a, 0x5a, 0x48, 0x02, 0x53, 0xb7}, /* Galaxy Seed */
75 1000, /* Credits * 10 */
76 70, /* Fuel * 10 */
77 0,
78 0, /* Galaxy - 1 */
79 PULSE_LASER, /* Front Laser */
80 0, /* Rear Laser */
81 0, /* Left Laser */
82 0, /* Right Laser */
83 0, 0,
84 20, /* Cargo Capacity */
85 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, /* Current Cargo */
86 0, /* ECM */
87 0, /* Fuel Scoop */
88 0, /* Energy Bomb */
89 0, /* Energy Unit */
90 0, /* Docking Computer */
91 0, /* Galactic H'Drive */
92 0, /* Escape Pod */
93 0,0,0,0,
94 3, /* No. of Missiles */
95 0, /* Legal Status */
96 {0x10, 0x0F, 0x11, 0x00, 0x03, 0x1C, /* Station Stock */
97 0x0E, 0x00, 0x00, 0x0A, 0x00, 0x11,
98 0x3A, 0x07, 0x09, 0x08, 0x00},
99 0, /* Fluctuation */
100 0, /* Score */
101 0x80 /* Saved */
102};
103
104struct commander cmdr;
105
106struct player_ship myship;
107
108
109struct ship_data *ship_list[NO_OF_SHIPS + 1] =
110{
111 NULL,
112 &missile_data,
113 &coriolis_data,
114 &esccaps_data,
115 &alloy_data,
116 &cargo_data,
117 &boulder_data,
118 &asteroid_data,
119 &rock_data,
120 &orbit_data,
121 &transp_data,
122 &cobra3a_data,
123 &pythona_data,
124 &boa_data,
125 &anacnda_data,
126 &hermit_data,
127 &viper_data,
128 &sidewnd_data,
129 &mamba_data,
130 &krait_data,
131 &adder_data,
132 &gecko_data,
133 &cobra1_data,
134 &worm_data,
135 &cobra3b_data,
136 &asp2_data,
137 &pythonb_data,
138 &ferdlce_data,
139 &moray_data,
140 &thargoid_data,
141 &thargon_data,
142 &constrct_data,
143 &cougar_data,
144 &dodec_data
145};
146
147
148
149void restore_saved_commander (void)
150{
151 cmdr = saved_cmdr;
152
153 docked_planet = find_planet (cmdr.ship_x, cmdr.ship_y);
154 hyperspace_planet = docked_planet;
155
156 generate_planet_data (&current_planet_data, docked_planet);
157 generate_stock_market ();
158 set_stock_quantities (cmdr.station_stock);
159}
160