51 const struct unit *pmodunit,
61 int activity_total[ACTIVITY_LAST];
62 int activity_units[ACTIVITY_LAST];
71 if (
punit == pmodunit) {
138 int units_total = t->extra_units[ei][act];
140 if (units_total > 0) {
144 turns = 1 + (remains + units_total - 1) / units_total;
158 int units_total = t->rmextra_units[ei][act];
160 if (units_total > 0) {
164 turns = 1 + (remains + units_total - 1) / units_total;
176 int units_total = t->activity_units[act];
178 if (units_total > 0) {
181 turns = 1 + (remains + units_total - 1) / units_total;
206 const struct unit *pmodunit)
239 int num_activities = 0;
252 if (num_activities > 0) {
261 enum extra_rmcause rmcause =
ERM_NONE;
264 case ACTIVITY_PILLAGE:
265 rmcause = ERM_PILLAGE;
267 case ACTIVITY_POLLUTION:
268 rmcause = ERM_CLEANPOLLUTION;
270 case ACTIVITY_FALLOUT:
271 rmcause = ERM_CLEANFALLOUT;
283 if (num_activities > 0) {
287 rmcause == ERM_PILLAGE ?
_(
"Pillage %s(%d)")
296 if (num_activities > 0) {
void astr_clear(struct astring *astr)
void astr_add(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
int turns_to_activity_done(const struct tile *ptile, Activity_type_id act, const struct extra_type *tgt, const struct unit *pmodunit)
static void calc_activity(struct actcalc *calc, const struct tile *ptile, const struct unit *pmodunit, Activity_type_id new_act, const struct extra_type *new_tgt)
const char * concat_tile_activity_text(struct tile *ptile)
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 * punit
enum unit_activity Activity_type_id
#define fc_assert(condition)
#define fc_calloc(n, esz)
int rmextra_turns[MAX_EXTRA_TYPES][ACTIVITY_LAST]
int activity_turns[ACTIVITY_LAST]
int extra_turns[MAX_EXTRA_TYPES][ACTIVITY_LAST]
enum unit_activity activity
struct extra_type * changed_from_target
struct extra_type * activity_target
enum unit_activity changed_from
int tile_activity_time(enum unit_activity activity, const struct tile *ptile, const struct extra_type *tgt)
bool is_tile_activity(enum unit_activity activity)
int get_activity_rate_this_turn(const struct unit *punit)
int get_activity_rate(const struct unit *punit)
bool is_build_activity(enum unit_activity activity)
const char * get_activity_text(enum unit_activity activity)
bool is_clean_activity(enum unit_activity activity)
#define activity_type_iterate(_act_)
#define activity_type_iterate_end
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end