[Done for V0.38] Spell system
Posted: Tue Oct 04, 2005 2:54 pm
As a programmer, I can't imagine this would be too hard to implement and would add all sorts of possibilities. What I think is needed is the ability to create new spells in a dungeon. In order to do this, assuming that the existing spells are hard coded, you would simply need to add a "spell table" to the code containing the attributes (runes, effect, etc) of each new spell. When the player casts some runes, the game first checks against hard coded spells as it does now and then looks through the spell table for a new spell which uses those runes. The way I see spells being defined is really simple, as follows:
1) The set of runes that make up the spell.
2) Effect of spell. This would be one of:
i) Create projectile. Projectile could be an object which flies away from the party in the direction they are facing, or a spell such as a fireball. There should be a flag which allows the object to be destroyed or turn into something else when it hits something so that you could have, for example, a magic dagger spell which launches a dagger which hits a monster and does damage and then vanishes.
ii) Create an object in hand. For creating potions, or a food spell, etc. Any object can be created, and the designer can specify if another object must be in hand for the spell to work - for example, an empty flask in hand for potion.
iii) Object created on square in front of party. The object created should be able to be anything, including monsters, wall items, etc. If the square in front of the party is inappropriate, the spell fails. There could be a spell for creating worms which give food when killed (a sort of food spell, but you have to fight for it), or a spell that creates an ornate alcove in the wall for storing things, or a spell that creates a weapon on the floor. The possibilities are endless.
iv) Special spell effects, such as light or darkness.
And that's it. Three main attributes required per spell - runes needed, effect (and there only needs to be four that I can think of, as listed above), and parameters such as item created or length of effect or amount of light, etc.
I could probably add a spell table such as this and the code to check it and create an appropriate effect when the right runes are cast in an afternoon, so I don't imagine it would be hard to implement. And it wouldn't mess anything up as if it isn't used then it makes no effect on the dungeon.
1) The set of runes that make up the spell.
2) Effect of spell. This would be one of:
i) Create projectile. Projectile could be an object which flies away from the party in the direction they are facing, or a spell such as a fireball. There should be a flag which allows the object to be destroyed or turn into something else when it hits something so that you could have, for example, a magic dagger spell which launches a dagger which hits a monster and does damage and then vanishes.
ii) Create an object in hand. For creating potions, or a food spell, etc. Any object can be created, and the designer can specify if another object must be in hand for the spell to work - for example, an empty flask in hand for potion.
iii) Object created on square in front of party. The object created should be able to be anything, including monsters, wall items, etc. If the square in front of the party is inappropriate, the spell fails. There could be a spell for creating worms which give food when killed (a sort of food spell, but you have to fight for it), or a spell that creates an ornate alcove in the wall for storing things, or a spell that creates a weapon on the floor. The possibilities are endless.
iv) Special spell effects, such as light or darkness.
And that's it. Three main attributes required per spell - runes needed, effect (and there only needs to be four that I can think of, as listed above), and parameters such as item created or length of effect or amount of light, etc.
I could probably add a spell table such as this and the code to check it and create an appropriate effect when the right runes are cast in an afternoon, so I don't imagine it would be hard to implement. And it wouldn't mess anything up as if it isn't used then it makes no effect on the dungeon.