"Magischer Pfad" funktioniert nicht
This commit is contained in:
Enno Rehling 2004-04-12 20:47:22 +00:00
parent 321c85c274
commit db8340648c
2 changed files with 207 additions and 212 deletions

View File

@ -918,6 +918,13 @@ roadto(const region * r, direction_t dir)
/* wenn es hier genug strassen gibt, und verbunden ist, und es dort /* wenn es hier genug strassen gibt, und verbunden ist, und es dort
* genug strassen gibt, dann existiert eine strasse in diese richtung */ * genug strassen gibt, dann existiert eine strasse in diese richtung */
region * r2; region * r2;
static const curse_type * roads_ct = NULL;
if (roads_ct==NULL) roads_ct = ct_find("magicstreet");
if (roads_ct!=NULL) {
curse *c = get_curse(r->attribs, roads_ct);
if (c!=NULL) return true;
}
if (dir>=MAXDIRECTIONS || dir<0) return false; if (dir>=MAXDIRECTIONS || dir<0) return false;
r2 = rconnect(r, dir); r2 = rconnect(r, dir);
@ -1208,25 +1215,26 @@ travel(unit * u, region * next, int flucht, region_list ** routep)
travelthru(u, first); travelthru(u, first);
while (rlist!=NULL) { while (rlist!=NULL) {
region * r = rlist->data; region * r = rlist->data;
travelthru(u, r); travelthru(u, r);
rlist=rlist->next; rlist=rlist->next;
if (rlist!=NULL) { if (rlist!=NULL) {
char * p; char * p;
if (r!=route->data) { if (r!=route->data) {
if (rlist->next==NULL) scat(" und "); if (rlist->next==NULL) scat(" und ");
else scat(", "); else scat(", ");
} }
p = buf+strlen(buf); p = buf+strlen(buf);
MSG(("travelthru_trail", "region", r), p, sizeof(buf)-strlen(buf), u->faction->locale, u->faction); if (rlist->next) {
} MSG(("travelthru_trail", "region", rlist->data), p, sizeof(buf)-strlen(buf), u->faction->locale, u->faction);
}
}
} }
} }
add_message(&u->faction->msgs, new_message( ADDMSG(&u->faction->msgs, msg_message("travel",
u->faction, "travel%u:unit%i:mode%r:start%r:end%s:regions", "unit mode start end regions", u, mode, first, current, strdup(buf)));
u, mode, first, current, strdup(buf)));
/* und jetzt noch die transportierten Einheiten verschieben */ /* und jetzt noch die transportierten Einheiten verschieben */

View File

@ -194,22 +194,22 @@ magicanalyse_region(region *r, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */ if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE) { if(c->flag & CURSE_NOAGE) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_region_noage%u:mage%r:region%s:spell", "analyse_region_noage", "mage region spell",
mage, r, LOC(lang, mkname("spell", c->type->cname)))); mage, r, LOC(lang, mkname("spell", c->type->cname))));
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_region_age%u:mage%r:region%s:spell%i:months", "analyse_region_age", "mage region spell months",
mage, r, LOC(lang, mkname("spell", c->type->cname)), mon)); mage, r, LOC(lang, mkname("spell", c->type->cname)), mon));
} }
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_region_fail%u:mage%r:region", mage, r)); "analyse_region_fail", "mage region", mage, r));
} }
} }
if (!found) { if (!found) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_region_nospell%u:mage%r:region", mage, r)); "analyse_region_nospell", "mage region", mage, r));
} }
} }
@ -235,22 +235,22 @@ magicanalyse_unit(unit *u, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */ if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE){ if(c->flag & CURSE_NOAGE){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_unit_noage%u:mage%u:unit%s:spell", "analyse_unit_noage", "mage unit spell",
mage, u, LOC(lang, mkname("spell", c->type->cname)))); mage, u, LOC(lang, mkname("spell", c->type->cname))));
}else{ }else{
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_unit_age%u:mage%u:unit%s:spell%i:months", "analyse_unit_age", "mage unit spell months",
mage, u, LOC(lang, mkname("spell", c->type->cname)), mon)); mage, u, LOC(lang, mkname("spell", c->type->cname)), mon));
} }
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_unit_fail%u:mage%u:unit", mage, u)); "analyse_unit_fail", "mage unit", mage, u));
} }
} }
if (!found) { if (!found) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_unit_nospell%u:mage%u:target", mage, u)); "analyse_unit_nospell", "mage target", mage, u));
} }
} }
@ -277,22 +277,22 @@ magicanalyse_building(building *b, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */ if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE){ if(c->flag & CURSE_NOAGE){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_building_age%u:mage%b:building%s:spell", "analyse_building_age", "mage building spell",
mage, b, LOC(lang, mkname("spell", c->type->cname)))); mage, b, LOC(lang, mkname("spell", c->type->cname))));
}else{ }else{
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_building_age%u:mage%b:building%s:spell%i:months", "analyse_building_age", "mage building spell months",
mage, b, LOC(lang, mkname("spell", c->type->cname)), mon)); mage, b, LOC(lang, mkname("spell", c->type->cname)), mon));
} }
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_building_fail%u:mage%b:building", mage, b)); "analyse_building_fail", "mage building", mage, b));
} }
} }
if (!found) { if (!found) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_building_nospell%u:mage%b:building", mage, b)); "analyse_building_nospell", "mage building", mage, b));
} }
} }
@ -319,23 +319,23 @@ magicanalyse_ship(ship *sh, unit *mage, double force)
if (chance(probability)) { /* Analyse geglückt */ if (chance(probability)) { /* Analyse geglückt */
if(c->flag & CURSE_NOAGE){ if(c->flag & CURSE_NOAGE){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_ship_noage%u:mage%h:ship%s:spell", "analyse_ship_noage", "mage ship spell",
mage, sh, LOC(lang, mkname("spell", c->type->cname)))); mage, sh, LOC(lang, mkname("spell", c->type->cname))));
}else{ }else{
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_ship_age%u:mage%h:ship%s:spell%i:months", "analyse_ship_age", "mage ship spell months",
mage, sh, LOC(lang, mkname("spell", c->type->cname)), mon)); mage, sh, LOC(lang, mkname("spell", c->type->cname)), mon));
} }
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_ship_fail%u:mage%h:ship", mage, sh)); "analyse_ship_fail", "mage ship", mage, sh));
} }
} }
if (!found) { if (!found) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"analyse_ship_nospell%u:mage%h:ship", mage, sh)); "analyse_ship_nospell", "mage ship", mage, sh));
} }
} }
@ -455,7 +455,7 @@ report_effect(region * r, unit * mage, message * seen, message * unseen)
/* Ist niemand von der Partei des Magiers in der Region, dem Magier /* Ist niemand von der Partei des Magiers in der Region, dem Magier
* nochmal gesondert melden */ * nochmal gesondert melden */
if(!fval(mage->faction, FL_DH)) { if(!fval(mage->faction, FL_DH)) {
add_message(&mage->faction->msgs, seen); ADDMSG(&mage->faction->msgs, seen);
} }
msg_release(seen); msg_release(seen);
if (unseen) msg_release(unseen); if (unseen) msg_release(unseen);
@ -738,12 +738,12 @@ sp_destroy_magic(castorder *co)
succ = destroy_curse(ap, cast_level, force, c); succ = destroy_curse(ap, cast_level, force, c);
if (succ) { if (succ) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_effect%u:unit%r:region%s:command%i:succ%s:target", "destroy_magic_effect", "unit region command succ target",
mage, mage->region, strdup(co->order), succ, strdup(ts))); mage, mage->region, strdup(co->order), succ, strdup(ts)));
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_noeffect%u:unit%r:region%s:command", "destroy_magic_noeffect", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
} }
@ -825,8 +825,8 @@ sp_transferaura(castorder *co)
/* sprintf(buf, "%s transferiert %d Aura auf %s", unitname(mage), /* sprintf(buf, "%s transferiert %d Aura auf %s", unitname(mage),
gain, unitname(u)); */ gain, unitname(u)); */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"auratransfer_success%u:unit%u:target%i:aura", mage, u, gain)); "auratransfer_success", "unit target aura", mage, u, gain));
return cast_level; return cast_level;
} }
@ -903,36 +903,25 @@ sp_goodwinds(castorder *co)
static int static int
sp_magicstreet(castorder *co) sp_magicstreet(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;
double power = co->force;
spellparameter *pa = co->par;
direction_t dir;
int duration = cast_level+1;
if(!(landregion(rterrain(r)))){ if (!landregion(rterrain(r))) {
cmistake(mage, strdup(co->order), 186, MSG_MAGIC); cmistake(mage, strdup(co->order), 186, MSG_MAGIC);
return 0; return 0;
} }
dir = finddirection(pa->param[0]->data.s, mage->faction->locale);
if (rroad(r, dir)){ /* wirkt schon in der Zauberrunde! */
cmistake(mage, strdup(co->order), 187, MSG_MAGIC); create_curse(mage, &r->attribs, ct_find("magicstreet"), co->force, co->level+1, 0, 0);
return 0;
}
/* wirkt schon in der Zauberrunde! */ /* melden, 1x pro Partei */
create_curse(mage, &r->attribs, ct_find("magicstreet"), power, duration, 0, 0); {
message * seen = msg_message("path_effect", "mage region", mage, r);
message * unseen = msg_message("path_effect", "mage region", NULL, r);
report_effect(r, mage, seen, unseen);
}
/* melden, 1x pro Partei */ return co->level;
{
message * seen = msg_message("path_effect", "mage region", mage, r);
message * unseen = msg_message("path_effect", "mage region", NULL, r);
report_effect(r, mage, seen, unseen);
}
return cast_level;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@ -1293,8 +1282,8 @@ patzer_ents(castorder *co)
LOC(default_locale, rc_name(new_race[RC_TREEMAN], ents!=1)), NULL); LOC(default_locale, rc_name(new_race[RC_TREEMAN], ents!=1)), NULL);
/* 'Erfolg' melden */ /* 'Erfolg' melden */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"regionmagic_patzer%u:unit%r:region%s:command%u:unit", mage, "regionmagic_patzer", "unit region command unit", mage,
mage->region, strdup(co->order), mage)); mage->region, strdup(co->order), mage));
/* melden, 1x pro Partei */ /* melden, 1x pro Partei */
@ -1381,17 +1370,17 @@ sp_rosthauch(castorder *co)
if (ironweapon) { if (ironweapon) {
/* {$mage mage} legt einen Rosthauch auf {target}. {amount} Waffen /* {$mage mage} legt einen Rosthauch auf {target}. {amount} Waffen
* wurden vom Rost zerfressen */ * wurden vom Rost zerfressen */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"rust_effect%u:mage%u:target%i:amount", mage, u, ironweapon)); "rust_effect", "mage target amount", mage, u, ironweapon));
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"rust_effect%u:mage%u:target%i:amount", "rust_effect", "mage target amount",
cansee(u->faction, r, mage, 0) ? mage:NULL, u, ironweapon)); cansee(u->faction, r, mage, 0) ? mage:NULL, u, ironweapon));
success += ironweapon; success += ironweapon;
} else { } else {
/* {$mage mage} legt einen Rosthauch auf {target}, doch der /* {$mage mage} legt einen Rosthauch auf {target}, doch der
* Rosthauch fand keine Nahrung */ * Rosthauch fand keine Nahrung */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"rust_fail%u:mage%u:target", mage, u)); "rust_fail", "mage target", mage, u));
} }
} }
/* in success stehen nun die insgesamt zerstörten Waffen. Im /* in success stehen nun die insgesamt zerstörten Waffen. Im
@ -1457,10 +1446,10 @@ sp_kaelteschutz(castorder *co)
duration, 1, men); duration, 1, men);
force -= u->number; force -= u->number;
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"heat_effect%u:mage%u:target", mage, u)); "heat_effect", "mage target", mage, u));
if (u->faction!=mage->faction) add_message(&u->faction->msgs, new_message(u->faction, if (u->faction!=mage->faction) ADDMSG(&u->faction->msgs, msg_message(
"heat_effect%u:mage%u:target", "heat_effect", "mage target",
cansee(u->faction, r, mage, 0) ? mage:NULL, u)); cansee(u->faction, r, mage, 0) ? mage:NULL, u));
i = cast_level; i = cast_level;
} }
@ -1503,11 +1492,11 @@ sp_sparkle(castorder *co)
create_curse(mage, &u->attribs, ct_find("sparkle"), cast_level, create_curse(mage, &u->attribs, ct_find("sparkle"), cast_level,
duration, rand(), u->number); duration, rand(), u->number);
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"sparkle_effect%u:mage%u:target", mage, u)); "sparkle_effect", "mage target", mage, u));
if (u->faction!=mage->faction) if (u->faction!=mage->faction)
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"sparkle_effect%u:mage%u:target", mage, u)); "sparkle_effect", "mage target", mage, u));
return cast_level; return cast_level;
} }
@ -1567,7 +1556,7 @@ sp_create_irongolem(castorder *co)
a->data.ca[1] = IRONGOLEM_CRUMBLE; a->data.ca[1] = IRONGOLEM_CRUMBLE;
a_add(&u2->attribs, a); a_add(&u2->attribs, a);
add_message(&mage->faction->msgs, ADDMSG(&mage->faction->msgs,
msg_message("magiccreate_effect", "region command unit amount object", msg_message("magiccreate_effect", "region command unit amount object",
mage->region, strdup(co->order), mage, number, mage->region, strdup(co->order), mage, number,
LOC(mage->faction->locale, rc_name(new_race[RC_IRONGOLEM], 1)))); LOC(mage->faction->locale, rc_name(new_race[RC_IRONGOLEM], 1))));
@ -1628,7 +1617,7 @@ sp_create_stonegolem(castorder *co)
a->data.ca[1] = STONEGOLEM_CRUMBLE; a->data.ca[1] = STONEGOLEM_CRUMBLE;
a_add(&u2->attribs, a); a_add(&u2->attribs, a);
add_message(&mage->faction->msgs, ADDMSG(&mage->faction->msgs,
msg_message("magiccreate_effect", "region command unit amount object", msg_message("magiccreate_effect", "region command unit amount object",
mage->region, strdup(co->order), mage, number, mage->region, strdup(co->order), mage, number,
LOC(mage->faction->locale, rc_name(new_race[RC_STONEGOLEM], 1)))); LOC(mage->faction->locale, rc_name(new_race[RC_STONEGOLEM], 1))));
@ -1784,8 +1773,8 @@ sp_great_drought(castorder *co)
} }
} }
if(!fval(mage->faction, FL_DH)){ if(!fval(mage->faction, FL_DH)){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"drought_effect%u:mage%r:region", mage, r)); "drought_effect", "mage region", mage, r));
} }
return cast_level; return cast_level;
} }
@ -2725,8 +2714,8 @@ sp_fumblecurse(castorder *co)
} }
curse_setflag(c, CURSE_ONLYONE); curse_setflag(c, CURSE_ONLYONE);
add_message(&target->faction->msgs, new_message(target->faction, ADDMSG(&target->faction->msgs, msg_message(
"fumblecurse%u:unit%r:region", target, target->region)); "fumblecurse", "unit region", target, target->region));
return cast_level; return cast_level;
} }
@ -2744,8 +2733,8 @@ patzer_fumblecurse(castorder *co)
c = create_curse(mage, &mage->attribs, ct_find("fumble"), force, c = create_curse(mage, &mage->attribs, ct_find("fumble"), force,
duration, effect, 0); duration, effect, 0);
if (c!=NULL) { if (c!=NULL) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"magic_fumble%u:unit%r:region%s:command", "magic_fumble", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
curse_setflag(c, CURSE_ONLYONE); curse_setflag(c, CURSE_ONLYONE);
} }
@ -2835,8 +2824,8 @@ sp_summondragon(castorder *co)
} }
} }
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"summondragon%u:unit%r:region%s:command%u:unit%r:region", "summondragon", "unit region command unit region",
mage, mage->region, strdup(co->order),mage, co->rt)); mage, mage->region, strdup(co->order),mage, co->rt));
free_regionlist(rl); free_regionlist(rl);
@ -3009,38 +2998,40 @@ wall_write(const border * b, FILE * f)
static void static void
wall_move(const border * b, struct unit * u, const struct region * from, const struct region * to) wall_move(const border * b, struct unit * u, const struct region * from, const struct region * to)
{ {
wall_data * fd = (wall_data*)b->data; wall_data * fd = (wall_data*)b->data;
int hp = dice(3, fd->force) * u->number; int hp = dice(3, fd->force) * u->number;
if (fd->active) { if (fd->active) {
hp = min (u->hp, hp); hp = min (u->hp, hp);
u->hp -= hp; u->hp -= hp;
if (u->hp) add_message(&u->faction->msgs, if (u->hp) {
new_message(u->faction, "firewall_damage%r:region%u:unit", from, u)); ADDMSG(&u->faction->msgs,
else add_message(&u->faction->msgs, msg_message( "firewall_damage", "region unit", from, u));
new_message(u->faction, "firewall_death%r:region%u:unit", from, u)); }
if (u->number>u->hp) { else ADDMSG(&u->faction->msgs,
scale_number(u, u->hp); msg_message( "firewall_death", "region unit", from, u));
u->hp = u->number; if (u->number>u->hp) {
} scale_number(u, u->hp);
} u->hp = u->number;
unused(from); }
unused(to); }
unused(from);
unused(to);
} }
border_type bt_firewall = { border_type bt_firewall = {
"firewall", "firewall",
b_transparent, /* transparent */ b_transparent, /* transparent */
wall_init, /* init */ wall_init, /* init */
wall_destroy, /* destroy */ wall_destroy, /* destroy */
wall_read, /* read */ wall_read, /* read */
wall_write, /* write */ wall_write, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
fire_name, /* name */ fire_name, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_finvisible, /* fvisible */ b_finvisible, /* fvisible */
b_uinvisible, /* uvisible */ b_uinvisible, /* uvisible */
NULL, NULL,
wall_move wall_move
}; };
static int static int
@ -3101,14 +3092,14 @@ sp_firewall(castorder *co)
for (u = r->units; u; u = u->next ) { for (u = r->units; u; u = u->next ) {
if(!fval(u->faction, FL_DH) ) { if(!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"firewall_effect%u:mage%r:region", "firewall_effect", "mage region",
cansee(u->faction, r, mage, 0) ? mage:NULL, r)); cansee(u->faction, r, mage, 0) ? mage:NULL, r));
} }
} }
if(!fval(mage->faction, FL_DH)){ if(!fval(mage->faction, FL_DH)){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"firewall_effect%u:mage%r:region", mage, r)); "firewall_effect", "mage region", mage, r));
} }
return cast_level; return cast_level;
@ -3178,14 +3169,14 @@ sp_wisps(castorder *co)
for(u = r->units; u; u = u->next ) { for(u = r->units; u; u = u->next ) {
if(!fval(u->faction, FL_DH) ) { if(!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"wisps_effect%u:mage%r:region", "wisps_effect", "mage region",
cansee(u->faction, r, mage, 0) ? mage:NULL, r)); cansee(u->faction, r, mage, 0) ? mage:NULL, r));
} }
} }
if(!fval(mage->faction, FL_DH)){ if(!fval(mage->faction, FL_DH)){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"wisps_effect%u:mage%r:region", mage, r)); "wisps_effect", "mage region", mage, r));
} }
return cast_level; return cast_level;
@ -3250,7 +3241,7 @@ sp_unholypower(castorder *co)
n -= u->number; n -= u->number;
u->race = u->irace = target_race; u->race = u->irace = target_race;
u->hp = unit_max_hp(u)*u->number - wounds; u->hp = unit_max_hp(u)*u->number - wounds;
add_message(&co->rt->msgs, msg_message("unholypower_effect", ADDMSG(&co->rt->msgs, msg_message("unholypower_effect",
"mage target race", mage, u, target_race)); "mage target race", mage, u, target_race));
} else { } else {
unit *un; unit *un;
@ -3274,7 +3265,7 @@ sp_unholypower(castorder *co)
} }
transfermen(u, un, n); transfermen(u, un, n);
un->hp = unit_max_hp(un)*n - wounds; un->hp = unit_max_hp(un)*n - wounds;
add_message(&co->rt->msgs, msg_message("unholypower_limitedeffect", ADDMSG(&co->rt->msgs, msg_message("unholypower_limitedeffect",
"mage target race amount", "mage target race amount",
mage, u, target_race, n)); mage, u, target_race, n));
n = 0; n = 0;
@ -3445,8 +3436,8 @@ patzer_deathcloud(castorder *co)
change_hitpoints(mage, -rand()%hp); change_hitpoints(mage, -rand()%hp);
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"magic_fumble%u:unit%r:region%s:command", "magic_fumble", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
return; return;
@ -3720,8 +3711,8 @@ sp_magicboost(castorder *co)
} }
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"magicboost_effect%u:unit%r:region%s:command", "magicboost_effect", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
return cast_level; return cast_level;
@ -4182,8 +4173,8 @@ sp_song_resistmagic(castorder *co)
force, duration, mr_bonus, 0); force, duration, mr_bonus, 0);
/* Erfolg melden */ /* Erfolg melden */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"regionmagic_effect%u:unit%r:region%s:command%u:unit", mage, "regionmagic_effect", "unit region command unit", mage,
mage->region, strdup(co->order), mage)); mage->region, strdup(co->order), mage));
return cast_level; return cast_level;
@ -4212,8 +4203,8 @@ sp_song_susceptmagic(castorder *co)
create_curse(mage, &r->attribs, ct_find("badmagicresistancezone"), create_curse(mage, &r->attribs, ct_find("badmagicresistancezone"),
force, duration, mr_malus, 0); force, duration, mr_malus, 0);
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"regionmagic_effect%u:unit%r:region%s:command%u:unit", mage, "regionmagic_effect", "unit region command unit", mage,
mage->region, strdup(co->order), mage)); mage->region, strdup(co->order), mage));
return cast_level; return cast_level;
@ -4337,14 +4328,14 @@ sp_raisepeasantmob(castorder *co)
for (u = r->units; u; u = u->next ) { for (u = r->units; u; u = u->next ) {
if (!fval(u->faction, FL_DH) ) { if (!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"sp_raisepeasantmob_effect%u:mage%r:region", "sp_raisepeasantmob_effect", "mage region",
cansee(u->faction, r, mage, 0) ? mage : NULL, r )); cansee(u->faction, r, mage, 0) ? mage : NULL, r ));
} }
} }
if (!fval(mage->faction, FL_DH)){ if (!fval(mage->faction, FL_DH)){
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"sp_raisepeasantmob_effect%u:mage%r:region", mage, r)); "sp_raisepeasantmob_effect", "mage region", mage, r));
} }
return cast_level; return cast_level;
@ -4381,8 +4372,8 @@ sp_migranten(castorder *co)
/* Personen unserer Rasse können problemlos normal übergeben werden */ /* Personen unserer Rasse können problemlos normal übergeben werden */
if (target->race == mage->faction->race){ if (target->race == mage->faction->race){
/* u ist von unserer Art, das Ritual wäre verschwendete Aura. */ /* u ist von unserer Art, das Ritual wäre verschwendete Aura. */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"sp_migranten_fail1%u:unit%r:region%s:command%u:target", mage, "sp_migranten_fail1", "unit region command target", mage,
mage->region, strdup(co->order), target)); mage->region, strdup(co->order), target));
} }
/* Auf eigene Einheiten versucht zu zaubern? Garantiert Tippfehler */ /* Auf eigene Einheiten versucht zu zaubern? Garantiert Tippfehler */
@ -4462,8 +4453,8 @@ sp_migranten(castorder *co)
set_string(&target->thisorder, ""); set_string(&target->thisorder, "");
/* Erfolg melden */ /* Erfolg melden */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"sp_migranten%u:unit%r:region%s:command%u:target", mage, "sp_migranten", "unit region command target", mage,
mage->region, strdup(co->order), target)); mage->region, strdup(co->order), target));
return target->number; return target->number;
@ -5082,8 +5073,8 @@ sp_dragonsong(castorder *co)
} }
} }
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"summondragon%u:unit%r:region%s:command%u:unit%r:region", "summondragon", "unit region command unit region",
mage, mage->region, strdup(co->order),mage, co->rt)); mage, mage->region, strdup(co->order),mage, co->rt));
free_regionlist(rl); free_regionlist(rl);
@ -5114,8 +5105,8 @@ sp_songofAttraction(castorder *co)
/* TODO Wander Effekt */ /* TODO Wander Effekt */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"summon%u:unit%r:region%s:command%u:unit%r:region", "summon", "unit region command unit region",
mage, mage->region, strdup(co->order),mage, r)); mage, mage->region, strdup(co->order),mage, r));
return cast_level; return cast_level;
@ -5206,8 +5197,8 @@ sp_icastle(castorder *co)
mage->building = b; mage->building = b;
} }
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"icastle_create%u:unit%r:region%s:command", mage, mage->region, "icastle_create", "unit region command", mage, mage->region,
strdup(co->order))); strdup(co->order)));
addmessage(r, 0, addmessage(r, 0,
@ -5313,8 +5304,8 @@ sp_readmind(castorder *co)
if (target_resists_magic(mage, target, TYP_UNIT, 0)){ if (target_resists_magic(mage, target, TYP_UNIT, 0)){
report_failure(mage, co->order); report_failure(mage, co->order);
/* "Fühlt sich beobachtet"*/ /* "Fühlt sich beobachtet"*/
add_message(&target->faction->msgs, new_message(target->faction, ADDMSG(&target->faction->msgs, msg_message(
"stealdetect%u:unit", target)); "stealdetect", "unit", target));
return 0; return 0;
} }
spy_message(2, mage, target); spy_message(2, mage, target);
@ -5411,8 +5402,8 @@ sp_baddreams(castorder *co)
curse_setflag(c, CURSE_ISNEW); curse_setflag(c, CURSE_ISNEW);
/* Erfolg melden*/ /* Erfolg melden*/
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"regionmagic_effect%u:unit%r:region%s:command%u:unit", mage, "regionmagic_effect", "unit region command unit", mage,
mage->region, strdup(co->order), mage)); mage->region, strdup(co->order), mage));
return cast_level; return cast_level;
@ -5448,8 +5439,8 @@ sp_gooddreams(castorder *co)
curse_setflag(c, CURSE_ISNEW); curse_setflag(c, CURSE_ISNEW);
/* Erfolg melden*/ /* Erfolg melden*/
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"regionmagic_effect%u:unit%r:region%s:command%u:unit", mage, "regionmagic_effect", "unit region command unit", mage,
mage->region, strdup(co->order), mage)); mage->region, strdup(co->order), mage));
return cast_level; return cast_level;
@ -5520,8 +5511,8 @@ sp_dreamreading(castorder *co)
/* Illusionen und Untote abfangen. */ /* Illusionen und Untote abfangen. */
if (fval(u->race, RCF_UNDEAD|RCF_ILLUSIONARY)) { if (fval(u->race, RCF_UNDEAD|RCF_ILLUSIONARY)) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"spellunitnotfound%u:unit%r:region%s:command%s:id", "spellunitnotfound", "unit region command id",
mage, mage->region, strdup(co->order), strdup(itoa36(u->no)))); mage, mage->region, strdup(co->order), strdup(itoa36(u->no))));
return 0; return 0;
} }
@ -5751,8 +5742,8 @@ sp_itemcloak(castorder *co)
target = pa->param[0]->data.u; target = pa->param[0]->data.u;
create_curse(mage,&target->attribs, ct_find("itemcloak"), power,duration,0,0); create_curse(mage,&target->attribs, ct_find("itemcloak"), power,duration,0,0);
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"itemcloak%u:mage%u:target", mage, target)); "itemcloak", "mage target", mage, target));
return cast_level; return cast_level;
} }
@ -6858,10 +6849,10 @@ sp_stealaura(castorder *co)
u = pa->param[0]->data.u; u = pa->param[0]->data.u;
if(!get_mage(u)) { if(!get_mage(u)) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"stealaura_fail%u:unit%u:target", mage, u)); "stealaura_fail", "unit target", mage, u));
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"stealaura_fail_detect%u:unit", u)); "stealaura_fail_detect", "unit", u));
return 0; return 0;
} }
@ -6872,17 +6863,17 @@ sp_stealaura(castorder *co)
get_mage(mage)->spellpoints += taura; get_mage(mage)->spellpoints += taura;
/* sprintf(buf, "%s entzieht %s %d Aura.", unitname(mage), unitname(u), /* sprintf(buf, "%s entzieht %s %d Aura.", unitname(mage), unitname(u),
taura); */ taura); */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"stealaura_success%u:mage%u:target%i:aura", mage, u, taura)); "stealaura_success", "mage target aura", mage, u, taura));
/* sprintf(buf, "%s fühlt seine magischen Kräfte schwinden und verliert %d " /* sprintf(buf, "%s fühlt seine magischen Kräfte schwinden und verliert %d "
"Aura.", unitname(u), taura); */ "Aura.", unitname(u), taura); */
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"stealaura_detect%u:unit%i:aura", u, taura)); "stealaura_detect", "unit aura", u, taura));
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"stealaura_fail%u:unit%u:target", mage, u)); "stealaura_fail", "unit target", mage, u));
add_message(&u->faction->msgs, new_message(u->faction, ADDMSG(&u->faction->msgs, msg_message(
"stealaura_fail_detect%u:unit", u)); "stealaura_fail_detect", "unit", u));
} }
return cast_level; return cast_level;
} }
@ -6952,8 +6943,8 @@ sp_antimagiczone(castorder *co)
effect, 0); effect, 0);
/* Erfolg melden*/ /* Erfolg melden*/
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"regionmagic_effect%u:unit%r:region%s:command%u:unit", mage, "regionmagic_effect", "unit region command unit", mage,
mage->region, strdup(co->order), mage)); mage->region, strdup(co->order), mage));
return cast_level; return cast_level;
@ -7013,8 +7004,8 @@ sp_magicrunes(castorder *co)
duration, 20, 0); duration, 20, 0);
/* Erfolg melden */ /* Erfolg melden */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"objmagic_effect%u:unit%r:region%s:command%s:target", mage, "objmagic_effect", "unit region command target", mage,
mage->region, strdup(co->order), buildingname(b))); mage->region, strdup(co->order), buildingname(b)));
break; break;
} }
@ -7027,8 +7018,8 @@ sp_magicrunes(castorder *co)
duration, 20, 0); duration, 20, 0);
/* Erfolg melden */ /* Erfolg melden */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"objmagic_effect%u:unit%r:region%s:command%s:target", mage, "objmagic_effect", "unit region command target", mage,
mage->region, strdup(co->order), shipname(sh))); mage->region, strdup(co->order), shipname(sh)));
break; break;
} }
@ -7158,12 +7149,12 @@ sp_q_antimagie(castorder *co)
succ = destroy_curse(ap, cast_level, force, c); succ = destroy_curse(ap, cast_level, force, c);
if(succ) { if(succ) {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_effect%u:unit%r:region%s:command%i:succ%s:target", "destroy_magic_effect", "unit region command succ target",
mage, mage->region, strdup(co->order), succ, strdup(ts))); mage, mage->region, strdup(co->order), succ, strdup(ts)));
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_noeffect%u:unit%r:region%s:command", "destroy_magic_noeffect", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
} }
@ -7212,8 +7203,8 @@ sp_destroy_curse(castorder *co)
c = findcurse(atoi36(pa->param[1]->data.s)); c = findcurse(atoi36(pa->param[1]->data.s));
if (!c){ if (!c){
/* Es wurde kein Ziel gefunden */ /* Es wurde kein Ziel gefunden */
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"spelltargetnotfound%u:unit%r:region%s:command", "spelltargetnotfound", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
} else { } else {
switch(obj){ switch(obj){
@ -7252,9 +7243,9 @@ sp_destroy_curse(castorder *co)
/* überprüfung, ob curse zu diesem objekt gehört */ /* überprüfung, ob curse zu diesem objekt gehört */
if (!is_cursed_with(*ap, c)){ if (!is_cursed_with(*ap, c)){
/* Es wurde kein Ziel gefunden */ /* Es wurde kein Ziel gefunden */
add_message(&mage->faction->msgs, ADDMSG(&mage->faction->msgs,
new_message(mage->faction, msg_message(
"spelltargetnotfound%u:unit%r:region%s:command", "spelltargetnotfound", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
} }
@ -7264,13 +7255,13 @@ sp_destroy_curse(castorder *co)
if (c->vigour <= 0.0) { if (c->vigour <= 0.0) {
remove_curse(ap, c); remove_curse(ap, c);
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_effect%u:unit%r:region%s:command%i:id%s:target", "destroy_magic_effect", "unit region command id target",
mage, mage->region, strdup(co->order), strdup(pa->param[1]->data.s), mage, mage->region, strdup(co->order), strdup(pa->param[1]->data.s),
strdup(ts))); strdup(ts)));
} else { } else {
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_noeffect%u:unit%r:region%s:command", "destroy_magic_noeffect", "unit region command",
mage, mage->region, strdup(co->order))); mage, mage->region, strdup(co->order)));
} }
} }
@ -7308,8 +7299,8 @@ sp_becomewyrm(castorder *co)
mage->race = new_race[RC_WYRM]; mage->race = new_race[RC_WYRM];
addspell(mage, SPL_WYRMODEM); addspell(mage, SPL_WYRMODEM);
add_message(&mage->faction->msgs, new_message(mage->faction, ADDMSG(&mage->faction->msgs, msg_message(
"becomewyrm%u:mage", mage)); "becomewyrm", "mage", mage));
return co->level; return co->level;
} }
@ -7774,8 +7765,6 @@ find_spellbyname(unit *u, const char *name, const struct locale * lang)
for (spt = m->spellptr; spt; spt = spt->next) { for (spt = m->spellptr; spt; spt = spt->next) {
if (sp->id==spt->spellid) return sp; if (sp->id==spt->spellid) return sp;
} }
} else {
log_warning(("cannot find spell by name: %s\n", name));
} }
return NULL; return NULL;
} }
@ -7924,9 +7913,7 @@ static spell spelldaten[] =
(spell_f)sp_ironkeeper, patzer (spell_f)sp_ironkeeper, patzer
}, },
{ {
SPL_MAGICSTREET, "magicstreet", NULL, SPL_MAGICSTREET, "magicstreet", NULL, NULL, NULL,
"ZAUBERE \'Magischer Pfad\' <Richtung>",
"c",
M_DRUIDE, M_DRUIDE,
(FARCASTING | SPELLLEVEL | REGIONSPELL | ONSHIPCAST | TESTRESISTANCE), (FARCASTING | SPELLLEVEL | REGIONSPELL | ONSHIPCAST | TESTRESISTANCE),
5, 4, 5, 4,