forked from github/server
- beim fixen des bugs habe ich einen Fehler gemacht, der die Liste der Schemen auf 0 reduziert, und allen Kontakt vom Astral- zum Normalraum unterbricht. Bei der Gelegenheit bessere Fehlererkennung eingebaut.
This commit is contained in:
parent
85d0383471
commit
b1fa0e3dd5
5 changed files with 313 additions and 307 deletions
|
@ -1345,10 +1345,10 @@ report_computer(FILE * F, faction * f, const faction_list * addresses,
|
||||||
}
|
}
|
||||||
print_curses(F, f, r, TYP_REGION);
|
print_curses(F, f, r, TYP_REGION);
|
||||||
cr_borders(r, f, sd->mode, F);
|
cr_borders(r, f, sd->mode, F);
|
||||||
if (sd->mode==see_unit && r->planep && r->planep->id == 1 && !is_cursed(r->attribs, C_ASTRALBLOCK, 0))
|
if (sd->mode==see_unit && rplane(r)==get_astralplane() && !is_cursed(r->attribs, C_ASTRALBLOCK, 0))
|
||||||
{
|
{
|
||||||
/* Sonderbehandlung Teleport-Ebene */
|
/* Sonderbehandlung Teleport-Ebene */
|
||||||
region_list *rl = astralregions(r_astral_to_standard(r), inhabitable);
|
region_list *rl = astralregions(r, inhabitable);
|
||||||
|
|
||||||
if (rl) {
|
if (rl) {
|
||||||
region_list *rl2 = rl;
|
region_list *rl2 = rl;
|
||||||
|
|
|
@ -1364,10 +1364,10 @@ describe(FILE * F, const region * r, int partial, faction * f)
|
||||||
rparagraph(F, buf, 0, 0);
|
rparagraph(F, buf, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (partial==0 && r->planep && r->planep->id == 1 &&
|
if (partial==0 && rplane(r) == get_astralplane() &&
|
||||||
!is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
!is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
/* Sonderbehandlung Teleport-Ebene */
|
/* Sonderbehandlung Teleport-Ebene */
|
||||||
region_list *rl = astralregions(r_astral_to_standard(r), inhabitable);
|
region_list *rl = astralregions(r, inhabitable);
|
||||||
region_list *rl2;
|
region_list *rl2;
|
||||||
|
|
||||||
if (rl) {
|
if (rl) {
|
||||||
|
|
|
@ -1903,118 +1903,118 @@ sp_treewalkenter(castorder *co)
|
||||||
static int
|
static int
|
||||||
sp_treewalkexit(castorder *co)
|
sp_treewalkexit(castorder *co)
|
||||||
{
|
{
|
||||||
region *rt;
|
region *rt;
|
||||||
region_list *rl, *rl2;
|
region_list *rl, *rl2;
|
||||||
int tax, tay;
|
int tax, tay;
|
||||||
unit *u, *u2;
|
unit *u, *u2;
|
||||||
int remaining_cap;
|
int remaining_cap;
|
||||||
int n;
|
int n;
|
||||||
int erfolg = 0;
|
int erfolg = 0;
|
||||||
region *r = co->rt;
|
region *r = co->rt;
|
||||||
unit *mage = (unit *)co->magician;
|
unit *mage = (unit *)co->magician;
|
||||||
double power = co->force;
|
double power = co->force;
|
||||||
spellparameter *pa = co->par;
|
spellparameter *pa = co->par;
|
||||||
int cast_level = co->level;
|
int cast_level = co->level;
|
||||||
|
|
||||||
if(getplane(r) != get_astralplane()) {
|
if(getplane(r) != get_astralplane()) {
|
||||||
cmistake(mage, strdup(co->order), 193, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 193, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
if(is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
cmistake(mage, strdup(co->order), 192, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 192, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
remaining_cap = (int)(power * 500);
|
remaining_cap = (int)(power * 500);
|
||||||
|
|
||||||
if(pa->param[0]->typ != SPP_REGION){
|
if(pa->param[0]->typ != SPP_REGION){
|
||||||
report_failure(mage, co->order);
|
report_failure(mage, co->order);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Koordinaten setzen und Region löschen für Überprüfung auf
|
/* Koordinaten setzen und Region löschen für Überprüfung auf
|
||||||
* Gültigkeit */
|
* Gültigkeit */
|
||||||
rt = pa->param[0]->data.r;
|
rt = pa->param[0]->data.r;
|
||||||
tax = rt->x;
|
tax = rt->x;
|
||||||
tay = rt->y;
|
tay = rt->y;
|
||||||
rt = NULL;
|
rt = NULL;
|
||||||
|
|
||||||
rl = astralregions(r_astral_to_standard(r), inhabitable);
|
rl = astralregions(r, inhabitable);
|
||||||
rt = 0;
|
rt = 0;
|
||||||
|
|
||||||
rl2 = rl;
|
rl2 = rl;
|
||||||
while(rl2) {
|
while(rl2) {
|
||||||
if(rl2->data->x == tax && rl2->data->y == tay) {
|
if(rl2->data->x == tax && rl2->data->y == tay) {
|
||||||
rt = rl2->data;
|
rt = rl2->data;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rl2 = rl2->next;
|
rl2 = rl2->next;
|
||||||
}
|
}
|
||||||
free_regionlist(rl);
|
free_regionlist(rl);
|
||||||
|
|
||||||
if(!rt) {
|
if(!rt) {
|
||||||
cmistake(mage, strdup(co->order), 195, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 195, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!r_isforest(rt)) {
|
if (!r_isforest(rt)) {
|
||||||
cmistake(mage, strdup(co->order), 196, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 196, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* für jede Einheit in der Kommandozeile */
|
/* für jede Einheit in der Kommandozeile */
|
||||||
for (n = 1; n < pa->length; n++) {
|
for (n = 1; n < pa->length; n++) {
|
||||||
if(pa->param[n]->flag == TARGET_RESISTS
|
if(pa->param[n]->flag == TARGET_RESISTS
|
||||||
|| pa->param[n]->flag == TARGET_NOTFOUND)
|
|| pa->param[n]->flag == TARGET_NOTFOUND)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
u = pa->param[n]->data.u;
|
u = pa->param[n]->data.u;
|
||||||
|
|
||||||
if(!ucontact(u, mage)) {
|
if(!ucontact(u, mage)) {
|
||||||
sprintf(buf, "%s hat uns nicht kontaktiert.", unitname(u));
|
sprintf(buf, "%s hat uns nicht kontaktiert.", unitname(u));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
} else {
|
} else {
|
||||||
int w = weight(u);
|
int w = weight(u);
|
||||||
if(!can_survive(u, rt)) {
|
if(!can_survive(u, rt)) {
|
||||||
cmistake(mage, strdup(co->order), 231, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 231, MSG_MAGIC);
|
||||||
} else if(remaining_cap - w < 0) {
|
} else if(remaining_cap - w < 0) {
|
||||||
sprintf(buf, "%s ist zu schwer.", unitname(u));
|
sprintf(buf, "%s ist zu schwer.", unitname(u));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
} else {
|
} else {
|
||||||
remaining_cap = remaining_cap - w;
|
remaining_cap = remaining_cap - w;
|
||||||
move_unit(u, rt, NULL);
|
move_unit(u, rt, NULL);
|
||||||
erfolg = cast_level;
|
erfolg = cast_level;
|
||||||
|
|
||||||
/* Meldungen in der Ausgangsregion */
|
/* Meldungen in der Ausgangsregion */
|
||||||
|
|
||||||
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
||||||
for(u2 = r->units; u2; u2 = u2->next ) {
|
for(u2 = r->units; u2; u2 = u2->next ) {
|
||||||
if(!fval(u2->faction, FL_DH)) {
|
if(!fval(u2->faction, FL_DH)) {
|
||||||
fset(u2->faction, FL_DH);
|
fset(u2->faction, FL_DH);
|
||||||
if(cansee(u2->faction, r, u, 0)) {
|
if(cansee(u2->faction, r, u, 0)) {
|
||||||
sprintf(buf, "%s wird durchscheinend und verschwindet.",
|
sprintf(buf, "%s wird durchscheinend und verschwindet.",
|
||||||
unitname(u));
|
unitname(u));
|
||||||
addmessage(r, u2->faction, buf, MSG_EVENT, ML_INFO);
|
addmessage(r, u2->faction, buf, MSG_EVENT, ML_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Meldungen in der Zielregion */
|
/* Meldungen in der Zielregion */
|
||||||
|
|
||||||
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
||||||
for(u2 = rt->units; u2; u2 = u2->next ) {
|
for(u2 = rt->units; u2; u2 = u2->next ) {
|
||||||
if(!fval(u2->faction, FL_DH)) {
|
if(!fval(u2->faction, FL_DH)) {
|
||||||
fset(u2->faction, FL_DH);
|
fset(u2->faction, FL_DH);
|
||||||
if(cansee(u2->faction, rt, u, 0)) {
|
if(cansee(u2->faction, rt, u, 0)) {
|
||||||
sprintf(buf, "%s erscheint plötzlich.", unitname(u));
|
sprintf(buf, "%s erscheint plötzlich.", unitname(u));
|
||||||
addmessage(rt, u2->faction, buf, MSG_EVENT, ML_INFO);
|
addmessage(rt, u2->faction, buf, MSG_EVENT, ML_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return erfolg;
|
return erfolg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -5918,142 +5918,141 @@ sp_enterastral(castorder *co)
|
||||||
int
|
int
|
||||||
sp_pullastral(castorder *co)
|
sp_pullastral(castorder *co)
|
||||||
{
|
{
|
||||||
region *rt, *ro;
|
region *rt, *ro;
|
||||||
unit *u, *u2;
|
unit *u, *u2;
|
||||||
region_list *rl, *rl2;
|
region_list *rl, *rl2;
|
||||||
int remaining_cap;
|
int remaining_cap;
|
||||||
int n, w;
|
int n, w;
|
||||||
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;
|
||||||
double power = co->force;
|
double power = co->force;
|
||||||
spellparameter *pa = co->par;
|
spellparameter *pa = co->par;
|
||||||
spell *sp = co->sp;
|
spell *sp = co->sp;
|
||||||
|
|
||||||
switch(getplaneid(r)) {
|
switch (getplaneid(r)) {
|
||||||
case 1:
|
case 1:
|
||||||
rt = r;
|
rt = r;
|
||||||
ro = pa->param[0]->data.r;
|
ro = pa->param[0]->data.r;
|
||||||
rl = astralregions(r_astral_to_standard(r), NULL);
|
rl = astralregions(r, NULL);
|
||||||
rl2 = rl;
|
rl2 = rl;
|
||||||
while (rl2!=NULL) {
|
while (rl2!=NULL) {
|
||||||
region * r2 = rl2->data;
|
region * r2 = rl2->data;
|
||||||
if (r2->x == ro->x && r2->y == ro->y) {
|
if (r2->x == ro->x && r2->y == ro->y) {
|
||||||
ro = r2;
|
ro = r2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rl2 = rl2->next;
|
rl2 = rl2->next;
|
||||||
}
|
}
|
||||||
if(!rl2) {
|
if(!rl2) {
|
||||||
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
|
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
|
||||||
"dieser Region hergestellt werden.", unitname(mage),
|
"dieser Region hergestellt werden.", unitname(mage),
|
||||||
regionid(mage->region), spell_name(sp, mage->faction->locale));
|
regionid(mage->region), spell_name(sp, mage->faction->locale));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
free_regionlist(rl);
|
free_regionlist(rl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
free_regionlist(rl);
|
free_regionlist(rl);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert "
|
sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert "
|
||||||
"nur in der astralen Welt.", unitname(mage),
|
"nur in der astralen Welt.", unitname(mage),
|
||||||
regionid(mage->region), spell_name(sp, mage->faction->locale));
|
regionid(mage->region), spell_name(sp, mage->faction->locale));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_cursed(rt->attribs, C_ASTRALBLOCK, 0) ||
|
if(is_cursed(rt->attribs, C_ASTRALBLOCK, 0) ||
|
||||||
is_cursed(ro->attribs, C_ASTRALBLOCK, 0)) {
|
is_cursed(ro->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
|
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
|
||||||
"dieser Region hergestellt werden.", unitname(mage),
|
"dieser Region hergestellt werden.", unitname(mage),
|
||||||
regionid(mage->region), spell_name(sp, mage->faction->locale));
|
regionid(mage->region), spell_name(sp, mage->faction->locale));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
remaining_cap = (int)((power-3) * 1500);
|
remaining_cap = (int)((power-3) * 1500);
|
||||||
|
|
||||||
/* für jede Einheit in der Kommandozeile */
|
/* für jede Einheit in der Kommandozeile */
|
||||||
for (n = 1; n < pa->length; n++) {
|
for (n = 1; n < pa->length; n++) {
|
||||||
if(pa->param[n]->flag == TARGET_NOTFOUND) continue;
|
if(pa->param[n]->flag == TARGET_NOTFOUND) continue;
|
||||||
|
|
||||||
u = pa->param[n]->data.u;
|
u = pa->param[n]->data.u;
|
||||||
|
|
||||||
if(!ucontact(u, mage)) {
|
if(!ucontact(u, mage)) {
|
||||||
if(power > 12 && pa->param[n]->flag == TARGET_RESISTS && can_survive(u, rt)) {
|
if(power > 12 && pa->param[n]->flag == TARGET_RESISTS && can_survive(u, rt)) {
|
||||||
sprintf(buf, "%s hat uns nicht kontaktiert, widersteht dem "
|
sprintf(buf, "%s hat uns nicht kontaktiert, widersteht dem "
|
||||||
"Zauber jedoch nicht.", unitname(u));
|
"Zauber jedoch nicht.", unitname(u));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
|
||||||
sprintf(buf, "%s wird von %s in eine andere Welt geschleudert.",
|
sprintf(buf, "%s wird von %s in eine andere Welt geschleudert.",
|
||||||
unitname(u),
|
unitname(u),
|
||||||
cansee(u->faction, r, mage, 0)?unitname(mage):"jemandem");
|
cansee(u->faction, r, mage, 0)?unitname(mage):"jemandem");
|
||||||
addmessage(r, u->faction, buf, MSG_MAGIC, ML_WARN);
|
addmessage(r, u->faction, buf, MSG_MAGIC, ML_WARN);
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s hat uns nicht kontaktiert und widersteht dem "
|
sprintf(buf, "%s hat uns nicht kontaktiert und widersteht dem "
|
||||||
"Zauber.", unitname(u));
|
"Zauber.", unitname(u));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
sprintf(buf, "%s versucht, %s in eine andere Welt zu schleudern.",
|
sprintf(buf, "%s versucht, %s in eine andere Welt zu schleudern.",
|
||||||
cansee(u->faction, r, mage, 0)?unitname(mage):"Jemand",
|
cansee(u->faction, r, mage, 0)?unitname(mage):"Jemand",
|
||||||
unitname(u));
|
unitname(u));
|
||||||
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
|
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
w = weight(u);
|
w = weight(u);
|
||||||
|
|
||||||
if(!can_survive(u, rt)) {
|
if(!can_survive(u, rt)) {
|
||||||
cmistake(mage, strdup(co->order), 231, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 231, MSG_MAGIC);
|
||||||
} else if(remaining_cap - w < 0) {
|
} else if(remaining_cap - w < 0) {
|
||||||
addmessage(r, mage->faction, "Die Einheit ist zu schwer.",
|
addmessage(r, mage->faction, "Die Einheit ist zu schwer.",
|
||||||
MSG_MAGIC, ML_MISTAKE);
|
MSG_MAGIC, ML_MISTAKE);
|
||||||
} else {
|
} else {
|
||||||
remaining_cap = remaining_cap - w;
|
remaining_cap = remaining_cap - w;
|
||||||
move_unit(u, rt, NULL);
|
move_unit(u, rt, NULL);
|
||||||
|
|
||||||
/* Meldungen in der Ausgangsregion */
|
/* Meldungen in der Ausgangsregion */
|
||||||
|
|
||||||
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
||||||
for(u2 = r->units; u2; u2 = u2->next ) {
|
for(u2 = r->units; u2; u2 = u2->next ) {
|
||||||
if(!fval(u2->faction, FL_DH)) {
|
if(!fval(u2->faction, FL_DH)) {
|
||||||
fset(u2->faction, FL_DH);
|
fset(u2->faction, FL_DH);
|
||||||
if(cansee(u2->faction, r, u, 0)) {
|
if(cansee(u2->faction, r, u, 0)) {
|
||||||
sprintf(buf, "%s wird durchscheinend und verschwindet.",
|
sprintf(buf, "%s wird durchscheinend und verschwindet.",
|
||||||
unitname(u));
|
unitname(u));
|
||||||
addmessage(r, u2->faction, buf, MSG_EVENT, ML_INFO);
|
addmessage(r, u2->faction, buf, MSG_EVENT, ML_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Meldungen in der Zielregion */
|
/* Meldungen in der Zielregion */
|
||||||
|
|
||||||
for (u2 = rt->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
for (u2 = rt->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
||||||
for(u2 = rt->units; u2; u2 = u2->next ) {
|
for(u2 = rt->units; u2; u2 = u2->next ) {
|
||||||
if(!fval(u2->faction, FL_DH)) {
|
if(!fval(u2->faction, FL_DH)) {
|
||||||
fset(u2->faction, FL_DH);
|
fset(u2->faction, FL_DH);
|
||||||
if(cansee(u2->faction, rt, u, 0)) {
|
if(cansee(u2->faction, rt, u, 0)) {
|
||||||
sprintf(buf, "%s erscheint plötzlich.", unitname(u));
|
sprintf(buf, "%s erscheint plötzlich.", unitname(u));
|
||||||
addmessage(rt, u2->faction, buf, MSG_EVENT, ML_INFO);
|
addmessage(rt, u2->faction, buf, MSG_EVENT, ML_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cast_level;
|
return cast_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
sp_leaveastral(castorder *co)
|
sp_leaveastral(castorder *co)
|
||||||
{
|
{
|
||||||
region *rt, *ro;
|
region *rt, *ro;
|
||||||
region_list *rl, *rl2;
|
region_list *rl, *rl2;
|
||||||
unit *u, *u2;
|
unit *u, *u2;
|
||||||
int remaining_cap;
|
int remaining_cap;
|
||||||
int n, w;
|
int n, w;
|
||||||
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;
|
||||||
double power = co->force;
|
double power = co->force;
|
||||||
spellparameter *pa = co->par;
|
spellparameter *pa = co->par;
|
||||||
|
|
||||||
|
@ -6066,7 +6065,7 @@ sp_leaveastral(castorder *co)
|
||||||
MSG_MAGIC, ML_MISTAKE);
|
MSG_MAGIC, ML_MISTAKE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
rl = astralregions(r_astral_to_standard(r), inhabitable);
|
rl = astralregions(r, inhabitable);
|
||||||
rl2 = rl;
|
rl2 = rl;
|
||||||
while (rl2!=NULL) {
|
while (rl2!=NULL) {
|
||||||
if (rl2->data == rt) break;
|
if (rl2->data == rt) break;
|
||||||
|
@ -6089,78 +6088,78 @@ sp_leaveastral(castorder *co)
|
||||||
if (ro==NULL || is_cursed(ro->attribs, C_ASTRALBLOCK, 0) || is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
|
if (ro==NULL || is_cursed(ro->attribs, C_ASTRALBLOCK, 0) || is_cursed(rt->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
sprintf(buf, "Die Wege aus dieser astralen Region sind blockiert.");
|
sprintf(buf, "Die Wege aus dieser astralen Region sind blockiert.");
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
remaining_cap = (int)((power-3) * 1500);
|
remaining_cap = (int)((power-3) * 1500);
|
||||||
|
|
||||||
/* für jede Einheit in der Kommandozeile */
|
/* für jede Einheit in der Kommandozeile */
|
||||||
for (n = 1; n < pa->length; n++) {
|
for (n = 1; n < pa->length; n++) {
|
||||||
if(pa->param[n]->flag == TARGET_NOTFOUND) continue;
|
if(pa->param[n]->flag == TARGET_NOTFOUND) continue;
|
||||||
|
|
||||||
u = pa->param[n]->data.u;
|
u = pa->param[n]->data.u;
|
||||||
|
|
||||||
if(!ucontact(u, mage)) {
|
if(!ucontact(u, mage)) {
|
||||||
if(power > 10 && !pa->param[n]->flag == TARGET_RESISTS && can_survive(u, rt)) {
|
if(power > 10 && !pa->param[n]->flag == TARGET_RESISTS && can_survive(u, rt)) {
|
||||||
sprintf(buf, "%s hat uns nicht kontaktiert, widersteht dem "
|
sprintf(buf, "%s hat uns nicht kontaktiert, widersteht dem "
|
||||||
"Zauber jedoch nicht.", unitname(u));
|
"Zauber jedoch nicht.", unitname(u));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
|
||||||
sprintf(buf, "%s wird von %s in eine andere Welt geschleudert.",
|
sprintf(buf, "%s wird von %s in eine andere Welt geschleudert.",
|
||||||
unitname(u),
|
unitname(u),
|
||||||
cansee(u->faction, r, mage, 0)?unitname(mage):"jemandem");
|
cansee(u->faction, r, mage, 0)?unitname(mage):"jemandem");
|
||||||
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
|
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s hat uns nicht kontaktiert und widersteht dem "
|
sprintf(buf, "%s hat uns nicht kontaktiert und widersteht dem "
|
||||||
"Zauber.", unitname(u));
|
"Zauber.", unitname(u));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_WARN);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_WARN);
|
||||||
sprintf(buf, "%s versucht, %s in eine andere Welt zu schleudern.",
|
sprintf(buf, "%s versucht, %s in eine andere Welt zu schleudern.",
|
||||||
cansee(u->faction, r, mage, 0)?unitname(mage):"Jemand",
|
cansee(u->faction, r, mage, 0)?unitname(mage):"Jemand",
|
||||||
unitname(u));
|
unitname(u));
|
||||||
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
|
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
w = weight(u);
|
w = weight(u);
|
||||||
|
|
||||||
if(!can_survive(u, rt)) {
|
if(!can_survive(u, rt)) {
|
||||||
cmistake(mage, strdup(co->order), 231, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 231, MSG_MAGIC);
|
||||||
} else if(remaining_cap - w < 0) {
|
} else if(remaining_cap - w < 0) {
|
||||||
addmessage(r, mage->faction, "Die Einheit ist zu schwer.",
|
addmessage(r, mage->faction, "Die Einheit ist zu schwer.",
|
||||||
MSG_MAGIC, ML_MISTAKE);
|
MSG_MAGIC, ML_MISTAKE);
|
||||||
} else {
|
} else {
|
||||||
remaining_cap = remaining_cap - w;
|
remaining_cap = remaining_cap - w;
|
||||||
move_unit(u, rt, NULL);
|
move_unit(u, rt, NULL);
|
||||||
|
|
||||||
/* Meldungen in der Ausgangsregion */
|
/* Meldungen in der Ausgangsregion */
|
||||||
|
|
||||||
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
for (u2 = r->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
||||||
for(u2 = r->units; u2; u2 = u2->next ) {
|
for(u2 = r->units; u2; u2 = u2->next ) {
|
||||||
if(!fval(u2->faction, FL_DH)) {
|
if(!fval(u2->faction, FL_DH)) {
|
||||||
fset(u2->faction, FL_DH);
|
fset(u2->faction, FL_DH);
|
||||||
if(cansee(u2->faction, r, u, 0)) {
|
if(cansee(u2->faction, r, u, 0)) {
|
||||||
sprintf(buf, "%s wird durchscheinend und verschwindet.",
|
sprintf(buf, "%s wird durchscheinend und verschwindet.",
|
||||||
unitname(u));
|
unitname(u));
|
||||||
addmessage(r, u2->faction, buf, MSG_EVENT, ML_INFO);
|
addmessage(r, u2->faction, buf, MSG_EVENT, ML_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Meldungen in der Zielregion */
|
/* Meldungen in der Zielregion */
|
||||||
|
|
||||||
for (u2 = rt->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
for (u2 = rt->units; u2; u2 = u2->next) freset(u2->faction, FL_DH);
|
||||||
for (u2 = rt->units; u2; u2 = u2->next ) {
|
for (u2 = rt->units; u2; u2 = u2->next ) {
|
||||||
if(!fval(u2->faction, FL_DH)) {
|
if(!fval(u2->faction, FL_DH)) {
|
||||||
fset(u2->faction, FL_DH);
|
fset(u2->faction, FL_DH);
|
||||||
if(cansee(u2->faction, rt, u, 0)) {
|
if(cansee(u2->faction, rt, u, 0)) {
|
||||||
sprintf(buf, "%s erscheint plötzlich.", unitname(u));
|
sprintf(buf, "%s erscheint plötzlich.", unitname(u));
|
||||||
addmessage(rt, u2->faction, buf, MSG_EVENT, ML_INFO);
|
addmessage(rt, u2->faction, buf, MSG_EVENT, ML_INFO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cast_level;
|
return cast_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -6373,40 +6372,40 @@ sp_showastral(castorder *co)
|
||||||
int
|
int
|
||||||
sp_viewreality(castorder *co)
|
sp_viewreality(castorder *co)
|
||||||
{
|
{
|
||||||
region_list *rl, *rl2;
|
region_list *rl, *rl2;
|
||||||
unit *u;
|
unit *u;
|
||||||
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(getplaneid(r) != 1) {
|
if(getplaneid(r) != 1) {
|
||||||
/* sprintf(buf, "Dieser Zauber kann nur im Astralraum gezaubert werden."); */
|
/* sprintf(buf, "Dieser Zauber kann nur im Astralraum gezaubert werden."); */
|
||||||
cmistake(mage, strdup(co->order), 217, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 217, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
if(is_cursed(r->attribs, C_ASTRALBLOCK, 0)) {
|
||||||
/* sprintf(buf, "Die materielle Welt ist hier nicht sichtbar.");*/
|
/* sprintf(buf, "Die materielle Welt ist hier nicht sichtbar.");*/
|
||||||
cmistake(mage, strdup(co->order), 218, MSG_MAGIC);
|
cmistake(mage, strdup(co->order), 218, MSG_MAGIC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
rl = astralregions(r_astral_to_standard(r), NULL);
|
rl = astralregions(r, NULL);
|
||||||
|
|
||||||
/* Irgendwann mal auf Curses u/o Attribut umstellen. */
|
/* Irgendwann mal auf Curses u/o Attribut umstellen. */
|
||||||
for (rl2=rl; rl2; rl2=rl2->next) {
|
for (rl2=rl; rl2; rl2=rl2->next) {
|
||||||
u = createunit(rl2->data, mage->faction, RS_FARVISION, new_race[RC_SPELL]);
|
u = createunit(rl2->data, mage->faction, RS_FARVISION, new_race[RC_SPELL]);
|
||||||
set_level(u, SK_OBSERVATION, co->level/2);
|
set_level(u, SK_OBSERVATION, co->level/2);
|
||||||
set_string(&u->name, "Zauber: Blick in die Realität");
|
set_string(&u->name, "Zauber: Blick in die Realität");
|
||||||
u->age = 2;
|
u->age = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
free_regionlist(rl);
|
free_regionlist(rl);
|
||||||
|
|
||||||
sprintf(buf, "%s gelingt es, durch die Nebel auf die Realität zu blicken.",
|
sprintf(buf, "%s gelingt es, durch die Nebel auf die Realität zu blicken.",
|
||||||
unitname(mage));
|
unitname(mage));
|
||||||
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
|
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
|
||||||
return cast_level;
|
return cast_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -6454,7 +6453,7 @@ sp_disruptastral(castorder *co)
|
||||||
if (r2->units!=NULL) {
|
if (r2->units!=NULL) {
|
||||||
region_list * trl2;
|
region_list * trl2;
|
||||||
|
|
||||||
trl = astralregions(r_astral_to_standard(rl2->data), inhabitable);
|
trl = astralregions(rl2->data, inhabitable);
|
||||||
for (trl2 = trl; trl2; trl2 = trl2->next) ++inhab_regions;
|
for (trl2 = trl; trl2; trl2 = trl2->next) ++inhab_regions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
#include "faction.h"
|
#include "faction.h"
|
||||||
#include "plane.h"
|
#include "plane.h"
|
||||||
|
|
||||||
|
/* util includes */
|
||||||
|
#include <log.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -60,9 +63,13 @@ astralregions(const region * r, boolean (*valid)(const region *))
|
||||||
region_list * rlist = NULL;
|
region_list * rlist = NULL;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
assert(rplane(r) == NULL);
|
assert(rplane(r) == get_astralplane());
|
||||||
if (r==NULL) return NULL;
|
if (rplane(r) != get_astralplane()) {
|
||||||
|
log_error(("astralregions was called with a non-astral region.\n"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
r = r_astral_to_standard(r);
|
r = r_astral_to_standard(r);
|
||||||
|
if (r==NULL) return NULL;
|
||||||
|
|
||||||
for (x=r->x-TP_RADIUS;x<=r->x+TP_RADIUS;++x) {
|
for (x=r->x-TP_RADIUS;x<=r->x+TP_RADIUS;++x) {
|
||||||
for (y=r->y-TP_RADIUS;y<=r->y+TP_RADIUS;++y) {
|
for (y=r->y-TP_RADIUS;y<=r->y+TP_RADIUS;++y) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ extern "C" {
|
||||||
|
|
||||||
struct region *r_standard_to_astral(const struct region *r);
|
struct region *r_standard_to_astral(const struct region *r);
|
||||||
struct region *r_astral_to_standard(const struct region *);
|
struct region *r_astral_to_standard(const struct region *);
|
||||||
extern struct region_list *astralregions(const struct region * r, boolean (*valid)(const struct region *));
|
extern struct region_list *astralregions(const struct region * rastral, boolean (*valid)(const struct region *));
|
||||||
extern struct region_list *all_in_range(const struct region *r, int n, boolean (*valid)(const struct region *));
|
extern struct region_list *all_in_range(const struct region *r, int n, boolean (*valid)(const struct region *));
|
||||||
extern boolean inhabitable(const struct region * r);
|
extern boolean inhabitable(const struct region * r);
|
||||||
extern struct plane * get_astralplane(void);
|
extern struct plane * get_astralplane(void);
|
||||||
|
|
Loading…
Reference in a new issue