forked from github/server
rename global target flag, invert logic
This commit is contained in:
parent
4bcaaa5f79
commit
ccf09770e3
|
@ -411,10 +411,10 @@
|
|||
<spell name="sparkledream" rank="5" parameters="u" los="true" ship="true" variable="true">
|
||||
<resource name="aura" amount="1" cost="level"/>
|
||||
</spell>
|
||||
<spell name="pull_astral" rank="7" parameters="ru+" variable="true" target_global="true">
|
||||
<spell name="pull_astral" rank="7" parameters="ru+" variable="true" globaltarget="true">
|
||||
<resource name="aura" amount="2" cost="level"/>
|
||||
</spell>
|
||||
<spell name="fetch_astral" rank="7" parameters="u+" variable="true" target_global="true">
|
||||
<spell name="fetch_astral" rank="7" parameters="u+" variable="true" globaltarget="true">
|
||||
<resource name="aura" amount="2" cost="level"/>
|
||||
</spell>
|
||||
<spell name="shockwave" rank="5" variable="true" combat="2">
|
||||
|
|
13
src/magic.c
13
src/magic.c
|
@ -1475,7 +1475,7 @@ verify_ship(region * r, unit * mage, const spell * sp, spllprm * spobj,
|
|||
{
|
||||
ship *sh = findship(spobj->data.i);
|
||||
|
||||
if (sh != NULL && sh->region != r && (sp->sptyp & SEARCHLOCAL)) {
|
||||
if (sh != NULL && sh->region != r && (sp->sptyp & GLOBALTARGET) == 0) {
|
||||
/* Burg muss in gleicher Region sein */
|
||||
sh = NULL;
|
||||
}
|
||||
|
@ -1498,7 +1498,7 @@ verify_building(region * r, unit * mage, const spell * sp, spllprm * spobj,
|
|||
{
|
||||
building *b = findbuilding(spobj->data.i);
|
||||
|
||||
if (b != NULL && b->region != r && (sp->sptyp & SEARCHLOCAL)) {
|
||||
if (b != NULL && b->region != r && (sp->sptyp & GLOBALTARGET) == 0) {
|
||||
/* Burg muss in gleicher Region sein */
|
||||
b = NULL;
|
||||
}
|
||||
|
@ -1552,14 +1552,15 @@ verify_unit(region * r, unit * mage, const spell * sp, spllprm * spobj,
|
|||
default:
|
||||
assert(!"shouldn't happen, this");
|
||||
}
|
||||
if (u != NULL && (sp->sptyp & SEARCHLOCAL)) {
|
||||
if (u->region != r)
|
||||
u = NULL;
|
||||
else if (sp->sptyp & TESTCANSEE) {
|
||||
if (u != NULL) {
|
||||
if (u->region == r) {
|
||||
if (!cansee(mage->faction, r, u, 0) && !ucontact(u, mage)) {
|
||||
u = NULL;
|
||||
}
|
||||
}
|
||||
else if ((sp->sptyp & GLOBALTARGET) == 0) {
|
||||
u = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (u == NULL) {
|
||||
|
|
|
@ -174,7 +174,7 @@ extern "C" {
|
|||
#define NOTFAMILIARCAST (1<<12)
|
||||
#define TESTRESISTANCE (1<<13) /* alle Zielobjekte (u, s, b, r) auf
|
||||
Magieresistenz prüfen */
|
||||
#define SEARCHLOCAL (1<<14) /* Ziel muss in der target_region sein */
|
||||
#define GLOBALTARGET (1<<14) /* Ziel muss in der target_region sein */
|
||||
#define TESTCANSEE (1<<15) /* alle Zielunits auf cansee prüfen */
|
||||
#define ANYTARGET (UNITSPELL|REGIONSPELL|BUILDINGSPELL|SHIPSPELL) /* wirkt auf alle objekttypen (unit, ship, building, region) */
|
||||
|
||||
|
|
|
@ -1169,8 +1169,6 @@ static int parse_spells(xmlDocPtr doc)
|
|||
sp->rank = (char)xml_ivalue(node, "rank", 0);
|
||||
if (xml_bvalue(node, "los", false))
|
||||
sp->sptyp |= TESTCANSEE; /* must see or have contact */
|
||||
if (!xml_bvalue(node, "target_global", false))
|
||||
sp->sptyp |= SEARCHLOCAL; /* must be in same region */
|
||||
if (xml_bvalue(node, "ship", false))
|
||||
sp->sptyp |= ONSHIPCAST;
|
||||
if (xml_bvalue(node, "ocean", false))
|
||||
|
@ -1180,6 +1178,8 @@ static int parse_spells(xmlDocPtr doc)
|
|||
if (xml_bvalue(node, "variable", false))
|
||||
sp->sptyp |= SPELLLEVEL;
|
||||
|
||||
if (xml_bvalue(node, "globaltarget", false))
|
||||
sp->sptyp |= GLOBALTARGET; /* target need not be in same region */
|
||||
if (xml_bvalue(node, "buildingtarget", false))
|
||||
sp->sptyp |= BUILDINGSPELL;
|
||||
if (xml_bvalue(node, "shiptarget", false))
|
||||
|
|
Loading…
Reference in New Issue