Antimagie zeigt jetzt (hoffentlich) den korrekten Befehl an.
This commit is contained in:
Enno Rehling 2004-05-21 11:49:08 +00:00
parent 0f83d33024
commit bc1f94a826
3 changed files with 62 additions and 61 deletions

View File

@ -1504,7 +1504,7 @@ do_combatmagic(battle *b, combatmagic_t was)
} }
power = spellpower(r, mage, sp, level); power = spellpower(r, mage, sp, level, cmd);
if (power <= 0) { /* Effekt von Antimagie */ if (power <= 0) { /* Effekt von Antimagie */
report_failed_spell(b, mage, sp); report_failed_spell(b, mage, sp);
pay_spell(mage, sp, level, 1); pay_spell(mage, sp, level, 1);
@ -1566,7 +1566,8 @@ do_combatspell(troop at, int row)
fi->magic = 0; /* Hat keinen Kampfzauber, kämpft nichtmagisch weiter */ fi->magic = 0; /* Hat keinen Kampfzauber, kämpft nichtmagisch weiter */
return; return;
} }
snprintf(cmd, 128, "ZAUBER %s", spell_name(sp, lang)); snprintf(cmd, 128, "%s \"%s\"",
LOC(lang, keywords[K_CAST]), spell_name(sp, lang));
if (cancast(mage, sp, 1, 1, cmd) == false) { if (cancast(mage, sp, 1, 1, cmd) == false) {
fi->magic = 0; /* Kann nicht mehr Zaubern, kämpft nichtmagisch weiter */ fi->magic = 0; /* Kann nicht mehr Zaubern, kämpft nichtmagisch weiter */
return; return;
@ -1597,7 +1598,7 @@ do_combatspell(troop at, int row)
pay_spell(mage, sp, level, 1); pay_spell(mage, sp, level, 1);
return; return;
} }
power = spellpower(r, mage, sp, level); power = spellpower(r, mage, sp, level, cmd);
if (power <= 0) { /* Effekt von Antimagie */ if (power <= 0) { /* Effekt von Antimagie */
report_failed_spell(b, mage, sp); report_failed_spell(b, mage, sp);
pay_spell(mage, sp, level, 1); pay_spell(mage, sp, level, 1);

View File

@ -985,7 +985,7 @@ cancast(unit * u, spell * sp, int level, int range, char * cmd)
*/ */
double double
spellpower(region * r, unit * u, spell * sp, int cast_level) spellpower(region * r, unit * u, spell * sp, int cast_level, const char * cmd)
{ {
curse * c; curse * c;
double force = cast_level; double force = cast_level;
@ -1005,7 +1005,7 @@ spellpower(region * r, unit * u, spell * sp, int cast_level)
if (curse_active(c)) { if (curse_active(c)) {
force -= curse_geteffect(c); force -= curse_geteffect(c);
curse_changevigour(&r->attribs, c, -cast_level); curse_changevigour(&r->attribs, c, -cast_level);
cmistake(u, findorder(u, u->thisorder), 185, MSG_MAGIC); cmistake(u, findorder(u, cmd), 185, MSG_MAGIC);
} }
/* Patzerfluch-Effekt: */ /* Patzerfluch-Effekt: */
@ -1013,7 +1013,7 @@ spellpower(region * r, unit * u, spell * sp, int cast_level)
if (curse_active(c)) { if (curse_active(c)) {
force -= curse_geteffect(c); force -= curse_geteffect(c);
curse_changevigour(&u->attribs, c, -1); curse_changevigour(&u->attribs, c, -1);
cmistake(u, findorder(u, u->thisorder), 185, MSG_MAGIC); cmistake(u, findorder(u, cmd), 185, MSG_MAGIC);
} }
force = force * MagicPower(); force = force * MagicPower();
@ -2925,7 +2925,7 @@ magic(void)
continue; continue;
} }
co->force = spellpower(target_r, u, sp, co->level); co->force = spellpower(target_r, u, sp, co->level, cmd);
/* die Stärke kann durch Antimagie auf 0 sinken */ /* die Stärke kann durch Antimagie auf 0 sinken */
if (co->force <= 0) { if (co->force <= 0) {
co->force = 0; co->force = 0;

View File

@ -311,7 +311,7 @@ int change_maxspellpoints(struct unit * u, int csp);
/* verändert die maximalen Magiepunkte einer Einheit */ /* verändert die maximalen Magiepunkte einer Einheit */
/* Zaubern */ /* Zaubern */
double spellpower(struct region *r, struct unit *u, spell *spruch, int cast_level); extern double spellpower(struct region *r, struct unit *u, spell *spruch, int cast_level, const char * cmd);
/* ermittelt die Stärke eines Spruchs */ /* ermittelt die Stärke eines Spruchs */
boolean fumble (struct region *r, struct unit *u, spell *spruch, int cast_level); boolean fumble (struct region *r, struct unit *u, spell *spruch, int cast_level);
/* true, wenn der Zauber misslingt, bei false gelingt der Zauber */ /* true, wenn der Zauber misslingt, bei false gelingt der Zauber */