From 26a88cf1cb18800287904112339d30431e9aa246 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Fri, 12 Dec 2003 17:17:13 +0000 Subject: [PATCH] =?UTF-8?q?-=20Ph=C3=B6nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/items/racespoils.c | 16 +++++++++ src/common/items/racespoils.h | 1 + src/common/kernel/combatspells.c | 53 ++++++++++++++++++++++++++++++ src/common/kernel/race.c | 11 ++++++- src/common/kernel/spell.c | 14 ++++++++ src/common/kernel/spell.h | 2 ++ src/common/settings-wdw.h | 2 ++ src/eressea/korrektur.c | 56 +++++++++++++++++++++++++++++++- src/res/de/strings.xml | 25 ++++++++++++++ src/res/races.xml | 11 +++++++ 10 files changed, 189 insertions(+), 2 deletions(-) diff --git a/src/common/items/racespoils.c b/src/common/items/racespoils.c index 1de7cf5f4..5e07a6460 100644 --- a/src/common/items/racespoils.c +++ b/src/common/items/racespoils.c @@ -189,6 +189,21 @@ item_type it_trollspoil = { 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 register_racespoils(void) { @@ -203,5 +218,6 @@ register_racespoils(void) it_register(&it_catspoil); it_register(&it_orcspoil); it_register(&it_trollspoil); + it_register(&it_phoenixfeather); } diff --git a/src/common/items/racespoils.h b/src/common/items/racespoils.h index 4fe656950..eb8354fb4 100644 --- a/src/common/items/racespoils.h +++ b/src/common/items/racespoils.h @@ -29,6 +29,7 @@ extern struct item_type it_insectspoil; extern struct item_type it_catspoil; extern struct item_type it_orcspoil; extern struct item_type it_trollspoil; +extern struct item_type it_phoenixfeather; extern void register_racespoils(void); diff --git a/src/common/kernel/combatspells.c b/src/common/kernel/combatspells.c index c72396e62..456555d45 100644 --- a/src/common/kernel/combatspells.c +++ b/src/common/kernel/combatspells.c @@ -59,6 +59,9 @@ spell_damage(int sp) case 4: /* verwundet 11-26 HP */ return "3d6+8"; + case 5: + /* leichter Schaden */ + return "2d4"; default: /* schwer verwundet 14-34 HP */ return "4d6+10"; @@ -641,6 +644,56 @@ sp_dragonodem(fighter * fi, int level, int power, spell * sp) 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 sp_drainodem(fighter * fi, int level, int power, spell * sp) { diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index 6d8788262..32053c583 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -546,6 +546,15 @@ dragon_drops(const struct race * rc, int size) } 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 * elf_spoil(const struct race * rc, int size) { @@ -784,7 +793,6 @@ tagbegin(struct xml_stack * stack) if (xml_bvalue(tag, "resistbash")) rc->battle_flags |= BF_RES_BASH; if (xml_bvalue(tag, "resistcut")) rc->battle_flags |= BF_RES_CUT; if (xml_bvalue(tag, "resistpierce")) rc->battle_flags |= BF_RES_PIERCE; - state->race = rc; } else if (strcmp(tag->name, "ai")==0) { @@ -943,6 +951,7 @@ register_races(void) * to generate battle spoils * race->itemdrop() */ 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)demon_spoil, "demonspoil"); register_function((pf_generic)goblin_spoil, "goblinspoil"); diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index 4006e7ae5..f6fda32d1 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -10428,6 +10428,20 @@ spell spelldaten[] = {0, 0, 0}}, (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*/ diff --git a/src/common/kernel/spell.h b/src/common/kernel/spell.h index 92c958f26..2eea00b88 100644 --- a/src/common/kernel/spell.h +++ b/src/common/kernel/spell.h @@ -208,6 +208,7 @@ enum { SPL_MALLORNTREEGROW, SPL_INVISIBILITY2_ILLAUN, SPL_BIGRECRUIT, + SPL_IMMOLATION, MAXALLSPELLS, 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_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_immolation(struct fighter * fi, int level, int power, struct spell * sp); /* ------------------------------------------------------------- */ diff --git a/src/common/settings-wdw.h b/src/common/settings-wdw.h index 73aca9a23..f17b23a0b 100644 --- a/src/common/settings-wdw.h +++ b/src/common/settings-wdw.h @@ -48,4 +48,6 @@ #undef ALLIANCEJOIN #define AUTOALLIANCE (HELP_FIGHT) +#define WDW_PHOENIX + #define MAILITPATH "/usr/sbin:$HOME/bin:/bin:/usr/bin:/usr/local/bin" diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 05d7d6cb1..a8ac32c71 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -2811,6 +2811,56 @@ give_cammo(void) 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 korrektur(void) { @@ -2881,7 +2931,7 @@ korrektur(void) * to be on the safe side: */ fix_demand(); - /* trade_orders(); */ + /* trade_orders(); */ /* immer ausführen, wenn neue Sprüche dazugekommen sind, oder sich * Beschreibungen geändert haben */ @@ -2891,6 +2941,10 @@ korrektur(void) /* Immer ausführen! Erschafft neue Teleport-Regionen, wenn nötig */ create_teleport_plane(); +#ifdef WDW_PHOENIX + check_phoenix(); +#endif + if (global.data_versionTrollhörner troll horns + + Feder des Phönix + feather of the phoenix + + + Federn des Phönix + feathers of the phoenix + Resourcen @@ -3016,6 +3024,23 @@ Jungdrachen young dragon + + + Phönix + phoenix + + + Phönixe + phoenixes + + + Phönixen + phoenixes + + + Phönix + phoenix + Illusion diff --git a/src/res/races.xml b/src/res/races.xml index 36626b811..b94abca4a 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -1317,4 +1317,15 @@ + + + + + + + + + + +