Difference between revisions of "Modding:being blueprint (0.9.9.7)"

From DoomRL Wiki

Jump to: navigation, search
(Created page with "WIP from old pages, must refine and re-investigate ------ If it bleeds, it leads. Beings inherit from the Thing base class which handles some basic pro...")
 
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
WIP from old pages, must refine and re-investigate
+
The being [[Modding:blueprint|blueprint]] is used to define new beings.
  
 +
== Blueprint ==
  
------
+
Being blueprints are registered with the ''register_being'' procedure. Registered blueprints are stored in a global Lua table called ''beings''.
  
 
+
{{drltable|Being Blueprint|3|{{Table3Col
 
+
 
+
 
+
 
+
 
+
If it bleeds, it leads. Beings inherit from the [[Modding:Thing|Thing]] base class which handles some basic properties in common with items. In addition the [[Modding:Player|Player]] inherits this class, so anything you can do to creatures can be done to the player as well.
+
 
+
== Prototype ==
+
 
+
New beings are created from being prototypes. Think of a being prototype as a recipe for creating new beings. There can be multiple former humans, but they all came from the same prototype. Prototypes are declared by passing a table with the desired properties to the Beings function. [[#Engine Hooks|Engine hooks]] may also be included in the prototype. Mostly, the prototype's properties just describe beings' initial properties (occasionally with different names). Beings' properties can also mostly be changed after they are instantiated. Required fields are underlined. Sometimes required fields can safely be omitted, but this will generate a message in the log file. All being prototypes are stored in a global table called beings. This table can be indexed by id or nid.
+
{|class="wikitable" style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
! colspan="3" style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''Being Prototype'''
+
{{Table3Col
+
 
   |es=background: #333;
 
   |es=background: #333;
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
+
   |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c2=vertical-align:top; padding:0px 2px;
 
   |c2=vertical-align:top; padding:0px 2px;
 
   |c3=padding:0px 2px;
 
   |c3=padding:0px 2px;
   |'''string'''|<u>name</u>|This is the being's name.
+
   |id            |{{modarg|string}}|The unique identifier used by the engine for this being. Passed as the first argument when registering a blueprint.
   |'''string'''|name_plural|This is the being's name_plural. By default, this is the name with an "s" appended.
+
  |<u>name</u>   |{{modarg|string}}|This is the being's name.
   |'''string'''|<u>ascii</u>|This is the being's picture. It should be a single character string.
+
   |name_plural   |{{modarg|string}}|This is the being's pluralized name. This defaults to the being's the name with an "s" appended.
   |'''string'''|id|This is the being's sid. It must be distinct from other string ids. (The numeric id is automatically assigned to a field called nid.) Only the first 20 characters will be used. The default is the first word of the name in all lowercase.
+
   |sound_id      |{{modarg|being}}|If included the being will search for sounds bound to this id instead of its own.
   |'''integer''' '''list'''|overlay|This field is only used in the graphical version. It describes a color transformation to be applied to the being's sprite. This will create overlay_red, overlay_green, overlay_blue, and overlay_alpha fields in the being prototype.
+
  |<u>ascii</u>   |{{modarg|string}}|This is the being's picture in console mode. It should be a single character string.
   |'''integer'''|XP|This is the being's expvalue. By default, it is <font-family: monospace>3xD<sup>2</sup>+20, where D is the being's <u>danger</u> (see below).
+
   |<u>color</u>  |{{modarg|Color}}|This is the being's color in console mode.
   |[[Modding:Cell|Cell ID]]|corpse|The determines the corpse left by the being. If the value is true, a new corpse cell will automatically be created. Otherwise this field is interpretted as a cell id. After a being is declared, this field will have been translated to a number. The default is true.
+
   |<u>sprite</u>  |{{modarg|Sprite}}|This is the being's sprite in graphical mode.
   |[[Modding:Item|Item Prototype]]|weapon|If this field is included, a new item will be declared and automatically equipped for beings generated from this prototype. The item prototype will automatically be a natural ranged weapon, have an id assigned, have zero weight, have no sprite, and have the IF_NODROP and IF_NOAMMO flags.
+
   |coscolor      |{{modarg|ColorSet}}|This is a graphical mode filter that can be used to add color to specific sprites.
   |'''integer'''|<u>sprite</u>|This is the being's sprite. (Use 0 for no sprite.)
+
   |glow          |{{modarg|ColorSet}}|This is a graphical mode filter that can be used to give a sprite a colored glow.
   |[[Modding:Constants#Colors|Color]]|<u>color</u>|This is the being's color.
+
   |overlay        |{{modarg|ColorSet}}|This is a graphical mode filter that can be used to subtract color from any sprite.
   |'''integer'''|toDam|This is the being's toDam. (This bonus only applies to melee attacks.) The default is 0.
+
  |hp            |{{modarg|integer}}|This is the being's hpmax and starting hp. The default is 10.
   |'''integer'''|toHit|This is the being's toHit. The default is 0.
+
   |armor          |{{modarg|integer}}|This is the being's armor bonus. The default is 0.
   |'''integer'''|speed|This is the being's speed. (Remember, the maximum allowed speed is 255.) The default is 100.
+
   |attackchance  |{{modarg|integer}}|This is the being's attackchance. The default is 75.
   |'''integer'''|armor|This is the being's armor. The default is 0.
+
   |todam          |{{modarg|integer}}|This is the being's todam bonus. The bonus applies only to melee attacks. The default is 0.
   |'''integer'''|<u>danger</u>|This is a [[Monster Generation|monster generation]] parameter.
+
   |tohit          |{{modarg|integer}}|This is the being's tohit bonus. The default is 0.
   |'''integer'''|<u>weight</u>|This is a [[Monster Generation|monster generation]] parameter.
+
   |tohitmelee    |{{modarg|integer}}|This is the being's tohitmelee bonus. The default is 0.
   |'''integer'''|<u>minLev</u>|This is a [[Monster Generation|monster generation]] parameter.
+
  |speed         |{{modarg|integer}}|This is the being's speed. The maximum allowed speed is 255. The default is 100.
   |'''integer'''|maxLev|This is a [[Monster Generation|monster generation]] parameter. The default is 200.
+
   |vision        |{{modarg|integer}}|This is the being's vision bonus. The default is 0, meaning the same vision as the player.
   |'''integer'''|HP|This is the being's hpmax and starting hp. The default is 10.
+
   |<u>min_lev</u> |{{modarg|integer}}|This is a [[Monster Generation|monster generation]] parameter.
  |'''integer'''|bulk|This parameter is unused. The default is 100.
+
   |max_lev        |{{modarg|integer}}|This is a [[Monster Generation|monster generation]] parameter. The default is 10000.
  |'''integer'''|group|Monsters from different groups will fight each other if they use the default AI. Oddly, the default is "weapon-other" which, as a string, translates to 0. The player is in group 1.
+
   |corpse        |{{modarg|cell}}|The determines the corpse left by the being. Instead of passing in a cell directly you can pass a boolean ''true'' which will make the engine automatically create and assign an appropriate being corpse. You can also pass in ''false'' or leave this field blank to specify no corpse.
  |'''integer'''|attackchance|This is the being's attackchance The default is 75.
+
  |<u>danger</u> |{{modarg|integer}}|This is a [[Monster Generation|monster generation]] parameter.
   |'''integer'''|toHitMelee|This is the being's toHitMelee. The default is 0.
+
   |<u>weight</u>  |{{modarg|integer}}|This is a [[Monster Generation|monster generation]] parameter.
   |[[Modding:Constants#Being Flags|Being Flag]] '''list'''|flags|The flags in this list will be included in the being's flag set. Upon instantiation, a flagSet property is added to the prototype will include these flags (and possibly some automatic flags) in set format. The default is an empty list.
+
   |xp            |{{modarg|integer}}|This is the being's expvalue. By default, it is <font-family: monospace>3xD<sup>2</sup>+20, where D is the being's <u>danger</u> value (above).
   |'''string'''|sound_id|If included and the being doesn't have sound bindings configured, then it will look for sound bindings under its sound_id.
+
   |bulk          |{{modarg|integer}}|This parameter is unused. The default is 100.
  |[[Modding:AI|AI ID]]|ai_type|This determines the being's AI. By default, the old pascal AI is used. (The pascal AI doesn't have an id.)
+
   |flags          |{{modarg|Being Flag}}|This parameter is an array of being flags which will be used by all beings of this type by default.
   |'''integer'''|vision|This is the being's vision. The default is 9. (The player also has vision 9 by default.)
+
   |<u>ai_type</u> |{{modarg|AI}}|This determines the being's AI.
  |'''integer'''|res_bullet|This is the being's res_bullet. The default is 0.
+
   |res_bullet  |{{modarg|integer}}|This is the being's resistance to bullet damage. The default is 0.
   |'''integer'''|res_melee|This is the being's res_melee. The default is 0.
+
   |res_melee   |{{modarg|integer}}|This is the being's resistance to melee damage. The default is 0.
   |'''integer'''|res_shrapnel|This is the being's res_shrapnel. The default is 0.
+
   |res_shrapnel |{{modarg|integer}}|This is the being's resistance to shrapnel damage. The default is 0.
   |'''integer'''|res_acid|This is the being's res_acid. The default is 0.
+
   |res_acid     |{{modarg|integer}}|This is the being's resistance to acid damage. The default is 0.
   |'''integer'''|res_fire|This is the being's res_fire. The default is 0.
+
   |res_fire    |{{modarg|integer}}|This is the being's resistance to fire damage. The default is 0.
   |'''integer'''|res_plasma|This is the being's res_plasma. The default is 0.
+
   |res_plasma   |{{modarg|integer}}|This is the being's resistance to plasma damage. The default is 0.
   |'''string'''|<u>desc</u>|This is the description of the being displayed in the more information view.
+
   |<u>desc</u>     |{{modarg|string}}|This is the description of the being displayed in the 'more information' view.
   |'''string'''|kill_desc|If included, this being will have a special kill description in the mortem.
+
   |<u>kill_desc</u> |{{modarg|string}}|If included this being will have a special kill description in the mortem.
   |'''string'''|kill_desc_melee|As kill_desc, but for melee kills.
+
   |kill_desc_melee |{{modarg|string}}|If included this being will have a special melee kill description in the mortem.
  |}}
+
   |weapon |{{modarg|Item Blueprint}}|You can inline an item blueprint here and it will be registered for you. Items defined this way are always natural ranged weapons that never drop and have no ammo. It will even be equippedly automatically for you.
|}
+
   |OnCreate    |{{modarg|function}}|
=== Flags ===
+
   |OnAction    |{{modarg|function}}|
==== Being Flags ====
+
   |OnAttacked   |{{modarg|function}}|
{{drltable|Being Flags|2|{{Table2Col
+
   |OnDie        |{{modarg|function}}|
  |es=background: #333;
+
   |OnDieCheck   |{{modarg|function}}|
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;
+
   |OnPickupItem |{{modarg|function}}|
  |c2=padding:0px 2px;
+
  |BF_INV|Stops the being from taking any damage. (Directly setting the being's HP can circumvent this. Does not work well with the being's HP set to zero.)
+
  |BF_BERSERK|Gives the damage reduction and melee damage bonus of [[Effects#Berserk|berserk]]. (The speed bonus is not included.)
+
  |BF_ENVIROSAFE|Beings with this flag are immune to damage from acid and lava tiles. (New hazardous tiles will have to check for this flag to respect it.)
+
  |BF_BACKPACK|Gives the ammo-stacking benefits of the [[Backpack]] powerup.
+
  |BF_POWERBONUS|Extends the duration of powerups as the [[Marine]] class bonus. New powerups will have to check for this flag (or use the provided helper function) to respect it.
+
  |BF_STAIRSENSE|For the player, reveals the stairs tile(s) as the [[Scout]] class bonus.
+
  |BF_INSTAUSE|Allows consumable items to be used in 0.1s instead of the usual 1.0s, as the [[Technician]] class bonus.
+
   |BF_MAPEXPERT|Makes computer maps work like tracking maps, as the [[Technician]] class bonus.
+
  |BF_MODEXPERT|Allows the being to mod unique items.
+
  |BF_QUICKSWAP|Gives the benefits of the Juggler trait.
+
  |BF_BERSERKER|Gives the benefits of the [[Traits#Berserker|Berserker]] trait.
+
  |BF_DUALGUN|Gives the benefits of the dualgunner trait.
+
  |BF_MASTERDODGE|Gives the benefits of the [[Traits#Dodgemaster|Dodgemaster]] trait.
+
  |BF_SHOTTYMAN|Gives the benefits of the [[Traits#Shottyman|Shottyman]] trait.
+
  |BF_POWERSENSE|For the player, shows the locations of all powerups (as the first level of the [[Traits#Intuition|Intuition]] trait).
+
  |BF_BEINGSENSE|For the player, shows the locations of enemies (as the second level of the Intuition trait).
+
  |BF_LEVERSENSE1|For the player, gives partial information about levers (as the first level of the Intuition trait).
+
  |BF_LEVERSENSE2|For the player, shows the exact effect of levers (as the second level of the Intuition trait).
+
  |BF_VAMPYRE|Gives the benefits of the [[Traits#Vampyre|Vampyre]] trait.
+
  |BF_BULLETDANCE|Gives the benefits of the [[Traits#Bullet Dance|Bullet Dance]] trait.
+
  |BF_ARMYDEAD|Gives the benefits of the [[Traits#Army of the Dead|Army of the Dead]] trait.
+
  |BF_AMMOCHAIN|Gives the benefits of the [[Traits#Ammochain|Ammochain]] trait.
+
  |BF_MEDPLUS|Allows med-packs to heal beyond 100% health (part of the [[Survivalist]] trait).
+
  |BF_HARDY|Allows protection to reduce damage all the way to zero (part of the [[Survivalist]] trait).
+
  |BF_CLEAVE|Gives the benefits of the [[Traits#Blademaster|Blademaster]] trait.
+
  |BF_GUNKATA|Gives the benefits of the [[Traits#Gun Kata|Gun Kata]] trait.
+
  |BF_SHOTTYHEAD|Gives the benefits of the [[Traits#Shottyhead|Shottyhead]] trait.
+
  |BF_NORUNPENALTY|Gives the benefits of the [[Traits#Running Man|Running Man]] trait.
+
  |BF_DUALBLADE|If both weapons in the being's equipment slots have IF_BLADE, this flag allows both weapons to attack in the same turn, each at half the attack time (part of the [[Traits#Malicious Blades|Malicious Blades]] trait).
+
  |BF_BLADEDEFEND|If the weapon in the being's prepared slot has IF_BLADE, this flag grants the being with resistances as [[Traits#Malicious Blades|Malicious Blades]].
+
  |BF_PISTOLMAX|Gives the benefits of the [[Sharpshooter]] trait.
+
  |BF_FIREANGEL|Gives the benefits of the [[Traits#Fireangel|Fireangel]] trait.
+
  |BF_ENTRENCHMENT|Gives the benefits of the [[Traits#Entrenchment|Entrenchment]] trait.
+
  |BF_SCAVENGER|Gives the benefits of the [[Scavenger]] trait (useless on anything other than the player).
+
  |BF_IMPATIENT|This flag causes packs to be automatically used when picked up as [[Angel of Impatience]].
+
  |BF_DARKNESS|For the player, stops exploration from being recorded as in [[Angel of Darkness]].
+
  |BF_MAXDAMAGE|Beings with this flag always roll maximum damage as in [[Angel of Max Carnage]].
+
  |BF_NOHEAL|This is a marker flag that stops healing effects from working as in [[Angel of Masochism]]. New sources of healing will have to check for this flag in order to respect it.
+
   |BF_SESSILE|Beings with this flag cannot move.
+
  |BF_NOMELEE|This flag stops the being from doing any type of melee attack.
+
   |BF_REGENERATE|Beings with this flag regenerate one health per second if they have less than 20 health remaining.
+
  |BF_SELFIMMUNE|Makes the being immune to its own attacks.
+
   |BF_KNOCKIMMUNE|Makes the being immune to [[knockback]].
+
   |BF_UNIQUENAME|This flag makes the game treat the being's name as a proper noun.
+
  |BF_ENTERBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.
+
   |BF_KILLBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.
+
  |BF_ENTERBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.
+
   |BF_KILLBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.
+
   |BF_CHARGE|This is a flag for the AI. Beings with this flag are willing to walk through hazardous cells to reach the player. (This applies to the default AI, and the direct_seek method.)
+
  |BF_HUNTING|This is a flag for the default AI. Beings with this flag will search out the player even if he is not in their line of sight.
+
   |BF_OPENDOORS|This is a flag for the default AI. Beings with this flag will open doors.
+
  |BF_NODROP|Beings with this flag will not drop their inventory or equipment when they die.
+
  |BF_NOEXP|Beings with this flag will not award experience to the player.
+
  |BF_BOSS|Killing this monster will cause the same message as killing the final boss as well as its death explosion and ending the game.
+
  |BF_JC|When used with BF_BOSS, changes the explosion to blue and changes the message to indicate that JC was killed instead of the cyberdemon.
+
 
   |}}
 
   |}}
 
}}
 
}}
 +
 +
 
== Engine Hooks ==
 
== Engine Hooks ==
Specifying one or more of these hooks in the prototype will allow for greater customization.
 
  
{|class="wikitable" style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
{{drltable|Being Hooks|2|{{Table2Col
! colspan="2" style="background: darkred; color: yellow; font-size: 120%; text-align: center"|'''Being Hooks'''
+
{{Table2Col
+
 
   |es=background: #333;
 
   |es=background: #333;
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
+
   |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c2=padding:0px 2px;
 
   |c2=padding:0px 2px;
   |'''void'''|[[#being_OnCreate|OnCreate]]([[Modding:Being|Being]] self)  
+
   |{{modarg|void}}  |[[#being_OnCreate   |OnCreate]] ({{modarg|being}} self)
   |'''void'''|[[#being_OnAction|OnAction]]([[Modding:Being|Being]] self)  
+
   |{{modarg|void}}  |[[#being_OnAction   |OnAction]] ({{modarg|being}} self)
   |'''void'''|[[#being_OnDie|OnDie]]([[Modding:Being|Being]] self, '''boolean''' overkill)  
+
  |{{modarg|void}}  |[[#being_OnAttacked  |OnAttacked]] ({{modarg|being}} self)
 +
   |{{modarg|void}}  |[[#being_OnDie       |OnDie]] ({{modarg|being}} self, {{modarg|boolean}} overkill)
 +
  |{{modarg|boolean}}|[[#being_OnDieCheck  |OnDieCheck]] ({{modarg|being}} self, {{modarg|boolean}} overkill)
 +
  |{{modarg|void}}  |[[#being_OnPickupItem|OnPickupItem]] ({{modarg|being}} self, {{modarg|item}} item)
 
   |}}
 
   |}}
|}
+
}}
 +
 
  
 
{{Anchor|being_OnCreate}}
 
{{Anchor|being_OnCreate}}
;OnCreate([[Modding:Being|Being]] self)  
+
'''OnCreate'''({{modarg|being}} self)
:This is called when the being is created.
+
:This is called when the being is created. Usually inventory and equipment get added here but many more adjustments are possible.
 
----
 
----
 
{{Anchor|being_OnAction}}
 
{{Anchor|being_OnAction}}
;OnAction([[Modding:Being|Being]] self)  
+
'''OnAction'''({{modarg|being}} self)
:This is called at the beginning of each of the being's turns. (Note that turns are only differentiated if time elapses in between.)
+
:This is called at the beginning of a being's turn. It is never called more than once per tick and the player, sadly, does not use this.
 +
----
 +
{{Anchor|being_OnAttacked}}
 +
'''OnAttacked'''({{modarg|being}} self)
 +
:This is called when a being is attacked and is usually only used by being AIs. It is not possible to determine the attacker.
 
----
 
----
 
{{Anchor|being_OnDie}}
 
{{Anchor|being_OnDie}}
;OnDie([[Modding:Being|Being]] self, '''boolean''' overkill)  
+
'''OnDie'''({{modarg|being}} self, {{modarg|boolean}} overkill)
 
:This is called when the being dies. ''overkill'' is true if the being was gibbed.
 
:This is called when the being dies. ''overkill'' is true if the being was gibbed.
 +
----
 +
{{Anchor|being_OnDieCheck}}
 +
'''OnDieCheck'''({{modarg|being}} self, {{modarg|boolean}} overkill) &rarr; '''boolean'''
 +
:This is called right before a being would normally die. Returning '''false''' will prevent the death, giving the being a minimum of 1 hp. ''overkill'' is true if the being was gibbed.
 +
----
 +
{{Anchor|being_OnPickupItem}}
 +
'''OnPickupItem'''({{modarg|being}} self, {{modarg|item}} item)
 +
:This is called when a being picks up an item. It is only used in DoomRL for statistical purposes.

Latest revision as of 01:03, 22 April 2013

The being blueprint is used to define new beings.

Blueprint

Being blueprints are registered with the register_being procedure. Registered blueprints are stored in a global Lua table called beings.

Being Blueprint
id string The unique identifier used by the engine for this being. Passed as the first argument when registering a blueprint.
name string This is the being's name.
name_plural string This is the being's pluralized name. This defaults to the being's the name with an "s" appended.
sound_id being If included the being will search for sounds bound to this id instead of its own.
ascii string This is the being's picture in console mode. It should be a single character string.
color Color This is the being's color in console mode.
sprite Sprite This is the being's sprite in graphical mode.
coscolor ColorSet This is a graphical mode filter that can be used to add color to specific sprites.
glow ColorSet This is a graphical mode filter that can be used to give a sprite a colored glow.
overlay ColorSet This is a graphical mode filter that can be used to subtract color from any sprite.
hp integer This is the being's hpmax and starting hp. The default is 10.
armor integer This is the being's armor bonus. The default is 0.
attackchance integer This is the being's attackchance. The default is 75.
todam integer This is the being's todam bonus. The bonus applies only to melee attacks. The default is 0.
tohit integer This is the being's tohit bonus. The default is 0.
tohitmelee integer This is the being's tohitmelee bonus. The default is 0.
speed integer This is the being's speed. The maximum allowed speed is 255. The default is 100.
vision integer This is the being's vision bonus. The default is 0, meaning the same vision as the player.
min_lev integer This is a monster generation parameter.
max_lev integer This is a monster generation parameter. The default is 10000.
corpse cell The determines the corpse left by the being. Instead of passing in a cell directly you can pass a boolean true which will make the engine automatically create and assign an appropriate being corpse. You can also pass in false or leave this field blank to specify no corpse.
danger integer This is a monster generation parameter.
weight integer This is a monster generation parameter.
xp integer This is the being's expvalue. By default, it is 3xD2+20, where D is the being's danger value (above).
bulk integer This parameter is unused. The default is 100.
flags Being Flag This parameter is an array of being flags which will be used by all beings of this type by default.
ai_type AI This determines the being's AI.
res_bullet integer This is the being's resistance to bullet damage. The default is 0.
res_melee integer This is the being's resistance to melee damage. The default is 0.
res_shrapnel integer This is the being's resistance to shrapnel damage. The default is 0.
res_acid integer This is the being's resistance to acid damage. The default is 0.
res_fire integer This is the being's resistance to fire damage. The default is 0.
res_plasma integer This is the being's resistance to plasma damage. The default is 0.
desc string This is the description of the being displayed in the 'more information' view.
kill_desc string If included this being will have a special kill description in the mortem.
kill_desc_melee string If included this being will have a special melee kill description in the mortem.
weapon Item Blueprint You can inline an item blueprint here and it will be registered for you. Items defined this way are always natural ranged weapons that never drop and have no ammo. It will even be equippedly automatically for you.
OnCreate function
OnAction function
OnAttacked function
OnDie function
OnDieCheck function
OnPickupItem function


Engine Hooks

Being Hooks
void OnCreate (being self)
void OnAction (being self)
void OnAttacked (being self)
void OnDie (being self, boolean overkill)
boolean OnDieCheck (being self, boolean overkill)
void OnPickupItem (being self, item item)


OnCreate(being self)

This is called when the being is created. Usually inventory and equipment get added here but many more adjustments are possible.

OnAction(being self)

This is called at the beginning of a being's turn. It is never called more than once per tick and the player, sadly, does not use this.

OnAttacked(being self)

This is called when a being is attacked and is usually only used by being AIs. It is not possible to determine the attacker.

OnDie(being self, boolean overkill)

This is called when the being dies. overkill is true if the being was gibbed.

OnDieCheck(being self, boolean overkill) → boolean

This is called right before a being would normally die. Returning false will prevent the death, giving the being a minimum of 1 hp. overkill is true if the being was gibbed.

OnPickupItem(being self, item item)

This is called when a being picks up an item. It is only used in DoomRL for statistical purposes.
Personal tools