57 ship->
mass += (i < 6) ? 200 : 100;
62 for (i = 0; i < ship->
fuel; i++) {
88 ship->
mass += 1600 * (habitation + life_support)
89 + 400 * (solar_panels + propulsion + fuel);
94 ship->
support_rate = life_support /
static_cast<double>(habitation);
96 if (life_support + habitation > 0) {
98 2.0 * solar_panels /
static_cast<double>(life_support + habitation);
100 if (fuel > 0 && propulsion > 0) {
112 / (200.0 *
MIN(propulsion, fuel) + 20.0);
128 if (!src || pplayer == src) {
129 struct packet_spaceship_info info;
133 info.sship_state = ship->
state;
137 info.fuel = ship->
fuel;
144 info.mass = ship->
mass;
151 lsend_packet_spaceship_info(dest, &info);
167 _(
"You need to have a capital in order to launch "
173 _(
"Your spaceship is already launched!"));
178 _(
"Your spaceship can't be launched yet!"));
187 _(
"The %s have launched a spaceship! "
188 "It is estimated to arrive at Alpha Centauri in %s."),
212 if (from == ACT_REQ_PLAYER) {
214 _(
"Spaceship action received,"
215 " but you don't have a spaceship!"));
222 if (from == ACT_REQ_PLAYER) {
224 _(
"You can't modify your spaceship after launch!"));
236 if (from == ACT_REQ_PLAYER) {
238 _(
"You don't have any unplaced Space Structurals!"));
245 if (from == ACT_REQ_PLAYER) {
247 _(
"That Space Structural would not be connected!"));
260 if (ship->
fuel != num - 1) {
264 if (from == ACT_REQ_PLAYER) {
266 _(
"You don't have any unplaced Space Components!"));
272 if (from == ACT_REQ_PLAYER) {
274 _(
"Your spaceship already has"
275 " the maximum number of Fuel Components!"));
292 if (from == ACT_REQ_PLAYER) {
294 _(
"You don't have any unplaced"
295 " Space Components!"));
301 if (from == ACT_REQ_PLAYER) {
303 _(
"Your spaceship already has the"
304 " maximum number of Propulsion Components!"));
322 if (from == ACT_REQ_PLAYER) {
324 _(
"You don't have any unplaced Space Modules!"));
330 if (from == ACT_REQ_PLAYER) {
332 _(
"Your spaceship already has the"
333 " maximum number of Habitation Modules!"));
351 if (from == ACT_REQ_PLAYER) {
353 _(
"You don't have any unplaced Space Modules!"));
359 if (from == ACT_REQ_PLAYER) {
361 _(
"Your spaceship already has the"
362 " maximum number of Life Support Modules!"));
380 if (from == ACT_REQ_PLAYER) {
382 _(
"You don't have any unplaced Space Modules!"));
388 if (from == ACT_REQ_PLAYER) {
390 _(
"Your spaceship already has the"
391 " maximum number of Solar Panel Modules!"));
403 qCritical(
"Received unknown spaceship place type %d from %s", type,
414 _(
"The %s spaceship has arrived at Alpha Centauri."),
425 _(
"Without guidance from the capital, the %s "
426 "spaceship is lost!"),
460 result[n++] = pplayer;
468 for (i = 1; i < n; i++) {
474 struct player *tmp = result[j];
475 result[j] = result[j - 1];
bool BV_ISSET(const BV &bv, int bit)
const char * textyear(int year)
Produce a statically allocated textual representation of the given year.
@ SSHIP_PLACE_LIFE_SUPPORT
@ SSHIP_PLACE_SOLAR_PANELS
const struct ft_color ftc_server
#define fc_assert_ret(condition)
const char * nation_plural_for_player(const struct player *pplayer)
Return the (translated) plural noun of the given nation of a player.
const char * nation_adjective_for_player(const struct player *pplayer)
Return the (translated) adjective for the given nation of a player.
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
Similar to notify_conn_packet (see also), but takes player as "destination".
int player_number(const struct player *pplayer)
Return the player index/number/id.
struct city * player_primary_capital(const struct player *pplayer)
Locate the player's primary capital city, (nullptr Otherwise)
const char * player_name(const struct player *pplayer)
Return the leader name of the player.
#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)
Rank launched player spaceships in order of arrival.
void spaceship_lost(struct player *pplayer)
Handle spaceship loss.
bool do_spaceship_place(struct player *pplayer, enum action_requester from, enum spaceship_place_type type, int num)
Place a spaceship part.
double spaceship_arrival(const struct player *pplayer)
Return arrival year of player's spaceship (fractional, as one spaceship may arrive before another in ...
void spaceship_calc_derived(struct player_spaceship *ship)
Calculate and fill in the derived quantities about the spaceship.
void send_spaceship_info(struct player *src, struct conn_list *dest)
Send details of src's spaceship (or spaceships of all players if src is nullptr) to specified destina...
void handle_spaceship_place(struct player *pplayer, enum spaceship_place_type type, int num)
Handle spaceship part placement request.
void handle_spaceship_launch(struct player *pplayer)
Handle spaceship launch request.
void spaceship_arrived(struct player *pplayer)
Handle spaceship arrival.
int num_spaceship_structurals_placed(const struct player_spaceship *ship)
Count the number of structurals placed; that is, in ship->structure[].
void spaceship_init(struct player_spaceship *ship)
Initialize spaceship struct; could also be used to "cancel" a spaceship (eg, if/when capital-capture ...
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 civ_game::@28::@32 server
struct conn_list * est_connections
struct packet_game_info info
bv_spaceship_structure structure
enum spaceship_state state
struct player_spaceship spaceship