Angband Forums

Angband Forums (
-   Development (
-   -   Monster spell and Projections (

Mark November 13, 2019 21:46

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 November 13, 2019 23:32

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.

All times are GMT +1. The time now is 05:37.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.