Merge pull request #660 from ennorehling/develop

remove shadowcall spell
This commit is contained in:
Enno Rehling 2017-02-18 18:38:36 +01:00 committed by GitHub
commit 8d963fefda
16 changed files with 29 additions and 155 deletions

View File

@ -3819,10 +3819,6 @@
<text locale="de">Meteorregen</text> <text locale="de">Meteorregen</text>
<text locale="en">Meteor Shower</text> <text locale="en">Meteor Shower</text>
</string> </string>
<string name="shadowcall">
<text locale="de">Schattenruf</text>
<text locale="en">Shadow Call</text>
</string>
<string name="create_ror"> <string name="create_ror">
<text locale="de">Erschaffe einen Ring der Regeneration</text> <text locale="de">Erschaffe einen Ring der Regeneration</text>
<text locale="en">Create A Ring of Regeneration</text> <text locale="en">Create A Ring of Regeneration</text>
@ -4503,10 +4499,6 @@
<text locale="de">Verletzt alle Gegner.</text> <text locale="de">Verletzt alle Gegner.</text>
<text locale="en">Injures all enemies.</text> <text locale="en">Injures all enemies.</text>
</string> </string>
<string name="shadowcall">
<text locale="de">Ruft Schattenwesen.</text>
<text locale="en">Calls beings from shadow.</text>
</string>
<string name="aura_of_fear"> <string name="aura_of_fear">
<text locale="de">Panik.</text> <text locale="de">Panik.</text>
<text locale="en">Panic.</text> <text locale="en">Panic.</text>

View File

@ -7521,16 +7521,6 @@
<text locale="en">"$unit($mage) casts $spell($spell). $int($amount) fighters are temporarily losing some of their memories."</text> <text locale="en">"$unit($mage) casts $spell($spell). $int($amount) fighters are temporarily losing some of their memories."</text>
</message> </message>
<message name="sp_shadowcall_effect" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="amount" type="int"/>
<arg name="race" type="race"/>
</type>
<text locale="de">"$unit($mage) ruft $int($amount) $race($race, 0) zu Hilfe."</text>
<text locale="en">"$unit($mage) calls upon the help of $int($amount) $race($race, 0)."</text>
</message>
<message name="battle::killed" section="battle"> <message name="battle::killed" section="battle">
<type> <type>
<arg name="unit" type="unit"/> <arg name="unit" type="unit"/>

View File

@ -885,35 +885,4 @@
<attack type="8" damage="1d10"/> <attack type="8" damage="1d10"/>
</race> </race>
<!-- for the shadowcall spell -->
<race name="shadowbat" magres="80" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.0" hp="1" ac="4" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="3" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000" killpeasants="yes"/>
<function name="name" value="namegeneric"/>
<attack type="4" damage="1d6"/>
<attack type="3" damage="1d1"/>
</race>
<!-- for the shadowcall spell -->
<race name="nightmare" magres="50" maxaura="0.000000" regaura="0.000000" weight="100" capacity="540" speed="1.0" hp="80" ac="10" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="3" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" invinciblenonmagic="yes">
<ai splitsize="500" killpeasants="yes"/>
<function name="name" value="namegeneric"/>
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="2" damage="1d10"/>
</race>
<!-- for the shadowcall spell -->
<race name="vampunicorn" magres="1.0" maxaura="0.000000" regaura="0.000000" weight="5000" capacity="2000" speed="1.0" hp="30" ac="4" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000" killpeasants="yes"/>
<function name="name" value="namegeneric"/>
<attack type="4" damage="2d10"/>
<attack type="3" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="2" damage="2d60"/>
</race>
</races> </races>

View File

@ -107,7 +107,6 @@
<entry spell="rustweapon" level="3" /> <entry spell="rustweapon" level="3" />
<entry spell="sacrifice_strength" level="15" /> <entry spell="sacrifice_strength" level="15" />
<entry spell="seduction" level="6" /> <entry spell="seduction" level="6" />
<entry spell="shadowcall" level="12" />
<entry spell="shadowknights" level="1" /> <entry spell="shadowknights" level="1" />
<entry spell="shapeshift" level="3" /> <entry spell="shapeshift" level="3" />
<entry spell="shockwave" level="5" /> <entry spell="shockwave" level="5" />

View File

@ -665,9 +665,6 @@
<spell name="aura_of_fear" rank="5" index="175" combat="2"> <spell name="aura_of_fear" rank="5" index="175" combat="2">
<resource name="aura" amount="12" cost="fixed"/> <resource name="aura" amount="12" cost="fixed"/>
</spell> </spell>
<spell name="shadowcall" rank="5" index="176" combat="1">
<resource name="aura" amount="24" cost="fixed"/>
</spell>
<spell name="immolation" rank="5" index="180" combat="2"> <spell name="immolation" rank="5" index="180" combat="2">
<resource name="aura" amount="24" cost="fixed"/> <resource name="aura" amount="24" cost="fixed"/>
</spell> </spell>

View File

@ -1283,31 +1283,5 @@
<attack type="4" damage="5d30"/> <attack type="4" damage="5d30"/>
<attack type="6" spell="drain_skills" level="12"/> <attack type="6" spell="drain_skills" level="12"/>
<attack type="6" spell="aura_of_fear" level="12"/> <attack type="6" spell="aura_of_fear" level="12"/>
<precombatspell spell="shadowcall"/>
</race>
<race name="shadowbat" magres="80" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="1" ac="4" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="3" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000" killpeasants="yes"/>
<function name="name" value="namegeneric"/>
<attack type="4" damage="1d6"/>
<attack type="3" damage="1d1"/>
</race>
<race name="nightmare" magres="50" maxaura="0.000000" regaura="0.000000" weight="100" capacity="540" speed="1.000000" hp="80" ac="10" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="3" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" invinciblenonmagic="yes">
<ai splitsize="500" killpeasants="yes"/>
<function name="name" value="namegeneric"/>
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="2" damage="1d10"/>
</race>
<race name="vampunicorn" magres="100" maxaura="0.000000" regaura="0.000000" weight="5000" capacity="2000" speed="1.000000" hp="30" ac="4" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000" killpeasants="yes"/>
<function name="name" value="namegeneric"/>
<attack type="4" damage="2d10"/>
<attack type="3" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="3" damage="1d4"/>
<attack type="2" damage="2d60"/>
</race> </race>
</races> </races>

View File

@ -123,7 +123,6 @@
<entry spell="rustweapon" level="3" /> <entry spell="rustweapon" level="3" />
<entry spell="sacrifice_strength" level="15" /> <entry spell="sacrifice_strength" level="15" />
<entry spell="seduction" level="6" /> <entry spell="seduction" level="6" />
<entry spell="shadowcall" level="12" />
<entry spell="shadowknights" level="1" /> <entry spell="shadowknights" level="1" />
<entry spell="shapeshift" level="3" /> <entry spell="shapeshift" level="3" />
<entry spell="shockwave" level="5" /> <entry spell="shockwave" level="5" />

View File

@ -471,9 +471,6 @@
<spell name="aura_of_fear" rank="5" index="175" combat="2"> <spell name="aura_of_fear" rank="5" index="175" combat="2">
<resource name="aura" amount="12" cost="fixed"/> <resource name="aura" amount="12" cost="fixed"/>
</spell> </spell>
<spell name="shadowcall" rank="5" index="176" combat="1">
<resource name="aura" amount="24" cost="fixed"/>
</spell>
<spell name="mallorntreegrow" rank="5" index="177" far="true" variable="true"> <spell name="mallorntreegrow" rank="5" index="177" far="true" variable="true">
<resource name="aura" amount="6" cost="level"/> <resource name="aura" amount="6" cost="level"/>
<resource name="mallorn" amount="1" cost="level"/> <resource name="mallorn" amount="1" cost="level"/>

View File

@ -43,7 +43,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <assert.h> #include <assert.h>
typedef enum { typedef enum {
TNONE = 0, TINTEGER = 1 TNONE = 0, TINTEGER = 1, TREAL = 2
} dict_type; } dict_type;
typedef struct dict_data { typedef struct dict_data {
@ -72,11 +72,18 @@ static int dict_read(attrib * a, void *owner, gamedata *data)
dd->name = strdup(name); dd->name = strdup(name);
READ_INT(store, &n); READ_INT(store, &n);
dd->type = (dict_type)n; dd->type = (dict_type)n;
if (dd->type != TINTEGER) { if (dd->type == TINTEGER) {
READ_INT(store, &dd->data.i);
}
else if (dd->type == TREAL) {
float flt;
READ_FLT(store, &flt);
dd->data.real = flt;
}
else {
log_error("read dict, invalid type %d", n); log_error("read dict, invalid type %d", n);
return AT_READ_FAIL; return AT_READ_FAIL;
} }
READ_INT(store, &dd->data.i);
return AT_READ_DEPR; return AT_READ_DEPR;
} }
@ -95,6 +102,16 @@ static void dict_done(attrib * a)
free(a->data.v); free(a->data.v);
} }
static void upgrade_keyval(const dict_data *dd, int keyval[], int v) {
if (strcmp(dd->name, "embassy_muschel") == 0) {
keyval[0] = atoi36("mupL");
keyval[1] = v;
}
else {
log_error("dict conversion, bad entry %s", dd->name);
}
}
static void dict_upgrade(attrib **alist, attrib *abegin) { static void dict_upgrade(attrib **alist, attrib *abegin) {
int n = 0, *keys = 0; int n = 0, *keys = 0;
int i = 0, val[8]; int i = 0, val[8];
@ -105,18 +122,17 @@ static void dict_upgrade(attrib **alist, attrib *abegin) {
} }
for (a = abegin; a && a->type == abegin->type; a = a->next) { for (a = abegin; a && a->type == abegin->type; a = a->next) {
dict_data *dd = (dict_data *)a->data.v; dict_data *dd = (dict_data *)a->data.v;
if (dd->type != TINTEGER) { if (dd->type == TINTEGER) {
log_error("dict conversion, bad type %d for %s", dd->type, dd->name); upgrade_keyval(dd, val + i * 2, dd->data.i);
++i;
}
else if (dd->type == TREAL) {
upgrade_keyval(dd, val + i * 2, (int)dd->data.real);
++i;
} }
else { else {
if (strcmp(dd->name, "embassy_muschel")==0) { log_error("dict conversion, bad type %d for %s", dd->type, dd->name);
val[i * 2] = atoi36("mupL"); assert(!"invalid input");
val[i * 2 + 1] = dd->data.i;
++i;
}
else {
log_error("dict conversion, bad entry %s", dd->name);
}
} }
if (i == 4) { if (i == 4) {
keys = realloc(keys, sizeof(int) * (n + i + 1)); keys = realloc(keys, sizeof(int) * (n + i + 1));

View File

@ -277,7 +277,6 @@ void free_races(void) {
free(at->data.dice); free(at->data.dice);
} }
} }
spellref_free(races->precombatspell);
free(xrefs); free(xrefs);
xrefs = 0; xrefs = 0;
free(races->_name); free(races->_name);
@ -337,7 +336,6 @@ race *rc_create(const char *zName)
assert(strchr(zName, ' ') == NULL); assert(strchr(zName, ' ') == NULL);
} }
rc->_name = strdup(zName); rc->_name = strdup(zName);
rc->precombatspell = NULL;
rc->attack[0].type = AT_COMBATSPELL; rc->attack[0].type = AT_COMBATSPELL;
for (i = 1; i < RACE_ATTACKS; ++i) for (i = 1; i < RACE_ATTACKS; ++i)

View File

@ -138,7 +138,6 @@ extern "C" {
int df_default; /* Verteidigungsskill Unbewaffnet (default: -2) */ int df_default; /* Verteidigungsskill Unbewaffnet (default: -2) */
int at_bonus; /* Ver<65>ndert den Angriffsskill (default: 0) */ int at_bonus; /* Ver<65>ndert den Angriffsskill (default: 0) */
int df_bonus; /* Ver<65>ndert den Verteidigungskill (default: 0) */ int df_bonus; /* Ver<65>ndert den Verteidigungskill (default: 0) */
struct spellref *precombatspell;
signed char *study_speed; /* study-speed-bonus in points/turn (0=30 Tage) */ signed char *study_speed; /* study-speed-bonus in points/turn (0=30 Tage) */
int flags; int flags;
int battle_flags; int battle_flags;

View File

@ -1849,17 +1849,6 @@ static int parse_races(xmlDocPtr doc)
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);
/* reading eressea/races/race/precombatspell */
xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "precombatspell", xpath);
assert(rc->precombatspell == NULL
|| !"precombatspell is already initialized");
for (k = 0; k != result->nodesetval->nodeNr; ++k) {
xmlNodePtr node = result->nodesetval->nodeTab[k];
rc->precombatspell = xml_spellref(node, "spell");
}
xmlXPathFreeObject(result);
/* reading eressea/races/race/attack */ /* reading eressea/races/race/attack */
xpath->node = node; xpath->node = node;
result = xmlXPathEvalExpression(BAD_CAST "attack", xpath); result = xmlXPathEvalExpression(BAD_CAST "attack", xpath);

View File

@ -561,13 +561,6 @@ const spell *get_combatspell(const unit * u, int nr)
if (m) { if (m) {
return m->combatspells[nr].sp; return m->combatspells[nr].sp;
} }
else {
const race * rc = u_race(u);
if (rc->precombatspell) {
return spellref_get(rc->precombatspell);
}
}
return NULL; return NULL;
} }

View File

@ -6596,7 +6596,6 @@ static spelldata spell_functions[] = {
{ "powerful_dragonbreath", sp_dragonodem, 0 }, { "powerful_dragonbreath", sp_dragonodem, 0 },
{ "drain_skills", sp_dragonodem, 0 }, { "drain_skills", sp_dragonodem, 0 },
{ "aura_of_fear", sp_flee, 0 }, { "aura_of_fear", sp_flee, 0 },
{ "shadowcall", sp_shadowcall, 0 },
{ "immolation", sp_immolation, 0 }, { "immolation", sp_immolation, 0 },
{ "firestorm", sp_immolation, 0 }, { "firestorm", sp_immolation, 0 },
{ "coldfront", sp_immolation, 0 }, { "coldfront", sp_immolation, 0 },

View File

@ -815,42 +815,6 @@ int sp_drainodem(fighter * fi, int level, double power, spell * sp)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
/* PRECOMBAT */ /* PRECOMBAT */
int sp_shadowcall(struct castorder * co)
{
fighter * fi = co->magician.fig;
int level = co->level;
double power = co->force;
battle *b = fi->side->battle;
region *r = b->region;
unit *mage = fi->unit;
attrib *a;
int force = (int)(get_force(power, 3) / 2);
unit *u;
const char *rcnames[3] = { "shadowbat", "nightmare", "vampunicorn" };
const race *rc = rc_find(rcnames[rng_int() % 3]);
message *msg;
u = create_unit(r, mage->faction, force, rc, 0, NULL, mage);
setstatus(u, ST_FIGHT);
set_level(u, SK_WEAPONLESS, (int)(power / 2));
set_level(u, SK_STAMINA, (int)(power / 2));
u->hp = u->number * unit_max_hp(u);
a = a_new(&at_unitdissolve);
a->data.ca[0] = 0;
a->data.ca[1] = 100;
a_add(&u->attribs, a);
make_fighter(b, u, fi->side, is_attacker(fi));
msg =
msg_message("sp_shadowcall_effect", "mage amount race", mage, u->number,
u_race(u));
message_all(b, msg);
msg_release(msg);
return level;
}
static fighter *summon_allies(const fighter *fi, const race *rc, int number) { static fighter *summon_allies(const fighter *fi, const race *rc, int number) {
attrib *a; attrib *a;
unit *mage = fi->unit; unit *mage = fi->unit;

View File

@ -49,7 +49,6 @@ extern "C" {
int sp_armorshield(struct castorder * co); int sp_armorshield(struct castorder * co);
int sp_stun(struct castorder * co); int sp_stun(struct castorder * co);
int sp_undeadhero(struct castorder * co); int sp_undeadhero(struct castorder * co);
int sp_shadowcall(struct castorder * co);
int sp_immolation(struct castorder * co); int sp_immolation(struct castorder * co);
#ifdef __cplusplus #ifdef __cplusplus