add a spell for igjarjuk (WIP)

This commit is contained in:
Enno Rehling 2015-08-30 10:57:08 +02:00
parent 9586d970e8
commit 7bb882b15b
5 changed files with 47 additions and 24 deletions

View File

@ -304,6 +304,9 @@
<spell name="wolfhowl" rank="5" index="94" variable="true" combat="1">
<resource name="aura" amount="2" cost="level"/>
</spell>
<spell name="igjarjuk" rank="5" index="94" variable="true" combat="1">
<function name="cast" value="igjarjuk"/>
</spell>
<spell name="resist_magic" rank="2" index="97" parameters="u+" los="true" ship="true" variable="true">
<resource name="aura" amount="5" cost="level"/>
</spell>

View File

@ -1699,7 +1699,7 @@ void do_combatmagic(battle * b, combatmagic_t was)
for (s = b->sides; s != b->sides + b->nsides; ++s) {
fighter *fig = 0;
if (s->bf->attacker) {
spell *sp = find_spell("wolfhowl");
spell *sp = find_spell("igjarjuk");
if (sp && fval(s->faction, FFL_CURSED)) {
int si;
for (si = 0; s->enemies[si]; ++si) {

View File

@ -6516,6 +6516,7 @@ static spelldata spell_functions[] = {
{ "stormwinds", sp_stormwinds, 0 },
{ "homestone", sp_homestone, 0 },
{ "wolfhowl", sp_wolfhowl, 0 },
{ "igjarjuk", sp_igjarjuk, 0 },
{ "versteinern", sp_petrify, 0 },
{ "strongwall", sp_strong_wall, 0 },
{ "gwyrrddestroymagic", sp_destroy_magic, 0 },

View File

@ -848,26 +848,17 @@ int sp_shadowcall(struct castorder * co)
return level;
}
int sp_wolfhowl(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;
static fighter *summon_allies(const fighter *fi, const race *rc, int number) {
attrib *a;
message *msg;
int force = (int)(get_force(power, 3) / 2);
const race * rc = get_race(RC_WOLF);
if (force > 0) {
unit *mage = fi->unit;
side *si = fi->side;
battle *b = si->battle;
region *r = b->region;
unit *u =
create_unit(r, mage->faction, force, rc, 0, NULL, mage);
create_unit(r, mage->faction, number, rc, 0, NULL, mage);
leave(u, true);
setstatus(u, ST_FIGHT);
set_level(u, SK_WEAPONLESS, (int)(power / 3));
set_level(u, SK_STAMINA, (int)(power / 3));
u->hp = u->number * unit_max_hp(u);
if (fval(mage, UFL_ANON_FACTION)) {
@ -879,10 +870,37 @@ int sp_wolfhowl(struct castorder * co)
a->data.ca[1] = 100;
a_add(&u->attribs, a);
make_fighter(b, u, fi->side, is_attacker(fi));
return make_fighter(b, u, si, is_attacker(fi));
}
int sp_igjarjuk(castorder *co) {
fighter * fi = co->magician.fig;
const race *rc = get_race(RC_WYRM);
fi = summon_allies(fi, rc, 1);
return 1;
}
int sp_wolfhowl(castorder * co)
{
fighter * fi = co->magician.fig;
int level = co->level;
double power = co->force;
battle *b = fi->side->battle;
unit *mage = fi->unit;
message *msg;
int force = (int)(get_force(power, 3) / 2);
const race * rc = get_race(RC_WOLF);
if (force > 0) {
unit *u;
int skills = (int)(power/3);
fi = summon_allies(fi, rc, force);
u = fi->unit;
set_level(u, SK_WEAPONLESS, skills);
set_level(u, SK_STAMINA, skills);
}
msg =
msg_message("sp_wolfhowl_effect", "mage amount race", mage, force, rc);
msg_message("sp_wolfhowl_effect", "mage amount race",
mage, force, rc);
message_all(b, msg);
msg_release(msg);

View File

@ -43,6 +43,7 @@ extern "C" {
extern int sp_mindblast_temp(struct castorder * co);
extern int sp_speed(struct castorder * co);
extern int sp_wolfhowl(struct castorder * co);
extern int sp_igjarjuk(struct castorder * co);
extern int sp_dragonodem(struct castorder * co);
extern int sp_reduceshield(struct castorder * co);
extern int sp_armorshield(struct castorder * co);