Difference between revisions of "Modding:Constants"

From DoomRL Wiki

Jump to: navigation, search
m (Fixing a link)
(Colors)
Line 313: Line 313:
  
 
For the basic 16 colors, the valkyrie string coloring escape is noted.
 
For the basic 16 colors, the valkyrie string coloring escape is noted.
 
+
{{Template:Color}}
{| style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
{{Template:Special_Color}}
|colspan=4 style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''Colors'''
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|BLACK
+
|width="100" style="background: black;"|
+
|@D
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|BLUE
+
|width="100" style="background: navy;"|
+
|@b
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|GREEN
+
|width="100" style="background: green;"|
+
|@g
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|CYAN
+
|width="100" style="background: teal;"|
+
|@c
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|RED
+
|width="100" style="background: maroon;"|
+
|@r
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|MAGENTA
+
|width="100" style="background: purple;"|
+
|@v
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|BROWN
+
|width="100" style="background: olive;"|
+
|@n or @N
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|LIGHTGRAY
+
|width="100" style="background: silver;"|
+
|@l
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|DARKGRAY
+
|width="100" style="background: gray;"|
+
|@d
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|LIGHTBLUE
+
|width="100" style="background: blue;"|
+
|@B
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|LIGHTGREEN
+
|width="100" style="background: lime;"|
+
|@G
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|LIGHTCYAN
+
|width="100" style="background: aqua;"|
+
|@C
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|LIGHTRED
+
|width="100" style="background: red;"|
+
|@R
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|LIGHTMAGENTA
+
|width="100" style="background: fuchsia;"|
+
|@V
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|YELLOW
+
|width="100" style="background: yellow;"|
+
|@y or @Y
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|WHITE
+
|width="100" style="background: white;"|
+
|@L
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|MULTIBLUE
+
|
+
|Randomly chosen from BLUE, LIGHTBLUE, and WHITE. Only works for missiles.
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|MULTIYELLOW
+
|
+
|Randomly chosen from YELLOW, LIGHTGREEN, and WHITE. Only works for missiles.
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|MULTIPORTAL
+
|
+
|Cycles between LIGHTMAGENTA, MAGENTA, and WHITE. Only works for things displayed in the map.
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|COLOR_WATER
+
|
+
|Alternates between BLUE and LIGHTBLUE. Only works for things displayed in the map.
+
|-
+
|style="vertical-align:top; padding-right: 2ex;"|COLOR_ACID
+
|
+
|Alternates between GREEN and LIGHTGREEN. Only works for things displayed in the map.
+
|- style="background: #333;"
+
|style="vertical-align:top; padding-right: 2ex;"|COLOR_LAVA
+
|
+
|Alternates between RED and YELLOW. Only works for things displayed in the map.
+
|}
+
  
 
== Flags ==
 
== Flags ==

Revision as of 04:28, 8 December 2012

Constants and Enumerations are common in any game and DoomRL is no exception. Internally, as most programmers are aware, these are integers. But to modders they are all important magic values, looked up here.

Contents

Engine Enums

ItemType

Every item has a type that determines how the engine treats it.

TItemType
ITEMTYPE_NONE
ITEMTYPE_RANGED
ITEMTYPE_NRANGED
ITEMTYPE_ARMOR
ITEMTYPE_MELEE
ITEMTYPE_AMMO
ITEMTYPE_PACK
ITEMTYPE_POWER
ITEMTYPE_BOOTS
ITEMTYPE_TELE
ITEMTYPE_LEVER
ITEMTYPE_AMMOPACK

BodyTarget

Sources of damage must specify a body target to determine which sources of armor are used. Inherent armor bonuses always apply.

TBodyTarget
TARGET_INTERNAL Protection from boots and armor will be ignored.
TARGET_TORSO Protection from armor counts but protection from boots does not.
TARGET_FEET Protection from boots counts but protection from armor does not.

EqSlot

It is preferred to use the (equivalent) slot constants.

TEqSlot
EFTORSO
EFWEAPON
EFBOOTS
EFWEAPON2

StatusEffect

Affects specify one of these status effects that will apply a color scheme to all the tiles on the HUD.

TStatusEffect
STATUSNORMAL
STATUSINVERT
STATUSRED
STATUSGREEN

DamageType

Sources of damage usually specify a damage type that determines how the damage regards protection, resistances, gibbing, and other things. For details on the differences between the damage types, look here.

TDamageType
DAMAGE_BULLET
DAMAGE_MELEE
DAMAGE_SHARPNEL [sic]
DAMAGE_ACID
DAMAGE_FIRE
DAMAGE_PLASMA
DAMAGE_IGNOREARMOR

AltFire

TAltFire
ALT_NONE
ALT_CHAIN
ALT_THROW
ALT_SCRIPT
ALT_AIMED
ALT_SINGLE
ALT_WHIRLWIND

AltReload

TAltReload
RELOAD_NONE
RELOAD_SCRIPT
RELOAD_FULL
RELOAD_DUAL
RELOAD_SINGLE

ExplosionFlag

TExplosionFlag
EFSELFHALF Deals half damage to the active being.
EFSELFKNOCKBACK Gives extra knockback to the active being.
EFSELFSAFE Deals no damage to the active being.
EFAFTERBLINK Blinks the screen after the explosion finishes.
EFCHAIN Causes secondary explosions (as the BFG 9000).
EFHALFKNOCK Causes half the usual knockback.
EFNOKNOCK Doesn't cause knockback.
EFRANDOMCONTENT Transmutes some cells in the explosion to the explosion's content cell; the rules is to transmute when damage is greater than 20.

LightFlag

TLightFlag
LFEXPLORED This flag is set for explored cells. It can be modified to create computer map-like effects or Angel of Darkness-like effects.
LFVISIBLE This flag is set for cells in the player's current LOS. This flag is automatically recalculated on every player action. It may be useful to manually modify this flag if LOS needs to be updated more often.
LFLIGHTED This flag is always set on the same cells as LFVISIBLE; both flags must be set for a cell to be visible.
LFDAMAGE This is a book-keeping flag for shotgun area-of-effect. Cells are set with this flag if they are calculated as in the shotgun blast but haven't yet been processed.
LFFRESH This is a book-keeping flag for explosions. New corpses are set with this flag to keep them from being immediately destroyed. This flag can be set to make any cell indestructible, but it may be cleared by the engine.
LFNOSPAWN Cells with this flag are counted as non-empty by the EF_NOSPAWN empty flag.

Constants

Maximums

Maximums
MAXX 78
MAXY 20
BOSS_LEVEL 25
MAXDEPTH 26
MAXAFFECT 5
MAX_INV_SIZE 22
MAX_EQ_SIZE 4

Cellsets

Cellsets
CELLSET_WALLS
CELLSET_FLOORS
CELLSET_CORPSES

Challenges

Challenges
CHALLENGE_BERSERK
CHALLENGE_MARKSMANSHIP
CHALLENGE_SHOTGUNNERY
CHALLENGE_LIGHTTRAVEL
CHALLENGE_IMPATIENCE
CHALLENGE_HASTE
CHALLENGE_PURITY
CHALLENGE_REDALERT
CHALLENGE_CARNAGE
CHALLENGE_MASOCHISM
CHALLENGE_100
CHALLENGE_PACIFISM
CHALLENGE_HUMANITY

Difficulty

Difficulty
DIFF_EASY
DIFF_MEDIUM
DIFF_HARD
DIFF_VERYHARD
DIFF_NIGHTMARE

PlayerRank

PlayerRank
RANKEXP
RANKSKILL

Player Statistics

Player Statistics
RANK_KILLTOTAL
RANK_KILLMELEE
RANK_KILLPISTOL
RANK_LEVEL
RANK_BADGE

Equip Slots

Equip Slots
SLOT_ARMOR
SLOT_WEAPON
SLOT_BOOTS
SLOT_PREPARED

Colors

Usually, it is possible to specify a foreground color and a background color. Since DoomRL uses 4 bit color, the lowest 4 bits determine the foreground color, and the next 4 bits determine the background color (zero is black). Occasionally, one of these may conflict with one of the special color constants.

Also, note that the exact color the end-user sees may depend on his system settings.

For the basic 16 colors, the valkyrie string coloring escape is noted.

Colors
Color ID Valkyrie ID Looks Like
BLACK 0 @D
BLUE 1 @b
GREEN 2 @g
CYAN 3 @c
RED 4 @r
MAGENTA 5 @v
BROWN 6 @n or @N
LIGHTGRAY 7 @l
DARKGRAY 8 @d
LIGHTBLUE 9 @B
LIGHTGREEN 10 @G
LIGHTCYAN 11 @C
LIGHTRED 12 @R
LIGHTMAGENTA 13 @V
YELLOW 14 @y or @Y
WHITE 15 @L
Colors
Color ID Looks Like Comments
MULTIBLUE 17 Missile only
MULTIYELLOW 18 Missile only
MULTIPORTAL 20 Map object only
COLOR_WATER 21 Map object only
COLOR_ACID 22 Map object only
COLOR_LAVA 23 Map object only

Flags

Generic Flags

Generic Flags
F_OVERLAY This flag is related to the graphical version.

Empty Flags

Empty flags are used with various functions to control the selection of random coords.

Empty Flags
EF_NOITEMS Excludes cells that contain an item.
EF_NOBEINGS Excludes cells that contain a being.
EF_NOBLOCK Excludes cells that block movement (CF_BLOCKMOVE).
EF_NOVISION Excludes cells that block vision (CF_BLOCKLOS).
EF_NOSTAIRS Excludes stairs (cells with an OnExit hook).
EF_NOTELE Excludes cells with a teleporter (an item with ITEMTYPE_TELE).
EF_NOHARM Excludes hazardous cells (CF_HAZARD).
EF_NOSAFE Excludes cells that are too near to the player (currently the threshold is less than or equal to distance of 5).
EF_NOSPAWN Excludes cells with LF_NOSPAWN.
Personal tools