summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-book.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-11 12:21:26 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-11 12:21:26 +0000
commitf3244b61a572b38692d4b96ad535963da28dfe8a (patch)
tree2480c0bb520f1fb741c72d7f314d0eaf9f1bf289 /crawl-ref/source/spl-book.cc
parent907b837e7c0860984593413279c686d27a81a77e (diff)
downloadcrawl-ref-f3244b61a572b38692d4b96ad535963da28dfe8a.tar.gz
crawl-ref-f3244b61a572b38692d4b96ad535963da28dfe8a.zip
Bug 2414178: applied Brendan MacDonell's patch (2414671) to make the book order
in spl-book.cc match enum.h git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7810 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-book.cc')
-rw-r--r--crawl-ref/source/spl-book.cc186
1 files changed, 101 insertions, 85 deletions
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index bf2c3313bb..ca1acb2125 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -49,9 +49,9 @@
#define RANDART_BOOK_TYPE_LEVEL "level"
#define RANDART_BOOK_TYPE_THEME "theme"
-#define NUMBER_SPELLBOOKS 61
+#define NUMBER_SPELLBOOKS sizeof(spellbook_template_array)/(sizeof(spell_type) * SPELLBOOK_SIZE)
-static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
+static spell_type spellbook_template_array[][SPELLBOOK_SIZE] =
{
// 0 - Minor Magic I
{SPELL_MAGIC_DART,
@@ -295,17 +295,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 24 - Necronomicon -- Kikubaaqudgha special
- {SPELL_SYMBOL_OF_TORMENT,
- SPELL_CONTROL_UNDEAD,
- SPELL_SUMMON_WRAITHS,
- SPELL_DEATHS_DOOR,
- SPELL_NECROMUTATION,
- SPELL_DEATH_CHANNEL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- },
- // 25 - Book of Callings
+ // 24 - Book of Callings
{SPELL_SUMMON_SMALL_MAMMALS,
SPELL_STICKS_TO_SNAKES,
SPELL_CALL_IMP,
@@ -315,7 +305,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 26 - Book of Charms
+ // 25 - Book of Charms
{SPELL_BACKLIGHT,
SPELL_REPEL_MISSILES,
SPELL_SLEEP,
@@ -325,17 +315,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_INVISIBILITY,
SPELL_NO_SPELL,
},
- // 27 - Book of Demonology -- Vehumet special
- {SPELL_ABJURATION_I,
- SPELL_RECALL,
- SPELL_CALL_IMP,
- SPELL_SUMMON_DEMON,
- SPELL_DEMONIC_HORDE,
- SPELL_SUMMON_GREATER_DEMON,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- },
- // 28 - Book of Air
+ // 26 - Book of Air
{SPELL_SHOCK,
SPELL_SWIFTNESS,
SPELL_REPEL_MISSILES,
@@ -361,7 +341,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
// already very common (i.e,. this level nine spell occurred in
// two books!)
- // 29 - Book of the Sky
+ // 27 - Book of the Sky
{SPELL_SUMMON_ELEMENTAL,
SPELL_INSULATION,
SPELL_AIRSTRIKE,
@@ -372,7 +352,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_CONJURE_BALL_LIGHTNING,
},
- // 30 - Book of Divinations
+ // 28 - Book of Divinations
{SPELL_DETECT_SECRET_DOORS,
SPELL_DETECT_CREATURES,
SPELL_DETECT_ITEMS,
@@ -382,7 +362,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_IDENTIFY,
SPELL_NO_SPELL,
},
- // 31 - Book of the Warp
+ // 29 - Book of the Warp
{SPELL_BANISHMENT,
SPELL_WARP_BRAND,
SPELL_DISPERSAL,
@@ -392,7 +372,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 32 - Book of Envenomations
+ // 30 - Book of Envenomations
{SPELL_SPIDER_FORM,
SPELL_SUMMON_SCORPIONS,
SPELL_POISON_AMMUNITION,
@@ -402,17 +382,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 33 - Book of Annihilations -- Vehumet special
- {SPELL_ISKENDERUNS_MYSTIC_BLAST,
- SPELL_POISON_ARROW,
- SPELL_CHAIN_LIGHTNING,
- SPELL_LEHUDIBS_CRYSTAL_SPEAR,
- SPELL_ICE_STORM,
- SPELL_FIRE_STORM,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- },
- // 34 - Book of Unlife
+ // 31 - Book of Unlife
{SPELL_SUBLIMATION_OF_BLOOD,
SPELL_ANIMATE_DEAD,
SPELL_TWISTED_RESURRECTION,
@@ -423,17 +393,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 35 - Tome of Destruction
- {SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- },
- // 36 - Book of Control
+ // 32 - Book of Control
{SPELL_CONTROL_TELEPORT,
SPELL_ENSLAVEMENT,
SPELL_TAME_BEASTS,
@@ -443,7 +403,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 37 - Book of Morphology
+ // 33 - Book of Morphology
{SPELL_FRAGMENTATION,
SPELL_POLYMORPH_OTHER,
SPELL_CIGOTUVIS_DEGENERATION,
@@ -455,7 +415,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 38 - Book of Tukima
+ // 34 - Book of Tukima
{SPELL_SURE_BLADE,
SPELL_TUKIMAS_VORPAL_BLADE,
SPELL_TUKIMAS_DANCE,
@@ -465,7 +425,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 39 - Book of Geomancy
+ // 35 - Book of Geomancy
{SPELL_SANDBLAST,
SPELL_STONESKIN,
SPELL_PASSWALL,
@@ -476,7 +436,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 40 - Book of Earth
+ // 36 - Book of Earth
{SPELL_MAXWELLS_SILVER_HAMMER,
SPELL_MAGIC_MAPPING,
SPELL_DIG,
@@ -486,17 +446,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL
},
- // 41 - manuals of all kinds
- {SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- SPELL_NO_SPELL,
- },
- // 42 - Book of Wizardry
+ // 37 - Book of Wizardry
{SPELL_DETECT_CREATURES,
SPELL_SUMMON_ELEMENTAL,
SPELL_MAGIC_MAPPING,
@@ -506,7 +456,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_HASTE,
SPELL_NO_SPELL,
},
- // 43 - Book of Power
+ // 38 - Book of Power
{SPELL_ANIMATE_DEAD,
SPELL_TELEPORT_OTHER,
SPELL_VENOM_BOLT,
@@ -516,7 +466,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_POISONOUS_CLOUD,
SPELL_NO_SPELL,
},
- // 44 - Book of Cantrips //jmf: added 04jan2000
+ // 39 - Book of Cantrips //jmf: added 04jan2000
{SPELL_CONFUSING_TOUCH,
SPELL_ANIMATE_SKELETON,
SPELL_SUMMON_SMALL_MAMMALS,
@@ -527,7 +477,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 45 - Book of Party Tricks //jmf: added 04jan2000
+ // 40 - Book of Party Tricks //jmf: added 04jan2000
{SPELL_SUMMON_BUTTERFLIES,
SPELL_APPORTATION,
SPELL_PROJECTED_NOISE,
@@ -538,7 +488,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 46 - Book of Beasts //jmf: added 19mar2000
+ // 41 - Book of Beasts //jmf: added 19mar2000
{SPELL_SUMMON_SMALL_MAMMALS,
SPELL_STICKS_TO_SNAKES,
SPELL_DETECT_CREATURES,
@@ -549,7 +499,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 47 - Book of Stalking //jmf: 24jun2000
+ // 42 - Book of Stalking //jmf: 24jun2000
{SPELL_STING,
SPELL_SURE_BLADE,
SPELL_PROJECTED_NOISE,
@@ -559,8 +509,52 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_INVISIBILITY,
SPELL_NO_SPELL,
},
+
+ // 43 - Book of Annihilations -- Vehumet special
+ {SPELL_ISKENDERUNS_MYSTIC_BLAST,
+ SPELL_POISON_ARROW,
+ SPELL_CHAIN_LIGHTNING,
+ SPELL_LEHUDIBS_CRYSTAL_SPEAR,
+ SPELL_ICE_STORM,
+ SPELL_FIRE_STORM,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ },
+
+ // 44 - Book of Demonology -- Vehumet special
+ {SPELL_ABJURATION_I,
+ SPELL_RECALL,
+ SPELL_CALL_IMP,
+ SPELL_SUMMON_DEMON,
+ SPELL_DEMONIC_HORDE,
+ SPELL_SUMMON_GREATER_DEMON,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ },
+
+ // 45 - Necronomicon -- Kikubaaqudgha special
+ {SPELL_SYMBOL_OF_TORMENT,
+ SPELL_CONTROL_UNDEAD,
+ SPELL_SUMMON_WRAITHS,
+ SPELL_DEATHS_DOOR,
+ SPELL_NECROMUTATION,
+ SPELL_DEATH_CHANNEL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ },
+
+ // 46 - Randart Spellbook (by level)
+ {SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ },
- // 48 -- unused
+ // 47 - Randart Spellbook (by theme)
{SPELL_NO_SPELL,
SPELL_NO_SPELL,
SPELL_NO_SPELL,
@@ -571,7 +565,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 49 - unused
+ // 48 - Book of Card Effects
{SPELL_NO_SPELL,
SPELL_NO_SPELL,
SPELL_NO_SPELL,
@@ -582,9 +576,31 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // Rods - start at 50.
+ // 49 - manuals of all kinds
+ {SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ },
+
+ // 50 - Tome of Destruction
+ {SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ SPELL_NO_SPELL,
+ },
+
+ // Rods - start at NUM_BOOKS.
- // 50 - Rod of smiting
+ // 51 - Rod of smiting
{SPELL_SMITING,
SPELL_NO_SPELL,
SPELL_NO_SPELL,
@@ -595,7 +611,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
},
- // 51 - Rod of summoning
+ // 52 - Rod of summoning
{SPELL_ABJURATION_I,
SPELL_RECALL,
SPELL_SUMMON_ELEMENTAL,
@@ -605,7 +621,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 52 - Rod of destruction (fire)
+ // 53 - Rod of destruction (fire)
{SPELL_THROW_FLAME,
SPELL_BOLT_OF_FIRE,
SPELL_FIREBALL,
@@ -615,7 +631,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 53 - Rod of destruction (ice)
+ // 54 - Rod of destruction (ice)
{SPELL_THROW_FROST,
SPELL_ICE_BOLT,
SPELL_FREEZING_CLOUD,
@@ -625,7 +641,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 54 - Rod of destruction (lightning, iron, fireball)
+ // 55 - Rod of destruction (lightning, iron, fireball)
{SPELL_LIGHTNING_BOLT,
SPELL_BOLT_OF_IRON,
SPELL_FIREBALL,
@@ -635,7 +651,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 55 - Rod of destruction (inaccuracy, magma, cold)
+ // 56 - Rod of destruction (inaccuracy, magma, cold)
{SPELL_BOLT_OF_INACCURACY,
SPELL_BOLT_OF_MAGMA,
SPELL_BOLT_OF_COLD,
@@ -645,7 +661,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 56 - Rod of warding
+ // 57 - Rod of warding
{SPELL_ABJURATION_I,
SPELL_CONDENSATION_SHIELD,
SPELL_CAUSE_FEAR,
@@ -655,7 +671,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 57 - Rod of discovery
+ // 58 - Rod of discovery
{SPELL_DETECT_SECRET_DOORS,
SPELL_DETECT_TRAPS,
SPELL_DETECT_ITEMS,
@@ -665,7 +681,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 58 - Rod of demonology
+ // 59 - Rod of demonology
{SPELL_ABJURATION_I,
SPELL_RECALL,
SPELL_CALL_IMP,
@@ -675,7 +691,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 59 - Rod of striking
+ // 60 - Rod of striking
{SPELL_STRIKING,
SPELL_NO_SPELL,
SPELL_NO_SPELL,
@@ -685,7 +701,7 @@ static spell_type spellbook_template_array[NUMBER_SPELLBOOKS][SPELLBOOK_SIZE] =
SPELL_NO_SPELL,
SPELL_NO_SPELL,
},
- // 60 - Rod of venom
+ // 61 - Rod of venom
{SPELL_CURE_POISON_II,
SPELL_VENOM_BOLT,
SPELL_POISON_ARROW,