Feature #2187 ยป 2187.patch
| client/cityrepdata.c | ||
|---|---|---|
|
static char buf[8];
|
||
|
const struct specialist *sp = data;
|
||
|
fc_assert_ret_val(sp != nullptr, nullptr);
|
||
|
fc_snprintf(buf, sizeof(buf), "%2d",
|
||
|
pcity->specialists[specialist_index(sp)]);
|
||
| client/helpdata.c | ||
|---|---|---|
|
/* TRANS: * ... Great Artist(s) ... */
|
||
|
_(" %s adds a %s superspecialist to the city.\n"),
|
||
|
BULLET, specialist_plural_translation(utype->spec_type));
|
||
|
} else if (DEFAULT_SPECIALIST != specialist_index(utype->spec_type)) {
|
||
|
} else if (utype->spec_type != nullptr) {
|
||
|
cat_snprintf(buf, bufsz,
|
||
|
/* TRANS: * ... Scientists */
|
||
|
_(" %s adds to cities as %s.\n"),
|
||
| ... | ... | |
|
{
|
||
|
bool reqs = FALSE;
|
||
|
fc_assert_ret(nullptr != pspec);
|
||
|
fc_assert_ret(NULL != buf && 0 < bufsz);
|
||
|
buf[0] = '\0';
|
||
| common/actres.c | ||
|---|---|---|
|
return TRI_NO;
|
||
|
}
|
||
|
sid = specialist_index(unit_type_get(actor->unit)->spec_type);
|
||
|
if (DEFAULT_SPECIALIST != sid) {
|
||
|
if (unit_type_get(actor->unit)->spec_type != nullptr) {
|
||
|
sid = specialist_index(unit_type_get(actor->unit)->spec_type);
|
||
|
if (!city_can_use_specialist(target->city, sid)) {
|
||
|
/* Respect specialist reqs */
|
||
|
/* Potential info leak about if they are fulfilled */
|
||
| common/networking/packets.def | ||
|---|---|---|
|
UINT8 unit_class_id;
|
||
|
UINT16 build_cost;
|
||
|
UINT8 pop_cost;
|
||
|
UINT8 spectype_id;
|
||
|
SINT8 spectype_id;
|
||
|
UINT8 attack_strength;
|
||
|
UINT8 defense_strength;
|
||
|
MOVEFRAGS move_rate;
|
||
| common/specialist.c | ||
|---|---|---|
|
**************************************************************************/
|
||
|
const char *specialist_rule_name(const struct specialist *sp)
|
||
|
{
|
||
|
fc_assert_ret_val(sp != nullptr, nullptr);
|
||
|
return rule_name_get(&sp->name);
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
const char *specialist_plural_translation(const struct specialist *sp)
|
||
|
{
|
||
|
fc_assert_ret_val(sp != nullptr, nullptr);
|
||
|
return name_translation_get(&sp->name);
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
bool is_super_specialist(const struct specialist *sp)
|
||
|
{
|
||
|
if (sp == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
|
return is_super_specialist_id(specialist_index(sp));
|
||
|
}
|
||
| ... | ... | |
|
**************************************************************************/
|
||
|
bool is_normal_specialist(const struct specialist *sp)
|
||
|
{
|
||
|
if (sp == nullptr) {
|
||
|
return FALSE;
|
||
|
}
|
||
|
return is_normal_specialist_id(specialist_index(sp));
|
||
|
}
|
||
| server/ruleset/ruleload.c | ||
|---|---|---|
|
ok = FALSE;
|
||
|
}
|
||
|
} else {
|
||
|
/* Specialists must have been processed before */
|
||
|
fc_assert_action(DEFAULT_SPECIALIST >= 0
|
||
|
&& specialist_by_number(DEFAULT_SPECIALIST),
|
||
|
ok = FALSE; break);
|
||
|
u->spec_type = specialist_by_number(DEFAULT_SPECIALIST);
|
||
|
u->spec_type = nullptr;
|
||
|
}
|
||
|
sval = secfile_lookup_str_default(file, transp_def_type_name(TDT_ALIGHT),
|
||
| ... | ... | |
|
packet.unit_class_id = uclass_number(utype_class(u));
|
||
|
packet.build_cost = u->build_cost;
|
||
|
packet.pop_cost = u->pop_cost;
|
||
|
packet.spectype_id = specialist_index(u->spec_type);
|
||
|
packet.spectype_id = u->spec_type ? specialist_index(u->spec_type) : -1;
|
||
|
packet.attack_strength = u->attack_strength;
|
||
|
packet.defense_strength = u->defense_strength;
|
||
|
packet.move_rate = u->move_rate;
|
||
| server/unithand.c | ||
|---|---|---|
|
}
|
||
|
act_utype = unit_type_get(punit);
|
||
|
sid = specialist_index(act_utype->spec_type);
|
||
|
nationality = unit_nationality(punit);
|
||
|
create_city(pplayer, ptile, name, nationality);
|
||
|
size = act_utype->city_size;
|
||
|
pcity = tile_city(ptile); /* A callback may destroy or replace it any time */
|
||
|
if (nullptr != pcity) {
|
||
|
if (nullptr != pcity && nullptr != act_utype->spec_type) {
|
||
|
sid = specialist_index(act_utype->spec_type);
|
||
|
if (is_super_specialist_id(sid) && pcity->specialists[sid] < MAX_CITY_SIZE) {
|
||
|
pcity->specialists[sid]++;
|
||
|
}
|
||
| tools/ruleutil/rulesave.c | ||
|---|---|---|
|
secfile_insert_int(sfile, put->build_cost, "%s.build_cost", path);
|
||
|
secfile_insert_int(sfile, put->pop_cost, "%s.pop_cost", path);
|
||
|
if (DEFAULT_SPECIALIST < 0 || DEFAULT_SPECIALIST != specialist_index(put->spec_type)) {
|
||
|
if (DEFAULT_SPECIALIST < 0 || (nullptr != put->spec_type)) {
|
||
|
secfile_insert_str(sfile, specialist_rule_name(put->spec_type),
|
||
|
"%s.specialist", path);
|
||
|
}
|
||