Several months ago, takkaria and I had a debate about how to improve the handling of effects. In case anyone is interested, the original exchange is here. The basic issues are:
1. We don't currently distinguish between simple effects which do one thing (e.g. remove fear) and compound effects which do lots of things (e.g. cure 60 hp and remove poison, blindness, confusion and stunning).
2. We don't have consistently parameterised effects, by which I mean that the code knows whether an effect requires aiming, but not whether it requires a target object, and that variable values are hard-coded - CLW, CSW and CCW are all *different* effects. This, incidentally, is why it's so hard to display the adjusted damage that an attack wand or rod would do.
Thirdly, there's no way to edit effects without hacking the source and recompiling.
So, we concluded that we need to split effects into two. Simple effects *have* to be in the code - because if you want to add or change one, you have to code that change. But compound effects are just multiple simple effects put together, and there's no reason these couldn't be in an edit file:
N:Cure Light Wounds
E: HEAL_HP:20:0
E: DEC_POIS:0:2d6
E: DEC_BLIND:0:-1 (where -1 means "all")
N:Cure Serious Wounds
E: HEAL_HP:40:0
E: DEC_POIS:0:-1
E: DEC_BLIND:0:-1
E: DEC_CONF:0:-1
etc. So, my plan is to define a full set of simple effects that can be called with a parameter "amount" (i.e. the hp to heal, temp boost to-hit, etc.) and a parameter "duration", and then create an edit file and a parser to deal with the compound effects. (There will be other aspects to encode as well, like whether the effect needs a target object or monster, and of course the flavour text.)
I'll post the list of simple effects here before I commit anything, to check that it covers what people think might be needed. In the meantime, does anyone have any comments on this approach? Are there other things to take into account?
1. We don't currently distinguish between simple effects which do one thing (e.g. remove fear) and compound effects which do lots of things (e.g. cure 60 hp and remove poison, blindness, confusion and stunning).
2. We don't have consistently parameterised effects, by which I mean that the code knows whether an effect requires aiming, but not whether it requires a target object, and that variable values are hard-coded - CLW, CSW and CCW are all *different* effects. This, incidentally, is why it's so hard to display the adjusted damage that an attack wand or rod would do.
Thirdly, there's no way to edit effects without hacking the source and recompiling.
So, we concluded that we need to split effects into two. Simple effects *have* to be in the code - because if you want to add or change one, you have to code that change. But compound effects are just multiple simple effects put together, and there's no reason these couldn't be in an edit file:
N:Cure Light Wounds
E: HEAL_HP:20:0
E: DEC_POIS:0:2d6
E: DEC_BLIND:0:-1 (where -1 means "all")
N:Cure Serious Wounds
E: HEAL_HP:40:0
E: DEC_POIS:0:-1
E: DEC_BLIND:0:-1
E: DEC_CONF:0:-1
etc. So, my plan is to define a full set of simple effects that can be called with a parameter "amount" (i.e. the hp to heal, temp boost to-hit, etc.) and a parameter "duration", and then create an edit file and a parser to deal with the compound effects. (There will be other aspects to encode as well, like whether the effect needs a target object or monster, and of course the flavour text.)
I'll post the list of simple effects here before I commit anything, to check that it covers what people think might be needed. In the meantime, does anyone have any comments on this approach? Are there other things to take into account?
Comment