- Phönix

This commit is contained in:
Christian Schlittchen 2003-12-12 17:17:13 +00:00
parent 2c53f3a8e7
commit 26a88cf1cb
10 changed files with 189 additions and 2 deletions

View File

@ -189,6 +189,21 @@ item_type it_trollspoil = {
NULL /* give */ NULL /* give */
}; };
resource_type rt_phoenixfeather = {
{ "phoenixfeather", "phoenixfeather_p" },
{ "phoenixfeather", "phoenixfeather_p" },
RTF_ITEM|RTF_POOLED,
&res_changeitem
};
item_type it_phoenixfeather = {
&rt_phoenixfeather, /* resourcetype */
0, 1, 0, /* flags, weight, capacity */
NULL, /* construction */
NULL, /* use */
NULL /* give */
};
void void
register_racespoils(void) register_racespoils(void)
{ {
@ -203,5 +218,6 @@ register_racespoils(void)
it_register(&it_catspoil); it_register(&it_catspoil);
it_register(&it_orcspoil); it_register(&it_orcspoil);
it_register(&it_trollspoil); it_register(&it_trollspoil);
it_register(&it_phoenixfeather);
} }

View File

@ -29,6 +29,7 @@ extern struct item_type it_insectspoil;
extern struct item_type it_catspoil; extern struct item_type it_catspoil;
extern struct item_type it_orcspoil; extern struct item_type it_orcspoil;
extern struct item_type it_trollspoil; extern struct item_type it_trollspoil;
extern struct item_type it_phoenixfeather;
extern void register_racespoils(void); extern void register_racespoils(void);

View File

@ -59,6 +59,9 @@ spell_damage(int sp)
case 4: case 4:
/* verwundet 11-26 HP */ /* verwundet 11-26 HP */
return "3d6+8"; return "3d6+8";
case 5:
/* leichter Schaden */
return "2d4";
default: default:
/* schwer verwundet 14-34 HP */ /* schwer verwundet 14-34 HP */
return "4d6+10"; return "4d6+10";
@ -641,6 +644,56 @@ sp_dragonodem(fighter * fi, int level, int power, spell * sp)
return level; return level;
} }
/* Feuersturm: Betrifft sehr viele Gegner (in der Regel alle),
* macht nur vergleichsweise geringen Schaden */
int
sp_immolation(fighter * fi, int level, int power, spell * sp)
{
battle *b = fi->side->battle;
troop dt;
troop at;
int minrow = FIGHT_ROW;
int maxrow = AVOID_ROW;
int force, enemies;
int killed = 0;
const char *damage;
sprintf(buf, "%s zaubert %s", unitname(fi->unit),
spell_name(sp, default_locale));
/* 2d4 HP */
damage = spell_damage(5);
/* Betrifft alle Gegner */
force = 99999;
enemies = count_enemies(b, fi->side, FS_ENEMY, minrow,
maxrow);
if (!enemies) {
scat(", aber niemand war in Reichweite.");
battlerecord(b, buf);
return 0;
}
scat(":");
battlerecord(b, buf);
at.fighter = fi;
at.index = 0;
do {
dt = select_enemy(b, fi, minrow, maxrow);
assert(dt.fighter);
--force;
killed += terminate(dt, at, AT_COMBATSPELL, damage, false);
} while (force && killed < enemies);
sprintf(buf, "%d Personen %s getötet",
killed, killed == 1 ? "wurde" : "wurden");
scat(".");
battlerecord(b, buf);
return level;
}
int int
sp_drainodem(fighter * fi, int level, int power, spell * sp) sp_drainodem(fighter * fi, int level, int power, spell * sp)
{ {

View File

@ -546,6 +546,15 @@ dragon_drops(const struct race * rc, int size)
} }
return itm; return itm;
} }
static item *
phoenix_drops(const struct race *rc, int size)
{
item *itm = NULL;
i_add(&itm, i_new(&it_phoenixfeather, size));
return itm;
}
static item * static item *
elf_spoil(const struct race * rc, int size) elf_spoil(const struct race * rc, int size)
{ {
@ -785,7 +794,6 @@ tagbegin(struct xml_stack * stack)
if (xml_bvalue(tag, "resistcut")) rc->battle_flags |= BF_RES_CUT; if (xml_bvalue(tag, "resistcut")) rc->battle_flags |= BF_RES_CUT;
if (xml_bvalue(tag, "resistpierce")) rc->battle_flags |= BF_RES_PIERCE; if (xml_bvalue(tag, "resistpierce")) rc->battle_flags |= BF_RES_PIERCE;
state->race = rc; state->race = rc;
} else if (strcmp(tag->name, "ai")==0) { } else if (strcmp(tag->name, "ai")==0) {
race * rc = state->race; race * rc = state->race;
@ -943,6 +951,7 @@ register_races(void)
* to generate battle spoils * to generate battle spoils
* race->itemdrop() */ * race->itemdrop() */
register_function((pf_generic)dragon_drops, "dragondrops"); register_function((pf_generic)dragon_drops, "dragondrops");
register_function((pf_generic)phoenix_drops, "phoenixdrops");
register_function((pf_generic)elf_spoil, "elfspoil"); register_function((pf_generic)elf_spoil, "elfspoil");
register_function((pf_generic)demon_spoil, "demonspoil"); register_function((pf_generic)demon_spoil, "demonspoil");
register_function((pf_generic)goblin_spoil, "goblinspoil"); register_function((pf_generic)goblin_spoil, "goblinspoil");

View File

@ -10429,6 +10429,20 @@ spell spelldaten[] =
(spell_f)sp_shadowcall, patzer (spell_f)sp_shadowcall, patzer
}, },
{SPL_IMMOLATION, "Feuersturm",
"Verletzt alle Gegner.",
NULL,
NULL,
M_GRAU, (COMBATSPELL), 5, 12,
{
{R_AURA, 2, SPC_LEVEL},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0}},
(spell_f)sp_immolation, patzer
},
/* SPL_NOSPELL MUSS der letzte Spruch der Liste sein*/ /* SPL_NOSPELL MUSS der letzte Spruch der Liste sein*/
{SPL_NOSPELL, "Keiner", NULL, NULL, NULL, 0, 0, 0, 0, {SPL_NOSPELL, "Keiner", NULL, NULL, NULL, 0, 0, 0, 0,

View File

@ -208,6 +208,7 @@ enum {
SPL_MALLORNTREEGROW, SPL_MALLORNTREEGROW,
SPL_INVISIBILITY2_ILLAUN, SPL_INVISIBILITY2_ILLAUN,
SPL_BIGRECRUIT, SPL_BIGRECRUIT,
SPL_IMMOLATION,
MAXALLSPELLS, MAXALLSPELLS,
NO_SPELL = (spellid_t) -1 NO_SPELL = (spellid_t) -1
}; };
@ -252,6 +253,7 @@ extern int sp_armorshield(struct fighter * fi, int level, int power, struct spel
extern int sp_stun(struct fighter * fi, int level, int power, struct spell * sp); extern int sp_stun(struct fighter * fi, int level, int power, struct spell * sp);
extern int sp_undeadhero(struct fighter * fi, int level, int power, struct spell * sp); extern int sp_undeadhero(struct fighter * fi, int level, int power, struct spell * sp);
extern int sp_shadowcall(struct fighter * fi, int level, int power, struct spell * sp); extern int sp_shadowcall(struct fighter * fi, int level, int power, struct spell * sp);
extern int sp_immolation(struct fighter * fi, int level, int power, struct spell * sp);
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */

View File

@ -48,4 +48,6 @@
#undef ALLIANCEJOIN #undef ALLIANCEJOIN
#define AUTOALLIANCE (HELP_FIGHT) #define AUTOALLIANCE (HELP_FIGHT)
#define WDW_PHOENIX
#define MAILITPATH "/usr/sbin:$HOME/bin:/bin:/usr/bin:/usr/local/bin" #define MAILITPATH "/usr/sbin:$HOME/bin:/bin:/usr/bin:/usr/local/bin"

View File

@ -2811,6 +2811,56 @@ give_cammo(void)
return 0; return 0;
} }
#ifdef WDW_PHOENIX
static region *
random_region(void)
{
region *r;
int c = 0;
/* count the available regions */
for(r=regions; r; r=r->next) {
if(rplane(r) == NULL) c++;
}
/* choose one */
c = rand()%c;
/* this is a bit obfuscated, but should be correct */
for(r=regions; c > 0; r=r->next) {
--c;
}
return(r);
}
static void
check_phoenix(void)
{
const race * phoenix_race = rc_find("phoenix");
unit * phoenix;
region * r;
faction *f;
/* check if there is a phoenix in the world */
for(f=factions; f; f=f->next) {
unit *u;
for(u=f->units; u; u=u->nextF) {
if(u->race == phoenix_race) {
return;
}
}
}
/* it is not, so we create it */
r = random_region();
phoenix = createunit(r, findfaction(MONSTER_FACTION), 1, phoenix_race);
/* generate an appropriate region message */
}
#endif
void void
korrektur(void) korrektur(void)
{ {
@ -2891,6 +2941,10 @@ korrektur(void)
/* Immer ausführen! Erschafft neue Teleport-Regionen, wenn nötig */ /* Immer ausführen! Erschafft neue Teleport-Regionen, wenn nötig */
create_teleport_plane(); create_teleport_plane();
#ifdef WDW_PHOENIX
check_phoenix();
#endif
if (global.data_version<TYPES_VERSION) fix_icastles(); if (global.data_version<TYPES_VERSION) fix_icastles();
#ifdef XMAS2000 #ifdef XMAS2000
santa_comes_to_town(); santa_comes_to_town();

View File

@ -754,6 +754,14 @@
<text locale="de">Trollhörner</text> <text locale="de">Trollhörner</text>
<text locale="en">troll horns</text> <text locale="en">troll horns</text>
</string> </string>
<string name="phoenixfeather">
<text locale="de">Feder des Phönix</text>
<text locale="en">feather of the phoenix</text>
</string>
<string name="phoenixfeather_p">
<text locale="de">Federn des Phönix</text>
<text locale="en">feathers of the phoenix</text>
</string>
<comment>Resourcen</comment> <comment>Resourcen</comment>
<string name="money"> <string name="money">
@ -3017,6 +3025,23 @@
<text locale="en">young dragon</text> <text locale="en">young dragon</text>
</string> </string>
<string name="phoenix">
<text locale="de">Phönix</text>
<text locale="en">phoenix</text>
</string>
<string name="troll_p">
<text locale="de">Phönixe</text>
<text locale="en">phoenixes</text>
</string>
<string name="troll_d">
<text locale="de">Phönixen</text>
<text locale="en">phoenixes</text>
</string>
<string name="troll_x">
<text locale="de">Phönix</text>
<text locale="en">phoenix</text>
</string>
<string name="illusion"> <string name="illusion">
<text locale="de">Illusion</text> <text locale="de">Illusion</text>
<text locale="en">illusion</text> <text locale="en">illusion</text>

View File

@ -1317,4 +1317,15 @@
<attack type="3" damage="1d4"></attack> <attack type="3" damage="1d4"></attack>
<attack type="2" damage="2d60"></attack> <attack type="2" damage="2d60"></attack>
</race> </race>
<race name="phoenix" magres="0.900000" maxaura="1.000000" regaura="2.000000" recruitcost="50000" maintenance="0" weight="50000" capacity="30000" speed="2.000000" hp="500" ac="6" damage="1d20" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" scarepeasants fly walk noteach getitem canguard resistbash resistbash resistcut resistpierce>
<ai splitsize="2" attackrandom learn></ai>
<function name="itemdrop" value="phoenixdrops"></function>
<skill name="sk_magic" modifier="16"></skill>
<skill name="sk_tactics" modifier="8"></skill>
<skill name="sk_perception" modifier="20"></skill>
<attack type="4" damage="1d12"></attack>
<attack type="4" damage="1d10"></attack>
<attack type="4" damage="1d10"></attack>
<attack type="6" spell="180"></attack>
</race>
</races> </races>