Changes between Initial Version and Version 1 of NewEffects


Ignore:
Timestamp:
11/22/11 11:44:21 (8 years ago)
Author:
magnate
Comment:

First draft

Legend:

Unmodified
Added
Removed
Modified
  • NewEffects

    v1 v1  
     1= Rewriting effects = 
     2== The drivers == 
     3- refactoring (http://c2.com/xp/RefactorMercilessly.html, #1041, #1124, #1403) 
     4 
     5- improve message handling (#1376, #1502) 
     6 
     7- bugfixing (#623, #726, #859, #1573, #1578) 
     8 
     9- increased flexibility and configurability (#57, #234, #418, #488, #578, #692, #992, #1276, #1279, #1408, #1437, #1459) 
     10 
     11== What we have now == 
     12Triggers leading to effects: 
     13- item use (quaff, read, aim, zap, use, eat, activate) 
     14- casting spell (includes all ranged monster attacks) 
     15- on-hit effects (monster confusion and monster blow effects) 
     16- on-move effects (triggering trap) 
     17- on-expiry effects (SHROOM_SPRINTING) 
     18 
     19Potential targets of effects: 
     20- player 
     21- monster(s) 
     22- object(s) 
     23- grid(s) 
     24 
     25Parameters potentially affecting effects: 
     26- originator level 
     27- target level 
     28- dungeon level 
     29- object level 
     30- spell level 
     31- feature level (trap / door / lock) 
     32- relevant skill (devices, mainly) 
     33 
     34Variables potentially affected: 
     35- amount (e.g. of damage, or healing) 
     36- range 
     37- duration 
     38- saving throw 
     39- random outcomes (polymorph, wonder etc.) 
     40 
     41At the moment only certain parameters affect certain variables for certain effects. 
     42 
     43At the moment certain amount variables are conflated with durations (cut, stun, poison).  
     44 
     45Most area affects are handled by the project() code, but separate functions exist for: 
     46- earthquake and destruction 
     47- detections 
     48- mapping, lighting and disarming 
     49- aggravation, probing, banishment and mass banishment 
     50 
     51Obviousness / learning is handled by various mechanisms. 
     52 
     53There are no effects which are conditional on the outcome of a previous effect, I think. 
     54 
     55== The vision == 
     56Most list-*.h files turned into !lib/edit files: 
     57 
     58list-effects.h and list-blow-effects.h and list-spell-effects.h combine into effects.txt 
     59 
     60list-gf-types.h becomes projections.txt 
     61 
     62list-mon-spells.h becomes mon_spell.txt (and eventually list-blow-methods.h into mon_blow.txt) 
     63 
     64It is not necessary to make a fully generic system. Something which replicates the current effects using editable text files would be a fine start. 
     65 
     66== Progress == 
     67=== Thinking === 
     68Effects should be atomic, with monster attacks, player spells or item activations specifying as many as they need.  
     69 
     70As much as possible should be adjusted before the effect is called, e.g. range and damage. These are properties of the item, spell or trap, not of the effect. 
     71 
     72All area effects could be done with project(). It's quite possible that all non-area effects could also be delivered via project(), if this is helpful. But this will mean passing variables into project (amount, duration, saving throw) because different targets may need those amounts adjusted differently. 
     73 
     74Current mental block is which adjustments which need to be passed into the effect(s) and how to manage them. 
     75 
     76=== Files === 
     77effects.txt - started 
     78 
     79mon_spell.txt - format and syntax done, just needs populating and parsing. At the moment the distinction between projected and non-projected spells is retained, but I think it may not be necessary, since project() can deal perfectly well with delivering an effect directly to a single target. 
     80 
     81projections.txt - half done (the breath elements), just needs the map effects sorting