Sunday, 9 August 2009

Some thoughts on Implementation of Potions

Looking back at the roadmap, the two major tasks left to do in this release cycle are potions/scrolls and corpses.

In this post I'll be talking about potions in particular. I've already defined them previously, but I want to talk more about their implementation. (Incidentally Kharne will follow the usual Roguelike concepts with potions for the time being. Eventually, I do want to allow them to be used also in some sort of Alchemy-based crafting system, much like that is found in some MMORPGs)

So, to begin with, these are the potions I intend to implement for the next release:
  • Potion of Healing: Andrew Doull of Unangband fame (and much more besides) commented a while back on the role of healing in Angband. I don't intend to deviate from his analysis too much, but I propose that standard Potions of Healing (which should be the commonest potion type found) shouild heal a flat 50% of lost HP instantly.
  • Potion of Extra Healing: Like its lesser brother, this will restore HP. instantly I'm minded to make this restore 100% of lost HP. Unlike the original Rogue, I'm not intending to allow maximum HP to be increased by chugging Potions at maximum health.
  • Potion of Curing: In Crawl, healing potions cure effects like poison and sickness, but I'm not keen on that usage as I feel it leads to using up valuable potions. I think the alternative method of providing a specialised potion to cure negative status effects would be useful instead (if it turns out that this is a bad idea, I'd be willing to change healing potions to work like Crawl's)
  • Potion of Regeneration: This was proposed by Andrew in the post mentioned above, and I'm also intending to implement it in Kharne. This should work like Crawl's Trog's Hand. For X turns, you regenerate 10% of maximum health back a turn.
  • Potion of Speed: For X turns, the player can move and act at 3 times his/her normal speed.
  • Potion of Restore Abilities: This potion will remove any negative status effects upon the player's being (e.g. if they are drained of strength by a creature, like Shadows used to do back in the days of AD&D). (This will require some additional coding for the class that holds the player to include a temporary buffer pool for each stat - it is this buffer pool that gets adjusted for temporary effects like strength drain and NOT the actual player's inherent strength).
  • Potion of Confusion: This will mimic the standard Confusion effect found in many Roguelikes, and lasts for X turns. This is actually very easy to implement, as it just requires a check on keypress to see if a movement key has been pressed, and if so, randomly choose another direction instread)
  • Potion of Blindness: Again, another potion with unbeneficial side effects that lasts for X turns. Technically speaking, this is just a matter of reducing the effective FOV radius to 0 squares (instead of the standard 7).
  • Potion of Paralysis: Paralysis will prevent you from acting. (I also intend it to be a monster attack posessed by Ghouls). Again lasts for X turns.
  • Potion of Free Action: Whilst under the effects of this potion, you cannot be paralysed or slowed. Another potion with a duration of X turns.
  • Potion of Combat Mastery: Massively increase the player's chance to hit for a certain number of turns. To balance this out, I feel the duration should not be as long as other potions, perhaps only 10-20 turns.
  • Potion of Reflexes: A defensive as opposed to an offensive potion. I intend for this to boost evasion for a limited period. Evasion is the stat used to determine if an attack hits or not, and is affected by armour worn, dexterity and other factors. Unlike Armour Class, its actually a logarithmic stat.
  • Potion of Might: Massively increase the player's damage for a certain number of turns. Like Potions of Combat Master, I feel the duration should not be as long as other potions, perhaps only 10 turns maximum.
So, in summary, there will be four potions with instant action-effects (Potions of Healing, Extra Healing, Curing and Restore Abilities), six that provide some sort of boost over time (Potions of Regeneration, Speed, Free Action, Combat Mastery, Reflexes and Speed) and three harmful potions (Blindness, Confusion and Paralysis).

In terms of distribution of potions, the most common (for obvious reasons) have to be the healing potions, and I feel that the harmful potions should account for no more than 20% of all potions found.

Thoughts?

2 comments:

Anonymous said...

Certainly a good standard set of potions. I'm not sure about the duration, though. You say "only" 10 to 20 turns. I think 20 turns can be a rather long time, esp. for confusion or paralization.

Are the effects of the potions only bound to the potions, or are the effects more general? Again I compare it to LambdaRogue, where I have a general DoEffect(intType) procedure which is called whenever a player drinks or eats something, drinks from an enchanted well, casts a spell on itself or is otherwise affected by some magic.

Dave said...

What sort of duration should negative-effect potions have, say in relation to positive effect ones?

The effects themselves will be more general. I intend to have an array of flags (which will be a data member of TCreature) to represent confused, poisoned so on.