Freeciv-3.2
Loading...
Searching...
No Matches
culture.c
Go to the documentation of this file.
1/****************************************************************************
2 Freeciv - Copyright (C) 2004 - The Freeciv Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12****************************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* common */
19#include "city.h"
20#include "effects.h"
21#include "game.h"
22#include "player.h"
23
24#include "culture.h"
25
26/************************************************************************/
29int city_culture(const struct city *pcity)
30{
31 return pcity->history + get_city_bonus(pcity, EFT_PERFORMANCE);
32}
33
34/************************************************************************/
37int city_history_gain(const struct city *pcity)
38{
39 return get_city_bonus(pcity, EFT_HISTORY)
40 + pcity->history * game.info.history_interest_pml / 1000;
41}
42
43/************************************************************************/
46int player_culture(const struct player *plr)
47{
48 int culture = plr->history + get_player_bonus(plr, EFT_NATION_PERFORMANCE);
49
50 city_list_iterate(plr->cities, pcity) {
51 culture += city_culture(pcity);
53
54 return culture;
55}
56
57/************************************************************************/
61int nation_history_gain(const struct player *pplayer)
62{
64 + pplayer->history * game.info.history_interest_pml / 1000;
65}
#define city_list_iterate(citylist, pcity)
Definition city.h:508
#define city_list_iterate_end
Definition city.h:510
char * incite_cost
Definition comments.c:75
int city_culture(const struct city *pcity)
Definition culture.c:29
int player_culture(const struct player *plr)
Definition culture.c:46
int city_history_gain(const struct city *pcity)
Definition culture.c:37
int nation_history_gain(const struct player *pplayer)
Definition culture.c:61
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
Definition effects.c:846
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
Definition effects.c:828
struct civ_game game
Definition game.c:62
Definition city.h:320
int history
Definition city.h:410
struct packet_game_info info
Definition game.h:89
struct city_list * cities
Definition player.h:279
int history
Definition player.h:314