Freeciv21
Develop your civilization from humble roots to a global empire
extras.h
Go to the documentation of this file.
1
/*__ ___ ***************************************
2
/ \ / \ Copyright (c) 1996-2020 Freeciv21 and Freeciv
3
\_ \ / __/ contributors. This file is part of Freeciv21.
4
_\ \ / /__ Freeciv21 is free software: you can redistribute it
5
\___ \____/ __/ and/or modify it under the terms of the GNU General
6
\_ _/ Public License as published by the Free Software
7
| @ @ \_ Foundation, either version 3 of the License,
8
| or (at your option) any later version.
9
_/ /\ You should have received a copy of the GNU
10
/o) (o/\ \_ General Public License along with Freeciv21.
11
\_____/ / If not, see https://www.gnu.org/licenses/.
12
\____/ ********************************************************/
13
#pragma once
14
15
// common
16
#include "
fc_types.h
"
17
#include "
terrain.h
"
18
19
// Used in the network protocol.
20
#define SPECENUM_NAME extra_flag_id
21
// Tile with this extra is considered native for units in tile.
22
#define SPECENUM_VALUE0 EF_NATIVE_TILE
23
#define SPECENUM_VALUE0NAME N_("?extraflag:NativeTile"
)
24
// Refuel native units
25
#define SPECENUM_VALUE1 EF_REFUEL
26
#define SPECENUM_VALUE1NAME N_("?extraflag:Refuel"
)
27
#define SPECENUM_VALUE2 EF_TERR_CHANGE_REMOVES
28
#define SPECENUM_VALUE2NAME N_("?extraflag:TerrChangeRemoves"
)
29
// Extra will be built in cities automatically
30
#define SPECENUM_VALUE3 EF_AUTO_ON_CITY_CENTER
31
#define SPECENUM_VALUE3NAME N_("?extraflag:AutoOnCityCenter"
)
32
// Extra is always present in cities
33
#define SPECENUM_VALUE4 EF_ALWAYS_ON_CITY_CENTER
34
#define SPECENUM_VALUE4NAME N_("?extraflag:AlwaysOnCityCenter"
)
35
// Road style gfx from ocean extra connects to nearby land
36
#define SPECENUM_VALUE5 EF_CONNECT_LAND
37
#define SPECENUM_VALUE5NAME N_("?extraflag:ConnectLand"
)
38
// Counts towards Global Warming
39
#define SPECENUM_VALUE6 EF_GLOBAL_WARMING
40
#define SPECENUM_VALUE6NAME N_("?extraflag:GlobalWarming"
)
41
// Counts towards Nuclear Winter
42
#define SPECENUM_VALUE7 EF_NUCLEAR_WINTER
43
#define SPECENUM_VALUE7NAME N_("?extraflag:NuclearWinter"
)
44
// Owner's flag will be shown on the tile
45
#define SPECENUM_VALUE8 EF_SHOW_FLAG
46
#define SPECENUM_VALUE8NAME N_("?extraflag:ShowFlag"
)
47
/* Extra's defense bonus will be counted to
48
* separate "Natural" defense layer. */
49
#define SPECENUM_VALUE9 EF_NATURAL_DEFENSE
50
#define SPECENUM_VALUE9NAME N_("?extraflag:NaturalDefense"
)
51
// Units inside will not die all at once
52
#define SPECENUM_VALUE10 EF_NO_STACK_DEATH
53
#define SPECENUM_VALUE10NAME N_("NoStackDeath"
)
54
55
#define SPECENUM_VALUE11 EF_USER_FLAG_1
56
#define SPECENUM_VALUE12 EF_USER_FLAG_2
57
#define SPECENUM_VALUE13 EF_USER_FLAG_3
58
#define SPECENUM_VALUE14 EF_USER_FLAG_4
59
#define SPECENUM_VALUE15 EF_USER_FLAG_5
60
#define SPECENUM_VALUE16 EF_USER_FLAG_6
61
#define SPECENUM_VALUE17 EF_USER_FLAG_7
62
#define SPECENUM_VALUE18 EF_USER_FLAG_8
63
64
#define SPECENUM_COUNT EF_COUNT
65
#define SPECENUM_NAMEOVERRIDE
66
#define SPECENUM_BITVECTOR bv_extra_flags
67
#include "specenum_gen.h"
68
69
#define EF_LAST_USER_FLAG EF_USER_FLAG_8
70
#define MAX_NUM_USER_EXTRA_FLAGS (EF_LAST_USER_FLAG - EF_USER_FLAG_1 + 1)
71
72
#define EXTRA_NONE (-1)
73
74
struct
extra_type
{
75
int
id
;
76
struct
name_translation
name
;
77
bool
ruledit_disabled
;
78
enum
extra_category
category
;
79
uint16_t
causes
;
80
uint8_t
rmcauses
;
81
82
char
graphic_str
[
MAX_LEN_NAME
];
83
char
graphic_alt
[
MAX_LEN_NAME
];
84
char
activity_gfx
[
MAX_LEN_NAME
];
85
char
act_gfx_alt
[
MAX_LEN_NAME
];
86
char
act_gfx_alt2
[
MAX_LEN_NAME
];
87
char
rmact_gfx
[
MAX_LEN_NAME
];
88
char
rmact_gfx_alt
[
MAX_LEN_NAME
];
89
90
struct
requirement_vector
reqs
;
91
struct
requirement_vector
rmreqs
;
92
struct
requirement_vector
appearance_reqs
;
93
struct
requirement_vector
disappearance_reqs
;
94
95
/* 'buildable' is unclean. Clean solution would be to rely solely on
96
* extra_cause: if the extra cannot be built, it's not in the cause's list.
97
* But we currently rely on actually-not-buildable extras to be on the
98
* lists, for example for the editor to list non-buildable but
99
* editor-placeable extras. */
100
bool
buildable
;
101
bool
generated
;
102
int
build_time
;
103
int
build_time_factor
;
104
int
removal_time
;
105
int
removal_time_factor
;
106
107
int
defense_bonus
;
108
int
appearance_chance
;
109
int
disappearance_chance
;
110
111
enum
extra_unit_seen_type
eus
;
112
113
bv_unit_classes
native_to
;
114
115
bv_extra_flags
flags
;
116
bv_extras
conflicts
;
117
bv_extras
hidden_by
;
118
bv_extras
bridged_over
;
// Needs "bridge" to get built over these extras
119
120
Tech_type_id
visibility_req
;
121
122
/* Same information as in hidden_by, but iterating through this list is
123
* much faster than through all extra types to check which ones are hiding
124
* this one. Only used client side. */
125
struct
extra_type_list *
hiders
;
126
127
// Same information as bridged_over
128
struct
extra_type_list *
bridged
;
129
130
QVector<QString>
*
helptext
;
131
132
struct
{
133
int
special_idx
;
134
struct
base_type
*
base
;
135
struct
road_type
*
road
;
136
struct
resource_type
*
resource
;
137
}
data
;
138
};
139
140
// get 'struct extra_type_list' and related functions:
141
#define SPECLIST_TAG extra_type
142
#define SPECLIST_TYPE struct extra_type
143
#include "
speclist.h
"
144
145
#define extra_type_list_iterate(extralist, pextra) \
146
TYPED_LIST_ITERATE(struct extra_type, extralist, pextra)
147
#define extra_type_list_iterate_end LIST_ITERATE_END
148
149
#define extra_type_list_iterate_rev(extralist, pextra) \
150
TYPED_LIST_ITERATE_REV(struct extra_type, extralist, pextra)
151
#define extra_type_list_iterate_rev_end LIST_ITERATE_REV_END
152
153
void
extras_init
();
154
void
extras_free
();
155
156
int
extra_count
();
157
int
extra_number
(
const
struct
extra_type
*pextra);
158
struct
extra_type
*
extra_by_number
(
int
id
);
159
160
/* For optimization purposes (being able to have it as macro instead of
161
* function call) this is now same as extra_number(). extras.c does have
162
* semantically correct implementation too. */
163
#define extra_index(_e_) (_e_)->id
164
165
const
char
*
extra_name_translation
(
const
struct
extra_type
*pextra);
166
const
char
*
extra_rule_name
(
const
struct
extra_type
*pextra);
167
struct
extra_type
*
extra_type_by_rule_name
(
const
char
*
name
);
168
struct
extra_type
*
extra_type_by_translated_name
(
const
char
*
name
);
169
170
#define extra_base_get(_e_) (_e_)->data.base
171
#define extra_road_get(_e_) (_e_)->data.road
172
173
void
extra_to_caused_by_list
(
struct
extra_type
*pextra,
174
enum
extra_cause cause);
175
struct
extra_type_list *
extra_type_list_by_cause
(
enum
extra_cause cause);
176
struct
extra_type
*
rand_extra_for_tile
(
struct
tile
*ptile,
177
enum
extra_cause cause,
178
bool
generated
);
179
180
struct
extra_type_list *
extra_type_list_of_unit_hiders
();
181
182
#define is_extra_caused_by(e, c) (e->causes & (1 << c))
183
bool
is_extra_caused_by_worker_action
(
const
struct
extra_type
*pextra);
184
bool
is_extra_caused_by_action
(
const
struct
extra_type
*pextra,
185
const
struct
action
*paction);
186
187
void
extra_to_removed_by_list
(
struct
extra_type
*pextra,
188
enum
extra_rmcause rmcause);
189
struct
extra_type_list *
190
extra_type_list_by_rmcause
(
enum
extra_rmcause rmcause);
191
192
bool
is_extra_removed_by
(
const
struct
extra_type
*pextra,
193
enum
extra_rmcause rmcause);
194
bool
is_extra_removed_by_worker_action
(
const
struct
extra_type
*pextra);
195
bool
is_extra_removed_by_action
(
const
struct
extra_type
*pextra,
196
const
struct
action
*paction);
197
198
bool
is_extra_card_near
(
const
struct
tile
*ptile,
199
const
struct
extra_type
*pextra);
200
bool
is_extra_near_tile
(
const
struct
tile
*ptile,
201
const
struct
extra_type
*pextra);
202
203
bool
extra_can_be_built
(
const
struct
extra_type
*pextra,
204
const
struct
tile
*ptile);
205
bool
can_build_extra
(
const
struct
extra_type
*pextra,
206
const
struct
unit
*punit,
const
struct
tile
*ptile);
207
bool
can_build_extra_base
(
const
struct
extra_type
*pextra,
208
const
struct
player
*pplayer,
209
const
struct
tile
*ptile);
210
bool
player_can_build_extra
(
const
struct
extra_type
*pextra,
211
const
struct
player
*pplayer,
212
const
struct
tile
*ptile);
213
bool
player_can_place_extra
(
const
struct
extra_type
*pextra,
214
const
struct
player
*pplayer,
215
const
struct
tile
*ptile);
216
217
bool
can_remove_extra
(
const
struct
extra_type
*pextra,
218
const
struct
unit
*punit,
const
struct
tile
*ptile);
219
bool
player_can_remove_extra
(
const
struct
extra_type
*pextra,
220
const
struct
player
*pplayer,
221
const
struct
tile
*ptile);
222
223
bool
is_native_extra_to_uclass
(
const
struct
extra_type
*pextra,
224
const
struct
unit_class
*pclass);
225
bool
is_native_extra_to_utype
(
const
struct
extra_type
*pextra,
226
const
struct
unit_type
*punittype);
227
bool
is_native_tile_to_extra
(
const
struct
extra_type
*pextra,
228
const
struct
tile
*ptile);
229
bool
extra_conflicting_on_tile
(
const
struct
extra_type
*pextra,
230
const
struct
tile
*ptile);
231
232
bool
hut_on_tile
(
const
struct
tile
*ptile);
233
bool
unit_can_enter_hut
(
const
struct
unit
*punit,
const
struct
tile
*ptile);
234
bool
unit_can_displace_hut
(
const
struct
unit
*punit,
235
const
struct
tile
*ptile);
236
237
bool
extra_has_flag
(
const
struct
extra_type
*pextra,
238
enum
extra_flag_id flag);
239
bool
is_extra_flag_card_near
(
const
struct
tile
*ptile,
240
enum
extra_flag_id flag);
241
bool
is_extra_flag_near_tile
(
const
struct
tile
*ptile,
242
enum
extra_flag_id flag);
243
244
void
user_extra_flags_init
();
245
void
extra_flags_free
();
246
void
set_user_extra_flag_name
(
enum
extra_flag_id
id
,
const
char
*
name
,
247
const
char
*helptxt);
248
const
char
*
extra_flag_helptxt
(
enum
extra_flag_id
id
);
249
250
bool
extra_causes_env_upset
(
struct
extra_type
*pextra,
251
enum
environment_upset_type
upset);
252
253
bool
can_extras_coexist
(
const
struct
extra_type
*pextra1,
254
const
struct
extra_type
*pextra2);
255
256
bool
can_extra_appear
(
const
struct
extra_type
*pextra,
257
const
struct
tile
*ptile);
258
bool
can_extra_disappear
(
const
struct
extra_type
*pextra,
259
const
struct
tile
*ptile);
260
261
struct
extra_type
*
next_extra_for_tile
(
const
struct
tile
*ptile,
262
enum
extra_cause cause,
263
const
struct
player
*pplayer,
264
const
struct
unit
*punit);
265
struct
extra_type
*
prev_extra_in_tile
(
const
struct
tile
*ptile,
266
enum
extra_rmcause rmcause,
267
const
struct
player
*pplayer,
268
const
struct
unit
*punit);
269
270
enum
extra_cause
activity_to_extra_cause
(
enum
unit_activity act);
271
enum
extra_rmcause
activity_to_extra_rmcause
(
enum
unit_activity act);
272
273
struct
player
*
extra_owner
(
const
struct
tile
*ptile);
274
275
bool
player_knows_extra_exist
(
const
struct
player
*pplayer,
276
const
struct
extra_type
*pextra,
277
const
struct
tile
*ptile);
278
279
#define extra_type_iterate(_p) \
280
{ \
281
int _i_##_p; \
282
for (_i_##_p = 0; _i_##_p < game.control.num_extra_types; _i_##_p++) { \
283
struct extra_type *_p = extra_by_number(_i_##_p);
284
285
#define extra_type_iterate_end \
286
} \
287
}
288
289
#define extra_type_re_active_iterate(_p) \
290
extra_type_iterate(_p) \
291
{ \
292
if (!_p->ruledit_disabled) {
293
294
#define extra_type_re_active_iterate_end \
295
} \
296
} \
297
extra_type_iterate_end;
298
299
#define extra_type_by_cause_iterate(_cause, _extra) \
300
{ \
301
struct extra_type_list *_etl_##_extra = \
302
extra_type_list_by_cause(_cause); \
303
if (_etl_##_extra != nullptr) { \
304
extra_type_list_iterate(_etl_##_extra, _extra) \
305
{
306
307
#define extra_type_by_cause_iterate_end \
308
} \
309
extra_type_list_iterate_end \
310
} \
311
}
312
313
#define extra_type_by_cause_iterate_rev(_cause, _extra) \
314
{ \
315
struct extra_type_list *_etl_ = extra_type_list_by_cause(_cause); \
316
extra_type_list_iterate_rev(_etl_, _extra) \
317
{
318
319
#define extra_type_by_cause_iterate_rev_end \
320
} \
321
extra_type_list_iterate_rev_end \
322
}
323
324
#define extra_type_by_rmcause_iterate(_rmcause, _extra) \
325
{ \
326
struct extra_type_list *_etl_ = extra_type_list_by_rmcause(_rmcause); \
327
extra_type_list_iterate_rev(_etl_, _extra) \
328
{
329
330
#define extra_type_by_rmcause_iterate_end \
331
} \
332
extra_type_list_iterate_rev_end \
333
}
334
335
#define extra_deps_iterate(_reqs, _dep) \
336
{ \
337
requirement_vector_iterate(_reqs, preq) \
338
{ \
339
if (preq->source.kind == VUT_EXTRA && preq->present) { \
340
struct extra_type *_dep; \
341
_dep = preq->source.value.extra;
342
343
#define extra_deps_iterate_end \
344
} \
345
} \
346
requirement_vector_iterate_end; \
347
}
QVector< QString >
is_extra_removed_by_worker_action
bool is_extra_removed_by_worker_action(const struct extra_type *pextra)
Is the extra removed by some kind of worker action?
Definition:
extras.cpp:942
extra_type_list_of_unit_hiders
struct extra_type_list * extra_type_list_of_unit_hiders()
Returns extra types that hide units.
Definition:
extras.cpp:234
extra_causes_env_upset
bool extra_causes_env_upset(struct extra_type *pextra, enum environment_upset_type upset)
Does the extra count toward environment upset?
Definition:
extras.cpp:915
can_build_extra_base
bool can_build_extra_base(const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile)
Tells if player can build extra to tile with suitable unit.
Definition:
extras.cpp:371
unit_can_displace_hut
bool unit_can_displace_hut(const struct unit *punit, const struct tile *ptile)
Returns TRUE iff the unit can enter or frighten any hut on the tile.
Definition:
extras.cpp:665
player_can_place_extra
bool player_can_place_extra(const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile)
Tells if player can place extra on tile.
Definition:
extras.cpp:430
rand_extra_for_tile
struct extra_type * rand_extra_for_tile(struct tile *ptile, enum extra_cause cause, bool generated)
Return random extra type for given cause that is native to the tile.
Definition:
extras.cpp:242
extra_type_by_rule_name
struct extra_type * extra_type_by_rule_name(const char *name)
Returns extra type matching rule name or nullptr if there is no extra type with such name.
Definition:
extras.cpp:183
set_user_extra_flag_name
void set_user_extra_flag_name(enum extra_flag_id id, const char *name, const char *helptxt)
Sets user defined name for extra flag.
Definition:
extras.cpp:859
extra_by_number
struct extra_type * extra_by_number(int id)
Return extras type of given id.
Definition:
extras.cpp:154
unit_can_enter_hut
bool unit_can_enter_hut(const struct unit *punit, const struct tile *ptile)
Returns TRUE iff the unit can enter any hut on the tile.
Definition:
extras.cpp:643
is_extra_caused_by_worker_action
bool is_extra_caused_by_worker_action(const struct extra_type *pextra)
Is the extra caused by some kind of worker action?
Definition:
extras.cpp:931
can_extra_appear
bool can_extra_appear(const struct extra_type *pextra, const struct tile *ptile)
Are all the requirements for extra to appear on tile fulfilled.
Definition:
extras.cpp:1021
extra_owner
struct player * extra_owner(const struct tile *ptile)
Who owns extras on tile.
Definition:
extras.cpp:1013
extra_number
int extra_number(const struct extra_type *pextra)
Return the extra id.
Definition:
extras.cpp:132
is_extra_flag_card_near
bool is_extra_flag_card_near(const struct tile *ptile, enum extra_flag_id flag)
Returns TRUE iff any cardinally adjacent tile contains an extra with the given flag (does not check p...
Definition:
extras.cpp:788
extra_has_flag
bool extra_has_flag(const struct extra_type *pextra, enum extra_flag_id flag)
Check if extra has given flag.
Definition:
extras.cpp:779
is_native_tile_to_extra
bool is_native_tile_to_extra(const struct extra_type *pextra, const struct tile *ptile)
Is tile native to extra?
Definition:
extras.cpp:559
extra_flags_free
void extra_flags_free()
Frees the memory associated with all extra flags.
Definition:
extras.cpp:847
hut_on_tile
bool hut_on_tile(const struct tile *ptile)
Returns TRUE iff an extra on the tile is a hut (removed by entering).
Definition:
extras.cpp:626
extra_name_translation
const char * extra_name_translation(const struct extra_type *pextra)
Return the (translated) name of the extra type.
Definition:
extras.cpp:165
extra_to_caused_by_list
void extra_to_caused_by_list(struct extra_type *pextra, enum extra_cause cause)
Add extra type to list of extra caused by given cause.
Definition:
extras.cpp:274
player_can_build_extra
bool player_can_build_extra(const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile)
Tells if player can build extra to tile with suitable unit.
Definition:
extras.cpp:414
activity_to_extra_cause
enum extra_cause activity_to_extra_cause(enum unit_activity act)
What extra cause activity is considered to be?
Definition:
extras.cpp:973
extra_can_be_built
bool extra_can_be_built(const struct extra_type *pextra, const struct tile *ptile)
Tells if extra can build to tile if all other requirements are met.
Definition:
extras.cpp:352
is_native_extra_to_utype
bool is_native_extra_to_utype(const struct extra_type *pextra, const struct unit_type *punittype)
Is extra native to unit type?
Definition:
extras.cpp:770
extra_conflicting_on_tile
bool extra_conflicting_on_tile(const struct extra_type *pextra, const struct tile *ptile)
Returns TRUE iff an extra that conflicts with pextra exists at ptile.
Definition:
extras.cpp:607
extras_init
void extras_init()
Initialize extras structures.
Definition:
extras.cpp:36
extra_to_removed_by_list
void extra_to_removed_by_list(struct extra_type *pextra, enum extra_rmcause rmcause)
Add extra type to list of extra removed by given cause.
Definition:
extras.cpp:296
extra_type_by_translated_name
struct extra_type * extra_type_by_translated_name(const char *name)
Returns extra type matching the translated name, or nullptr if there is no extra type with that name.
Definition:
extras.cpp:208
prev_extra_in_tile
struct extra_type * prev_extra_in_tile(const struct tile *ptile, enum extra_rmcause rmcause, const struct player *pplayer, const struct unit *punit)
Returns prev extra by cause that unit or player can remove from tile.
Definition:
extras.cpp:732
can_extras_coexist
bool can_extras_coexist(const struct extra_type *pextra1, const struct extra_type *pextra2)
Can two extras coexist in same tile?
Definition:
extras.cpp:902
is_extra_near_tile
bool is_extra_near_tile(const struct tile *ptile, const struct extra_type *pextra)
Is there extra of the given type near tile? (Does not check ptile itself.)
Definition:
extras.cpp:335
extra_type_list_by_cause
struct extra_type_list * extra_type_list_by_cause(enum extra_cause cause)
Returns extra type for given cause.
Definition:
extras.cpp:224
can_remove_extra
bool can_remove_extra(const struct extra_type *pextra, const struct unit *punit, const struct tile *ptile)
Tells if unit can remove extra from tile.
Definition:
extras.cpp:543
extra_type_list_by_rmcause
struct extra_type_list * extra_type_list_by_rmcause(enum extra_rmcause rmcause)
Returns extra type for given rmcause.
Definition:
extras.cpp:286
is_extra_flag_near_tile
bool is_extra_flag_near_tile(const struct tile *ptile, enum extra_flag_id flag)
Returns TRUE iff any adjacent tile contains an extra with the given flag (does not check ptile itself...
Definition:
extras.cpp:812
is_extra_caused_by_action
bool is_extra_caused_by_action(const struct extra_type *pextra, const struct action *paction)
Is the extra caused by specific worker action?
Definition:
extras.cpp:953
extra_flag_helptxt
const char * extra_flag_helptxt(enum extra_flag_id id)
Return the (untranslated) help text of the user extra flag.
Definition:
extras.cpp:892
is_extra_removed_by
bool is_extra_removed_by(const struct extra_type *pextra, enum extra_rmcause rmcause)
Is given cause one of the removal causes for the given extra?
Definition:
extras.cpp:307
extras_free
void extras_free()
Free the memory associated with extras.
Definition:
extras.cpp:71
is_extra_removed_by_action
bool is_extra_removed_by_action(const struct extra_type *pextra, const struct action *paction)
Is the extra removed by specific worker action?
Definition:
extras.cpp:963
extra_count
int extra_count()
Return the number of extra_types.
Definition:
extras.cpp:127
activity_to_extra_rmcause
enum extra_rmcause activity_to_extra_rmcause(enum unit_activity act)
What extra rmcause activity is considered to be?
Definition:
extras.cpp:994
is_extra_card_near
bool is_extra_card_near(const struct tile *ptile, const struct extra_type *pextra)
Is there extra of the given type cardinally near tile? (Does not check ptile itself....
Definition:
extras.cpp:317
player_can_remove_extra
bool player_can_remove_extra(const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile)
Tells if player can remove extra from tile with suitable unit.
Definition:
extras.cpp:525
user_extra_flags_init
void user_extra_flags_init()
Initialize user extra flags.
Definition:
extras.cpp:835
extra_rule_name
const char * extra_rule_name(const struct extra_type *pextra)
Return the (untranslated) rule name of the extra type.
Definition:
extras.cpp:174
player_knows_extra_exist
bool player_knows_extra_exist(const struct player *pplayer, const struct extra_type *pextra, const struct tile *ptile)
Extra is not hidden from the user.
Definition:
extras.cpp:1051
can_build_extra
bool can_build_extra(const struct extra_type *pextra, const struct unit *punit, const struct tile *ptile)
Tells if unit can build extra on tile.
Definition:
extras.cpp:475
is_native_extra_to_uclass
bool is_native_extra_to_uclass(const struct extra_type *pextra, const struct unit_class *pclass)
Is extra native to unit class?
Definition:
extras.cpp:761
next_extra_for_tile
struct extra_type * next_extra_for_tile(const struct tile *ptile, enum extra_cause cause, const struct player *pplayer, const struct unit *punit)
Returns next extra by cause that unit or player can build to tile.
Definition:
extras.cpp:687
can_extra_disappear
bool can_extra_disappear(const struct extra_type *pextra, const struct tile *ptile)
Are all the requirements for extra to disappear from tile fulfilled.
Definition:
extras.cpp:1036
fc_types.h
environment_upset_type
environment_upset_type
Definition:
fc_types.h:1085
Tech_type_id
int Tech_type_id
Definition:
fc_types.h:294
MAX_LEN_NAME
#define MAX_LEN_NAME
Definition:
fc_types.h:61
name
const char * name
Definition:
inputfile.cpp:118
speclist.h
action
Definition:
actions.h:305
base_type
Definition:
base.h:43
extra_type
Definition:
extras.h:74
extra_type::native_to
bv_unit_classes native_to
Definition:
extras.h:113
extra_type::rmact_gfx
char rmact_gfx[MAX_LEN_NAME]
Definition:
extras.h:87
extra_type::conflicts
bv_extras conflicts
Definition:
extras.h:116
extra_type::rmcauses
uint8_t rmcauses
Definition:
extras.h:80
extra_type::act_gfx_alt
char act_gfx_alt[MAX_LEN_NAME]
Definition:
extras.h:85
extra_type::appearance_reqs
struct requirement_vector appearance_reqs
Definition:
extras.h:92
extra_type::flags
bv_extra_flags flags
Definition:
extras.h:115
extra_type::hiders
struct extra_type_list * hiders
Definition:
extras.h:125
extra_type::rmact_gfx_alt
char rmact_gfx_alt[MAX_LEN_NAME]
Definition:
extras.h:88
extra_type::causes
uint16_t causes
Definition:
extras.h:79
extra_type::road
struct road_type * road
Definition:
extras.h:135
extra_type::bridged_over
bv_extras bridged_over
Definition:
extras.h:118
extra_type::resource
struct resource_type * resource
Definition:
extras.h:136
extra_type::removal_time
int removal_time
Definition:
extras.h:104
extra_type::bridged
struct extra_type_list * bridged
Definition:
extras.h:128
extra_type::build_time_factor
int build_time_factor
Definition:
extras.h:103
extra_type::ruledit_disabled
bool ruledit_disabled
Definition:
extras.h:77
extra_type::disappearance_reqs
struct requirement_vector disappearance_reqs
Definition:
extras.h:93
extra_type::generated
bool generated
Definition:
extras.h:101
extra_type::special_idx
int special_idx
Definition:
extras.h:133
extra_type::rmreqs
struct requirement_vector rmreqs
Definition:
extras.h:91
extra_type::visibility_req
Tech_type_id visibility_req
Definition:
extras.h:120
extra_type::category
enum extra_category category
Definition:
extras.h:78
extra_type::id
int id
Definition:
extras.h:75
extra_type::data
struct extra_type::@22 data
extra_type::graphic_alt
char graphic_alt[MAX_LEN_NAME]
Definition:
extras.h:83
extra_type::activity_gfx
char activity_gfx[MAX_LEN_NAME]
Definition:
extras.h:84
extra_type::disappearance_chance
int disappearance_chance
Definition:
extras.h:109
extra_type::removal_time_factor
int removal_time_factor
Definition:
extras.h:105
extra_type::act_gfx_alt2
char act_gfx_alt2[MAX_LEN_NAME]
Definition:
extras.h:86
extra_type::reqs
struct requirement_vector reqs
Definition:
extras.h:90
extra_type::buildable
bool buildable
Definition:
extras.h:100
extra_type::eus
enum extra_unit_seen_type eus
Definition:
extras.h:111
extra_type::defense_bonus
int defense_bonus
Definition:
extras.h:107
extra_type::appearance_chance
int appearance_chance
Definition:
extras.h:108
extra_type::graphic_str
char graphic_str[MAX_LEN_NAME]
Definition:
extras.h:82
extra_type::build_time
int build_time
Definition:
extras.h:102
extra_type::hidden_by
bv_extras hidden_by
Definition:
extras.h:117
extra_type::helptext
QVector< QString > * helptext
Definition:
extras.h:130
extra_type::name
struct name_translation name
Definition:
extras.h:76
extra_type::base
struct base_type * base
Definition:
extras.h:134
name_translation
Definition:
name_translation.h:23
player
Definition:
player.h:231
resource_type
Definition:
terrain.h:37
road_type
Definition:
road.h:54
tile
Definition:
tile.h:42
unit_class
Definition:
unittype.h:120
unit_type
Definition:
unittype.h:465
unit
Definition:
unit.h:134
terrain.h
common
extras.h
Generated by
1.9.1