wormhole:

- not into chaotic or young regions
- clear messages when appearing and traveling
This commit is contained in:
Enno Rehling 2004-02-21 23:04:12 +00:00
parent 41e989a713
commit 552e58d3a2
2 changed files with 26 additions and 2 deletions

View File

@ -33,7 +33,7 @@
static boolean static boolean
good_region(const region * r) good_region(const region * r)
{ {
return (rplane(r)==NULL && r->units!=NULL && r->land!=NULL); return (!fval(r, RF_CHAOTIC) && r->age>30 && rplane(r)==NULL && r->units!=NULL && r->land!=NULL);
} }
static int static int
@ -78,11 +78,17 @@ wormhole_age(struct attrib * a)
int maxtransport = 4; int maxtransport = 4;
for (;u!=NULL && maxtransport!=0;u=u->next) { for (;u!=NULL && maxtransport!=0;u=u->next) {
message * m;
if (u->number>maxtransport) continue; if (u->number>maxtransport) continue;
if (teure_talente(u)) continue; if (teure_talente(u)) continue;
if (u->building!=data->entry) continue; if (u->building!=data->entry) continue;
move_unit(u, data->exit->region, NULL); move_unit(u, data->exit->region, NULL);
maxtransport -= u->number; maxtransport -= u->number;
m = msg_message("wormhole_exit", "unit region", u, data->exit);
add_message(&data->exit->region->msgs, m);
add_message(&u->faction->msgs, m);
msg_release(m);
} }
destroy_building(data->entry); destroy_building(data->entry);
@ -130,7 +136,8 @@ make_wormhole(region * r1, region * r2)
wormhole_data * d2 = (wormhole_data*)a2->data.v; wormhole_data * d2 = (wormhole_data*)a2->data.v;
d1->entry = d2->exit = b1; d1->entry = d2->exit = b1;
d2->entry = d1->exit = b2; d2->entry = d1->exit = b2;
/* ADDMSG() */ ADDMSG(&r1->msgs, msg_message("wormhole_appear", "region", r1));
ADDMSG(&r2->msgs, msg_message("wormhole_appear", "region", r2));
} }
void void

View File

@ -5656,4 +5656,21 @@
<text locale="en">"$unit($unit) in $region($region): '$command' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text> <text locale="en">"$unit($unit) in $region($region): '$command' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text>
<text locale="fr">"$unit($unit) in $region($region): '$command' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text> <text locale="fr">"$unit($unit) in $region($region): '$command' - No pyramids may be build in this region. The closest region to build a pyramid in is between $int($mindist) and $int($maxdist) regions away."</text>
</message> </message>
<message name="wormhole_exit" section="events">
<type>
<arg name="unit" type="unit"></arg>
<arg name="region" type="region"></arg>
</type>
<text locale="de">"$unit($unit) reist durch ein Wurmloch nach $region($region)."</text>
<text locale="fr">"$unit($unit) travels through a wormhole to $region($region)."</text>
<text locale="en">"$unit($unit) travels through a wormhole to $region($region)."</text>
</message>
<message name="wormhole_appear" section="events">
<type>
<arg name="region" type="region"></arg>
</type>
<text locale="de">"In $region($region) erscheint ein Wurmloch."</text>
<text locale="fr">"A wormhole appears in $region($region)."</text>
<text locale="en">"A wormhole appears in $region($region)."</text>
</message>
</messages> </messages>