From 552e58d3a299981d9c283cd5cc3258a893aad945 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 21 Feb 2004 23:04:12 +0000 Subject: [PATCH] wormhole: - not into chaotic or young regions - clear messages when appearing and traveling --- src/common/modules/wormhole.c | 11 +++++++++-- src/res/messages.xml | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/common/modules/wormhole.c b/src/common/modules/wormhole.c index 06c21cdce..14eeb5d04 100644 --- a/src/common/modules/wormhole.c +++ b/src/common/modules/wormhole.c @@ -33,7 +33,7 @@ static boolean 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 @@ -78,11 +78,17 @@ wormhole_age(struct attrib * a) int maxtransport = 4; for (;u!=NULL && maxtransport!=0;u=u->next) { + message * m; if (u->number>maxtransport) continue; if (teure_talente(u)) continue; if (u->building!=data->entry) continue; + move_unit(u, data->exit->region, NULL); 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); @@ -130,7 +136,8 @@ make_wormhole(region * r1, region * r2) wormhole_data * d2 = (wormhole_data*)a2->data.v; d1->entry = d2->exit = b1; 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 diff --git a/src/res/messages.xml b/src/res/messages.xml index 0734640ea..730d2cd7b 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -5656,4 +5656,21 @@ "$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." "$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." + + + + + + "$unit($unit) reist durch ein Wurmloch nach $region($region)." + "$unit($unit) travels through a wormhole to $region($region)." + "$unit($unit) travels through a wormhole to $region($region)." + + + + + + "In $region($region) erscheint ein Wurmloch." + "A wormhole appears in $region($region)." + "A wormhole appears in $region($region)." +