forked from github/server
ZEIGE: Anzeige von Zauern die zu hochstufig sind
This commit is contained in:
parent
aa38d6325c
commit
4be3bc99fa
1 changed files with 22 additions and 20 deletions
|
@ -301,11 +301,12 @@ createspelllist(unit *u, magic_t mtyp)
|
||||||
for (slist=spells;slist!=NULL;slist=slist->next) {
|
for (slist=spells;slist!=NULL;slist=slist->next) {
|
||||||
spell * sp = slist->data;
|
spell * sp = slist->data;
|
||||||
if (sp->magietyp == mtyp && sp->level <= sk) {
|
if (sp->magietyp == mtyp && sp->level <= sk) {
|
||||||
if (!has_spell(u, sp))
|
if (!has_spell(u, sp)) {
|
||||||
addspell(u, sp->id);
|
addspell(u, sp->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
/* Erzeugen eines neuen Magiers */
|
/* Erzeugen eines neuen Magiers */
|
||||||
|
@ -362,8 +363,7 @@ already_seen(const faction * f, spellid_t id)
|
||||||
void
|
void
|
||||||
updatespelllist(unit * u)
|
updatespelllist(unit * u)
|
||||||
{
|
{
|
||||||
int max = eff_skill(u, SK_MAGIC, u->region);
|
int sk = eff_skill(u, SK_MAGIC, u->region);
|
||||||
int sk = max;
|
|
||||||
spell_list * slist;
|
spell_list * slist;
|
||||||
spell * sp;
|
spell * sp;
|
||||||
magic_t gebiet = find_magetype(u);
|
magic_t gebiet = find_magetype(u);
|
||||||
|
@ -371,13 +371,13 @@ updatespelllist(unit * u)
|
||||||
|
|
||||||
/* Nur Orkmagier bekommen den Keuschheitsamulettzauber */
|
/* Nur Orkmagier bekommen den Keuschheitsamulettzauber */
|
||||||
sp = find_spellbyid(SPL_ARTEFAKT_CHASTITYBELT);
|
sp = find_spellbyid(SPL_ARTEFAKT_CHASTITYBELT);
|
||||||
if (old_race(u->race)==RC_ORC && !has_spell(u, sp) && sp->level<=max) {
|
if (old_race(u->race)==RC_ORC && !has_spell(u, sp) && sp->level<=sk) {
|
||||||
addspell(u, SPL_ARTEFAKT_CHASTITYBELT);
|
addspell(u, SPL_ARTEFAKT_CHASTITYBELT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nur Wyrm-Magier bekommen den Wyrmtransformationszauber */
|
/* Nur Wyrm-Magier bekommen den Wyrmtransformationszauber */
|
||||||
sp = find_spellbyid(SPL_BECOMEWYRM);
|
sp = find_spellbyid(SPL_BECOMEWYRM);
|
||||||
if (fspecial(u->faction, FS_WYRM) && !has_spell(u, sp) && sp->level<=max) {
|
if (fspecial(u->faction, FS_WYRM) && !has_spell(u, sp) && sp->level<=sk) {
|
||||||
addspell(u, SPL_BECOMEWYRM);
|
addspell(u, SPL_BECOMEWYRM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,17 +388,17 @@ updatespelllist(unit * u)
|
||||||
/* keine breaks! Wyrme sollen alle drei Zauber können.*/
|
/* keine breaks! Wyrme sollen alle drei Zauber können.*/
|
||||||
case RC_WYRM:
|
case RC_WYRM:
|
||||||
sp = find_spellbyid(SPL_WYRMODEM);
|
sp = find_spellbyid(SPL_WYRMODEM);
|
||||||
if (sp!=NULL && !has_spell(u, sp) && sp->level<=max) {
|
if (sp!=NULL && !has_spell(u, sp) && sp->level<=sk) {
|
||||||
addspell(u, sp->id);
|
addspell(u, sp->id);
|
||||||
}
|
}
|
||||||
case RC_DRAGON:
|
case RC_DRAGON:
|
||||||
sp = find_spellbyid(SPL_DRAGONODEM);
|
sp = find_spellbyid(SPL_DRAGONODEM);
|
||||||
if (sp!=NULL && !has_spell(u, sp) && sp->level<=max) {
|
if (sp!=NULL && !has_spell(u, sp) && sp->level<=sk) {
|
||||||
addspell(u, sp->id);
|
addspell(u, sp->id);
|
||||||
}
|
}
|
||||||
case RC_FIREDRAGON:
|
case RC_FIREDRAGON:
|
||||||
sp = find_spellbyid(SPL_FIREDRAGONODEM);
|
sp = find_spellbyid(SPL_FIREDRAGONODEM);
|
||||||
if (sp!=NULL && has_spell(u, sp) && sp->level<=max) {
|
if (sp!=NULL && has_spell(u, sp) && sp->level<=sk) {
|
||||||
addspell(u, sp->id);
|
addspell(u, sp->id);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -411,9 +411,10 @@ updatespelllist(unit * u)
|
||||||
|
|
||||||
for (slist=spells;slist!=NULL;slist=slist->next) {
|
for (slist=spells;slist!=NULL;slist=slist->next) {
|
||||||
spell * sp = slist->data;
|
spell * sp = slist->data;
|
||||||
|
if (sp->level<=sk) {
|
||||||
boolean know = has_spell(u, sp);
|
boolean know = has_spell(u, sp);
|
||||||
|
|
||||||
if (know || (gebiet!=M_GRAU && sp->magietyp == gebiet && sp->level <= sk)) {
|
if (know || (gebiet!=M_GRAU && sp->magietyp == gebiet)) {
|
||||||
faction * f = u->faction;
|
faction * f = u->faction;
|
||||||
|
|
||||||
if (!know) addspell(u, sp->id);
|
if (!know) addspell(u, sp->id);
|
||||||
|
@ -424,6 +425,7 @@ updatespelllist(unit * u)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
/* Funktionen für die Bearbeitung der List-of-known-spells */
|
/* Funktionen für die Bearbeitung der List-of-known-spells */
|
||||||
|
@ -509,7 +511,7 @@ set_combatspell(unit *u, spell *sp, struct order * ord, int level)
|
||||||
cmistake(u, ord, 173, MSG_MAGIC);
|
cmistake(u, ord, 173, MSG_MAGIC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (has_spell(u, sp) == false) {
|
if (!has_spell(u, sp)) {
|
||||||
/* Diesen Zauber kennt die Einheit nicht */
|
/* Diesen Zauber kennt die Einheit nicht */
|
||||||
cmistake(u, ord, 169, MSG_MAGIC);
|
cmistake(u, ord, 169, MSG_MAGIC);
|
||||||
return;
|
return;
|
||||||
|
@ -865,7 +867,7 @@ knowsspell(const region * r, const unit * u, const spell * sp)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/* steht der Spruch in der Spruchliste? */
|
/* steht der Spruch in der Spruchliste? */
|
||||||
if (has_spell(u, sp) == false){
|
if (!has_spell(u, sp)) {
|
||||||
/* ist der Spruch aus einem anderen Magiegebiet? */
|
/* ist der Spruch aus einem anderen Magiegebiet? */
|
||||||
if (find_magetype(u) != sp->magietyp) {
|
if (find_magetype(u) != sp->magietyp) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue