124
129
struct packet_spaceship_info info;
125
130
struct player_spaceship *ship = &pplayer->spaceship;
127
info.player_num = pplayer->player_no;
132
info.player_num = player_number(pplayer);
128
133
info.sship_state = ship->state;
129
134
info.structurals = ship->structurals;
130
135
info.components = ship->components;
163
168
if (!find_palace(pplayer)) {
164
notify_player(pplayer, NULL, E_SPACESHIP,
169
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
165
170
_("You need to have a capital in order to launch "
169
174
if (ship->state >= SSHIP_LAUNCHED) {
170
notify_player(pplayer, NULL, E_SPACESHIP,
171
_("Your spaceship is already launched!"));
175
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
176
_("Your spaceship is already launched!"));
174
179
if (ship->state != SSHIP_STARTED
175
180
|| ship->success_rate == 0.0) {
176
notify_player(pplayer, NULL, E_SPACESHIP,
177
_("Your spaceship can't be launched yet!"));
181
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
182
_("Your spaceship can't be launched yet!"));
182
187
ship->launch_year = game.info.year;
183
188
arrival = ship->launch_year + (int) ship->travel_time;
185
notify_player(NULL, NULL, E_SPACESHIP,
186
_("The %s have launched a spaceship! "
187
"It is estimated to arrive on Alpha Centauri in %s."),
188
nation_plural_for_player(pplayer),
190
notify_player(NULL, NULL, E_SPACESHIP, ftc_server,
191
_("The %s have launched a spaceship! "
192
"It is estimated to arrive on Alpha Centauri in %s."),
193
nation_plural_for_player(pplayer),
191
196
send_spaceship_info(pplayer, NULL);
200
205
struct player_spaceship *ship = &pplayer->spaceship;
202
207
if (ship->state == SSHIP_NONE) {
203
notify_player(pplayer, NULL, E_SPACESHIP,
204
_("Spaceship action received,"
205
" but you don't have a spaceship!"));
208
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
209
_("Spaceship action received,"
210
" but you don't have a spaceship!"));
208
213
if (ship->state >= SSHIP_LAUNCHED) {
209
notify_player(pplayer, NULL, E_SPACESHIP,
210
_("You can't modify your spaceship after launch!"));
214
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
215
_("You can't modify your spaceship after launch!"));
213
218
if (type == SSHIP_PLACE_STRUCTURAL) {
217
222
if (num_spaceship_structurals_placed(ship) >= ship->structurals) {
218
notify_player(pplayer, NULL, E_SPACESHIP,
219
_("You don't have any unplaced Space Structurals!"));
223
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
224
_("You don't have any unplaced Space Structurals!"));
222
227
if (num!=0 && !ship->structure[structurals_info[num].required]) {
223
notify_player(pplayer, NULL, E_SPACESHIP,
224
_("That Space Structural"
225
" would not be connected!"));
228
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
229
_("That Space Structural would not be connected!"));
228
232
ship->structure[num] = TRUE;
237
241
if (ship->fuel + ship->propulsion >= ship->components) {
238
notify_player(pplayer, NULL, E_SPACESHIP,
239
_("You don't have any unplaced"
240
" Space Components!"));
242
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
243
_("You don't have any unplaced Space Components!"));
243
246
if (num > NUM_SS_COMPONENTS/2) {
244
notify_player(pplayer, NULL, E_SPACESHIP,
245
_("Your spaceship already has"
246
" the maximum number of Fuel Components!"));
247
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
248
_("Your spaceship already has"
249
" the maximum number of Fuel Components!"));
258
261
if (ship->fuel + ship->propulsion >= ship->components) {
259
notify_player(pplayer, NULL, E_SPACESHIP,
260
_("You don't have any unplaced"
261
" Space Components!"));
262
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
263
_("You don't have any unplaced"
264
" Space Components!"));
264
267
if (num > NUM_SS_COMPONENTS/2) {
265
notify_player(pplayer, NULL, E_SPACESHIP,
266
_("Your spaceship already has the"
267
" maximum number of Propulsion Components!"));
268
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
269
_("Your spaceship already has the"
270
" maximum number of Propulsion Components!"));
270
273
ship->propulsion++;
279
282
if (ship->habitation + ship->life_support + ship->solar_panels
281
notify_player(pplayer, NULL, E_SPACESHIP,
282
_("You don't have any unplaced"
284
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
285
_("You don't have any unplaced Space Modules!"));
286
if (num > NUM_SS_MODULES/3) {
287
notify_player(pplayer, NULL, E_SPACESHIP,
288
_("Your spaceship already has the"
289
" maximum number of Habitation Modules!"));
288
if (num > NUM_SS_MODULES / 3) {
289
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
290
_("Your spaceship already has the"
291
" maximum number of Habitation Modules!"));
292
294
ship->habitation++;
301
303
if (ship->habitation + ship->life_support + ship->solar_panels
303
notify_player(pplayer, NULL, E_SPACESHIP,
304
_("You don't have any unplaced"
305
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
306
_("You don't have any unplaced Space Modules!"));
308
if (num > NUM_SS_MODULES/3) {
309
notify_player(pplayer, NULL, E_SPACESHIP,
310
_("Your spaceship already has the"
311
" maximum number of Life Support Modules!"));
309
if (num > NUM_SS_MODULES / 3) {
310
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
311
_("Your spaceship already has the"
312
" maximum number of Life Support Modules!"));
314
315
ship->life_support++;
323
324
if (ship->habitation + ship->life_support + ship->solar_panels
325
notify_player(pplayer, NULL, E_SPACESHIP,
326
_("You don't have any unplaced"
326
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
327
_("You don't have any unplaced Space Modules!"));
330
if (num > NUM_SS_MODULES/3) {
331
notify_player(pplayer, NULL, E_SPACESHIP,
332
_("Your spaceship already has the"
333
" maximum number of Solar Panel Modules!"));
330
if (num > NUM_SS_MODULES / 3) {
331
notify_player(pplayer, NULL, E_SPACESHIP, ftc_server,
332
_("Your spaceship already has the"
333
" maximum number of Solar Panel Modules!"));
336
336
ship->solar_panels++;
347
347
**************************************************************************/
348
348
void spaceship_lost(struct player *pplayer)
350
notify_player(NULL, NULL, E_SPACESHIP,
351
_("Without guidance from the capital, the %s "
352
"spaceship is lost!"),
353
nation_adjective_for_player(pplayer));
350
notify_player(NULL, NULL, E_SPACESHIP, ftc_server,
351
_("Without guidance from the capital, the %s "
352
"spaceship is lost!"),
353
nation_adjective_for_player(pplayer));
354
354
spaceship_init(&pplayer->spaceship);
355
355
send_spaceship_info(pplayer, NULL);