Re: [Pybem-developers] boojum
Brought to you by:
abriggs
From: Anthony B. <ab...@ii...> - 2002-06-20 05:01:01
|
At 10:11 AM +0800 18/6/02, Anthony Briggs wrote: >skill sword synonyms swor effect +lvl combat requires item sword >item sword effect +2 combat requires skill sword > >skill knight >synonyms knig >effect +lvl combat > +lvl upkeep >requires skills sword riding shield heraldry > items sword horse plate_armour shield > >...looks a bit more readable ;) I've been thinking a bit more about the overall design of items. It seems to me that at the 'base level', items should have three things: 1. a type, eg. skill, item, attribute, and perhaps some other player-definable types 2. a list/dictionary of effects that the item will have, such as +2 combat, increasing movement, adding extra skills(?), etc. 3. a list/dictionary of requirements for each effect, including anti-requirements. I think the effects are going to be reasonably straightforward to do - you'd have the usual plus/minus/divide/multiply by an amount, as well as replacing it with a certain amount. You'd probably also want some sort of order that these were applied in, eg. start with a unit's best weapon type when adding up combat bonuses. To save processor time, you'd probably also want to go through a unit prior to running the turn, and figure out which items were active (or not), so that you didn't have to redo it every time that unit's attributes were accessed. Except when your items changed, of course - perhaps we could have a 'dirty' flag for a unit's items, and then recalculate the attributes if necessary. The hard bit is probably going to be writing the requirements in a flexible way. eg. You might want to have something that only works in a certain terrain type, or has particular 'extra' bonuses in a terrain type, only works when used on a certain type of monster, etc. The ones that requre a certain skill, item or the lack thereof are going to be easy, but the hex/target ones will probably have to be hard coded if we can't come up with am easy way to access generic objects' attributes. To make life easier, perhaps we could do items that rely on skills first, and then add in the terrain and target reqs later. Anyway, just some food for thought. Ant -- ---------------------------------------------------- HyPEraCtiVE? HeY, WhO aRE YoU cALliNg HypERaCtIve?! aB...@Ii... ---------------------------------------------------- |