Modding:Missile
From DoomRL Wiki
Missiles are created whenever a ranged weapon fires a shot. Some of the effects of the missile (like damage) depend on the weapon that fired it. Most of the missile properties are related to animation, although some have a game effect. Some weapons fire shotgun blasts instead of missiles. Shotgun blasts (called shotguns) are separate objects with their own IDs. A weapon will interpret its missile as a shotgun if it has the IF_SHOTGUN flag.
Missile Prototype
Missile prototypes are declared using the global Missile function. They are stored in a global table called missiles which can be indexed by string or numeric id. Required properties are underlined.
(Projectile) Missile Prototype | ||
---|---|---|
string | id | This is the missile's string id. By convention, it should be all lowercase and shouldn't have any whitespace. (A numeric id called nid is assigned automatically.) For inline missile definitions, this field is created automatically. |
string | soundID | If the missile doesn't have a sound bindings and this field exists, it will be used to look for sound bindings in a different place. Missiles are responsible for the .explode sound binding. By convention, this is the same as the ID of the weapon that fires the missile (if the weapon has a different id to begin with which isn't the case for inline definitions). |
string | ascii | This is the single character used to represent the missile animation. "-", the default, is automatically rotated as is commonly seen in DoomRL. |
Color | color | This is the color used to draw the missile animation. |
integer | delay | This is the number of milliseconds to pause after each stage of the missile animation. Typical values used by DoomRL are in the range of 10 to 50. |
integer | miss_base | When this missile is fired at the player, this is the base dodge chance. |
integer | miss_dist | When this missile is fired at the player, this is the amount that the dodge chance increases per unit of distance. |
string | firedesc | If this field is a non-empty string, this message will be used instead of the usual one when an enemy fires this weapon. The @1 escape will be replaced with the enemy's name (with appropriate article and capitalization). |
string | hitdesc | If this field is a non-empty string, this message will be used instead of the usual one when an enemy hits with this weapon. |
integer | maxrange | This field is currently unused. The default is 10. |
integer | range | If this field is non-zero, the player's targeting is restricted by this range when firing a weapon with this missile. Even if this value is large, targeting is still restricted by the player's vision. The default is 0. |
Missile Flag list | flags | This flags in this list are included in the missile's flag set. This is automatically translated into set format in a property called flagSet. The default is the empty list. |
integer | expl_delay | If this missile causes an explosion (determined by the weapon that fired it), this is the pause in milliseconds after each stage of the explosion animation. The default is 40. |
Color | expl_color | This is the color of the explosion animation. Since explosions are mulicolored, not all colors are allowed here. See Level.explosion for details. The default is RED. |
ExplosionFlag list | expl_flags | This is a list of explosion flags that are applied to explosions created by this missile. This is automatically translated into set format in a property called expl_flagSet. The default is the empty list. |
Cell ID | content | If this field is declared, then an explosion will have a chance of transmuting cells into this cell (as described here). This is automatically translated into a numeric id. |
Flags
Projectile Missile Flags | |
MF_RAY | This flag changes the missile's animation. The delay is ignored and all cells in the path are drawn with the projectile (as with the Shambler's ranged attack). |
MF_HARD | This flag causes the missile to continue after hitting a being (as with the Railgun). |
MF_EXACT | This flag causes the missile to stop at the targeted square (as with the Revenant's Launcher). |
MF_IMMIDATE | This flag causes the missile to always hit the targetted square (although it may still miss a being standing on that square). The missile does not respect line of fire -- it will go through walls (although AI controlled beings using such a missile will still respect line-of-sight). The animation for the missile will only display over the targeted cell. (Arch-viles' natural weapon uses this flag.) |
Shotgun Prototype
Shotgun prototypes are declared using the global Shotgun function. They are stored in a global table called shotguns which can be indexed by string or numeric ID. Required properties are underlined.
Shotgun (Missile) Prototype | ||
---|---|---|
string | id | This is the shotgun's string id. By convention, it should be all lowercase with no spaces. (A numeric id called nid is automatically created.) |
integer | range | This is the shotgun's range. |
integer | spread | This is the shotgun's spread. |
integer | reduce | This is the percentage of the shotgun's damage that decays per unit of distance. |