forked from github/server
- Pyramidenfindezauber interessanter gemacht.
This commit is contained in:
parent
9acad9a56e
commit
d1751cb0a3
2 changed files with 34 additions and 20 deletions
|
@ -7229,32 +7229,44 @@ sp_becomewyrm(castorder *co)
|
||||||
* Stufe: unterschiedlich
|
* Stufe: unterschiedlich
|
||||||
* Gebiet: alle
|
* Gebiet: alle
|
||||||
* Wirkung:
|
* Wirkung:
|
||||||
* gibt an, ob sich der Magier in einer Pyramidenbauregion
|
* gibt die ungefaehre Entfernung zur naechstgelegenen Pyramiden-
|
||||||
* befindet.
|
* region an.
|
||||||
*
|
*
|
||||||
* Flags:
|
* Flags:
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
sp_wdwpyramid(castorder *co)
|
sp_wdwpyramid(castorder *co)
|
||||||
{
|
{
|
||||||
region *r = co->rt;
|
region *r = co->rt;
|
||||||
unit *mage = (unit *)co->magician;
|
unit *mage = (unit *)co->magician;
|
||||||
int cast_level = co->level;
|
int cast_level = co->level;
|
||||||
|
|
||||||
if(!(landregion(rterrain(r)))){
|
|
||||||
cmistake(mage, strdup(co->order), 186, MSG_MAGIC);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(a_find(r->attribs, &at_wdwpyramid) != NULL) {
|
if(a_find(r->attribs, &at_wdwpyramid) != NULL) {
|
||||||
add_message(&mage->faction->msgs, new_message(mage->faction,
|
ADDMSG(&mage->faction->msgs, msg_message("wdw_pyramidspell_found",
|
||||||
"wdw_pyramidspell_found%u:mage%r:region%s:command",
|
"unit region command", mage, r, strdup(co->order)));
|
||||||
mage, r, strdup(co->order)));
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
add_message(&mage->faction->msgs, new_message(mage->faction,
|
region *r2;
|
||||||
"wdw_pyramidspell_notfound%u:mage%r:region%s:command",
|
int mindist = -1;
|
||||||
mage, r, strdup(co->order)));
|
int minshowdist;
|
||||||
|
int maxshowdist;
|
||||||
|
|
||||||
|
for(r2 = regions; r2; r2 = r2->next) {
|
||||||
|
if(a_find(r->attribs, &at_wdwpyramid) != NULL) {
|
||||||
|
short dist = distance(mage->region, r2);
|
||||||
|
if(dist < mindist) {
|
||||||
|
mindist = dist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(mindist >= 1);
|
||||||
|
|
||||||
|
minshowdist = mindist - rand()%5;
|
||||||
|
maxshowdist = minshowdist + 4;
|
||||||
|
|
||||||
|
ADDMSG(&mage->faction->msgs, msg_message("wdw_pyramidspell_notfound",
|
||||||
|
"unit region command mindist maxdist", mage, r, strdup(co->order),
|
||||||
|
max(1, minshowdist), maxshowdist));
|
||||||
}
|
}
|
||||||
|
|
||||||
return cast_level;
|
return cast_level;
|
||||||
|
|
|
@ -5633,9 +5633,11 @@
|
||||||
<arg name="unit" type="unit"></arg>
|
<arg name="unit" type="unit"></arg>
|
||||||
<arg name="region" type="region"></arg>
|
<arg name="region" type="region"></arg>
|
||||||
<arg name="command" type="string"></arg>
|
<arg name="command" type="string"></arg>
|
||||||
|
<arg name="mindist" type="int"></arg>
|
||||||
|
<arg name="maxdist" type="int"></arg>
|
||||||
</type>
|
</type>
|
||||||
<text locale="de">"$unit($unit) in $region($region): '$command' - In dieser Regione können keine Pyramiden gebaut werden."</text>
|
<text locale="de">"$unit($unit) in $region($region): '$command' - In dieser Region können keine Pyramiden gebaut werden. Die nächste Pyramidenregion ist zwischen $int($mindist) und $int($maxdist) Regionen entfernt."</text>
|
||||||
<text locale="en">"$unit($unit) in $region($region): '$command' - No pyramids may be build in this region."</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."</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>
|
||||||
</messages>
|
</messages>
|
||||||
|
|
Loading…
Reference in a new issue