Adding Oangband magic realms/spellbooks. What changes do I need to make?
Collapse
X
-
-
Code:#define NUM_ELEMENTS 12
Code:#define ADD(a, b) (a + b)
Code:int num_items; int n = ADD(num_items, 7);
Code:int num_items; int n = (num_items + 7);
Code:#define S(a, b, c, ...) { a, b, c, ... }
The hash ('#') before the 'a' is a special way of saying 'turn this parameter into a string'. So if you define a macro STRINGIFY like so:
Code:#define STRINGIFY(a) #a
Code:"TEST"
Hope that helps!takkaria whispers something about options. -more-Comment
-
Comment
-
I did that a long time ago, but I'll check it. And edit what I find into this post.
Edit: Ok, this is what it says:
/**
* \file list-magic-realms.h
* \brief Spell realms
*/
/* index spell stat verb spell noun book noun realm name*/
REALM(NONE, STAT_STR, "", "", "", "")
REALM(ARCANE, STAT_INT, "cast", "spell", "magic book", "arcane")
REALM(PIOUS, STAT_WIS, "recite", "prayer", "prayer book", "divine")
REALM(NATURE, STAT_WIS, "use", "druidic lore", "nature book", "nature")
REALM(NECROMANCY, STAT_INT, "perform", "ritual", "necromancy book", "necromancy")
Note: the realms work just fine. You can play an Assassin (though you will be casting rogue spells), or a Druid (casting mage spells), the names of the spellbooks just don't display in inventory and store lists. Hence the excitement about finding the 'show_inven' and related sections in ui-object.c and ui-store.c. The problem is if I start a Necromancer, for example, my starting inventory appears like this:
a)
b) a ration of food
c) a scroll of word of recall
So if you browse, inspect, or gain a spell from a it displays the list of spells just fine and casts them fine. It just won't display the book name. In inventory or store.Last edited by Elfin Jedi; April 17, 2017, 09:44.Comment
-
light purple for necromancy books, light green for nature books; changing prayer books to light blue. They do display properly on the ASCII map. (Light green ?, light purple ?.)Comment
-
Hmm. Looks like more data that belongs in object_base.txt
I'd forgotten all about that.
Edit:
The thing to do is to grep for cases for TV_MAGIC_BOOK and add new entries. This is not the only place, by a long shot. There are 10 places that need to be edited.Last edited by Pete Mack; April 17, 2017, 17:34.Comment
-
case TV_MAGIC_BOOK:
if (terse)
return "& Book~ #";
else
return "& Book~ of Magic Spells #";
case TV_PRAYER_BOOK:
if (terse)
return "& Book~ #";
else
return "& Holy Book~ of Prayers #";
case TV_NATURE_BOOK:
if (terse)
return "& Book~ #";
else
return "& Book~ of Nature Lore #";
case TV_NECROMANCY_BOOK:
if (terse)
return "& Book~ #";
else
return "& Book~ of Necromancy #";
I already searched for TV_MAGIC_BOOK, Book, and even TV a while ago and added more code for each of the results. Except for wiz-stats.c which only has TV_MAGIC_BOOK and has a note saying that since prayer books have the same probability only one of the two needs to be tracked. I don't know if there would be anything there that needs editing.
List of files changed: list-tvals.h, obj-desc.c, obj-randart.c, obj-tval.c, store.c, ui-knowledge.c, ui-options.c, wiz-spoil.c. Oh and list-magic-realms.h, object.txt, object_base.txt, store.txt, class.txt.Last edited by Elfin Jedi; April 18, 2017, 05:39.Comment
-
Agreed - that's what I'd be doing now. In fact, it is what I'm doing for my tragically buggy pathfinding algorithm...One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.Comment
Comment