Ensure that Battlemage's initial three spell schools are unique.
This commit is contained in:
parent
8500c020cb
commit
980daa1d8c
23
objects.c
23
objects.c
|
@ -1945,12 +1945,23 @@ object_t *addobject(obpile_t *where, char *name, int canstack, int dolinks, enum
|
||||||
// select actual random schools to use.
|
// select actual random schools to use.
|
||||||
for (i = 0; i < nschools; i++) {
|
for (i = 0; i < nschools; i++) {
|
||||||
if (where->owner && hasjob(where->owner, J_BATTLEMAGE)) {
|
if (where->owner && hasjob(where->owner, J_BATTLEMAGE)) {
|
||||||
switch (rnd(1,5)) {
|
int isnew = B_FALSE;
|
||||||
case 1: school[i] = SS_FIRE; break;
|
while (!isnew) {
|
||||||
case 2: school[i] = SS_COLD; break;
|
switch (rnd(1,5)) {
|
||||||
case 3: school[i] = SS_AIR; break;
|
case 1: school[i] = SS_FIRE; break;
|
||||||
case 4: school[i] = SS_TRANSLOCATION; break;
|
case 2: school[i] = SS_COLD; break;
|
||||||
case 5: school[i] = SS_WILD; break;
|
case 3: school[i] = SS_AIR; break;
|
||||||
|
case 4: school[i] = SS_TRANSLOCATION; break;
|
||||||
|
case 5: school[i] = SS_WILD; break;
|
||||||
|
}
|
||||||
|
isnew = B_TRUE;
|
||||||
|
// make sure it's not a school we already have
|
||||||
|
for (n = 0; n < i; n++) {
|
||||||
|
if (school[n] == school[i]) {
|
||||||
|
isnew = B_FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (where->owner && hasjobcat(where->owner, JC_MAGE)) {
|
} else if (where->owner && hasjobcat(where->owner, JC_MAGE)) {
|
||||||
school[i] = getrandomspellschool(where->owner, B_TRUE);
|
school[i] = getrandomspellschool(where->owner, B_TRUE);
|
||||||
|
|
Loading…
Reference in New Issue