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