54#undef TECH_UPKEEP_DEBUGGING
75 * penalty_percent) / 100;
90 if (originating_plr) {
98 if (member != originating_plr) {
118 _(
"The %s have researched %s."),
145 struct effect_list *plist = effect_list_new();
149 const char *advance_name;
158 effect_list_destroy(plist);
178 if (mod <= ++num_teams) {
179 if (0 ==
fc_rand(++num_techs)) {
190 effect_list_destroy(plist);
203 Q_(
"?fromeffect:%s acquired from %s!"),
209 Q_(
"?fromeffect:%s acquired from %s's %s!"),
216 Q_(
"?fromeffect:The %s have acquired %s from %s."),
221 effect_list_destroy(plist);
274 const struct conn_list *dest)
278 const struct player *pplayer;
287 restricted_info = full_info;
294 if (NULL != pplayer) {
300 bool embassy =
FALSE;
315 }
else if (pconn->observer) {
328 bool was_discovery,
bool saving_bulbs)
332 bool was_first =
FALSE;
333 bool bonus_tech_hack =
FALSE;
335 const char *advance_name;
341#ifndef FREECIV_NDEBUG
352 if (was_first && vap) {
356 if (pobs->source.kind == VUT_ADVANCE
357 && pobs->source.value.advance == vap
358 && pobs->range >= REQ_RANGE_WORLD
364 _(
"Discovery of %s OBSOLETES %s in %s!"),
377 bonus_tech_hack =
TRUE;
459 _(
"Discovery of %s makes the government form %s"
460 " available. You may want to start a revolution."),
480 if (0 < had_embassies[i]
484 if (aplayer != pother_player) {
492 if (tech_found == presearch->
tech_goal) {
505 _(
"Learned %s. Our scientists focus on %s; "
521 bool ai_found =
FALSE;
526 if (
is_ai(aplayer)) {
540 if (
is_ai(aplayer)) {
549 _(
"Learned %s. Scientists "
550 "do not know what to research next."),
554 _(
"Learned %s. Scientists choose to research %s."),
572 if (bonus_tech_hack) {
575 const char *radv_name;
585 && additional_tech !=
A_UNSET) {
589 }
else if (additional_tech !=
A_UNSET) {
593 _(
"Great scientists from all the "
594 "world join your civilization: you learn "
595 "%s immediately."), radv_name);
599 _(
"%s acquire %s as a result of learning %s."),
600 research_name, radv_name, advance_name);
693 _(
"Insufficient science output. We lost %s."),
717 bv_techs eligible_techs;
728 BV_CLR(eligible_techs, i);
737 BV_CLR(eligible_techs, root);
746 BV_CLR(eligible_techs, prereq);
751 BV_CLR(eligible_techs, prereq);
762 chosen =
fc_rand(eligible) + 1;
774 fc_assert_msg(chosen == 0,
"internal error (eligible=%d, chosen=%d)",
815 _(
"The %s have lost %s."),
827 _(
"The %s have lost %s."),
849 _(
"The required technology for our government '%s' "
850 "was lost. The citizens have started a "
851 "revolution into '%s'."),
857 }
else if (NULL != pplayer->target_government
859 pplayer->target_government)) {
865 _(
"The required technology for our new government "
866 "'%s' was lost. The citizens chose '%s' as new "
867 "target government."),
870 pplayer->target_government = pgov;
881 if (pcity->production.kind == VUT_UTYPE
885 _(
"%s can't build %s. The required technology was "
893 if (pcity->production.kind == VUT_IMPROVEMENT
895 pcity->production.value.building)) {
898 _(
"%s can't build %s. The required technology was "
902 (pcity->production.value.building));
925 if (
fc_rand(++num_techs) == 0) {
938 int cheapest_cost = -1;
939 int cheapest_amount = 0;
946 if (
cost < cheapest_cost || cheapest_cost == -1) {
947 cheapest_cost =
cost;
950 }
else if (
cost == cheapest_cost &&
fc_rand(++cheapest_amount) == 0) {
1063 _(
"Technology goal is %s."),
1078#ifdef TECH_UPKEEP_DEBUGGING
1082 bool global_state[
A_LAST];
1095 log_debug(
"[research %d] %-25s (ID: %3d) cost: %6d - reachable: %-3s "
1124 log_debug(
"[player %d] researched: %-25s (ID: %4d) techs: %3d "
1196 for (i = 0; i < num_random_techs; i++) {
1211 struct research *presearch, *vresearch;
1213 const char *advance_name;
1261#ifndef FREECIV_NDEBUG
1268 stolen_tech = preferred;
1274 _(
"You steal %s from the %s."),
1278 _(
"The %s stole %s from the %s and shared it with you."),
1284 _(
"The %s stole %s from you!"),
1289 _(
"The %s have stolen %s from the %s."),
1397 _(
"Too bad! You made a mistake transferring the tech %s and "
1401 _(
"Too bad! The %s made a mistake transferring the tech "
1416 bool donor_can_lose =
TRUE;
1426 donor_can_lose =
FALSE;
1443 _(
"Too bad! You made a mistake transferring the tech %s and "
1447 _(
"Too bad! The %s made a mistake transferring the tech "
1448 "%s and didn't get it."),
void astr_free(struct astring *astr)
void astr_init(struct astring *astr)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
#define BV_ISSET(bv, bit)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_list_iterate_end
void remove_obsolete_buildings(struct player *pplayer)
void choose_build_target(struct player *pplayer, struct city *pcity)
bool city_refresh(struct city *pcity)
struct player * conn_get_player(const struct connection *pconn)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
struct effect_list * effects[EFT_COUNT]
int get_player_bonus_effects(struct effect_list *plist, const struct player *pplayer, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
void get_effect_list_req_text(const struct effect_list *plist, struct astring *astr)
#define MAX_NUM_TECH_LIST
const struct ft_color ftc_server
const char * city_link(const struct city *pcity)
void send_game_info(struct conn_list *dest)
const char * government_name_translation(const struct government *pgovern)
Government_type_id government_count(void)
struct government * government_of_player(const struct player *pplayer)
bool can_change_to_government(struct player *pplayer, const struct government *gov)
Government_type_id government_number(const struct government *pgovern)
Government_type_id government_index(const struct government *pgovern)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
void handle_player_change_government(struct player *pplayer, Government_type_id government)
bool is_great_wonder(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
struct city * city_from_great_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define log_debug(message,...)
#define whole_map_iterate(_map, _tile)
#define whole_map_iterate_end
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
bool update_player_tile_knowledge(struct player *pplayer, struct tile *ptile)
void upgrade_all_city_extras(struct player *pplayer, bool discovery)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
struct nation_type * nation_of_player(const struct player *pplayer)
const char * nation_plural_for_player(const struct player *pplayer)
void notify_research(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void notify_research_embassies(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
int send_packet_unknown_research(struct connection *pc, const struct packet_unknown_research *packet)
int send_packet_research_info(struct connection *pc, const struct packet_research_info *packet)
int player_slot_count(void)
const char * player_name(const struct player *pplayer)
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
int player_index(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
void send_player_all_c(struct player *src, struct conn_list *dest)
void send_player_info_c(struct player *src, struct conn_list *dest)
#define shuffled_players_iterate_end
#define shuffled_players_iterate(NAME_pplayer)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
bool research_invention_reachable(const struct research *presearch, const Tech_type_id tech)
enum tech_state research_invention_set(struct research *presearch, Tech_type_id tech, enum tech_state value)
const char * research_advance_rule_name(const struct research *presearch, Tech_type_id tech)
int player_tech_upkeep(const struct player *pplayer)
int research_number(const struct research *presearch)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
int research_total_bulbs_required(const struct research *presearch, Tech_type_id tech, bool loss_value)
const char * research_rule_name(const struct research *presearch)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
Tech_type_id research_goal_step(const struct research *presearch, Tech_type_id goal)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
void research_update(struct research *presearch)
int research_pretty_name(const struct research *presearch, char *buf, size_t buf_len)
#define research_players_iterate(_presearch, _pplayer)
#define researches_iterate(_presearch)
#define research_players_iterate_end
#define researches_iterate_end
void script_server_signal_emit(const char *signal_name,...)
struct civ_game::@29 rgame
struct civ_game::@30::@34 server
struct conn_list * est_connections
int global_init_techs[MAX_NUM_TECH_LIST]
struct packet_game_info info
int init_techs[MAX_NUM_TECH_LIST]
bool tech_steal_allow_holes
bool tech_trade_loss_allow_holes
enum free_tech_method free_tech_method
bool global_advances[A_LAST]
bool tech_loss_allow_holes
bool tech_parasite_allow_holes
char inventions[A_LAST+1]
struct player::@69::@71 server
int bulbs_researched_saved
int bulbs_researching_saved
struct research::research_invention inventions[A_ARRAY_SIZE]
Tech_type_id researching_saved
struct advance * advance_by_number(const Tech_type_id atype)
bool is_future_tech(Tech_type_id tech)
bool advance_has_flag(Tech_type_id tech, enum tech_flag_id flag)
struct advance * valid_advance_by_number(const Tech_type_id id)
Tech_type_id advance_required(const Tech_type_id tech, enum tech_req require)
const char * advance_rule_name(const struct advance *padvance)
#define advance_index_iterate_end
static Tech_type_id advance_count(void)
#define advance_index_iterate(_start, _index)
const char * utype_name_translation(const struct unit_type *punittype)