Monster spell and Projections

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mark
    Adept
    • Oct 2007
    • 130

    Monster spell and Projections

    Just a quick question to help me understand the game data files? What *is* a projection, in the sense of what kind of thing is that file trying to describe?

    How should I think of the relationship between the breath effects in monster spell and those in projections data files?
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9647

    #2
    All monster ranged attacks (aside from spells that act directly on the player like causing wounds), and all player ranged attacks and effects except shooting and throwing of objects. So it includes all the elemental damage types, (as listed in list-elements.h) and a bunch of other effects to monsters, terrain, etc (listed in list-projections.h).

    All the information used to be in mon-spell.c, the list-*.h files and the project*.c files; projection.txt is meant to make it easier to adjust the properties of projections (like words used in messages, effect of resistance) without having to recompile the game. Note that the code: line includes the code from the relevant list-*.h file, which is used in the project*.c files to make the effects actually happen.

    So monster_spell.txt will define the breath (like BR_FIRE) which appears in monster.txt; the effect line tells you that BR_FIRE uses the breath effect (defined in effects.c), the FIRE projection type, and parameters for the size of the breath cone. The breath effect code then calls the project() function to affect all the grids in the cone of effect, which in turn calls functions to deal with the effects of fire on terrain, objects, monsters and the player that are on one of those grids.
    Last edited by Nick; November 13, 2019, 23:39. Reason: Answer the second part of the question
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎