61 ship->support_rate =
ship->energy_rate =
62 ship->success_rate =
ship->travel_time = 0.0;
66 ship->mass += (
i < 6) ? 200 : 100;
71 for (
i = 0;
i <
ship->fuel;
i++) {
76 for (
i = 0;
i <
ship->propulsion;
i++) {
81 for (
i = 0;
i <
ship->habitation;
i++) {
86 for (
i = 0;
i <
ship->life_support;
i++) {
91 for (
i = 0;
i <
ship->solar_panels;
i++) {
97 ship->mass += 1600 * (habitation + life_support)
98 + 400 * (solar_panels + propulsion + fuel);
100 ship->population = habitation * 10000;
102 if (habitation > 0) {
103 ship->support_rate = life_support / (
double) habitation;
105 if (life_support + habitation > 0) {
106 ship->energy_rate = 2.0 * solar_panels / (
double)(life_support+habitation);
108 if (fuel>0 && propulsion>0) {
120 / 100 / (200.0 *
MIN(propulsion,fuel) + 20.0);
136 if (!src || pplayer == src) {
174 _(
"You need to have a capital in order to launch "
180 _(
"Your spaceship is already launched!"));
184 ||
ship->success_rate == 0.0) {
186 _(
"Your spaceship can't be launched yet!"));
195 _(
"The %s have launched a spaceship! "
196 "It is estimated to arrive at Alpha Centauri in %s."),
223 _(
"Spaceship action received,"
224 " but you don't have a spaceship!"));
233 _(
"You can't modify your spaceship after launch!"));
247 _(
"You don't have any unplaced Space Structurals!"));
256 _(
"That Space Structural would not be connected!"));
269 if (
ship->fuel != num - 1) {
272 if (
ship->fuel +
ship->propulsion >=
ship->components) {
275 _(
"You don't have any unplaced Space Components!"));
283 _(
"Your spaceship already has"
284 " the maximum number of Fuel Components!"));
297 if (
ship->propulsion != num - 1) {
300 if (
ship->fuel +
ship->propulsion >=
ship->components) {
303 _(
"You don't have any unplaced"
304 " Space Components!"));
312 _(
"Your spaceship already has the"
313 " maximum number of Propulsion Components!"));
326 if (
ship->habitation != num - 1) {
329 if (
ship->habitation +
ship->life_support +
ship->solar_panels
333 _(
"You don't have any unplaced Space Modules!"));
341 _(
"Your spaceship already has the"
342 " maximum number of Habitation Modules!"));
355 if (
ship->life_support != num - 1) {
358 if (
ship->habitation +
ship->life_support +
ship->solar_panels
362 _(
"You don't have any unplaced Space Modules!"));
370 _(
"Your spaceship already has the"
371 " maximum number of Life Support Modules!"));
377 ship->life_support++;
384 if (
ship->solar_panels != num - 1) {
387 if (
ship->habitation +
ship->life_support +
ship->solar_panels
391 _(
"You don't have any unplaced Space Modules!"));
399 _(
"Your spaceship already has the"
400 " maximum number of Solar Panel Modules!"));
406 ship->solar_panels++;
412 log_error(
"Received unknown spaceship place type %d from %s",
423 _(
"The %s spaceship has arrived at Alpha Centauri."),
434 _(
"Without guidance from the capital, the %s "
435 "spaceship is lost!"),
468 result[
n++] = pplayer;
475 for (
i = 1;
i <
n;
i++) {
482 result[j] = result[j-1];
#define BV_ISSET(bv, bit)
const char * textyear(int year)
@ SSHIP_PLACE_LIFE_SUPPORT
@ SSHIP_PLACE_SOLAR_PANELS
const struct ft_color ftc_server
#define fc_assert_ret(condition)
#define log_error(message,...)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_plural_for_player(const struct player *pplayer)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void lsend_packet_spaceship_info(struct conn_list *dest, const struct packet_spaceship_info *packet)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
struct city * player_primary_capital(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
#define shuffled_players_iterate_end
#define shuffled_players_iterate(NAME_pplayer)
int rank_spaceship_arrival(struct player **result)
void spaceship_lost(struct player *pplayer)
bool do_spaceship_place(struct player *pplayer, enum action_requester from, enum spaceship_place_type type, int num)
double spaceship_arrival(const struct player *pplayer)
void spaceship_calc_derived(struct player_spaceship *ship)
void send_spaceship_info(struct player *src, struct conn_list *dest)
void handle_spaceship_place(struct player *pplayer, enum spaceship_place_type type, int num)
void handle_spaceship_launch(struct player *pplayer)
void spaceship_arrived(struct player *pplayer)
int num_spaceship_structurals_placed(const struct player_spaceship *ship)
void spaceship_init(struct player_spaceship *ship)
const struct sship_part_info structurals_info[NUM_SS_STRUCTURALS]
const struct sship_part_info modules_info[NUM_SS_MODULES]
const struct sship_part_info components_info[NUM_SS_COMPONENTS]
#define NUM_SS_COMPONENTS
#define NUM_SS_STRUCTURALS
struct conn_list * est_connections
struct packet_game_info info
struct civ_game::@32::@36 server
bv_spaceship_structure structure
enum spaceship_state state
struct player_spaceship spaceship