Difference between revisions of "Modding:Affects"

From DoomRL Wiki

Jump to: navigation, search
m (Forgot to change the title of table 2.)
m (used more effective templates)
 
(One intermediate revision by one user not shown)
Line 3: Line 3:
 
== Prototype ==
 
== Prototype ==
  
{|class="wikitable" style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
{{drltable|Affect Prototype|3|{{Table3Col
! colspan="2" style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''Affect Prototype'''
+
{{Table2Col
+
 
   |es=background: #333;
 
   |es=background: #333;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
   |c2=padding:0px 2px;
+
   |c2=vertical-align:top; padding:0px 2px;
   |'''string''' id                           | The identifier for the affect.
+
   |c3=padding:0px 2px;
   |'''string''' name                         | What is displayed in the status line while the effect is active.
+
  |{{modarg|string}}      |id             |The identifier for the affect.
   |'''[[Modding:Constants#Colors|Color]]''' color   | The color of the name on the status line while the effect is on.
+
   |{{modarg|string}}      |name           |What is displayed in the status line while the effect is active.
   |'''[[Modding:Constants#Colors|Color]]''' color_expire | The color of the name on the status line when the effect is wearing off.
+
   |{{modarg|Color}}      |color         |The color of the name on the status line while the effect is on.
   |'''string''' message_init                 | The message printed when the effect is activated.
+
   |{{modarg|Color}}      |color_expire   |The color of the name on the status line when the effect is wearing off.
   |'''string''' message_ending               | The message printed when the effect is wearing off.  This is unused in 0.9.9.6.
+
   |{{modarg|string}}      |message_init   |The message printed when the effect is activated.
   |'''string''' message_done                 | The message printed when the effect wears off.
+
   |{{modarg|string}}      |message_ending |The message printed when the effect is wearing off.  This is unused in 0.9.9.6.
   |'''[[Modding:Constants#StatusEffect|StatusEffect]]''' status_effect | The overlay effect that occurs while this effect is active.
+
   |{{modarg|string}}      |message_done   |The message printed when the effect wears off.
   |'''integer''' status_strength             | When multiple effects have overlay changes, the one with the highest strength will be the overlay displayed if more than one is active at the same time.
+
   |{{modarg|StatusEffect}}|status_effect |The overlay effect that occurs while this effect is active.
 +
   |{{modarg|integer}}    |status_strength|When multiple effects have overlay changes, the one with the highest strength will be the overlay displayed if more than one is active at the same time.
 
   }}
 
   }}
|}
+
}}
  
 
== Engine Hooks ==
 
== Engine Hooks ==
  
{|class="wikitable" style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
{{drltable|Affect Hooks|2|{{Table2Col
! colspan="2" style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''Affect Engine Hooks'''
+
{{Table2Col
+
 
   |es=background: #333;
 
   |es=background: #333;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c2=padding:0px 2px;
 
   |c2=padding:0px 2px;
   |'''void''' | [[#OnAdd|OnAdd]]('''Affect''' self)
+
   |{{modarg|void}}|[[#OnAdd|OnAdd]]('''Affect''' self)
   |'''void''' | [[#OnTick|OnTick]]('''Affect''' self)
+
   |{{modarg|void}}|[[#OnTick|OnTick]]('''Affect''' self)
   |'''void''' | [[#OnRemove|OnRemove]]('''Affect''' self)
+
   |{{modarg|void}}|[[#OnRemove|OnRemove]]('''Affect''' self)
 
   }}
 
   }}
|}
+
}}
  
 
{{anchor|OnAdd}}
 
{{anchor|OnAdd}}

Latest revision as of 22:02, 24 March 2012

These represent the various temporary effects in the game.

Prototype

Affect Prototype
string id The identifier for the affect.
string name What is displayed in the status line while the effect is active.
Color color The color of the name on the status line while the effect is on.
Color color_expire The color of the name on the status line when the effect is wearing off.
string message_init The message printed when the effect is activated.
string message_ending The message printed when the effect is wearing off. This is unused in 0.9.9.6.
string message_done The message printed when the effect wears off.
StatusEffect status_effect The overlay effect that occurs while this effect is active.
integer status_strength When multiple effects have overlay changes, the one with the highest strength will be the overlay displayed if more than one is active at the same time.

Engine Hooks

Affect Hooks
void OnAdd(Affect self)
void OnTick(Affect self)
void OnRemove(Affect self)

OnAdd(Affect self)
This is called when the effect is gained.

OnTick(Affect self)
This is called every action while the effect is active.

OnRemove(Affect self)
This is called when the effect is lost.
Personal tools