- alliance in the CR

- migrants message removed from NR
This commit is contained in:
Enno Rehling 2009-07-10 14:54:09 +00:00
parent ab2b357f8c
commit 3a7b0a6561
5 changed files with 50 additions and 13 deletions

View File

@ -928,6 +928,20 @@ show_allies_cr(FILE * F, const faction * f, const ally * sf)
}
}
/* prints allies */
static void
show_alliances_cr(FILE * F, const faction * f)
{
if (f->alliance) {
alliance * al = f->alliance;
assert(al->leader);
fprintf(F, "ALLIANCE %d\n", al->id);
fprintf(F, "\"%s\";name\n", al->name);
fprintf(F, "%d;leader\n", al->leader->no);
fprintf(F, "%d;leader\n", al->leader->no);
}
}
/* prints all visible spells in a region */
static void
show_active_spells(const region * r)
@ -957,7 +971,6 @@ cr_find_address(FILE * F, const faction * uf, const faction_list * addresses)
fprintf(F, "\"%s\";locale\n", locale_name(f->locale));
if (f->alliance!=NULL && f->alliance==uf->alliance) {
fprintf(F, "%d;alliance\n", f->alliance->id);
fprintf(F, "\"%s\";alliancename\n", f->alliance->name);
}
}
flist = flist->next;
@ -1344,8 +1357,14 @@ report_computer(const char * filename, report_context * ctx, const char * charse
fprintf(F, "\"%s\";mailto\n", mailto);
fprintf(F, "\"%s\";mailcmd\n", locale_string(f->locale, "mailcmd"));
}
show_alliances_cr(F, f);
fprintf(F, "PARTEI %d\n", f->no);
fprintf(F, "\"%s\";locale\n", locale_name(f->locale));
if (f->alliance) {
fprintf(F, "%d;alliance\n", f->alliance->id);
}
fprintf(F, "%d;age\n", f->age);
fprintf(F, "%d;Optionen\n", f->options);
#if SCORE_MODULE

View File

@ -2051,11 +2051,13 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars
centre(F, buf, true);
if (f->race == new_race[RC_HUMAN]) {
int maxmig = count_maxmigrants(f);
if (maxmig>0) {
m = msg_message("nr_migrants", "units maxunits", count_migrants(f), maxmig);
nr_render(m, f->locale, buf, sizeof(buf), f);
msg_release(m);
centre(F, buf, true);
}
}
{
int maxh = maxheroes(f);
if (maxh) {

View File

@ -1223,6 +1223,12 @@ count_migrants (const faction * f)
int
count_maxmigrants(const faction * f)
{
static int migrants = -1;
if (migrants<0) {
migrants = get_param_int(global.parameters, "rules.migrants", INT_MAX);
}
if (migrants==INT_MAX) {
int x = 0;
if (f->race == new_race[RC_HUMAN]) {
int nsize = count_all(f);
@ -1232,6 +1238,8 @@ count_maxmigrants(const faction * f)
}
}
return x;
}
return migrants;
}
void

View File

@ -944,6 +944,13 @@ get_addresses(report_context * ctx)
flist->data = ctx->f;
if (ctx->f->alliance) {
faction_list * member = ctx->f->alliance->members;
for (;member;member=member->next) {
add_faction(&flist, member->data);
}
}
for (r=ctx->first;sr==NULL && r!=ctx->last;r=r->next) {
sr = find_seen(ctx->seen, r);
}

View File

@ -138,6 +138,7 @@
<param name="study.expensivemigrants" value="1"/>
<param name="study.speedup" value="1"/>
<param name="world.era" value="3"/>
<param name="rules.migrants" value="0"/>
<param name="rules.check_overload" value="0"/>
<param name="rules.combat.goblinbonus" value="3"/>
<param name="rules.ship.capacity" value="1"/> <!-- -->