Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old November 13, 2019, 21:46   #1
Mark
Adept
 
Join Date: Oct 2007
Posts: 129
Mark is on a distinguished road
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?
Mark is offline   Reply With Quote
Old November 13, 2019, 23:32   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,862
Donated: $60
Nick will become famous soon enough
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.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

Last edited by Nick; November 13, 2019 at 23:39. Reason: Answer the second part of the question
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Monster spell messages (list-mon-spells.h) conversion to text in progress Elsairon Development 19 July 19, 2015 02:40
Monster Spell and experience changes Malak Darkhunter Vanilla 8 October 11, 2012 02:10
Alternative detect monster spell? Mikko Lehtinen Variants 11 December 22, 2011 23:33
Feature request: breath/spell damage in monster memory Marble Dice Vanilla 7 October 21, 2009 08:17
LOS/FOV/projections in NPP/Sangband half Development 1 July 21, 2009 23:49


All times are GMT +1. The time now is 02:38.


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