spells that have no function in the xml file get one from an array, cleaning up and simplifying that code.

This commit is contained in:
Enno Rehling 2012-05-09 23:23:40 -07:00
parent 3805db34c4
commit ea7eaf87aa
4 changed files with 175 additions and 462 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ bin/
*.opensdf *.opensdf
ipch/ ipch/
*.log *.log
src/Release/

View File

@ -100,6 +100,7 @@
</spell> </spell>
<spell name="fireball" type="draig" rank="5" level="2" index="4" variable="true" combat="2"> <spell name="fireball" type="draig" rank="5" level="2" index="4" variable="true" combat="2">
<!-- Feuerball --> <!-- Feuerball -->
<function name="cast" value="combat_spell"/>
<resource name="aura" amount="1" cost="level"/> <resource name="aura" amount="1" cost="level"/>
</spell> </spell>
<spell name="magicboost" type="draig" rank="3" level="3" index="17" ship="true"> <spell name="magicboost" type="draig" rank="3" level="3" index="17" ship="true">
@ -301,6 +302,7 @@
</spell> </spell>
<spell name="hail" type="gwyrrd" rank="5" level="3" index="5" variable="true" combat="2"> <spell name="hail" type="gwyrrd" rank="5" level="3" index="5" variable="true" combat="2">
<!-- Hagel --> <!-- Hagel -->
<function name="cast" value="combat_spell"/>
<resource name="aura" amount="1" cost="level"/> <resource name="aura" amount="1" cost="level"/>
</spell> </spell>
<spell name="goodwinds" type="common" rank="5" level="4" index="56" parameters="s" ship="true" variable="true"> <spell name="goodwinds" type="common" rank="5" level="4" index="56" parameters="s" ship="true" variable="true">
@ -655,6 +657,7 @@
<resource name="aura" amount="3" cost="fixed"/> <resource name="aura" amount="3" cost="fixed"/>
</spell> </spell>
<spell name="meteor_rain" type="gray" rank="5" level="3" index="108" variable="true" combat="2"> <spell name="meteor_rain" type="gray" rank="5" level="3" index="108" variable="true" combat="2">
<function name="cast" value="combat_spell"/>
<resource name="aura" amount="1" cost="level"/> <resource name="aura" amount="1" cost="level"/>
</spell> </spell>
<spell name="wyrm_transformation" type="gray" rank="5" level="1" index="166"> <spell name="wyrm_transformation" type="gray" rank="5" level="1" index="166">

View File

@ -1,9 +1,11 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<spells> <spells>
<spell name="fireball" type="draig" rank="5" level="2" index="4" variable="true" combat="2"> <spell name="fireball" type="draig" rank="5" level="2" index="4" variable="true" combat="2">
<function name="cast" value="combat_spell"/>
<resource name="aura" amount="1" cost="level"/> <resource name="aura" amount="1" cost="level"/>
</spell> </spell>
<spell name="hail" type="gwyrrd" rank="5" level="3" index="5" variable="true" combat="2"> <spell name="hail" type="gwyrrd" rank="5" level="3" index="5" variable="true" combat="2">
<function name="cast" value="combat_spell"/>
<resource name="aura" amount="1" cost="level"/> <resource name="aura" amount="1" cost="level"/>
</spell> </spell>
<spell name="rustweapon" type="gwyrrd" rank="5" level="3" index="6" parameters="u+" los="true" far="true" variable="true"> <spell name="rustweapon" type="gwyrrd" rank="5" level="3" index="6" parameters="u+" los="true" far="true" variable="true">
@ -311,6 +313,7 @@
<resource name="aura" amount="3" cost="level"/> <resource name="aura" amount="3" cost="level"/>
</spell> </spell>
<spell name="meteor_rain" type="gray" rank="5" level="3" index="108" variable="true" combat="2"> <spell name="meteor_rain" type="gray" rank="5" level="3" index="108" variable="true" combat="2">
<function name="cast" value="combat_spell"/>
<resource name="aura" amount="1" cost="level"/> <resource name="aura" amount="1" cost="level"/>
</spell> </spell>
<spell name="fish_shield" type="tybied" rank="2" level="8" index="109" variable="true" combat="1"> <spell name="fish_shield" type="tybied" rank="2" level="8" index="109" variable="true" combat="1">

View File

@ -6510,462 +6510,169 @@ static int sp_wdwpyramid(castorder * co)
} }
typedef struct spelldata { typedef struct spelldata {
unsigned int id;
const char *sname; const char *sname;
spell_f sp_function; spell_f cast;
void (*patzer) (castorder *); fumble_f fumble;
} spelldata; } spelldata;
static spelldata spelldaten[] = { static spelldata spell_functions[] = {
/* M_GWYRRD */ /* M_GWYRRD */
{ { "stonegolem", sp_create_stonegolem, 0},
SPL_STONEGOLEM, "stonegolem", { "irongolem", sp_create_irongolem, 0},
sp_create_stonegolem, NULL}, { "treegrow", sp_hain, patzer_ents},
{ { "rustweapon", sp_rosthauch, 0},
SPL_IRONGOLEM, "irongolem", { "cold_protection", sp_kaelteschutz, 0},
sp_create_irongolem, NULL}, { "ironkeeper", sp_ironkeeper, 0},
{ { "magicstreet", sp_magicstreet, 0},
SPL_TREEGROW, "treegrow", { "windshield", sp_windshield, 0},
sp_hain, patzer_ents}, { "mallorntreegrow", sp_mallornhain, patzer_ents},
{ { "goodwinds", sp_goodwinds, 0},
SPL_RUSTWEAPON, "rustweapon", { "healing", sp_healing, 0},
sp_rosthauch, NULL}, { "reelingarrows", sp_reeling_arrows, 0},
{ { "gwyrrdfumbleshield", sp_fumbleshield, 0},
SPL_KAELTESCHUTZ, "cold_protection", { "transferauradruide", sp_transferaura, 0},
sp_kaelteschutz, NULL}, { "earthquake", sp_earthquake, 0},
{ { "stormwinds", sp_stormwinds, 0},
SPL_HAGEL, "hail", { "homestone", sp_homestone, 0},
sp_kampfzauber, NULL}, { "wolfhowl", sp_wolfhowl, 0},
{ { "versteinern", sp_petrify, 0},
SPL_IRONKEEPER, "ironkeeper", { "strongwall", sp_strong_wall, 0},
sp_ironkeeper, NULL}, { "gwyrrddestroymagic", sp_destroy_magic, 0},
{ { "treewalkenter", sp_treewalkenter, 0},
SPL_MAGICSTREET, "magicstreet", { "treewalkexit", sp_treewalkexit, 0},
sp_magicstreet, NULL}, { "holyground", sp_holyground, 0},
{ { "summonent", sp_summonent, 0},
SPL_WINDSHIELD, "windshield", { "gwyrrdfamiliar", sp_summon_familiar, 0},
sp_windshield, NULL}, { "blessstonecircle", sp_blessstonecircle, 0},
{ { "barkskin", sp_armorshield, 0},
SPL_MALLORNTREEGROW, "mallorntreegrow", { "summonfireelemental", sp_drought, 0},
sp_mallornhain, patzer_ents}, { "maelstrom", sp_maelstrom, 0},
{SPL_GOODWINDS, "goodwinds", { "magic_roots", sp_mallorn, 0},
sp_goodwinds, NULL}, { "great_drought", sp_great_drought, 0},
{
SPL_HEALING, "healing",
sp_healing, NULL},
{
SPL_REELING_ARROWS, "reelingarrows",
sp_reeling_arrows, NULL},
{
SPL_GWYRRD_FUMBLESHIELD, "gwyrrdfumbleshield",
sp_fumbleshield, NULL},
{
SPL_TRANSFERAURA_DRUIDE, "transferauradruide",
sp_transferaura, NULL},
{
SPL_EARTHQUAKE, "earthquake",
sp_earthquake, NULL},
{
SPL_STORMWINDS, "stormwinds",
sp_stormwinds, NULL},
{
SPL_HOMESTONE, "homestone",
sp_homestone, NULL},
{
SPL_WOLFHOWL, "wolfhowl",
sp_wolfhowl, NULL},
{
SPL_VERSTEINERN, "versteinern",
sp_petrify, NULL},
{
SPL_STRONG_WALL, "strongwall",
sp_strong_wall, NULL},
{
SPL_GWYRRD_DESTROY_MAGIC, "gwyrrddestroymagic",
sp_destroy_magic, NULL},
{
SPL_TREEWALKENTER, "treewalkenter",
sp_treewalkenter, NULL},
{
SPL_TREEWALKEXIT, "treewalkexit",
sp_treewalkexit, NULL},
{
SPL_HOLYGROUND, "holyground",
sp_holyground, NULL},
{
SPL_SUMMONENT, "summonent",
sp_summonent, NULL},
{
SPL_GWYRRD_FAMILIAR, "gwyrrdfamiliar",
sp_summon_familiar, NULL},
{
SPL_BLESSSTONECIRCLE, "blessstonecircle",
sp_blessstonecircle, NULL},
{
SPL_GWYRRD_ARMORSHIELD, "barkskin",
sp_armorshield, NULL},
{
SPL_DROUGHT, "summonfireelemental",
sp_drought, NULL},
{
SPL_MAELSTROM, "maelstrom",
sp_maelstrom, NULL},
{
SPL_MALLORN, "magic_roots",
sp_mallorn, NULL},
{
SPL_GREAT_DROUGHT, "great_drought",
sp_great_drought, NULL},
/* M_DRAIG */ /* M_DRAIG */
{ { "sparklechaos", sp_sparkle, 0},
SPL_SPARKLE_CHAOS, "sparklechaos", { "magicboost", sp_magicboost, 0},
sp_sparkle, NULL}, { "bloodsacrifice", sp_bloodsacrifice, 0},
{ { "berserk", sp_berserk, 0},
SPL_FIREBALL, "fireball", { "fumblecurse", sp_fumblecurse, patzer_fumblecurse},
sp_kampfzauber, NULL}, { "summonundead", sp_summonundead, patzer_peasantmob},
{ { "combatrust", sp_combatrosthauch, 0},
SPL_MAGICBOOST, "magicboost", { "transferaurachaos", sp_transferaura, 0},
sp_magicboost, NULL}, { "firewall", sp_firewall, patzer_peasantmob},
{ { "plague", sp_plague, patzer_peasantmob},
SPL_BLOODSACRIFICE, "bloodsacrifice", { "chaosrow", sp_chaosrow, 0},
sp_bloodsacrifice, NULL}, { "summonshadow", sp_summonshadow, patzer_peasantmob},
{ { "undeadhero", sp_undeadhero, 0},
SPL_BERSERK, "berserk", { "auraleak", sp_auraleak, 0},
sp_berserk, NULL}, { "draigfumbleshield", sp_fumbleshield, 0},
{ { "forestfire", sp_forest_fire, patzer_peasantmob},
SPL_FUMBLECURSE, "fumblecurse", { "draigdestroymagic", sp_destroy_magic, 0},
sp_fumblecurse, patzer_fumblecurse}, { "unholypower", sp_unholypower, 0},
{ { "deathcloud", sp_deathcloud, patzer_peasantmob},
SPL_SUMMONUNDEAD, "summonundead", { "summondragon", sp_summondragon, patzer_peasantmob},
sp_summonundead, patzer_peasantmob}, { "summonshadowlords", sp_summonshadowlords, patzer_peasantmob},
{ { "draigfamiliar", sp_summon_familiar, 0},
SPL_COMBATRUST, "combatrust", { "chaossuction", sp_chaossuction, patzer_peasantmob},
sp_combatrosthauch, NULL},
{
SPL_TRANSFERAURA_CHAOS, "transferaurachaos",
sp_transferaura, NULL},
{
SPL_FIREWALL, "firewall",
sp_firewall, patzer_peasantmob},
{
SPL_PLAGUE, "plague",
sp_plague, patzer_peasantmob},
{
SPL_CHAOSROW, "chaosrow",
sp_chaosrow, NULL},
{
SPL_SUMMONSHADOW, "summonshadow",
sp_summonshadow, patzer_peasantmob},
{
SPL_UNDEADHERO, "undeadhero",
sp_undeadhero, NULL},
{
SPL_AURALEAK, "auraleak",
sp_auraleak, NULL},
{
SPL_DRAIG_FUMBLESHIELD, "draigfumbleshield",
sp_fumbleshield, NULL},
{
SPL_FOREST_FIRE, "forestfire",
sp_forest_fire, patzer_peasantmob},
{
SPL_DRAIG_DESTROY_MAGIC, "draigdestroymagic",
sp_destroy_magic, NULL},
{
SPL_UNHOLYPOWER, "unholypower",
sp_unholypower, NULL},
{
SPL_DEATHCLOUD, "deathcloud",
sp_deathcloud, patzer_peasantmob},
{
SPL_SUMMONDRAGON, "summondragon",
sp_summondragon, patzer_peasantmob},
{
SPL_SUMMONSHADOWLORDS, "summonshadowlords",
sp_summonshadowlords, patzer_peasantmob},
{
SPL_DRAIG_FAMILIAR, "draigfamiliar",
sp_summon_familiar, NULL},
{
SPL_CHAOSSUCTION, "chaossuction",
sp_chaossuction, patzer_peasantmob},
/* M_ILLAUN */ /* M_ILLAUN */
{ { "sparkledream", sp_sparkle, 0},
SPL_SPARKLE_DREAM, "sparkledream", { "shadowknights", sp_shadowknights, 0},
sp_sparkle, NULL}, { "flee", sp_flee, 0},
{ { "puttorest", sp_puttorest, 0},
SPL_SHADOWKNIGHTS, "shadowknights", { "icastle", sp_icastle, 0},
sp_shadowknights, NULL}, { "transferauratraum", sp_transferaura, 0},
{ { "shapeshift", sp_illusionary_shapeshift, 0},
SPL_FLEE, "flee", { "dreamreading", sp_dreamreading, 0},
sp_flee, NULL}, { "tiredsoldiers", sp_tiredsoldiers, 0},
{ { "reanimate", sp_reanimate, 0},
SPL_PUTTOREST, "puttorest", { "analysedream", sp_analysedream, 0},
sp_puttorest, NULL}, { "disturbingdreams", sp_disturbingdreams, 0},
{ { "sleep", sp_sleep, 0},
SPL_ICASTLE, "icastle", { "wisps", sp_wisps, 0},
sp_icastle, NULL}, { "gooddreams", sp_gooddreams, 0},
{ { "illaundestroymagic", sp_destroy_magic, 0},
SPL_TRANSFERAURA_TRAUM, "transferauratraum", { "illaunfamiliar", sp_summon_familiar, 0},
sp_transferaura, NULL}, { "clone", sp_clonecopy, 0},
{ { "bad_dreams", sp_baddreams, 0},
SPL_ILL_SHAPESHIFT, "shapeshift", { "mindblast", sp_mindblast_temp, 0},
sp_illusionary_shapeshift, NULL}, { "orkdream", sp_sweetdreams, 0},
{ { "summon_alp", sp_summon_alp, 0},
SPL_DREAMREADING, "dreamreading",
sp_dreamreading, NULL},
{
SPL_TIREDSOLDIERS, "tiredsoldiers",
sp_tiredsoldiers, NULL},
{
SPL_REANIMATE, "reanimate",
sp_reanimate, NULL},
{
SPL_ANALYSEDREAM, "analysedream",
sp_analysedream, NULL},
{
SPL_DISTURBINGDREAMS, "disturbingdreams",
sp_disturbingdreams, NULL},
{
SPL_SLEEP, "sleep",
sp_sleep, NULL},
{
SPL_WISPS, "wisps",
sp_wisps, NULL},
{
SPL_GOODDREAMS, "gooddreams",
sp_gooddreams, NULL},
{
SPL_ILLAUN_DESTROY_MAGIC, "illaundestroymagic",
sp_destroy_magic, NULL},
{
SPL_ILLAUN_FAMILIAR, "illaunfamiliar",
sp_summon_familiar, NULL},
{
SPL_CLONECOPY, "clone",
sp_clonecopy, NULL},
{
SPL_BADDREAMS, "bad_dreams",
sp_baddreams, NULL},
{
SPL_MINDBLAST, "mindblast",
sp_mindblast_temp, NULL},
{
SPL_ORKDREAM, "orkdream",
sp_sweetdreams, NULL},
{
SPL_SUMMON_ALP, "summon_alp",
sp_summon_alp, NULL},
/* M_CERDDOR */ /* M_CERDDOR */
{ { "appeasement", sp_denyattack, 0},
SPL_DENYATTACK, "appeasement", { "song_of_healing", sp_healing, 0},
sp_denyattack, NULL}, { "generous", sp_generous, 0},
{ { "song_of_fear", sp_flee, 0},
SPL_HEALINGSONG, "song_of_healing", { "courting", sp_recruit, 0},
sp_healing, NULL}, { "song_of_confusion", sp_chaosrow, 0},
{ { "heroic_song", sp_hero, 0},
SPL_GENEROUS, "generous", { "transfer_aura_song", sp_transferaura, 0},
sp_generous, NULL}, { "analysesong_unit", sp_analysesong_unit, 0},
{ { "cerrdorfumbleshield", sp_fumbleshield, 0},
SPL_SONG_OF_FEAR, "song_of_fear", { "calm_monster", sp_calm_monster, 0},
sp_flee, NULL}, { "seduction", sp_seduce, 0},
{ { "headache", sp_headache, 0},
SPL_RECRUIT, "courting", { "sound_out", sp_pump, 0},
sp_recruit, NULL}, { "bloodthirst", sp_berserk, 0},
{ { "frighten", sp_frighten, 0},
SPL_SONG_OF_CONFUSION, "song_of_confusion", { "analyse_object", sp_analysesong_obj, 0},
sp_chaosrow, NULL}, { "cerddor_destroymagic", sp_destroy_magic, 0},
{ { "migration", sp_migranten, 0},
SPL_HERO, "heroic_song", { "summon_familiar", sp_summon_familiar, 0},
sp_hero, NULL}, { "raise_mob", sp_raisepeasants, 0},
{ { "song_resist_magic", sp_song_resistmagic, 0},
SPL_TRANSFERAURA_BARDE, "transfer_aura_song", { "melancholy", sp_depression, 0},
sp_transferaura, NULL}, { "song_suscept_magic", sp_song_susceptmagic, 0},
{ { "song_of_peace", sp_song_of_peace, 0},
SPL_UNIT_ANALYSESONG, "analysesong_unit", { "song_of_slavery", sp_charmingsong, 0},
sp_analysesong_unit, NULL}, { "big_recruit", sp_bigrecruit, 0},
{ { "calm_riot", sp_rallypeasantmob, 0},
SPL_CERRDOR_FUMBLESHIELD, "cerrdorfumbleshield", { "incite_riot", sp_raisepeasantmob, 0},
sp_fumbleshield, NULL},
{SPL_CALM_MONSTER, "calm_monster",
sp_calm_monster, NULL},
{SPL_SEDUCE, "seduction",
sp_seduce, NULL},
{
SPL_HEADACHE, "headache",
sp_headache, NULL},
{SPL_PUMP, "sound_out",
sp_pump, NULL},
{
SPL_BLOODTHIRST, "bloodthirst",
sp_berserk, NULL},
{
SPL_FRIGHTEN, "frighten",
sp_frighten, NULL},
{
SPL_OBJ_ANALYSESONG, "analyse_object",
sp_analysesong_obj, NULL},
{
SPL_CERDDOR_DESTROY_MAGIC, "cerddor_destroymagic",
sp_destroy_magic, NULL},
{
SPL_MIGRANT, "migration",
sp_migranten, NULL},
{
SPL_CERDDOR_FAMILIAR, "summon_familiar",
sp_summon_familiar, NULL},
{
SPL_RAISEPEASANTS, "raise_mob",
sp_raisepeasants, NULL},
{
SPL_SONG_RESISTMAGIC, "song_resist_magic",
sp_song_resistmagic, NULL},
{
SPL_DEPRESSION, "melancholy",
sp_depression, NULL},
{
SPL_SONG_SUSCEPTMAGIC, "song_suscept_magic",
sp_song_susceptmagic, NULL},
{
SPL_SONG_OF_PEACE, "song_of_peace",
sp_song_of_peace, NULL},
{
SPL_SONG_OF_ENSLAVE, "song_of_slavery",
sp_charmingsong, NULL},
{
SPL_BIGRECRUIT, "big_recruit",
sp_bigrecruit, NULL},
{
SPL_RALLYPEASANTMOB, "calm_riot",
sp_rallypeasantmob, NULL},
{
SPL_RAISEPEASANTMOB, "incite_riot",
sp_raisepeasantmob, NULL},
/* M_TYBIED */ /* M_TYBIED */
{ { "analyze_magic", sp_analysemagic, 0},
SPL_ANALYSEMAGIC, "analyze_magic", { "concealing_aura", sp_itemcloak, 0},
sp_analysemagic, NULL}, { "tybiedfumbleshield", sp_fumbleshield, 0},
{
SPL_ITEMCLOAK, "concealing_aura",
sp_itemcloak, NULL},
{
SPL_TYBIED_FUMBLESHIELD, "tybiedfumbleshield",
sp_fumbleshield, NULL},
#ifdef SHOWASTRAL_NOT_BORKED #ifdef SHOWASTRAL_NOT_BORKED
{ { "show_astral", sp_showastral, 0},
SPL_SHOWASTRAL, "show_astral",
sp_showastral, NULL},
#endif #endif
{ { "resist_magic", sp_resist_magic_bonus, 0},
SPL_RESISTMAGICBONUS, "resist_magic", { "keeploot", sp_keeploot, 0},
sp_resist_magic_bonus, NULL}, { "enterastral", sp_enterastral, 0},
{ { "leaveastral", sp_leaveastral, 0},
SPL_KEEPLOOT, "keeploot", { "auratransfer", sp_transferaura, 0},
sp_keeploot, NULL}, { "shockwave", sp_stun, 0},
{ { "antimagiczone", sp_antimagiczone, 0},
SPL_ENTERASTRAL, "enterastral", { "destroy_magic", sp_destroy_magic, 0},
sp_enterastral, NULL}, { "pull_astral", sp_pullastral, 0},
{ { "fetch_astral", sp_fetchastral, 0},
SPL_LEAVEASTRAL, "leaveastral", { "steal_aura", sp_stealaura, 0},
sp_leaveastral, NULL}, { "airship", sp_flying_ship, 0},
{ { "break_curse", sp_break_curse, 0},
SPL_TRANSFERAURA_ASTRAL, "auratransfer", { "eternal_walls", sp_eternizewall, 0},
sp_transferaura, NULL}, { "protective_runes", sp_magicrunes, 0},
{ { "fish_shield", sp_reduceshield, 0},
SPL_SHOCKWAVE, "shockwave", { "combat_speed", sp_speed, 0},
sp_stun, NULL}, { "view_reality", sp_viewreality, 0},
{ { "double_time", sp_speed2, 0},
SPL_ANTIMAGICZONE, "antimagiczone", { "armor_shield", sp_armorshield, 0},
sp_antimagiczone, NULL}, { "summon_familiar", sp_summon_familiar, 0},
{ { "living_rock", sp_movecastle, 0},
SPL_TYBIED_DESTROY_MAGIC, "destroy_magic", { "astral_disruption", sp_disruptastral, 0},
sp_destroy_magic, NULL}, { "sacrifice_strength", sp_permtransfer, 0},
{
SPL_PULLASTRAL, "pull_astral",
sp_pullastral, NULL},
{
SPL_FETCHASTRAL, "fetch_astral",
sp_fetchastral, NULL},
{
SPL_STEALAURA, "steal_aura",
sp_stealaura, NULL},
{
SPL_FLYING_SHIP, "airship",
sp_flying_ship, NULL},
{
SPL_DESTROY_MAGIC, "break_curse",
sp_break_curse, NULL},
{
SPL_ETERNIZEWALL, "eternal_walls",
sp_eternizewall, NULL},
{
SPL_SCHILDRUNEN, "protective_runes",
sp_magicrunes, NULL},
{
SPL_REDUCESHIELD, "fish_shield",
sp_reduceshield, NULL},
{
SPL_SPEED, "combat_speed",
sp_speed, NULL},
{
SPL_VIEWREALITY, "view_reality",
sp_viewreality, NULL},
{
SPL_SPEED2, "double_time",
sp_speed2, NULL},
{
SPL_ARMORSHIELD, "armor_shield",
sp_armorshield, NULL},
{
SPL_TYBIED_FAMILIAR, "summon_familiar",
sp_summon_familiar, NULL},
{
SPL_MOVECASTLE, "living_rock",
sp_movecastle, NULL},
{
SPL_DISRUPTASTRAL, "astral_disruption",
sp_disruptastral, NULL},
{
SPL_PERMTRANSFER, "sacrifice_strength",
sp_permtransfer, NULL},
/* M_GRAY */ /* M_GRAY */
/* Definitionen von Create_Artefaktspruechen */ /* Definitionen von Create_Artefaktspruechen */
{ { "wyrm_transformation", sp_becomewyrm, 0},
SPL_METEORRAIN, "meteor_rain",
sp_kampfzauber, NULL},
{
SPL_BECOMEWYRM, "wyrm_transformation",
sp_becomewyrm, NULL},
/* Monstersprueche */ /* Monstersprueche */
{SPL_FIREDRAGONODEM, "fiery_dragonbreath", { "fiery_dragonbreath", sp_dragonodem, 0},
sp_dragonodem, NULL}, { "icy_dragonbreath", sp_dragonodem, 0},
{SPL_DRAGONODEM, "icy_dragonbreath", { "powerful_dragonbreath", sp_dragonodem, 0},
sp_dragonodem, NULL}, { "drain_skills", sp_dragonodem, 0},
{SPL_WYRMODEM, "powerful_dragonbreath", { "aura_of_fear", sp_flee, 0},
sp_dragonodem, NULL}, { "shadowcall", sp_shadowcall, 0},
{SPL_DRAINODEM, "drain_skills", { "immolation", sp_immolation, 0},
sp_dragonodem, NULL}, { "firestorm", sp_immolation, 0},
{ { "coldfront", sp_immolation, 0},
SPL_AURA_OF_FEAR, "aura_of_fear", { "acidrain", sp_immolation, 0},
sp_flee, NULL},
{
SPL_SHADOWCALL, "shadowcall",
sp_shadowcall, NULL},
{
SPL_IMMOLATION, "immolation",
sp_immolation, NULL},
{SPL_FIREODEM, "firestorm",
sp_immolation, NULL},
{SPL_ICEODEM, "coldfront",
sp_immolation, NULL},
{SPL_ACIDODEM, "acidrain",
sp_immolation, NULL},
/* SPL_NOSPELL MUSS der letzte Spruch der Liste sein */ /* SPL_NOSPELL MUSS der letzte Spruch der Liste sein */
{ { 0, 0, 0 }
SPL_NOSPELL, "no spell",
NULL, NULL}
}; };
static boolean chaosgate_valid(const connection * b) static boolean chaosgate_valid(const connection * b)
@ -7006,24 +6713,21 @@ border_type bt_chaosgate = {
chaosgate_move chaosgate_move
}; };
static void set_spelldata_i(spell * sp, spelldata * data) static void register_spelldata(void)
{
sp->cast = data->sp_function;
sp->patzer = data->patzer;
}
void set_spelldata(spell * sp)
{ {
int i; int i;
for (i = 0; spelldaten[i].id != SPL_NOSPELL; ++i) { char zText[32];
spelldata *data = spelldaten + i; strcpy(zText, "fumble_");
if (strcmp(data->sname, sp->sname) == 0) { for (i = 0; spell_functions[i].cast; ++i) {
set_spelldata_i(sp, data); spelldata *data = spell_functions + i;
return; if (data->cast) {
register_function((pf_generic)data->cast, data->sname);
}
if (data->fumble) {
strlcpy(zText+7, data->sname, sizeof(zText)-7);
register_function((pf_generic)data->fumble, zText);
} }
} }
log_error(("unknown spell %s.\n", sp->sname));
assert(!"there is no spell by that name");
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@ -7120,7 +6824,6 @@ static int sp_readmind(castorder * co)
void register_spells(void) void register_spells(void)
{ {
set_spelldata_cb = &set_spelldata;
at_register(&at_wdwpyramid); at_register(&at_wdwpyramid);
at_register(&at_deathcloud_compat); at_register(&at_deathcloud_compat);
@ -7131,9 +6834,12 @@ void register_spells(void)
ct_register(&ct_firewall); ct_register(&ct_firewall);
ct_register(&ct_deathcloud); ct_register(&ct_deathcloud);
register_function((pf_generic) & sp_blessedharvest, "cast_blessedharvest"); register_function((pf_generic) sp_blessedharvest, "cast_blessedharvest");
register_function((pf_generic) & sp_wdwpyramid, "wdwpyramid"); register_function((pf_generic) sp_wdwpyramid, "wdwpyramid");
register_function((pf_generic) & sp_summon_familiar, "cast_familiar"); register_function((pf_generic) sp_summon_familiar, "cast_familiar");
register_function((pf_generic) & sp_babbler, "cast_babbler"); register_function((pf_generic) sp_babbler, "cast_babbler");
register_function((pf_generic) & sp_readmind, "cast_readmind"); register_function((pf_generic) sp_readmind, "cast_readmind");
register_function((pf_generic) sp_kampfzauber, "combat_spell");
register_spelldata();
} }