<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://drl.chaosforge.org/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://drl.chaosforge.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Game+Hunter</id>
		<title>DRL Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://drl.chaosforge.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Game+Hunter"/>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Special:Contributions/Game_Hunter"/>
		<updated>2026-05-26T21:44:09Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.21.1</generator>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:The_Wall</id>
		<title>Strategy:The Wall</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:The_Wall"/>
				<updated>2012-06-19T21:03:54Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: tag fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{infostrat switch}}&lt;br /&gt;
== Main Guide (v0.9.9.4) ==&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (v0.9.9.5) ===&lt;br /&gt;
&lt;br /&gt;
Nothing significant to the weapon itself.&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (v0.9.9.6) ===&lt;br /&gt;
&lt;br /&gt;
Monster AI is a bit different, making the level harder.&lt;br /&gt;
&lt;br /&gt;
=== General Tactics ===&lt;br /&gt;
Base strategy posted by [[User:GinDiamond|GinDiamond]] 15:00, June 19 2012 (EST).&lt;br /&gt;
&lt;br /&gt;
The Wall can be very challenging if one does not understand the basic mechanics of monster movement, and the fact that walls can be destroyed with fire or plasma damage.&lt;br /&gt;
&lt;br /&gt;
To start the Wall, situate yourself about 7 tiles away from either of the far left corners of the Wall:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#############################&lt;br /&gt;
...########7.................&lt;br /&gt;
...########.65...............&lt;br /&gt;
...########...4..............&lt;br /&gt;
...########....3.............&lt;br /&gt;
...########.....2@...........&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you have to use your rockets to blow a hole in the Wall (aprx. 8 rockets). Try to keep the number of &amp;quot;pockets&amp;quot; low, so enemies can't hide out in them. Better yet, use the splash from rocket explosions to make yourself a little 2-tile nook to duck behind when things get rough. Try to make a 3-tile wide hole that is even with the nook on your side:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#############################&lt;br /&gt;
.............................&lt;br /&gt;
.............................&lt;br /&gt;
.............................&lt;br /&gt;
...######@...................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From here, use a shotgun (combat, tactical, double) to blow an enemy back if it comes too close. When an enemy is about 3 tiles from you (use the wait key), shoot them with a shotgun (or a rapid-fire weapon if you have the right traits):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#############################&lt;br /&gt;
.............................&lt;br /&gt;
.............................&lt;br /&gt;
......BXX....................&lt;br /&gt;
...######@...................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
NOTE: Double shotguns, used this way, will easily take down a hell knight in three bangs.&lt;br /&gt;
&lt;br /&gt;
This way, the enemy will be blown backward, and you'll hit any other close-by enemies. However, if the enemy is right up next to you like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#############################&lt;br /&gt;
.............................&lt;br /&gt;
.............................&lt;br /&gt;
........B....................&lt;br /&gt;
...######@...................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then you're screwed, because if you use a shotgun, it will blow them backward diagonally and then when they retaliate, the splash will destroy your nook. Use a rapid-fire weapon or a strong melee weapon.&lt;br /&gt;
&lt;br /&gt;
If using rapid-fire, try to wait for an enemy to get in this position (you'll have to creep up out of your nook:)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#############################&lt;br /&gt;
.............................&lt;br /&gt;
.............................&lt;br /&gt;
.........@...................&lt;br /&gt;
..B######....................&lt;br /&gt;
B..########..................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That way, you can use your rapid-fire weapon to pick them off without fear of enemy fire.&lt;br /&gt;
When the enemy creeps up to your level, duck behind your nook, reload, and then corner-shoot like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#############################&lt;br /&gt;
.............................&lt;br /&gt;
.............................&lt;br /&gt;
...BXXXXX....................&lt;br /&gt;
..B######@...................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
...########..................&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once all of the enemies are dead (16, I think), you can reap the rewards on the far side behind the Wall.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Contest_pages</id>
		<title>Strategy:Contest pages</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Contest_pages"/>
				<updated>2012-05-29T21:03:05Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: fixed link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains all Strategy-based pages included in the strategy contest (found [http://forum.chaosforge.org/index.php/topic,4867.0.html here] on the Chaosforge forums), as well as any winners for them. It also contains information regarding the contest.&lt;br /&gt;
&lt;br /&gt;
==Contest Rules==&lt;br /&gt;
Entries will be graded on the merit of the information given, rather than its sheer volume. While it is true that a large and informative entry will likely be marked higher than a small and informative entry (simply because it contains more amounts of useful information), '''the key factors that attribute to a successful entry are''':&lt;br /&gt;
*Detail - either in having many possible strategies, or explaining the various considerations of a given strategy&lt;br /&gt;
*Originality - creativity, regarding both the strategy itself and how it is presented&lt;br /&gt;
*Accuracy - up-to-date for the current public version, and valid as a strategy itself&lt;br /&gt;
*Comprehension - one with basic knowledge of game [[mechanics]] (and, if necessary, an accompanying Game Data page) should understand the strategy&lt;br /&gt;
*Focus - keep to the scope of the topic at hand&lt;br /&gt;
&lt;br /&gt;
'''All entries should be emailed to [http://mailto:theuberhunter@gmail.com theuberhunter@gmail.com]''' using the following format:&lt;br /&gt;
*The subject line should read &amp;quot;[WIKICOMP#X] Strategy:&amp;quot; (minus quotes, where X is the competition number), followed by the topic&lt;br /&gt;
**example: [WIKICOMP#1] Strategy:Rocket launcher&lt;br /&gt;
*The entry itself can either be written in the body of the email, separate from the rest of the email's content, or as a document file attached to the email. For procedures on formatting, refer to the formatting guidelines just after the rules.&lt;br /&gt;
*Include a username somewhere in the email. Your forum name is recommended (and necessary, if you want to get your prize) but any name will do. If no username is given, it will default to the email address of the submission.&lt;br /&gt;
&lt;br /&gt;
After submitting the email, a reply should be added to the forum topic, stating that (in so many words) you have entered a submission for the current contest. If there is more than one topic for the current contest, also name the topic (or topics) for which you wrote an entry (or entries). While this is not required to enter, it is necessary as validation so that the prize is handed out to the appropriate member. Alternatively, you are allowed to submit your entry through the forum topic, though this carries the risk of letting other contestants view your entry before the deadline has been reached.&lt;br /&gt;
&lt;br /&gt;
Prizes will be determined on a per-topic basis. Some topics will be worth more (in terms of their prize) than others. '''The contest judge ([[User:Game Hunter|Game Hunter]]) reserves the right not to award a prize for a given topic in a given contest if none of the entries are of sufficient quality to be worthy of the prize given.'''&lt;br /&gt;
&lt;br /&gt;
A player can submit an entry for each topic during a contest, and can potentially receive the prize for each one. '''Multiple entries should be submitted separately: one email per topic.'''&lt;br /&gt;
&lt;br /&gt;
Each contest will accept entries for about one week: '''the deadline will always be Midnight GMT of that day''' ([http://wwp.greenwichmeantime.com see here for the current GMT time]). After the deadline is reached, there will be, at most, a one-week period during which submissions will be examined and a winner for each topic will be determined. After the grading period, prizes will be handed out to winners.&lt;br /&gt;
&lt;br /&gt;
Regardless of the winner, all entries will have their strategies added to the Wiki. These will initially be posted immediately after the contest ends, ordered by date. After all entries are graded and a winner is chosen, the winner's strategy entry will be placed at the top of the page (with the others left unmoved). This entry will then be used as the basis on which to add other components of strategy: the other entries will eventually be merged into this entry (and will be handled by Game_Hunter).&lt;br /&gt;
&lt;br /&gt;
==Formatting Guidelines==&lt;br /&gt;
Entries are expected to be written in a format appropriate for Wiki reading. A good starting place for this is to use a very basic text program such as Notepad. You can also try to write your entry on the Wiki itself, using &amp;quot;Show Preview&amp;quot; to check for errors, then copy-paste it as your entry.&lt;br /&gt;
&lt;br /&gt;
Basic etiquette is as follows:&lt;br /&gt;
*Do not use typical indentations under any circumstance. Indentations using the TAB key have no effect on the display here, and indentations created with spaces are meant for a different task. If you really want indentation, add a colon (:) where the indent would go.&lt;br /&gt;
*Do not use any program-specific stylizations. Wikipedia standards have [http://meta.wikimedia.org/wiki/Help:Editing their own procedures] for the styles you may want. You are free to use these in your entry if you believe they will improve the organization of what you are writing. (Here are [http://meta.wikimedia.org/wiki/Help:Wikitext_examples additional examples] if you need a full range of possibilities.)&lt;br /&gt;
**The exception of this format is that you should not use section-based formatting (for example, &amp;lt;nowiki&amp;gt;==Title==&amp;lt;/nowiki&amp;gt;) as this is reserved for possible segmentation of the strategy page itself.&lt;br /&gt;
*Paragraphs should be of an appropriate length. If a paragraph is too short, attempt to merge it with another paragraph containing similar ideas. If a paragraph is too long, either split it into separate paragraphs or use a bullet-point format. This is often expected not just on Wikis but on any Internet forum as well.&lt;br /&gt;
*Remove any word-wrapping before submitting an entry. Otherwise the transfer to the Wiki will require a few thousand backspaces, because the copy-paste was messed up due to the way that word-wrapping handles spaces.&lt;br /&gt;
&lt;br /&gt;
==Current Contest==&lt;br /&gt;
===Status===&lt;br /&gt;
Entry period: submissions will be accepted no later than June 10, 2012 at Midnight (GMT).&lt;br /&gt;
&lt;br /&gt;
===Topics===&lt;br /&gt;
#[[Strategy:Hell's Arena|Hell's Arena]] (prize: USD25)&lt;br /&gt;
#[[Strategy:The Chained Court|The Chained Court]] (prize: USD25)&lt;br /&gt;
&lt;br /&gt;
==Past Contests==&lt;br /&gt;
===November 9-16, 2011===&lt;br /&gt;
#[[Strategy:Rocket launcher|Rocket launcher]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Intuition|Intuition]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
#[[Strategy:Demon|Demon]] (winner: [[User:Elephant|Elephant]])&lt;br /&gt;
&lt;br /&gt;
===November 18-27, 2011===&lt;br /&gt;
#[[Strategy:Combat shotgun|Combat shotgun]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Shottyman|Shottyman]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
&lt;br /&gt;
===January 8-16, 2012===&lt;br /&gt;
#[[Strategy:Double shotgun|Double shotgun]] (winner: [[User:Kashi|Kashi]])&lt;br /&gt;
#[[Strategy:Reloader|Reloader]] (winner: [[User:AlterAsc|AlterAsc]])&lt;br /&gt;
#[[Strategy:Pain elemental|Pain elemental]] (winner: [[User:Tormuse|Tormuse]])&lt;br /&gt;
&lt;br /&gt;
===January 20 - February 3, 2012===&lt;br /&gt;
#[[Strategy:Arachnotron|Arachnotron]] (winner: [[User:IronBeer|IronBeer]])&lt;br /&gt;
#[[Strategy:BFG 9000|BFG 9000]] (winner: [[User:ZicherCZ|ZicherCZ]])&lt;br /&gt;
#[[Strategy:Juggler|Juggler]] (winner: [[User:shark20061|shark20061]])&lt;br /&gt;
#[[Strategy:Former commando|Former commando]] (winner: [[User:ZicherCZ|ZicherCZ]])&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Juggler</id>
		<title>Strategy:Juggler</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Juggler"/>
				<updated>2012-05-26T22:50:52Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: reorganized&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Main Guide (v0.9.9.5) ==&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (v.0.9.9.6) ===&lt;br /&gt;
Nothing significant to the trait itself.&lt;br /&gt;
&lt;br /&gt;
=== General Tactics ===&lt;br /&gt;
Basic strategy written by [[User:shark20061|shark20061]] 20:32, February 2 2012 (GMT).&lt;br /&gt;
&lt;br /&gt;
If you're like me and like to carry several different weapons at once, Juggler can really come in handy.  Juggler has 2 main parts, each with their own benefits.&lt;br /&gt;
&lt;br /&gt;
First, Juggler lets you use swap your current weapon with your prepared one instantly.  Normally, this would take 8/10 a second of time, which means that you can switch from your long range plasma rifle to your close range double shotgun if a monster suddenly appears next to you, without letting it get a free hit.  Very useful against [[lost soul|lost souls]], as they almost always get free turns since they are so fast.  This also means that swapping weapons this way (or by quickkey) no longer counts as a turn, which can save precious time when going for Icarus Cross [[medals]] or when under the effects of [[Effects#Berserk|berserk]], [[Effects#Invulnerable|invulnerability]], [[envirosuit pack|envirosuit packs]], or [[Light-Amp Goggles]], which have durations in turns (if it takes less than 0.1 seconds to do, it doesn't use up a turn).&lt;br /&gt;
*The ability to switch weapons instantly might seem minor at first glance, but it can be a lifesaver, or at least an ammo saver, in any game.  Depending on the situation, you may want to use a shotgun to knock something back or spray a group of small enemies, or you might want to use a plasma gun to get something big dead fast, (such as an [[arch-vile]]) or you might want to use a [[chaingun]] for some precision shooting that isn't serious enough to warrant use of plasma (such as a [[Demon]] next to a barrel that you don't want to blow up since it might destroy useful items) or a [[rocket launcher]] to disperse large groups of enemies.  Being able to switch rapidly and repeatedly in the middle of a battle can be essential in order to have the right weapon out at the right second, especially if you empty a weapon and it would be too dangerous to take the time to reload. [[User:Tormuse|Tormuse]] 10:26, February 6 2012 (GMT)&lt;br /&gt;
*An additional benefit introduced in version 0.9.9.5 is the fact that, if you have multiple of one kind of weapon in your main inventory, using the number keys to select your basic weapons now selects the one with the most ammo.  (In previous versions, it would select the one with the *least* ammo which would mean you would frequently pull out empty weapons which was as useless as it was frustrating)  This means you can now, for example, have multiple Chainguns in your inventory and if you empty one, instead of taking 2.5 seconds to reload, you can instantaneously switch to the next one and keep firing without a break!  In order to take advantage of this strategy, there are a couple of things to remember:  Using my above example with the Chainguns, after emptying one of them, you would have to first pull out a different weapon, say a shotgun by pressing 3, before pressing 6 to pull out the full Chaingun.  This is because pressing 6 while you're wielding the Chaingun produces the message &amp;quot;you already have the chaingun in your hands&amp;quot; and nothing happens.  The additional step of pulling out the shotgun is also instantaneous, though, so it doesn't really impact gameplay.  The other thing to remember is that if the empty Chaingun is in the prepared slot, the game will default to swapping rather than switching to the full one in the main inventory.  You will have to do a bit of juggling to get the empty one out of the prepared slot before you can take advantage of the ability to instantly switch to the full one. [[User:Tormuse|Tormuse]] 10:26, February 6 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
The second part of Juggler allows you switch between the common weapons in your inventory instantly.  This means that you don't have to have your second weapon in your prepared slot if it's any of the standard [[Weapons#Melee Weapons|melee]] or [[Weapons#Ranged Weapons|ranged]] weapons. This means that you can have a ammo box in the prepared slot and still take advantage of the Juggler bonus by using the quick keys.  One very useful thing this does is that it allows you to get the common weapon upgrades -- combat knife to chainsaw, shotgun to combat shotgun and/or double shotgun, chaingun to plasma rifle, and anything to BFG9000 (on bosses) ready faster.  If you have Juggler before getting to [[The Chained Court]], you can pick the chainsaw up, swap it to the prepared slot, then quickkey swap another weapon in your main weapon slot.  You just picked up the chainsaw and readied it and another weapon all in 1 second and still have it ready to tear monsters apart at any time.&lt;br /&gt;
What's really awesome is that Juggler will work with [[assemblies]]. [[Chainsword]], [[high power weapon]], and other assembled items can be swapped by using the quickkey for the base item.&lt;br /&gt;
&lt;br /&gt;
With Juggler, you can equip and use several different weapons in a row without worrying about reloading in the middle of combat or spending time switching weapons.  It works well against pain elementals and the swarms of lost souls they can produce.  Start with a room clearing weapon -- the double shotgun (or any shotgun really, but the double shotgun's wide spread make it work well).  Fire it, then switch to a rapid fire weapon (like the chaingun, or, better, the plasma rifle).  A prepared melee weapon can be used to take care of any lost souls that actually reach you.&lt;br /&gt;
&lt;br /&gt;
As a convienence factor, the juggler skill lets you attack with a melee weapon if you have it in the prepared slot (so you don't have to keep switching back and forth manually), although manual switching will still be required if you plan on having an non-melee exotic or unique on deck in the prepared slot for instant switching.&lt;br /&gt;
*The fact that Juggler automatically uses a melee weapon in the prepared slot doesn't usually have an advantage unless you happen to have a unique melee weapon, since you can instantly switch to combat knives and chainsaws anyway.  It does have a use in helping achieve medals and badges that require fists only, though, since, for example, if you have a Chainsaw in the prepared slot while your hands are empty and you have Juggler trait, you will do Chainsaw damage to your enemies, but the game will consider them fist kills.  This makes fist-only challenges a lot easier! [[User:Tormuse|Tormuse]] 10:26, February 6 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
There are a few points that make Juggler flexible and a viable option on most builds.  The first is that it's available as early as level 2 no matter what class you pick, since it only requires 1 point in [[Finesse]].  The second is that only two master traits block Finesse, and therefore block Juggler: [[Army of the Dead]] and [[Entrenchment]].  Therefore, juggler is a nice complement that allows you to access most of the tools you need when you need them, without letting the monsters get a turn.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Contest_pages</id>
		<title>Strategy:Contest pages</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Contest_pages"/>
				<updated>2012-05-26T22:34:00Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: new contest, oh boy&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains all Strategy-based pages included in the strategy contest (found [http://forum.chaosforge.org/index.php/topic,4867.0.html here] on the Chaosforge forums), as well as any winners for them. It also contains information regarding the contest.&lt;br /&gt;
&lt;br /&gt;
==Contest Rules==&lt;br /&gt;
Entries will be graded on the merit of the information given, rather than its sheer volume. While it is true that a large and informative entry will likely be marked higher than a small and informative entry (simply because it contains more amounts of useful information), '''the key factors that attribute to a successful entry are''':&lt;br /&gt;
*Detail - either in having many possible strategies, or explaining the various considerations of a given strategy&lt;br /&gt;
*Originality - creativity, regarding both the strategy itself and how it is presented&lt;br /&gt;
*Accuracy - up-to-date for the current public version, and valid as a strategy itself&lt;br /&gt;
*Comprehension - one with basic knowledge of game [[mechanics]] (and, if necessary, an accompanying Game Data page) should understand the strategy&lt;br /&gt;
*Focus - keep to the scope of the topic at hand&lt;br /&gt;
&lt;br /&gt;
'''All entries should be emailed to [http://mailto:theuberhunter@gmail.com theuberhunter@gmail.com]''' using the following format:&lt;br /&gt;
*The subject line should read &amp;quot;[WIKICOMP#X] Strategy:&amp;quot; (minus quotes, where X is the competition number), followed by the topic&lt;br /&gt;
**example: [WIKICOMP#1] Strategy:Rocket launcher&lt;br /&gt;
*The entry itself can either be written in the body of the email, separate from the rest of the email's content, or as a document file attached to the email. For procedures on formatting, refer to the formatting guidelines just after the rules.&lt;br /&gt;
*Include a username somewhere in the email. Your forum name is recommended (and necessary, if you want to get your prize) but any name will do. If no username is given, it will default to the email address of the submission.&lt;br /&gt;
&lt;br /&gt;
After submitting the email, a reply should be added to the forum topic, stating that (in so many words) you have entered a submission for the current contest. If there is more than one topic for the current contest, also name the topic (or topics) for which you wrote an entry (or entries). While this is not required to enter, it is necessary as validation so that the prize is handed out to the appropriate member. Alternatively, you are allowed to submit your entry through the forum topic, though this carries the risk of letting other contestants view your entry before the deadline has been reached.&lt;br /&gt;
&lt;br /&gt;
Prizes will be determined on a per-topic basis. Some topics will be worth more (in terms of their prize) than others. '''The contest judge ([[Game Hunter]]) reserves the right not to award a prize for a given topic in a given contest if none of the entries are of sufficient quality to be worthy of the prize given.'''&lt;br /&gt;
&lt;br /&gt;
A player can submit an entry for each topic during a contest, and can potentially receive the prize for each one. '''Multiple entries should be submitted separately: one email per topic.'''&lt;br /&gt;
&lt;br /&gt;
Each contest will accept entries for about one week: '''the deadline will always be Midnight GMT of that day''' ([http://wwp.greenwichmeantime.com see here for the current GMT time]). After the deadline is reached, there will be, at most, a one-week period during which submissions will be examined and a winner for each topic will be determined. After the grading period, prizes will be handed out to winners.&lt;br /&gt;
&lt;br /&gt;
Regardless of the winner, all entries will have their strategies added to the Wiki. These will initially be posted immediately after the contest ends, ordered by date. After all entries are graded and a winner is chosen, the winner's strategy entry will be placed at the top of the page (with the others left unmoved). This entry will then be used as the basis on which to add other components of strategy: the other entries will eventually be merged into this entry (and will be handled by Game_Hunter).&lt;br /&gt;
&lt;br /&gt;
==Formatting Guidelines==&lt;br /&gt;
Entries are expected to be written in a format appropriate for Wiki reading. A good starting place for this is to use a very basic text program such as Notepad. You can also try to write your entry on the Wiki itself, using &amp;quot;Show Preview&amp;quot; to check for errors, then copy-paste it as your entry.&lt;br /&gt;
&lt;br /&gt;
Basic etiquette is as follows:&lt;br /&gt;
*Do not use typical indentations under any circumstance. Indentations using the TAB key have no effect on the display here, and indentations created with spaces are meant for a different task. If you really want indentation, add a colon (:) where the indent would go.&lt;br /&gt;
*Do not use any program-specific stylizations. Wikipedia standards have [http://meta.wikimedia.org/wiki/Help:Editing their own procedures] for the styles you may want. You are free to use these in your entry if you believe they will improve the organization of what you are writing. (Here are [http://meta.wikimedia.org/wiki/Help:Wikitext_examples additional examples] if you need a full range of possibilities.)&lt;br /&gt;
**The exception of this format is that you should not use section-based formatting (for example, &amp;lt;nowiki&amp;gt;==Title==&amp;lt;/nowiki&amp;gt;) as this is reserved for possible segmentation of the strategy page itself.&lt;br /&gt;
*Paragraphs should be of an appropriate length. If a paragraph is too short, attempt to merge it with another paragraph containing similar ideas. If a paragraph is too long, either split it into separate paragraphs or use a bullet-point format. This is often expected not just on Wikis but on any Internet forum as well.&lt;br /&gt;
*Remove any word-wrapping before submitting an entry. Otherwise the transfer to the Wiki will require a few thousand backspaces, because the copy-paste was messed up due to the way that word-wrapping handles spaces.&lt;br /&gt;
&lt;br /&gt;
==Current Contest==&lt;br /&gt;
===Status===&lt;br /&gt;
Entry period: submissions will be accepted no later than June 10, 2012 at Midnight (GMT).&lt;br /&gt;
&lt;br /&gt;
===Topics===&lt;br /&gt;
#[[Strategy:Hell's Arena|Hell's Arena]] (prize: USD25)&lt;br /&gt;
#[[Strategy:The Chained Court|The Chained Court]] (prize: USD25)&lt;br /&gt;
&lt;br /&gt;
==Past Contests==&lt;br /&gt;
===November 9-16, 2011===&lt;br /&gt;
#[[Strategy:Rocket launcher|Rocket launcher]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Intuition|Intuition]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
#[[Strategy:Demon|Demon]] (winner: [[User:Elephant|Elephant]])&lt;br /&gt;
&lt;br /&gt;
===November 18-27, 2011===&lt;br /&gt;
#[[Strategy:Combat shotgun|Combat shotgun]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Shottyman|Shottyman]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
&lt;br /&gt;
===January 8-16, 2012===&lt;br /&gt;
#[[Strategy:Double shotgun|Double shotgun]] (winner: [[User:Kashi|Kashi]])&lt;br /&gt;
#[[Strategy:Reloader|Reloader]] (winner: [[User:AlterAsc|AlterAsc]])&lt;br /&gt;
#[[Strategy:Pain elemental|Pain elemental]] (winner: [[User:Tormuse|Tormuse]])&lt;br /&gt;
&lt;br /&gt;
===January 20 - February 3, 2012===&lt;br /&gt;
#[[Strategy:Arachnotron|Arachnotron]] (winner: [[User:IronBeer|IronBeer]])&lt;br /&gt;
#[[Strategy:BFG 9000|BFG 9000]] (winner: [[User:ZicherCZ|ZicherCZ]])&lt;br /&gt;
#[[Strategy:Juggler|Juggler]] (winner: [[User:shark20061|shark20061]])&lt;br /&gt;
#[[Strategy:Former commando|Former commando]] (winner: [[User:ZicherCZ|ZicherCZ]])&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Contest_pages</id>
		<title>Strategy:Contest pages</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Contest_pages"/>
				<updated>2012-05-26T22:31:12Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains all Strategy-based pages included in the strategy contest (found [http://forum.chaosforge.org/index.php/topic,4867.0.html here] on the Chaosforge forums), as well as any winners for them. It also contains information regarding the contest.&lt;br /&gt;
&lt;br /&gt;
==Contest Rules==&lt;br /&gt;
Entries will be graded on the merit of the information given, rather than its sheer volume. While it is true that a large and informative entry will likely be marked higher than a small and informative entry (simply because it contains more amounts of useful information), '''the key factors that attribute to a successful entry are''':&lt;br /&gt;
*Detail - either in having many possible strategies, or explaining the various considerations of a given strategy&lt;br /&gt;
*Originality - creativity, regarding both the strategy itself and how it is presented&lt;br /&gt;
*Accuracy - up-to-date for the current public version, and valid as a strategy itself&lt;br /&gt;
*Comprehension - one with basic knowledge of game [[mechanics]] (and, if necessary, an accompanying Game Data page) should understand the strategy&lt;br /&gt;
*Focus - keep to the scope of the topic at hand&lt;br /&gt;
&lt;br /&gt;
'''All entries should be emailed to [http://mailto:theuberhunter@gmail.com theuberhunter@gmail.com]''' using the following format:&lt;br /&gt;
*The subject line should read &amp;quot;[WIKICOMP#X] Strategy:&amp;quot; (minus quotes, where X is the competition number), followed by the topic&lt;br /&gt;
**example: [WIKICOMP#1] Strategy:Rocket launcher&lt;br /&gt;
*The entry itself can either be written in the body of the email, separate from the rest of the email's content, or as a document file attached to the email. For procedures on formatting, refer to the formatting guidelines just after the rules.&lt;br /&gt;
*Include a username somewhere in the email. Your forum name is recommended (and necessary, if you want to get your prize) but any name will do. If no username is given, it will default to the email address of the submission.&lt;br /&gt;
&lt;br /&gt;
After submitting the email, a reply should be added to the forum topic, stating that (in so many words) you have entered a submission for the current contest. If there is more than one topic for the current contest, also name the topic (or topics) for which you wrote an entry (or entries). While this is not required to enter, it is necessary as validation so that the prize is handed out to the appropriate member. Alternatively, you are allowed to submit your entry through the forum topic, though this carries the risk of letting other contestants view your entry before the deadline has been reached.&lt;br /&gt;
&lt;br /&gt;
Prizes will be determined on a per-topic basis. Some topics will be worth more (in terms of their prize) than others. '''The contest judge ([[Game Hunter]]) reserves the right not to award a prize for a given topic in a given contest if none of the entries are of sufficient quality to be worthy of the prize given.'''&lt;br /&gt;
&lt;br /&gt;
A player can submit an entry for each topic during a contest, and can potentially receive the prize for each one. '''Multiple entries should be submitted separately: one email per topic.'''&lt;br /&gt;
&lt;br /&gt;
Each contest will accept entries for about one week: '''the deadline will always be Midnight GMT of that day''' ([http://wwp.greenwichmeantime.com see here for the current GMT time]). After the deadline is reached, there will be, at most, a one-week period during which submissions will be examined and a winner for each topic will be determined. After the grading period, prizes will be handed out to winners.&lt;br /&gt;
&lt;br /&gt;
Regardless of the winner, all entries will have their strategies added to the Wiki. These will initially be posted immediately after the contest ends, ordered by date. After all entries are graded and a winner is chosen, the winner's strategy entry will be placed at the top of the page (with the others left unmoved). This entry will then be used as the basis on which to add other components of strategy: the other entries will eventually be merged into this entry (and will be handled by Game_Hunter).&lt;br /&gt;
&lt;br /&gt;
==Formatting Guidelines==&lt;br /&gt;
Entries are expected to be written in a format appropriate for Wiki reading. A good starting place for this is to use a very basic text program such as Notepad. You can also try to write your entry on the Wiki itself, using &amp;quot;Show Preview&amp;quot; to check for errors, then copy-paste it as your entry.&lt;br /&gt;
&lt;br /&gt;
Basic etiquette is as follows:&lt;br /&gt;
*Do not use typical indentations under any circumstance. Indentations using the TAB key have no effect on the display here, and indentations created with spaces are meant for a different task. If you really want indentation, add a colon (:) where the indent would go.&lt;br /&gt;
*Do not use any program-specific stylizations. Wikipedia standards have [http://meta.wikimedia.org/wiki/Help:Editing their own procedures] for the styles you may want. You are free to use these in your entry if you believe they will improve the organization of what you are writing. (Here are [http://meta.wikimedia.org/wiki/Help:Wikitext_examples additional examples] if you need a full range of possibilities.)&lt;br /&gt;
**The exception of this format is that you should not use section-based formatting (for example, &amp;lt;nowiki&amp;gt;==Title==&amp;lt;/nowiki&amp;gt;) as this is reserved for possible segmentation of the strategy page itself.&lt;br /&gt;
*Paragraphs should be of an appropriate length. If a paragraph is too short, attempt to merge it with another paragraph containing similar ideas. If a paragraph is too long, either split it into separate paragraphs or use a bullet-point format. This is often expected not just on Wikis but on any Internet forum as well.&lt;br /&gt;
*Remove any word-wrapping before submitting an entry. Otherwise the transfer to the Wiki will require a few thousand backspaces, because the copy-paste was messed up due to the way that word-wrapping handles spaces.&lt;br /&gt;
&lt;br /&gt;
==Current Contest==&lt;br /&gt;
===Status===&lt;br /&gt;
Entry period: submissions will be accepted no later than February 4, 2012 at Midnight (GMT).&lt;br /&gt;
&lt;br /&gt;
===Topics===&lt;br /&gt;
#[[Strategy:Arachnotron|Arachnotron]] (prize USD10)&lt;br /&gt;
#[[Strategy:BFG 9000|BFG 9000]] (prize USD10)&lt;br /&gt;
#[[Strategy:Juggler|Juggler]] (prize USD10)&lt;br /&gt;
#[[Strategy:Former commando|Former commando]] (prize USD10)&lt;br /&gt;
&lt;br /&gt;
==Past Contests==&lt;br /&gt;
===November 9-16, 2011===&lt;br /&gt;
#[[Strategy:Rocket launcher|Rocket launcher]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Intuition|Intuition]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
#[[Strategy:Demon|Demon]] (winner: [[User:Elephant|Elephant]])&lt;br /&gt;
&lt;br /&gt;
===November 18-27, 2011===&lt;br /&gt;
#[[Strategy:Combat shotgun|Combat shotgun]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Shottyman|Shottyman]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
&lt;br /&gt;
===January 8-16, 2012===&lt;br /&gt;
#[[Strategy:Double shotgun|Double shotgun]] (winner: [[User:Kashi|Kashi]])&lt;br /&gt;
#[[Strategy:Reloader|Reloader]] (winner: [[User:AlterAsc|AlterAsc]])&lt;br /&gt;
#[[Strategy:Pain elemental|Pain elemental]] (winner: [[User:Tormuse|Tormuse]])&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:BFG_9000</id>
		<title>Strategy:BFG 9000</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:BFG_9000"/>
				<updated>2012-05-26T22:30:29Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Main Guide (0.9.9.5) ==&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (0.9.9.6) ===&lt;br /&gt;
Nothing significant to the weapon itself.&lt;br /&gt;
&lt;br /&gt;
=== General Tactics ===&lt;br /&gt;
Basic strategy written by [[ZicherCZ|ZicherCZ]] 16:55, February 03 2012 (GMT).&lt;br /&gt;
&lt;br /&gt;
BFG9000, the ultimate in conventional DoomRL warfare, is highly efficient against practically any foe, but consumes ammunition like there's no tomorrow.&lt;br /&gt;
&lt;br /&gt;
A few tips on efficient use:&lt;br /&gt;
* BFG is the best weapon to use against targets you want to take out really quickly. [[Arch-vile|Archviles]] (doubly so those in the Mortuary) or [[Mancubus|mancubi]] can serve as a prime example, although, more likely than not, these would require two shots to go down. If you don't mind a bit of an overkill, you can, with near-certainty, take out those nasty [[Former_commando|former commandos]] and [[Revenant|revenants]] in one shot as well. [[Cyberdemon|Cyberdemon]] will then die (on average) after 5, 6, 7, 9 and 11 shots (with growing difficulty level). For the [[Spider Mastermind|Mastermind]] and [[John_Carmack|JC]] add 1 to Cyberdemon's numbers.&lt;br /&gt;
* If at all possible, try to hit multiple foes at once. The explosion radius of 10 is a definite help to this.&lt;br /&gt;
* If you happen to find another BFG, take it to save space in your inventory.. Its clip can hold 100 plasma cells, while an inventory slot can hold only 50 (70 with [[Backpack|backpack]]).&lt;br /&gt;
* Bulk-modding the BFG once increases the number of shots without reloading from two to three, which can be a life-saver at times. Another bulk mod will then increase this number to four, another one to five, fourth to seven and fifth then to nine (the exact clip sizes are 130, 169, 219, 285 and 371). With regards to the previous tip, a spare B5-modded BFG can hold more plasma cells than seven inventory slots.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Former_commando</id>
		<title>Strategy:Former commando</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Former_commando"/>
				<updated>2012-05-26T22:30:13Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Main Guide (0.9.9.5) ==&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (0.9.9.6) ===&lt;br /&gt;
Nothing significant to the enemy itself.&lt;br /&gt;
&lt;br /&gt;
=== General Tactics ===&lt;br /&gt;
Basic strategy written by [[ZicherCZ|ZicherCZ]] 12:00, February 03 2012 (GMT).&lt;br /&gt;
&lt;br /&gt;
Former commandos are the toughest of all formers, and one of the deadliest enemies throughout the whole game. With a good enough accuracy and a plasma rifle in their hands, they can easily take you down in two volleys. Their ranged offensive power is something to be afraid of, but they share all formers offensive weakness - their pitiful melee attack. On the defensive side they do not go down easily as well. They have natural two points of armor and will happily grab and wear any armor from the ground to become even more hardy. Their double health, compared to other formers, doesn't help either.&lt;br /&gt;
&lt;br /&gt;
Sometimes commandos spawn with a pack of 4-6 former humans and sergeants. If you happen to start a level close to them, and you can't retreat, they should be your top kill priority. Commandos wield a plasma gun that is left for you to take after their death. On Nightmare! and Angel of Darkness they ressurect with a new, fully loaded one, so farming one commando for plasma cells is a viable option. &lt;br /&gt;
&lt;br /&gt;
So, how does one deal with them? If possible, don't allow them to get a shot at you. When you see one, retreat behind a corner and wait for them to come into melee range. [[Strategy:Giftdropping|Gift-dropping]] can help a lot, cornershooting can beat them down a bit before they come close. But beware of knockback of your weapons - you don't want to push them away and let them shower you with plasma.&lt;br /&gt;
&lt;br /&gt;
The best position you can get them in is this:&lt;br /&gt;
&lt;br /&gt;
  ###h&lt;br /&gt;
  # #&lt;br /&gt;
  ###&lt;br /&gt;
    @&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  ###&lt;br /&gt;
  # #h&lt;br /&gt;
  ###&lt;br /&gt;
    @&lt;br /&gt;
&lt;br /&gt;
This works for any side of any corner. In these positions, the commando cannot attack you and potencial knockback (for example from shotguns) will send them back along the wall. If retreat to a safe position is not a viable option, you may simply want to whip out the biggest weapon at your disposal and try to one-hit-kill them.&lt;br /&gt;
&lt;br /&gt;
=== Weapon Usage ===&lt;br /&gt;
&lt;br /&gt;
==== Melee ====&lt;br /&gt;
Commandos are pushovers in melee combat, but you have to get to their melee range or lure them to you. Again, gift-dropping and waiting around a corner is probably the best idea. Or simply leave them alone.&lt;br /&gt;
&lt;br /&gt;
==== Pistol ====&lt;br /&gt;
Pistols, unless heavily modded, exotic or unique, are very weak against commandos. An unmodded standard pistol would need seven bullets on average to kill them. Thus, it's definitely wise to retreat if you meet one in the open. Unless you can use any of the strategies mentioned before, that is.&lt;br /&gt;
&lt;br /&gt;
==== Shotgun ====&lt;br /&gt;
These fare better against commandos. A double shotgun can fairly reliably kill them point-blank in one shot (approx. 70% chance).&lt;br /&gt;
On the other hand, if you find one on the edge of your line of sight, even a normal shotgun has a good chance of knockback. With the commandos normal speed, they will then return to your line of sight on your reload without firing. This can be a bit ammo-consuming though.&lt;br /&gt;
&lt;br /&gt;
==== Rapid Fire ====&lt;br /&gt;
Chaingun will not make it for you. It takes three volleys on average to kill a commando, and you may not get the chance to fire three times. Plasma gun works quite better - the chance to kill a commando is about 55% when all the shots hit.&lt;br /&gt;
&lt;br /&gt;
==== Explosive ====&lt;br /&gt;
With the rocket launcher, a standard attack has slightly below 50% chance of one-hit-kill, and even if it does not kill the commando right away, it will push it back. Then you can just wait for it to come into your line of sight again to kill it with a second rocket. BFG 9000, on the other hand, allows for a nearly 100% chance to kill a commando in one hit. And you'll get those 40 plasma cells back if it's plasma rifle is not destroyed in the blast.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:BFG_9000</id>
		<title>Strategy:BFG 9000</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:BFG_9000"/>
				<updated>2012-05-26T22:25:18Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
== Main Guide (0.9.9.5) ==&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (0.9.9.6) ===&lt;br /&gt;
Nothing significant to the weapon itself.&lt;br /&gt;
&lt;br /&gt;
=== General Tactics ===&lt;br /&gt;
Basic strategy written by [[ZicherCZ|ZicherCZ]] 16:55, February 03 2012 (GMT).&lt;br /&gt;
&lt;br /&gt;
BFG9000, the ultimate in conventional DoomRL warfare, is highly efficient against practically any foe, but consumes ammunition like there's no tomorrow.&lt;br /&gt;
&lt;br /&gt;
A few tips on efficient use:&lt;br /&gt;
* BFG is the best weapon to use against targets you want to take out really quickly. [[Arch-vile|Archviles]] (doubly so those in the Mortuary) or [[Mancubus|mancubi]] can serve as a prime example, although, more likely than not, these would require two shots to go down. If you don't mind a bit of an overkill, you can, with near-certainty, take out those nasty [[Former_commando|former commandos]] and [[Revenant|revenants]] in one shot as well. [[Cyberdemon|Cyberdemon]] will then die (on average) after 5, 6, 7, 9 and 11 shots (with growing difficulty level). For the [[Spider Mastermind|Mastermind]] and [[John_Carmack|JC]] add 1 to Cyberdemon's numbers.&lt;br /&gt;
* If at all possible, try to hit multiple foes at once. The explosion radius of 10 is a definite help to this.&lt;br /&gt;
* If you happen to find another BFG, take it to save space in your inventory.. Its clip can hold 100 plasma cells, while an inventory slot can hold only 50 (70 with [[Backpack|backpack]]).&lt;br /&gt;
* Bulk-modding the BFG once increases the number of shots without reloading from two to three, which can be a life-saver at times. Another bulk mod will then increase this number to four, another one to five, fourth to seven and fifth then to nine (the exact clip sizes are 130, 169, 219, 285 and 371). With regards to the previous tip, a spare B5-modded BFG can hold more plasma cells than seven inventory slots.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Arachnotron</id>
		<title>Strategy:Arachnotron</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Arachnotron"/>
				<updated>2012-05-26T22:24:06Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: reorganized&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{infostrat switch}}&lt;br /&gt;
== Main Guide (v0.9.9.5) ==&lt;br /&gt;
&lt;br /&gt;
=== Version Changes (v0.9.9.6) ===&lt;br /&gt;
Nothing significant to the enemy itself.&lt;br /&gt;
&lt;br /&gt;
=== General Tactics ===&lt;br /&gt;
Base strategy posted by [[User:IronBeer|IronBeer]] 19:02, January 27 2012 (GMT).&lt;br /&gt;
&lt;br /&gt;
The Arachnotron is a ranged attacker, equipped with a lowish-power (1d5x5) but somewhat accurate (+3) plasma gun. Even in the best circumstances, fighting a ‘tron in an open area is a hairy proposition, but a straight-up gunfight is seriously complicated by an Arachnotron’s 130% speed. This essentially means that an Arachnotron will get to make (assuming normal move/act speeds for the player) 4 actions for every 3 of your actions. Generally, these actions will be to fire upon the player should s/he be in view, and those extra actions have a nasty tendency to appear at the exact worst times.  &lt;br /&gt;
&lt;br /&gt;
Arachnotrons are fairly durable with 50 hitpoints and 2 points of [[armor|protection]], so fairly heavy firepower is necessary to bring one down efficiently. However, their high speed results in an enemy that can lay down a very heavy field of fire. Circle-strafing or side-stepping is somewhat effective, but two factors work against the player who attempts this. First, the sheer number of shots an Arachnotron fires mean that at least a few will hit you eventually; second, Arachnotrons are frighteningly good at getting their extra action while firing on the player. This extra action essentially means that the Arachnotron will get a free cheap shot on a “stationary” player, since the player did not move immediately prior to the Arachnotron’s last move. (See [[Dodging]].) Needless to say, this is very bad for the player.&lt;br /&gt;
&lt;br /&gt;
Now that we know what we’re up against, how do we go about killing these things? As noted above, Arachnotrons are pretty tough, so we’ll probably need a few actions to bring one down. The threat of being counter-attacked should always loom large, so most of our tactics should generally involve firing such that our foe cannot retaliate.&lt;br /&gt;
&lt;br /&gt;
=== Weapon Usage ===&lt;br /&gt;
Early-game (Hell’s Armory, ordinary floors at higher difficulty levels), your best bet is some flavor of [[shotgun]] and corner-shooting. Shotguns serve very well by permitting the player to attack blindly, and by knocking back the Arachnotron, forcing it to spend an action getting back into position. [[Knockback]] can also sometimes be used to push an Arachnotron into acid or lava, killing it more quickly, but often destroying their plasma cells in the process. If an Arachnotron is dumb enough to close into melee range while you have a shotgun equipped, you should think twice before firing at point-blank range. If the ‘tron is badly injured, and you’re certain that your next blast will kill it, then go ahead and fire. Alternatively, if the ‘tron is against a wall and won’t be knocked back, go to town- this particular foe is weak in melee. However, if the Arachnotron is fairly healthy and has a space to be knocked into, you may want to switch weapons- the danger is that you’ll knock the ‘tron out of melee range and it’ll melt you with easy short-range fire on a stationary target.&lt;br /&gt;
&lt;br /&gt;
I generally don’t endorse using rapid-fire weapons against ‘trons unless your build really takes advantage of them. A [[chaingun]] in untrained hands will be a difficult and painful gunfight; a [[plasma rifle]] should do a bit better owing to the increased damage and armor reduction, but it’ll still be messy. Any rapid-fire master trait (especially [[Ammochain]]) lets a player go just about toe-to-toe with a ‘tron, generally by wasting the ‘tron first. Blind-firing into a known position is a fully viable strategy, but may be expensive, ammo-wise. Staying out of an Arachnotron’s sights is generally worth the ammo investment, and plasma users might be able to break even.&lt;br /&gt;
&lt;br /&gt;
An unmodified [[rocket launcher]] is a rather poor choice for slaying ‘trons, but pretty much any practical mod setup or special rocket launcher is quite effective. A non-exhaustive list of “good” mod setups would include: 1 bulk mod, a [[micro launcher]], or a [[tactical rocket launcher]]. Alternatively, a couple levels in [[Reloader]] will work; off-setting that slow reload time is crucial to using rockets against Arachnotrons. Since they already have the potential to double-act, the base reload time only makes that problem worse should you choose to reload at a bad time. Actually fighting Arachnotrons with rockets is pretty simple: check range, aim, shoot, reload and repeat. Rockets should usually deal knockback, and an Arachnotron engaged at the edge of viewing range should seldom retaliate effectively, if at all. 3 rockets will usually do the job, but will destroy the plasma cell drop.&lt;br /&gt;
&lt;br /&gt;
The [[BFG 9000]] is OVERKILL, and if you’re pointing one at an Arachnotron, it better have a lot of nearby ugly friends, or you better be sitting on a trainload of extra cells. The same problem with the rocket launcher (reload time) is also an issue for BFGs.&lt;br /&gt;
&lt;br /&gt;
The last engagement option is to get up close and bash an Arachnotron’s ugly face in with a melee weapon. Surprisingly, this is a pretty good idea: Arachnotrons have -100% (yes, that is a negative) resistance to melee damage. Anybody can easily dispatch a ‘tron with a [[chainsaw]], and a trained [[Brute]] can punch one out with little trouble. Arachnotrons can hit back for moderate damage, but it is a lot less than their ranged attack. Of course, the only problem is getting close.&lt;br /&gt;
*If you find yourself a couple of spaces away from an arachnotron with no cover immediately available, charging into melee range is probably your best option (running mode not necessary, in my opinion). Another way to get them into melee range is to just wait around a corner and shoot them to get their attention, and wait.  Charging into melee towards an arachnotron at the edge of your vision is just asking for trouble though: you'll be taking plasma volleys, and in general charging into melee exposes you to fire from other enemies, especially ones that were out of sight behind the one you're after. [[User:Matt_S|Matt_S]] 00:24, February 02 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
Also, switching to your best armor is seldom a bad idea, just in case. This usually means [[red armor]], or something with Plasma resist (if you’ve gotten lucky).&lt;br /&gt;
&lt;br /&gt;
=== Trait Usage ===&lt;br /&gt;
Defensive traits such as [[Ironman]] and [[Tough as Nails]] don’t exactly shine against Arachnotrons, but the extra tankiness is the unsung hero that will keep you alive during a firefight. I typically take Ironman after getting a master trait on just about every build I do. Brute can be valuable as well, but charging an Arachnotron just for the sake of getting a melee kill is a bad idea; baiting a ‘tron into chasing you can simplify the “closing-in” problem, but you may take some hits. [[Dodgemaster]] is actually less helpful than you would think, since Arachnotrons attack in bursts, and the trait only affects the first dodge per incoming attack. Rank 2 in Intuition is always good, perhaps even too good- the application should be pretty obvious. [[Gun Kata]] has the potential to ruin Arachnotrons so long as your pistols have the capacity to kill your target in one clip. Ammochain is a time-tested classic trait; the near-zero ammo consumption combined with a well-modded weapon allows a player to easily outshoot ‘trons. If you’ve managed to get a really good suit of armor Survivalist has the potential to be absolutely hilarious and can totally negate an incoming volley.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous Information ===&lt;br /&gt;
Arachnotron Caves are fiendish levels that have ended many a game for unfortunate Doomguys everywhere. They're seldom simple, and a lot of times your best bet is to simply try and bolt for the stairs or pop a [[homing phase device]]. If you feel confident in your gear and your supplies, clearing the cave presents both challenge and opportunity. The challenges lie in the fact that caves combine huge open areas with lots of blind corners. Radar shoot where possible and try and stay behind cover if using shotguns. There are positions where you can see your target but they cannot see you (and thus cannot retaliate); these positions are not intuitive or easy to communicate, but can be figured out over time. If using a well-kitted rocket launcher (or derivative), try to isolate and snipe ‘trons individually just as they enter vision. This is often easier said than done, but a Missile Launcher really helps. Rapid-fire gunners should simply try and stay in cover and poke at Arachnotrons when they wander into view; gunners typically have the firepower to quickly dispatch ‘trons but nobody can really afford to get shot up. Of course, the opportunity presented is the pile of power cells that the Arachnotrons will drop, and occasionally loot and powerups on the floor.&lt;br /&gt;
*This is a time where I'd recommend activating run mode if there's any Arachnotrons around you. Hurry behind any group of rocks you see, and if you have a rocket launcher or even a BFG, this is a good time to bring it out. A melee weapon can actually be really useful here, as there will often be situations where an Arachnotron comes sneaking around the corner of your rock cover, where he's too close to blow up (except with a BFG which doesn't hurt you) and where you can't corner shoot him with a shotgun. [[User:Matt_S|Matt_S]] 00:24, February 02 2012 (GMT)&lt;br /&gt;
*I thought this info might be helpful, which shows the minimum depth and number of Arachnotrons in a cave.  More Arachnotrons will appear if playing [[Angel of 100|Ao100]]: number is dependent on depth. [[User:Shark20061|Shark20061]] 09:26, 7 March 2012 (CET)&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot; align=&amp;quot;left&amp;quot;&lt;br /&gt;
! Difficulty&lt;br /&gt;
! Floor of earliest appearance&lt;br /&gt;
! Number of Arachnotrons&lt;br /&gt;
|-&lt;br /&gt;
| ITYTD&lt;br /&gt;
| 17&lt;br /&gt;
| 4 - 5&lt;br /&gt;
|-&lt;br /&gt;
| HNTR&lt;br /&gt;
| 14&lt;br /&gt;
| 4 - 5 (up to 10 on [[Angel of 100|Ao100]])&lt;br /&gt;
|-&lt;br /&gt;
| HMP&lt;br /&gt;
| 11&lt;br /&gt;
| 5 - 8 (up to 15 on [[Angel of 100|Ao100]])&lt;br /&gt;
|-&lt;br /&gt;
| UV&lt;br /&gt;
| 8&lt;br /&gt;
| 7 - 12 (up to 24 on [[Angel of 100|Ao100]])&lt;br /&gt;
|-&lt;br /&gt;
| N!&lt;br /&gt;
| 5&lt;br /&gt;
| 7 - 15 (up to 30 on [[Angel of 100|Ao100]])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Regarding powerups: Do not even think about taking small health globes if you're under enemy fire. Since they restore you from running to normal, Arachnotrons will get a &amp;quot;temporary&amp;quot; restoration of their [[accuracy]], from +1 all the way to +5, which is a huge difference at any range: the end result is that you'll lose much more than you could gain. Taking large health globes is safer against a single at-the-edge Arachnotron, but even that can be more dangerous than it's worth. Same thing about using med-packs - beware of using them without cover: being Technician in this case is a great help, as you can switch to running back after only 0.1s instead. [[Berserk Pack|Berserk Packs]] are mostly a shoe-in, but against arachnotrons it's not as effective as usual as each hit will deal at least 1 damage anyway.If you don't see stairs or a particularly nice powerup (like the [[Invulnerability Globe]]), run to cover. [[User:AlterAsc|AlterAsc]] 15:34, February 03 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/Building_an_Episode</id>
		<title>Modding:Tutorial/Building an Episode</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/Building_an_Episode"/>
				<updated>2012-04-23T14:48:00Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: some corrections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The simplest of modules are built upon a single map, a single level. While this can provide for some very unique and thrilling gameplay, it is not nearly on the same scale of DoomRL itself, which is a gauntlet of many levels, one after another. If you'd prefer to have a module with the structure of something longer and more challenging than a single level can produce, you're probably looking to create an episode. The purpose of this tutorial is to explain exactly how that is done.&lt;br /&gt;
&lt;br /&gt;
In order to fully explore the possibilities of an episodic module, make sure you understand the basics of modding. If nothing else, take a look at the tutorial [[Modding:Tutorial/Constructing a Map|Constructing a Map]] before continuing on.&lt;br /&gt;
&lt;br /&gt;
== Special Concept: Setting Levels ==&lt;br /&gt;
The player object comes with a custom property called &amp;quot;episode&amp;quot;. This is what determines where the player will be when they reach a certain depth. In fact, this is the majority is what is necessary to string together all the levels in an episode. This is combined with an episodic engine hook known as OnCreateEpisode to build the episode's content. Here is a simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
core.declare( &amp;quot;a_mod&amp;quot;, {} ) --initialize the module object&lt;br /&gt;
&lt;br /&gt;
function a_mod.OnCreateEpisode()&lt;br /&gt;
    player.episode = {}     --initialize/reset the table&lt;br /&gt;
&lt;br /&gt;
    --defines first floor as a special level&lt;br /&gt;
    player.episode[1] = { style = 1, script = &amp;quot;hells_arena&amp;quot; }&lt;br /&gt;
    --defines second floor as a random level&lt;br /&gt;
    player.episode[2] = { style = 1, number = 1, name = &amp;quot;Floor&amp;quot;, danger = 1}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following would create an episode with two levels. The first level is defined by calling a level &amp;quot;script&amp;quot;: the script used here is actually Hell's Arena from the base game. Because the map was initialized with the rest of the game (and this is not a total conversion module), it is included as part of the potential level scripts. So long as a level object has been created and initialized in your module, you are free to include any levels you want as well. (Although style does not have an effect on the level, it is necessary to include as a formality.)&lt;br /&gt;
&lt;br /&gt;
The second level is defined through level properties, rather than calling a script. When this is done, the game can initialize a level with these properties but must still produce some sort of generated content. For this, we require the OnGenerate() hook:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function a_mod.OnGenerate()&lt;br /&gt;
    Generator.reset()&lt;br /&gt;
    Generator.generate_caves_dungeon()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OnGenerate() controls the content of unscripted maps. This can be technically used to create an identical series of maps, but it is much more interesting to create maps using generator functions. Generator.reset() clears any leftover data in the generator, while Generator.generate_caves_dungeon() creates a random cave level ([[Level Type#Cave|of which you are probably familiar]]). The properties defined from OnCreateEpisode() will come into play for the purposes of determining things such as the walls, doors, floors, danger level, and so on. See [[Modding:Generator]] for a complete list of generator functions with which to play around.&lt;br /&gt;
&lt;br /&gt;
Now that we understand the basics of producing an episodic module, let us discuss a simple example that emulates that of a very old version of the game: Classic Mode.&lt;br /&gt;
&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
&lt;br /&gt;
=== .OnCreateEpisode() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function classic.OnCreateEpisode()&lt;br /&gt;
    local BOSS_LEVEL = 10&lt;br /&gt;
    player.episode = {}&lt;br /&gt;
  &lt;br /&gt;
    player.episode[1]     = { style = 1, script = &amp;quot;intro&amp;quot; }&lt;br /&gt;
    for i=2,BOSS_LEVEL-1 do&lt;br /&gt;
        player.episode[i] = { style = 1, number = i, name = &amp;quot;Phobos&amp;quot;, danger = i}&lt;br /&gt;
    end&lt;br /&gt;
    player.episode[10]    = { style = 3, script = &amp;quot;phobos_arena&amp;quot; }&lt;br /&gt;
	&lt;br /&gt;
    statistics.bonus_levels_count = 0&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
As before, we initialize the episode table. We've also defined the end level, coined ''BOSS_LEVEL'', as the tenth floor. The layout is fairly straightforward:&lt;br /&gt;
&lt;br /&gt;
*The very first level takes place in Phobos Base Entry. This is indicated with the script &amp;quot;intro&amp;quot;.&lt;br /&gt;
*Floors two through nine are set as randomly-generated levels. They will be named &amp;quot;Phobos 2&amp;quot;, &amp;quot;Phobos 3&amp;quot;, etc, and will have danger levels of the same number.&lt;br /&gt;
*The final level is a level script called &amp;quot;phobos_arena&amp;quot;. Although this is not included in the base game, we'll be providing this script ourselves for the purpose of this episode.&lt;br /&gt;
&lt;br /&gt;
Finally, as a matter of completeness, since there are technically no &amp;quot;special&amp;quot; levels in this episode, we set the bonus level count to zero from the statistics object. Special levels can actually be included as part of the level initialization by defining the ''special'' key: red stairs will be automatically provided on that level in addition to everything else. In either case, however, the statistics for bonus levels must be manually set.&lt;br /&gt;
&lt;br /&gt;
=== .OnGenerate() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function classic.OnGenerate()&lt;br /&gt;
    Generator.reset()&lt;br /&gt;
    Generator.generate_tiled_dungeon()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This function is almost identical to the one from the concepts example: the generator object is reset, and then a tiled dungeon is set for any and all unscripted (random) levels. The tiled dungeon is the de-facto level style found in DoomRL: it is the one that always appears on the second floor, regardless of the circumstances. Since this is a classic map, all of the levels are determined in this manner. You can, however, use some randomization within '''OnGenerate()''' to change which map is actually generated. The specifics of the randomization in the base game can be found in [[Level type]].&lt;br /&gt;
&lt;br /&gt;
=== .OnMortemPrint() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function classic.OnMortemPrint(killedby)&lt;br /&gt;
    if killedby == &amp;quot;defeated the Mastermind&amp;quot; then&lt;br /&gt;
        killedby = &amp;quot;defeated the Cyberdemon&amp;quot;&lt;br /&gt;
    elseif killedby == nil then&lt;br /&gt;
        killedby = &amp;quot;played through the classics&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..killedby )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
'''OnMortemPrint()''' is where all mortem-printing should be done, hence its name. It comes with the ''killedby'' parameter, which determines the status of the player at the time of the printing. Despite its name, ''killedby'' can produce a variety of messages, including those for winning the game. This mortem_print in particular is just like the one from the tutorial for [[Modding:Tutorial/Recreating Hell's Arena|Hell's Arena]], so it should be familiar enough to understsand already.&lt;br /&gt;
&lt;br /&gt;
Of particular note is that we require a change in the victory condition: ''killedby'' returns that the Mastermind was defeated in a standard victory, so we change it to reflect that it was the Cyberdemon instead.&lt;br /&gt;
&lt;br /&gt;
=== .OnWinGame() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function classic.OnWinGame()&lt;br /&gt;
    ui.plot_screen([[&lt;br /&gt;
Once you beat the Cyberdemon and clean out the moon&lt;br /&gt;
base you're supposed to win, aren't you? Aren't you?&lt;br /&gt;
Where's your fat reward and ticket back home? What&lt;br /&gt;
the hell is this? It's not supposed to end this way!&lt;br /&gt;
      &lt;br /&gt;
It stinks like rotten meat but it looks like the&lt;br /&gt;
lost Deimos base. Looks like you're stuck on&lt;br /&gt;
The Shores of Hell. And the only way out is through...&lt;br /&gt;
]])&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The '''OnWinGame()''' hook allows you to play around with some of the user interface commands upon winning the game. If you recall beating the base game, it's what happens immediately after killing the Spider Mastermind, but before the mortem appears. Our use of the hook simply displays a single screen of plot with the '''ui.plot_screen()''' function, which accepts a single string. You can play around with some properties here but that's better saved for '''OnMortem()'''.&lt;br /&gt;
&lt;br /&gt;
== Levels: Phobos Arena ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Levels(&amp;quot;phobos_arena&amp;quot;,{&lt;br /&gt;
  name = &amp;quot;Phobos Arena&amp;quot;,&lt;br /&gt;
  entry = &amp;quot;Then at last he found the Phobos Arena!&amp;quot;,&lt;br /&gt;
  welcome = &amp;quot;You enter a big arena. There's blood everywhere. You hear heavy mechanical footsteps...&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
  Create = function ()&lt;br /&gt;
    Level.fill(&amp;quot;wall&amp;quot;)&lt;br /&gt;
    Level.fill(&amp;quot;floor&amp;quot;, area.FULL_SHRINKED )&lt;br /&gt;
    local scatter_area = area.new( 5,3,68,15 )&lt;br /&gt;
    local translation = {&lt;br /&gt;
        ['.'] = &amp;quot;blood&amp;quot;,&lt;br /&gt;
        ['#'] = &amp;quot;gwall&amp;quot;,&lt;br /&gt;
        ['&amp;gt;'] = &amp;quot;stairs&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
    Level.scatter_put(scatter_area,translation, [[&lt;br /&gt;
      .....&lt;br /&gt;
      .###.&lt;br /&gt;
      .###.&lt;br /&gt;
      .###.&lt;br /&gt;
      .....&lt;br /&gt;
    ]],&amp;quot;floor&amp;quot;,12)&lt;br /&gt;
&lt;br /&gt;
    Level.flags[ LF_NOHOMING ] = true&lt;br /&gt;
    Level.scatter(area.FULL_SHRINKED,&amp;quot;floor&amp;quot;,&amp;quot;blood&amp;quot;,100)&lt;br /&gt;
    Generator.set_permanence( area.FULL )&lt;br /&gt;
    player.flags[ BF_ENTERBOSS1 ] = true&lt;br /&gt;
  end,&lt;br /&gt;
&lt;br /&gt;
  OnEnter = function ()&lt;br /&gt;
    local boss = Level.summon(&amp;quot;cyberdemon&amp;quot;)&lt;br /&gt;
    boss.flags[ BF_BOSS ] = true&lt;br /&gt;
  end,&lt;br /&gt;
  &lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is the level included with Classic Mode: the end-game level, Phobos Arena. This is, more or less, a replica of the original end-game level prior to version 0.9.9.5. Many of the things covered here have already been explained in the singular module tutorials, so they will not be described in detail here. This is a quick overview:&lt;br /&gt;
&lt;br /&gt;
*We start with a wall-bordered blank room, randomly add 12 pillars away from the borders, then randomly populate the rest of the level with blood.&lt;br /&gt;
*Homing phase devices will fail to work here (though there are no stairs to phase to anyway).&lt;br /&gt;
*Everything in the level is made permanent so that no walls can be destroyed&lt;br /&gt;
*The player's flags are modified so that the game knows we are on a boss level.&lt;br /&gt;
*Finally, the Cyberdemon is spawned at a random coordinate and given the boss flag, so that killing it ends the game.&lt;br /&gt;
&lt;br /&gt;
One thing not seen in previous tutorials, however, is the Level object itself. In a singular module, the level is created with the '''run()''' function: in an episodic module, levels are defined separately and called when necessary. The basic level structure is as follows:&lt;br /&gt;
&lt;br /&gt;
*Levels are technically handled with functional syntax. The identifier is placed as the first argument in this function, and a table that defines the level's properties and hooks is given as the second argument.&lt;br /&gt;
*Typical level properties are:&lt;br /&gt;
**''name'' is what the level is called, as it appears at the bottom-right.&lt;br /&gt;
**''entry'' is what appears in the mortem, signifying that you entered the level.&lt;br /&gt;
**''welcome'' is what appears in the message log as you enter the level.&lt;br /&gt;
*Hooks are added to the level, just as they would be for a singular module. Of particular note is that the '''run()''' hook is replaced with '''Create()''': they are functionally identical, but use different names due to where they are called.&lt;br /&gt;
&lt;br /&gt;
Within the module's source, this level is given its own file in a separate folder called &amp;quot;data&amp;quot;. In order for the module to access the file, a function called '''require''' is used:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require &amp;quot;classic:data/phobos_arena&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The module's name is written before the colon, and the path from the module's root folder is written after. '''require''' assumes a .lua extension, and few other files would be useful at this time.&lt;br /&gt;
&lt;br /&gt;
== Review ==&lt;br /&gt;
Included is the main.lua, phobos_arena.lua, and the module.lua used to run the file:&lt;br /&gt;
&lt;br /&gt;
{{:Modding:Tutorial/Building an Episode/Source}}&lt;br /&gt;
&lt;br /&gt;
Source data: [http://dl.dropbox.com/u/54818507/classic.module.zip classic.module]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/Recreating_Hell%27s_Arena</id>
		<title>Modding:Tutorial/Recreating Hell's Arena</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/Recreating_Hell%27s_Arena"/>
				<updated>2012-04-08T17:09:00Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: /* Review */ new link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In many ways, learning through example is a solid method of figuring out how to create your own code. The archetypical example we use here is Hell's Arena, which has been the example mod of DoomRL since the inception of the sandbox. It imitates [[Hell's Arena]] as it appears in DoomRL itself, which a few additions added here and there to create a different experience.&lt;br /&gt;
&lt;br /&gt;
As with all example modules in these tutorials, we will first begin with any radically-new concepts that require plenty of room, then go on to explain things by declaration. Usually this would involve looking at any cells/items/beings (or just old-fashioned tables) but this module has no new objects. Instead, we will only need to move through each engine hook and how it affects the map itself. As a measure of extra caution, generic comments will be added to this map as a means to provide understanding for those skipping all the extra details.&lt;br /&gt;
&lt;br /&gt;
==Special Concept: Adding Sound and Music==&lt;br /&gt;
&lt;br /&gt;
The most significant departure from the Arena's vanilla counterpart is the inclusion of custom sounds and music. This is explained sufficiently in the [[Modding:Module|module documentation]], but the steps to doing so will be laid out explicitly here.&lt;br /&gt;
&lt;br /&gt;
*First and foremost, you need to the sound and/or music files. Sounds must be a .wav file, and music must be a .mid, .mp3, or .ogg file. (Note that using .mp3 or .ogg can easily make WAD files much bigger files, so take caution when adding them to your module.) It is suggested that you name your sound and music files something that describes the audio of the file, as its filename (minus the extension) will be used verbatim in the lua script.&lt;br /&gt;
*Second, we need to put them into the module correctly. This is done by creating additional subdirectories in your .module folder:&lt;br /&gt;
**sound files go into &amp;quot;sound&amp;quot;&lt;br /&gt;
**music files go into &amp;quot;music&amp;quot;&lt;br /&gt;
*Whenever you want to access one of these sound or music files, you will use one of the following methods:&lt;br /&gt;
**Sounds are most commonly called using '''being:play_sound'''(''filename''), where &amp;quot;being&amp;quot; is whomever you want the sound to originate from. For &amp;quot;surround&amp;quot; sounds, use '''player:play_sound()'''.&lt;br /&gt;
**If you want the sound at a very specific point on the map, use '''[[Modding:Level#level_explosion|Level.explosion()]]''' and set the radius, delay, and damage of the explosion to zero: this removes any physical part of the explosion, allowing you to play only a sound at that point.&lt;br /&gt;
**Music is added using '''core.play_music'''(''filename''). It will override any music already playing. (Unfortunately there is no way to turn off the music: if you want no music to play, create a music file that has no audio and use it instead.)&lt;br /&gt;
*&amp;lt;u&amp;gt;Do not modify sound.lua or music.lua.&amp;lt;/u&amp;gt; This is technically a way to modify (or include) sounds and music for particular objects/calls, but neither of these files are included in the source folder or WAD file. For the sake of players wanting an easy dump into their DoomRL folder, it is higly recommended that you stick to the aforementioned procedure instead.&lt;br /&gt;
&lt;br /&gt;
In the Hell's Arena module, Skulltag sounds are added at the start of the map, as well as the start of each wave. Music by Simon Volpert, named &amp;quot;Rounds of Hell&amp;quot;, is also included at the beginning of the map and changes for each wave. (Adding sounds to beings is a lot more complicated, and we won't get into it here. Suffice it to say that it may prove more trouble than it's worth, not to mention that default sounds cannot be overwritten.)&lt;br /&gt;
&lt;br /&gt;
==Engine Hooks==&lt;br /&gt;
&lt;br /&gt;
===.run()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--always declare the module_id global&lt;br /&gt;
core.declare( &amp;quot;arena&amp;quot; , {} )&lt;br /&gt;
&lt;br /&gt;
function arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Hell Arena&amp;quot;                    --that IS what it's called&lt;br /&gt;
    Level.name_number = 0                        --remove floor #&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)                         --immortal border tiles&lt;br /&gt;
    local translation = {&lt;br /&gt;
        ['.'] = &amp;quot;floor&amp;quot;,                         --gray floor&lt;br /&gt;
        [','] = &amp;quot;blood&amp;quot;,                         --red floor (blood)&lt;br /&gt;
        ['#'] = &amp;quot;rwall&amp;quot;,                         --red wall (bloodstone)&lt;br /&gt;
        ['&amp;gt;'] = &amp;quot;stairs&amp;quot;                         --gray (normal) stairs&lt;br /&gt;
	}&lt;br /&gt;
 &lt;br /&gt;
     --create map cell string (76x18)&lt;br /&gt;
	local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
............................................................................&lt;br /&gt;
..................................,,,,,,....................................&lt;br /&gt;
..,,,.............................,,,,,,,...................................&lt;br /&gt;
..,&amp;gt;,............................,,,,,,,,,..................................&lt;br /&gt;
..,,,............................,,,,,,,,...................................&lt;br /&gt;
..................................,,,,,,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
	]]&lt;br /&gt;
    --create pillar cell string (6x5)&lt;br /&gt;
    local column = [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
	]]&lt;br /&gt;
 &lt;br /&gt;
    --puts map in non-border area&lt;br /&gt;
    Level.place_tile( translation, map, 2, 2 )&lt;br /&gt;
    --adds random pillars and blood&lt;br /&gt;
    Level.scatter_put( area.new(5,3,68,15), translation, column, &amp;quot;floor&amp;quot;,9+math.random(8))&lt;br /&gt;
    Level.scatter( area.FULL_SHRINKED,&amp;quot;floor&amp;quot;,&amp;quot;blood&amp;quot;,100)&lt;br /&gt;
    --all walls become indestructible&lt;br /&gt;
    Generator.set_permanence(area.FULL)&lt;br /&gt;
    --inserts player&lt;br /&gt;
    Level.player(38,10)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you recall in the tutorial [[Modding:Tutorial/Constructing a Map|Constructing a Map]], we used the starting coordinate (1,1) for the '''Level.place_tile()''' method, rather than (2,2). This is because we included the map's border tiles in our test map. It is, in fact, possible to customize the border of the map (there are some issues with non-cell objects on the border, so it is suggested you don't allow for them): however, if the border of the map is going to be uniform, then when you use '''Level.fill()''', fill the level with the border tiles you want. Then, when you write out the map string, you can ignore their existence altogether (the dimensions of such a map string should be 76x18), and place the map string at the starting coordinate (2,2) instead.&lt;br /&gt;
&lt;br /&gt;
Additionally, we have another cell string on this map: a 6x5 group consisting of a pillar surrounded by floor tiles. Hell's Arena randomly scatters these tiles around using the '''Level.scatter_put()''' method. The arguments are as follows:&lt;br /&gt;
*Area in which the cell string can be placed&lt;br /&gt;
*character/map translation table (thus you should write this cell string in the same terms as your map's)&lt;br /&gt;
*name of the cell string&lt;br /&gt;
*cell_id on which this cell string can be placed (the method will be sure that the entire cell string can replace only the cell_id you input here)&lt;br /&gt;
*number of times cell string is placed&lt;br /&gt;
&lt;br /&gt;
In the example, a fairly large area is carved out for these pillars to be placed, defining the same translation as for the normal map, using the variable name of the cell string, replacing the &amp;quot;floor&amp;quot; cell, and will be added anywhere from 10-17 times. Note that the middle of the map uses &amp;quot;blood&amp;quot; floor tiles rather than &amp;quot;floor&amp;quot;, so that pillar will never appear here.&lt;br /&gt;
&lt;br /&gt;
Finally, after placing the pillars, blood floor files are randomly added to the floor using the '''Level.scatter()''' method. '''Level.scatter()''' is similar to '''Level.scatter_put()''' but has no translation/map arguments. Instead, it asks for the area affected, the cell_id that will replace, the cell_id being replaced, and the number of times it should be added. In the example, &amp;quot;floor&amp;quot; is replaced with &amp;quot;blood&amp;quot; 100 times on any non-border tile (''area.FULL_SHRINKED'' is equivalent to '''area.new'''(''2'',''2'',''77'',''19'')).&lt;br /&gt;
&lt;br /&gt;
===.OnEnter()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnEnter()&lt;br /&gt;
    core.play_music(&amp;quot;rounds_of_hell_part_1&amp;quot;)         --use some kick-ass music&lt;br /&gt;
    player:play_sound(&amp;quot;preparetofight&amp;quot;)               --skulltag announcer!&lt;br /&gt;
    player.eq.weapon = item.new( &amp;quot;shotgun&amp;quot; )          --give the man a shotty&lt;br /&gt;
 &lt;br /&gt;
    --add 50 shotgun shells to inventory in a single &amp;quot;shell&amp;quot; item&lt;br /&gt;
    local shells = item.new( &amp;quot;shell&amp;quot; )&lt;br /&gt;
    shells.ammo = 50&lt;br /&gt;
    player.inv:add( shells )&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''OnEnter()''' hook begins in a way you'd tend to expect: special sound/music is added and the player's inventory is adjusted (specifically they are given a shotgun in-hand and fifty shells in the bank).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    Level.result(1)                                   --sets up first wave&lt;br /&gt;
 &lt;br /&gt;
    --big announcement stuff&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces:&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;Welcome to Hell's Arena, mortal!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;You are either very foolish, or very brave. Either way I like it!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;And so do the crowds!\&amp;quot;&amp;quot;)&lt;br /&gt;
    player:play_sound(&amp;quot;fight&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;Suddenly you hear screams everywhere! \&amp;quot;Blood! Blood! BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;The voice booms again, \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
    player:play_sound(&amp;quot;one&amp;quot;)&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next part of '''OnEnter()''' is a series of '''ui.msg()''' methods to display text onto the player's top part of the screen. Sounds are added are relevant points of the monologue. Note that, although '''ui.msg_enter()''' isn't being used, the player will have to press ENTER once two lines of text is fully displayed. Getting the timing of this with sounds can be tricky, so I would personally recommend that you use '''ui.msg_enter()''' just before a sound is to be played.&lt;br /&gt;
&lt;br /&gt;
Also included here is the '''Level.result()''' method. '''Level.result()''' can be used in two ways:&lt;br /&gt;
&lt;br /&gt;
*Calling without any arguments returns the current value of '''Level.result()'''&lt;br /&gt;
*Calling with an integer argument sets '''Level.result()''' to that integer value&lt;br /&gt;
&lt;br /&gt;
This value can be used for a number of things, but it is most often associated with events occurring in the level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    --create the first wave&lt;br /&gt;
    Level.summon(&amp;quot;demon&amp;quot;,3)                           --3 demons&lt;br /&gt;
    Level.summon(&amp;quot;lostsoul&amp;quot;,2)                        --2 lost souls&lt;br /&gt;
    Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY-1)            --0/1/2/3/4 cacodemons&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, '''OnEnter()''' spawns us some enemies using the '''Level.summon()''' method. This is a very simple function: input the being_id you want to spawn and how many, and the game will randomly generate them anywhere on the map. To spawn enemies in a specific area, you will want to use Level.area_summon(), which includes an area argument.&lt;br /&gt;
&lt;br /&gt;
The number of cacodemons in the level depends on the difficulty, which can be called through a pre-defined global variable called ''DIFFICULTY''. On I'm Too Young To Die, ''DIFFICULTY'' is equal to 1; on Hey, Not Too Rough, ''DIFFICULTY'' is equal to 2; and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
===.OnKill()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnKill()&lt;br /&gt;
        --randomized cheers from the crowd&lt;br /&gt;
	local temp = math.random(3)&lt;br /&gt;
	if     temp == 1 then ui.msg(&amp;quot;The crowds go wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;) &lt;br /&gt;
	elseif temp == 2 then ui.msg(&amp;quot;The crowds cheer! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;) &lt;br /&gt;
	else                  ui.msg(&amp;quot;The crowds cheer! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;) end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''OnKill()''' hook is used in Hell's Arena to add some crowd cheering. It is randomized between three messages using a temporary variable that changes every time another enemy dies (as the variable is re-defined each time the hook is triggered).&lt;br /&gt;
&lt;br /&gt;
===.OnKillAll()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnKillAll()&lt;br /&gt;
    if Level.result() == 1 then                       --if first wave completes&lt;br /&gt;
        --more talk&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you &amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;are, you show some determination.\&amp;quot;&amp;quot;);&lt;br /&gt;
        ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;The voice continues, \&amp;quot;I can now let you go free, or&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;you may try to complete the challenge!\&amp;quot;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        --player can choose to continue&lt;br /&gt;
        local choice = ui.msg_confirm(&amp;quot;\&amp;quot;Do you want to continue the fight?\&amp;quot;&amp;quot;)&lt;br /&gt;
        if choice then                                --player chose to continue&lt;br /&gt;
            core.play_music(&amp;quot;rounds_of_hell_part_2&amp;quot;)  --second verse better than first&lt;br /&gt;
            player:play_sound(&amp;quot;two&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;I like it! Let the show go on!\&amp;quot;&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
            Level.drop(&amp;quot;chaingun&amp;quot;)                    --sweet drop&lt;br /&gt;
            Level.summon(&amp;quot;demon&amp;quot;,3)                   --3 demons&lt;br /&gt;
            Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY)      --1/2/3/4/5 cacodemons&lt;br /&gt;
        --player chose to stop&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; &amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnKillAll()''' contains the bulk of code in this map, since each time a wave of enemies is killed, a number of things change. The first condition required is to check which wave we're on using '''Level.result()'''. Recall that '''Level.result()''' is equal to 1 based on the '''OnEnter()''' hook, so the first '''OnKillAll()''' will trigger for this first case.&lt;br /&gt;
&lt;br /&gt;
After another lengthy explanation, the player is given a y/n confirmation using the '''ui.msg_confirm()''' method. This returns a true/false value depending on the input of the player: in the example we assign this return value to ''choice''. Thus we can use this variable to determine what happens next:&lt;br /&gt;
&lt;br /&gt;
*In the event that the player chooses to accept with the &amp;quot;y&amp;quot; key (''choice'' is set to true), then we get another music change, some displayed praise, and some items and beings added to the level.&lt;br /&gt;
*In the event that the player choosen to decline with the &amp;quot;n&amp;quot; key (''choice'' is set to false), then we get a displayed insult.&lt;br /&gt;
&lt;br /&gt;
'''Level.drop()''' should be self-explanatory: is it the item equivalent of '''Level.summon()'''. Both the '''Level.drop()''' and '''Level.summon()''' methods can have the number of items/beings omitted: if so, the default value of 1 is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    elseif Level.result() == 2 then                   --if second wave completes&lt;br /&gt;
        --even more talk&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;to survive makes me excited!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;I can let you go now, and give you a small reward, or&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;you can choose to fight the final challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
	--player can choose to continue&lt;br /&gt;
        local choice = ui.msg_confirm(&amp;quot;\&amp;quot;Do you want to continue the fight?\&amp;quot;&amp;quot;)&lt;br /&gt;
        if choice then                           --player chosen to continue&lt;br /&gt;
            core.play_music(&amp;quot;rounds_of_hell_part_3&amp;quot;)  --strongest music yet&lt;br /&gt;
            player:play_sound(&amp;quot;three&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Excellent! May the fight begin!!!\&amp;quot;&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Kill, Kill, KILL!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
            --some more sweet loot&lt;br /&gt;
            Level.drop(&amp;quot;shell&amp;quot;,4)&lt;br /&gt;
            Level.drop(&amp;quot;ammo&amp;quot;,4)&lt;br /&gt;
            --spawns are a little more difficulty-dependent&lt;br /&gt;
            if DIFFICULTY &amp;lt;= 2 then              --ITYTD and HNTR&lt;br /&gt;
                Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY+1)&lt;br /&gt;
            elseif DIFFICULTY == 3 then          --HMP&lt;br /&gt;
                Level.summon(&amp;quot;knight&amp;quot;,2)&lt;br /&gt;
            elseif DIFFICULTY &amp;gt;= 4 then          --UV and N!&lt;br /&gt;
                Level.summon(&amp;quot;baron&amp;quot;,2)&lt;br /&gt;
            end&lt;br /&gt;
        else                                     --player chose to stop&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
           --pointless loot&lt;br /&gt;
           Level.drop(&amp;quot;shell&amp;quot;,3) &lt;br /&gt;
           Level.drop(&amp;quot;lmed&amp;quot;)&lt;br /&gt;
           Level.drop(&amp;quot;smed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the '''OnKillAll()''' code shows for the case of '''Level.result()''' equal to 2. It is roughly the same as the first case (different music/items/summons/messages aside), but with the following nontrivial changes:&lt;br /&gt;
&lt;br /&gt;
*The enemies used in the final wave are included in an if-then-elseif conditional statement, with each condition depending on ''DIFFICULTY''. We have three settings: cacodemons (2 on ITYTD, 3 on HNTR), hell knights (on HMP), and barons of hell (on UV and N!).&lt;br /&gt;
*If the player chooses to decline, they will still receive some items. This is simply how it works in the vanilla map, and serves no real purpose in a single-level module such as this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    elseif Level.result() == 3 then              --if third wave completes&lt;br /&gt;
        --finally done talking&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Congratulations mortal! A pity you came to&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;destroy us, for you would make a formidable hell warrior!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;I grant you the title of Hell's Arena Champion!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;And a promise is a promise... search the arena again...\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
        --also pointless loot&lt;br /&gt;
        Level.drop(&amp;quot;scglobe&amp;quot;)&lt;br /&gt;
        Level.drop(&amp;quot;barmor&amp;quot;)&lt;br /&gt;
        Level.drop(&amp;quot;lmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, '''OnKillAll()''' checks for the case of Level.result equal to 3: this is after all three waves have been killed. The announcer finishes entirely and the player receives some superfluous rewards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    --increment level counter each time a wave completes&lt;br /&gt;
    Level.result(Level.result()+1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This final piece of code is very important: each time '''OnKillAll()''' is triggered, after all the '''Level.result()''' checks are made, '''Level.result()''' is incremented by one. This means that, after the first wave of enemies is killed, the case of Level.result equal to 1 is executed, the other cases are ignored, and then Level.result() is set to 2. This repeats for the other cases, albeit with different lines being executed before Level.result() is incremented.&lt;br /&gt;
&lt;br /&gt;
===.OnExit()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnExit()&lt;br /&gt;
    ui.msg_enter(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --takes care of mortem text for &amp;quot;killed by something unknown...&amp;quot;&lt;br /&gt;
    if Level.result() &amp;lt; 4&lt;br /&gt;
        then arena.result = &amp;quot;fled alive the trials at wave &amp;quot;..Level.result()&lt;br /&gt;
        else arena.result = &amp;quot;completed the trials&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the player leaves the level (and '''OnExit()''' triggers), a final statement is given (which must be confirmed to continue, lest it be missed entirely) and a new field to ''arena'' is added, this time a string called ''result''. If '''Level.result()''' is less than 4 (which is to say, all waves were not killed) then ''arena.result'' writes out when the player left using '''Level.result()''' as the wave number. If '''Level.result()''' is 4 (or technically greater) then ''arena.result'' writes out that the player finished. But where is this string going to?&lt;br /&gt;
&lt;br /&gt;
===.OnMortem()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby                 --calls kill descriptions from beings&lt;br /&gt;
    if arena.result then kill = arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, fled alive the trials at wave 3&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Hell Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''OnMortem()''' hook is called whenever the player has exited the level, immediately after '''OnExit()''', and can be used to change what is displayed on the mortem screen. Here we see ''arena.result'' in action:&lt;br /&gt;
&lt;br /&gt;
*If the player is killed by an enemy, that being's ''kill_desc'' (or ''kill_desc_melee'') can be called using ''player.killedby'', which is then set to the local variable ''kill''. If not, ''kill'' will be empty when the first line executes.&lt;br /&gt;
*If ''arena.result'' was created (and will thus be true), then ''kill'' is instead set to that string. Since ''arena.result'' is only created if the player chooses to exit the game, this will not overwrite the case where the player is actually killed. It is done mostly to avoid any instances in which there would be a &amp;quot;killed by something unknown...&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
Finally, the first two lines of the mortem are replaced with the '''player:mortem_print()''' method. ''player.name'' is the name of the player (as determined in-game); ''player.explevel'' is the character level; and ''klasses[player.klass].name'' checks the class prototype and returns the player's chosen class's name (for example, &amp;quot;Marine&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==Review==&lt;br /&gt;
Here is the entire main.lua file to view at once:&lt;br /&gt;
&lt;br /&gt;
{{:Modding:Tutorial/Recreating Hell's Arena/Source}}&lt;br /&gt;
&lt;br /&gt;
Source data: [http://dl.dropbox.com/u/54818507/arena.module.zip arena.module]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/Recreating_Hell%27s_Arena/Source</id>
		<title>Modding:Tutorial/Recreating Hell's Arena/Source</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/Recreating_Hell%27s_Arena/Source"/>
				<updated>2012-04-08T16:52:48Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised for 0996&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--always declare the module_id global&lt;br /&gt;
core.declare( &amp;quot;arena&amp;quot; , {} )&lt;br /&gt;
&lt;br /&gt;
function arena.OnEnter()&lt;br /&gt;
    core.play_music(&amp;quot;rounds_of_hell_part_1&amp;quot;)          --use some kick-ass music&lt;br /&gt;
    player:play_sound(&amp;quot;preparetofight&amp;quot;)               --skulltag announcer!&lt;br /&gt;
    player.eq.weapon = item.new( &amp;quot;shotgun&amp;quot; )          --give the man a shotty&lt;br /&gt;
 &lt;br /&gt;
    --add 50 shotgun shells to inventory in a single &amp;quot;shell&amp;quot; item&lt;br /&gt;
    local shells = item.new( &amp;quot;shell&amp;quot; )&lt;br /&gt;
    shells.ammo = 50&lt;br /&gt;
    player.inv:add( shells )&lt;br /&gt;
 &lt;br /&gt;
    Level.result(1)                                   --sets up first wave&lt;br /&gt;
 &lt;br /&gt;
    --big announcement stuff&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces:&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;Welcome to Hell's Arena, mortal!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;You are either very foolish, or very brave. Either way I like it!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;And so do the crowds!\&amp;quot;&amp;quot;)&lt;br /&gt;
    player:play_sound(&amp;quot;fight&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;Suddenly you hear screams everywhere! \&amp;quot;Blood! Blood! BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;The voice booms again, \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
    player:play_sound(&amp;quot;one&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
    --create the first wave&lt;br /&gt;
    Level.summon(&amp;quot;demon&amp;quot;,3)                           --3 demons&lt;br /&gt;
    Level.summon(&amp;quot;lostsoul&amp;quot;,2)                        --2 lost souls&lt;br /&gt;
    Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY-1)            --0/1/2/3/4 cacodemons&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function arena.OnKill()&lt;br /&gt;
        --randomized cheers from the crowd&lt;br /&gt;
    local temp = math.random(3)&lt;br /&gt;
    if     temp == 1 then ui.msg(&amp;quot;The crowds go wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;) &lt;br /&gt;
    elseif temp == 2 then ui.msg(&amp;quot;The crowds cheer! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;) &lt;br /&gt;
    else                  ui.msg(&amp;quot;The crowds cheer! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;) end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function arena.OnKillAll()&lt;br /&gt;
    if Level.result() == 1 then                       --if first wave completes&lt;br /&gt;
        --more talk&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you &amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;are, you show some determination.\&amp;quot;&amp;quot;);&lt;br /&gt;
        ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;The voice continues, \&amp;quot;I can now let you go free, or&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;you may try to complete the challenge!\&amp;quot;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        --player can choose to continue&lt;br /&gt;
        local choice = ui.msg_confirm(&amp;quot;\&amp;quot;Do you want to continue the fight?\&amp;quot;&amp;quot;)&lt;br /&gt;
        if choice then                                --player chose to continue&lt;br /&gt;
            core.play_music(&amp;quot;rounds_of_hell_part_2&amp;quot;)  --second verse better than first&lt;br /&gt;
            player:play_sound(&amp;quot;two&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;I like it! Let the show go on!\&amp;quot;&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
            Level.drop(&amp;quot;chaingun&amp;quot;)                    --sweet drop&lt;br /&gt;
            Level.summon(&amp;quot;demon&amp;quot;,3)                   --3 demons&lt;br /&gt;
            Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY)      --1/2/3/4/5 cacodemons&lt;br /&gt;
        --player chose to stop&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; &amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
 &lt;br /&gt;
    elseif Level.result() == 2 then                   --if second wave completes&lt;br /&gt;
        --even more talk&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;to survive makes me excited!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;I can let you go now, and give you a small reward, or&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;you can choose to fight the final challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
    --player can choose to continue&lt;br /&gt;
        local choice = ui.msg_confirm(&amp;quot;\&amp;quot;Do you want to continue the fight?\&amp;quot;&amp;quot;)&lt;br /&gt;
        if choice then                                --player chosen to continue&lt;br /&gt;
            core.play_music(&amp;quot;rounds_of_hell_part_3&amp;quot;)  --strongest music yet&lt;br /&gt;
            player:play_sound(&amp;quot;three&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Excellent! May the fight begin!!!\&amp;quot;&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Kill, Kill, KILL!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
            --some more sweet loot&lt;br /&gt;
            Level.drop(&amp;quot;shell&amp;quot;,4)&lt;br /&gt;
            Level.drop(&amp;quot;ammo&amp;quot;,4)&lt;br /&gt;
            --spawns are a little more difficulty-dependent&lt;br /&gt;
            if DIFFICULTY &amp;lt;= 2 then              --ITYTD and HNTR&lt;br /&gt;
                Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY+1)&lt;br /&gt;
            elseif DIFFICULTY == 3 then          --HMP&lt;br /&gt;
                Level.summon(&amp;quot;knight&amp;quot;,2)&lt;br /&gt;
            elseif DIFFICULTY &amp;gt;= 4 then          --UV and N!&lt;br /&gt;
                Level.summon(&amp;quot;baron&amp;quot;,2)&lt;br /&gt;
            end&lt;br /&gt;
        else                                     --player chose to stop&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
           --pointless loot&lt;br /&gt;
           Level.drop(&amp;quot;shell&amp;quot;,3) &lt;br /&gt;
           Level.drop(&amp;quot;lmed&amp;quot;)&lt;br /&gt;
           Level.drop(&amp;quot;smed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
 &lt;br /&gt;
    elseif Level.result() == 3 then              --if third wave completes&lt;br /&gt;
        --finally done talking&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Congratulations mortal! A pity you came to&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;destroy us, for you would make a formidable hell warrior!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;I grant you the title of Hell's Arena Champion!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;And a promise is a promise... search the arena again...\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
        --also pointless loot&lt;br /&gt;
        Level.drop(&amp;quot;scglobe&amp;quot;)&lt;br /&gt;
        Level.drop(&amp;quot;barmor&amp;quot;)&lt;br /&gt;
        Level.drop(&amp;quot;lmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
 &lt;br /&gt;
    --increment level counter each time a wave completes&lt;br /&gt;
    Level.result(Level.result()+1)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function arena.OnExit()&lt;br /&gt;
    ui.msg_enter(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --takes care of mortem text for &amp;quot;killed by something unknown...&amp;quot;&lt;br /&gt;
    if Level.result() &amp;lt; 4&lt;br /&gt;
        then arena.result = &amp;quot;fled alive the trials at wave &amp;quot;..Level.result()&lt;br /&gt;
        else arena.result = &amp;quot;completed the trials&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby                 --calls kill descriptions from beings&lt;br /&gt;
    if arena.result then kill = arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, fled alive the trials at wave 3&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Hell Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Hell Arena&amp;quot;                    --that IS what it's called&lt;br /&gt;
    Level.name_number = 0                        --remove floor #&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)                         --immortal border tiles&lt;br /&gt;
    local translation = {&lt;br /&gt;
        ['.'] = &amp;quot;floor&amp;quot;,                         --gray floor&lt;br /&gt;
        [','] = &amp;quot;blood&amp;quot;,                         --red floor (blood)&lt;br /&gt;
        ['#'] = &amp;quot;rwall&amp;quot;,                         --red wall (bloodstone)&lt;br /&gt;
        ['&amp;gt;'] = &amp;quot;stairs&amp;quot;                         --gray (normal) stairs&lt;br /&gt;
    }&lt;br /&gt;
 &lt;br /&gt;
     --create map cell string (76x18)&lt;br /&gt;
    local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
............................................................................&lt;br /&gt;
..................................,,,,,,....................................&lt;br /&gt;
..,,,.............................,,,,,,,...................................&lt;br /&gt;
..,&amp;gt;,............................,,,,,,,,,..................................&lt;br /&gt;
..,,,............................,,,,,,,,...................................&lt;br /&gt;
..................................,,,,,,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
]]&lt;br /&gt;
    --create pillar cell string (6x5)&lt;br /&gt;
    local column = [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
]]&lt;br /&gt;
 &lt;br /&gt;
    --puts map in non-border area&lt;br /&gt;
    Level.place_tile( translation, map, 2, 2 )&lt;br /&gt;
    --adds random pillars and blood&lt;br /&gt;
    Level.scatter_put( area.new(5,3,68,15), translation, column, &amp;quot;floor&amp;quot;,9+math.random(8))&lt;br /&gt;
    Level.scatter( area.FULL_SHRINKED,&amp;quot;floor&amp;quot;,&amp;quot;blood&amp;quot;,100)&lt;br /&gt;
    --all walls become indestructible&lt;br /&gt;
    Generator.set_permanence(area.FULL)&lt;br /&gt;
    --inserts player&lt;br /&gt;
    Level.player(38,10)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/Recreating_Hell%27s_Arena</id>
		<title>Modding:Tutorial/Recreating Hell's Arena</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/Recreating_Hell%27s_Arena"/>
				<updated>2012-04-08T16:52:23Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised for 0996&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In many ways, learning through example is a solid method of figuring out how to create your own code. The archetypical example we use here is Hell's Arena, which has been the example mod of DoomRL since the inception of the sandbox. It imitates [[Hell's Arena]] as it appears in DoomRL itself, which a few additions added here and there to create a different experience.&lt;br /&gt;
&lt;br /&gt;
As with all example modules in these tutorials, we will first begin with any radically-new concepts that require plenty of room, then go on to explain things by declaration. Usually this would involve looking at any cells/items/beings (or just old-fashioned tables) but this module has no new objects. Instead, we will only need to move through each engine hook and how it affects the map itself. As a measure of extra caution, generic comments will be added to this map as a means to provide understanding for those skipping all the extra details.&lt;br /&gt;
&lt;br /&gt;
==Special Concept: Adding Sound and Music==&lt;br /&gt;
&lt;br /&gt;
The most significant departure from the Arena's vanilla counterpart is the inclusion of custom sounds and music. This is explained sufficiently in the [[Modding:Module|module documentation]], but the steps to doing so will be laid out explicitly here.&lt;br /&gt;
&lt;br /&gt;
*First and foremost, you need to the sound and/or music files. Sounds must be a .wav file, and music must be a .mid, .mp3, or .ogg file. (Note that using .mp3 or .ogg can easily make WAD files much bigger files, so take caution when adding them to your module.) It is suggested that you name your sound and music files something that describes the audio of the file, as its filename (minus the extension) will be used verbatim in the lua script.&lt;br /&gt;
*Second, we need to put them into the module correctly. This is done by creating additional subdirectories in your .module folder:&lt;br /&gt;
**sound files go into &amp;quot;sound&amp;quot;&lt;br /&gt;
**music files go into &amp;quot;music&amp;quot;&lt;br /&gt;
*Whenever you want to access one of these sound or music files, you will use one of the following methods:&lt;br /&gt;
**Sounds are most commonly called using '''being:play_sound'''(''filename''), where &amp;quot;being&amp;quot; is whomever you want the sound to originate from. For &amp;quot;surround&amp;quot; sounds, use '''player:play_sound()'''.&lt;br /&gt;
**If you want the sound at a very specific point on the map, use '''[[Modding:Level#level_explosion|Level.explosion()]]''' and set the radius, delay, and damage of the explosion to zero: this removes any physical part of the explosion, allowing you to play only a sound at that point.&lt;br /&gt;
**Music is added using '''core.play_music'''(''filename''). It will override any music already playing. (Unfortunately there is no way to turn off the music: if you want no music to play, create a music file that has no audio and use it instead.)&lt;br /&gt;
*&amp;lt;u&amp;gt;Do not modify sound.lua or music.lua.&amp;lt;/u&amp;gt; This is technically a way to modify (or include) sounds and music for particular objects/calls, but neither of these files are included in the source folder or WAD file. For the sake of players wanting an easy dump into their DoomRL folder, it is higly recommended that you stick to the aforementioned procedure instead.&lt;br /&gt;
&lt;br /&gt;
In the Hell's Arena module, Skulltag sounds are added at the start of the map, as well as the start of each wave. Music by Simon Volpert, named &amp;quot;Rounds of Hell&amp;quot;, is also included at the beginning of the map and changes for each wave. (Adding sounds to beings is a lot more complicated, and we won't get into it here. Suffice it to say that it may prove more trouble than it's worth, not to mention that default sounds cannot be overwritten.)&lt;br /&gt;
&lt;br /&gt;
==Engine Hooks==&lt;br /&gt;
&lt;br /&gt;
===.run()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--always declare the module_id global&lt;br /&gt;
core.declare( &amp;quot;arena&amp;quot; , {} )&lt;br /&gt;
&lt;br /&gt;
function arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Hell Arena&amp;quot;                    --that IS what it's called&lt;br /&gt;
    Level.name_number = 0                        --remove floor #&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)                         --immortal border tiles&lt;br /&gt;
    local translation = {&lt;br /&gt;
        ['.'] = &amp;quot;floor&amp;quot;,                         --gray floor&lt;br /&gt;
        [','] = &amp;quot;blood&amp;quot;,                         --red floor (blood)&lt;br /&gt;
        ['#'] = &amp;quot;rwall&amp;quot;,                         --red wall (bloodstone)&lt;br /&gt;
        ['&amp;gt;'] = &amp;quot;stairs&amp;quot;                         --gray (normal) stairs&lt;br /&gt;
	}&lt;br /&gt;
 &lt;br /&gt;
     --create map cell string (76x18)&lt;br /&gt;
	local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
............................................................................&lt;br /&gt;
..................................,,,,,,....................................&lt;br /&gt;
..,,,.............................,,,,,,,...................................&lt;br /&gt;
..,&amp;gt;,............................,,,,,,,,,..................................&lt;br /&gt;
..,,,............................,,,,,,,,...................................&lt;br /&gt;
..................................,,,,,,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
	]]&lt;br /&gt;
    --create pillar cell string (6x5)&lt;br /&gt;
    local column = [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
	]]&lt;br /&gt;
 &lt;br /&gt;
    --puts map in non-border area&lt;br /&gt;
    Level.place_tile( translation, map, 2, 2 )&lt;br /&gt;
    --adds random pillars and blood&lt;br /&gt;
    Level.scatter_put( area.new(5,3,68,15), translation, column, &amp;quot;floor&amp;quot;,9+math.random(8))&lt;br /&gt;
    Level.scatter( area.FULL_SHRINKED,&amp;quot;floor&amp;quot;,&amp;quot;blood&amp;quot;,100)&lt;br /&gt;
    --all walls become indestructible&lt;br /&gt;
    Generator.set_permanence(area.FULL)&lt;br /&gt;
    --inserts player&lt;br /&gt;
    Level.player(38,10)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you recall in the tutorial [[Modding:Tutorial/Constructing a Map|Constructing a Map]], we used the starting coordinate (1,1) for the '''Level.place_tile()''' method, rather than (2,2). This is because we included the map's border tiles in our test map. It is, in fact, possible to customize the border of the map (there are some issues with non-cell objects on the border, so it is suggested you don't allow for them): however, if the border of the map is going to be uniform, then when you use '''Level.fill()''', fill the level with the border tiles you want. Then, when you write out the map string, you can ignore their existence altogether (the dimensions of such a map string should be 76x18), and place the map string at the starting coordinate (2,2) instead.&lt;br /&gt;
&lt;br /&gt;
Additionally, we have another cell string on this map: a 6x5 group consisting of a pillar surrounded by floor tiles. Hell's Arena randomly scatters these tiles around using the '''Level.scatter_put()''' method. The arguments are as follows:&lt;br /&gt;
*Area in which the cell string can be placed&lt;br /&gt;
*character/map translation table (thus you should write this cell string in the same terms as your map's)&lt;br /&gt;
*name of the cell string&lt;br /&gt;
*cell_id on which this cell string can be placed (the method will be sure that the entire cell string can replace only the cell_id you input here)&lt;br /&gt;
*number of times cell string is placed&lt;br /&gt;
&lt;br /&gt;
In the example, a fairly large area is carved out for these pillars to be placed, defining the same translation as for the normal map, using the variable name of the cell string, replacing the &amp;quot;floor&amp;quot; cell, and will be added anywhere from 10-17 times. Note that the middle of the map uses &amp;quot;blood&amp;quot; floor tiles rather than &amp;quot;floor&amp;quot;, so that pillar will never appear here.&lt;br /&gt;
&lt;br /&gt;
Finally, after placing the pillars, blood floor files are randomly added to the floor using the '''Level.scatter()''' method. '''Level.scatter()''' is similar to '''Level.scatter_put()''' but has no translation/map arguments. Instead, it asks for the area affected, the cell_id that will replace, the cell_id being replaced, and the number of times it should be added. In the example, &amp;quot;floor&amp;quot; is replaced with &amp;quot;blood&amp;quot; 100 times on any non-border tile (''area.FULL_SHRINKED'' is equivalent to '''area.new'''(''2'',''2'',''77'',''19'')).&lt;br /&gt;
&lt;br /&gt;
===.OnEnter()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnEnter()&lt;br /&gt;
    core.play_music(&amp;quot;rounds_of_hell_part_1&amp;quot;)         --use some kick-ass music&lt;br /&gt;
    player:play_sound(&amp;quot;preparetofight&amp;quot;)               --skulltag announcer!&lt;br /&gt;
    player.eq.weapon = item.new( &amp;quot;shotgun&amp;quot; )          --give the man a shotty&lt;br /&gt;
 &lt;br /&gt;
    --add 50 shotgun shells to inventory in a single &amp;quot;shell&amp;quot; item&lt;br /&gt;
    local shells = item.new( &amp;quot;shell&amp;quot; )&lt;br /&gt;
    shells.ammo = 50&lt;br /&gt;
    player.inv:add( shells )&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''OnEnter()''' hook begins in a way you'd tend to expect: special sound/music is added and the player's inventory is adjusted (specifically they are given a shotgun in-hand and fifty shells in the bank).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    Level.result(1)                                   --sets up first wave&lt;br /&gt;
 &lt;br /&gt;
    --big announcement stuff&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces:&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;Welcome to Hell's Arena, mortal!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;You are either very foolish, or very brave. Either way I like it!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;\&amp;quot;And so do the crowds!\&amp;quot;&amp;quot;)&lt;br /&gt;
    player:play_sound(&amp;quot;fight&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;Suddenly you hear screams everywhere! \&amp;quot;Blood! Blood! BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
    ui.msg(&amp;quot;The voice booms again, \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
    player:play_sound(&amp;quot;one&amp;quot;)&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next part of '''OnEnter()''' is a series of '''ui.msg()''' methods to display text onto the player's top part of the screen. Sounds are added are relevant points of the monologue. Note that, although '''ui.msg_enter()''' isn't being used, the player will have to press ENTER once two lines of text is fully displayed. Getting the timing of this with sounds can be tricky, so I would personally recommend that you use '''ui.msg_enter()''' just before a sound is to be played.&lt;br /&gt;
&lt;br /&gt;
Also included here is the '''Level.result()''' method. '''Level.result()''' can be used in two ways:&lt;br /&gt;
&lt;br /&gt;
*Calling without any arguments returns the current value of '''Level.result()'''&lt;br /&gt;
*Calling with an integer argument sets '''Level.result()''' to that integer value&lt;br /&gt;
&lt;br /&gt;
This value can be used for a number of things, but it is most often associated with events occurring in the level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    --create the first wave&lt;br /&gt;
    Level.summon(&amp;quot;demon&amp;quot;,3)                           --3 demons&lt;br /&gt;
    Level.summon(&amp;quot;lostsoul&amp;quot;,2)                        --2 lost souls&lt;br /&gt;
    Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY-1)            --0/1/2/3/4 cacodemons&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, '''OnEnter()''' spawns us some enemies using the '''Level.summon()''' method. This is a very simple function: input the being_id you want to spawn and how many, and the game will randomly generate them anywhere on the map. To spawn enemies in a specific area, you will want to use Level.area_summon(), which includes an area argument.&lt;br /&gt;
&lt;br /&gt;
The number of cacodemons in the level depends on the difficulty, which can be called through a pre-defined global variable called ''DIFFICULTY''. On I'm Too Young To Die, ''DIFFICULTY'' is equal to 1; on Hey, Not Too Rough, ''DIFFICULTY'' is equal to 2; and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
===.OnKill()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnKill()&lt;br /&gt;
        --randomized cheers from the crowd&lt;br /&gt;
	local temp = math.random(3)&lt;br /&gt;
	if     temp == 1 then ui.msg(&amp;quot;The crowds go wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;) &lt;br /&gt;
	elseif temp == 2 then ui.msg(&amp;quot;The crowds cheer! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;) &lt;br /&gt;
	else                  ui.msg(&amp;quot;The crowds cheer! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;) end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''OnKill()''' hook is used in Hell's Arena to add some crowd cheering. It is randomized between three messages using a temporary variable that changes every time another enemy dies (as the variable is re-defined each time the hook is triggered).&lt;br /&gt;
&lt;br /&gt;
===.OnKillAll()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnKillAll()&lt;br /&gt;
    if Level.result() == 1 then                       --if first wave completes&lt;br /&gt;
        --more talk&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you &amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;are, you show some determination.\&amp;quot;&amp;quot;);&lt;br /&gt;
        ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;The voice continues, \&amp;quot;I can now let you go free, or&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;you may try to complete the challenge!\&amp;quot;&amp;quot;);&lt;br /&gt;
 &lt;br /&gt;
        --player can choose to continue&lt;br /&gt;
        local choice = ui.msg_confirm(&amp;quot;\&amp;quot;Do you want to continue the fight?\&amp;quot;&amp;quot;)&lt;br /&gt;
        if choice then                                --player chose to continue&lt;br /&gt;
            core.play_music(&amp;quot;rounds_of_hell_part_2&amp;quot;)  --second verse better than first&lt;br /&gt;
            player:play_sound(&amp;quot;two&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;I like it! Let the show go on!\&amp;quot;&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
            Level.drop(&amp;quot;chaingun&amp;quot;)                    --sweet drop&lt;br /&gt;
            Level.summon(&amp;quot;demon&amp;quot;,3)                   --3 demons&lt;br /&gt;
            Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY)      --1/2/3/4/5 cacodemons&lt;br /&gt;
        --player chose to stop&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; &amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnKillAll()''' contains the bulk of code in this map, since each time a wave of enemies is killed, a number of things change. The first condition required is to check which wave we're on using '''Level.result()'''. Recall that '''Level.result()''' is equal to 1 based on the '''OnEnter()''' hook, so the first '''OnKillAll()''' will trigger for this first case.&lt;br /&gt;
&lt;br /&gt;
After another lengthy explanation, the player is given a y/n confirmation using the '''ui.msg_confirm()''' method. This returns a true/false value depending on the input of the player: in the example we assign this return value to ''choice''. Thus we can use this variable to determine what happens next:&lt;br /&gt;
&lt;br /&gt;
*In the event that the player chooses to accept with the &amp;quot;y&amp;quot; key (''choice'' is set to true), then we get another music change, some displayed praise, and some items and beings added to the level.&lt;br /&gt;
*In the event that the player choosen to decline with the &amp;quot;n&amp;quot; key (''choice'' is set to false), then we get a displayed insult.&lt;br /&gt;
&lt;br /&gt;
'''Level.drop()''' should be self-explanatory: is it the item equivalent of '''Level.summon()'''. Both the '''Level.drop()''' and '''Level.summon()''' methods can have the number of items/beings omitted: if so, the default value of 1 is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    elseif Level.result() == 2 then                   --if second wave completes&lt;br /&gt;
        --even more talk&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;to survive makes me excited!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;I can let you go now, and give you a small reward, or&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;you can choose to fight the final challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
	--player can choose to continue&lt;br /&gt;
        local choice = ui.msg_confirm(&amp;quot;\&amp;quot;Do you want to continue the fight?\&amp;quot;&amp;quot;)&lt;br /&gt;
        if choice then                           --player chosen to continue&lt;br /&gt;
            core.play_music(&amp;quot;rounds_of_hell_part_3&amp;quot;)  --strongest music yet&lt;br /&gt;
            player:play_sound(&amp;quot;three&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Excellent! May the fight begin!!!\&amp;quot;&amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Kill, Kill, KILL!\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
            --some more sweet loot&lt;br /&gt;
            Level.drop(&amp;quot;shell&amp;quot;,4)&lt;br /&gt;
            Level.drop(&amp;quot;ammo&amp;quot;,4)&lt;br /&gt;
            --spawns are a little more difficulty-dependent&lt;br /&gt;
            if DIFFICULTY &amp;lt;= 2 then              --ITYTD and HNTR&lt;br /&gt;
                Level.summon(&amp;quot;cacodemon&amp;quot;,DIFFICULTY+1)&lt;br /&gt;
            elseif DIFFICULTY == 3 then          --HMP&lt;br /&gt;
                Level.summon(&amp;quot;knight&amp;quot;,2)&lt;br /&gt;
            elseif DIFFICULTY &amp;gt;= 4 then          --UV and N!&lt;br /&gt;
                Level.summon(&amp;quot;baron&amp;quot;,2)&lt;br /&gt;
            end&lt;br /&gt;
        else                                     --player chose to stop&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot;)&lt;br /&gt;
            ui.msg(&amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
           --pointless loot&lt;br /&gt;
           Level.drop(&amp;quot;shell&amp;quot;,3) &lt;br /&gt;
           Level.drop(&amp;quot;lmed&amp;quot;)&lt;br /&gt;
           Level.drop(&amp;quot;smed&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the '''OnKillAll()''' code shows for the case of '''Level.result()''' equal to 2. It is roughly the same as the first case (different music/items/summons/messages aside), but with the following nontrivial changes:&lt;br /&gt;
&lt;br /&gt;
*The enemies used in the final wave are included in an if-then-elseif conditional statement, with each condition depending on ''DIFFICULTY''. We have three settings: cacodemons (2 on ITYTD, 3 on HNTR), hell knights (on HMP), and barons of hell (on UV and N!).&lt;br /&gt;
*If the player chooses to decline, they will still receive some items. This is simply how it works in the vanilla map, and serves no real purpose in a single-level module such as this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    elseif Level.result() == 3 then              --if third wave completes&lt;br /&gt;
        --finally done talking&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Congratulations mortal! A pity you came to&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;destroy us, for you would make a formidable hell warrior!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;I grant you the title of Hell's Arena Champion!\&amp;quot;&amp;quot;)&lt;br /&gt;
        ui.msg(&amp;quot;\&amp;quot;And a promise is a promise... search the arena again...\&amp;quot;&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
        --also pointless loot&lt;br /&gt;
        Level.drop(&amp;quot;scglobe&amp;quot;)&lt;br /&gt;
        Level.drop(&amp;quot;barmor&amp;quot;)&lt;br /&gt;
        Level.drop(&amp;quot;lmed&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, '''OnKillAll()''' checks for the case of Level.result equal to 3: this is after all three waves have been killed. The announcer finishes entirely and the player receives some superfluous rewards.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    --increment level counter each time a wave completes&lt;br /&gt;
    Level.result(Level.result()+1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This final piece of code is very important: each time '''OnKillAll()''' is triggered, after all the '''Level.result()''' checks are made, '''Level.result()''' is incremented by one. This means that, after the first wave of enemies is killed, the case of Level.result equal to 1 is executed, the other cases are ignored, and then Level.result() is set to 2. This repeats for the other cases, albeit with different lines being executed before Level.result() is incremented.&lt;br /&gt;
&lt;br /&gt;
===.OnExit()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnExit()&lt;br /&gt;
    ui.msg_enter(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --takes care of mortem text for &amp;quot;killed by something unknown...&amp;quot;&lt;br /&gt;
    if Level.result() &amp;lt; 4&lt;br /&gt;
        then arena.result = &amp;quot;fled alive the trials at wave &amp;quot;..Level.result()&lt;br /&gt;
        else arena.result = &amp;quot;completed the trials&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the player leaves the level (and '''OnExit()''' triggers), a final statement is given (which must be confirmed to continue, lest it be missed entirely) and a new field to ''arena'' is added, this time a string called ''result''. If '''Level.result()''' is less than 4 (which is to say, all waves were not killed) then ''arena.result'' writes out when the player left using '''Level.result()''' as the wave number. If '''Level.result()''' is 4 (or technically greater) then ''arena.result'' writes out that the player finished. But where is this string going to?&lt;br /&gt;
&lt;br /&gt;
===.OnMortem()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby                 --calls kill descriptions from beings&lt;br /&gt;
    if arena.result then kill = arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, fled alive the trials at wave 3&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Hell Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''OnMortem()''' hook is called whenever the player has exited the level, immediately after '''OnExit()''', and can be used to change what is displayed on the mortem screen. Here we see ''arena.result'' in action:&lt;br /&gt;
&lt;br /&gt;
*If the player is killed by an enemy, that being's ''kill_desc'' (or ''kill_desc_melee'') can be called using ''player.killedby'', which is then set to the local variable ''kill''. If not, ''kill'' will be empty when the first line executes.&lt;br /&gt;
*If ''arena.result'' was created (and will thus be true), then ''kill'' is instead set to that string. Since ''arena.result'' is only created if the player chooses to exit the game, this will not overwrite the case where the player is actually killed. It is done mostly to avoid any instances in which there would be a &amp;quot;killed by something unknown...&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
Finally, the first two lines of the mortem are replaced with the '''player:mortem_print()''' method. ''player.name'' is the name of the player (as determined in-game); ''player.explevel'' is the character level; and ''klasses[player.klass].name'' checks the class prototype and returns the player's chosen class's name (for example, &amp;quot;Marine&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
==Review==&lt;br /&gt;
Here is the entire main.lua file to view at once:&lt;br /&gt;
&lt;br /&gt;
{{:Modding:Tutorial/Recreating Hell's Arena/Source}}&lt;br /&gt;
&lt;br /&gt;
Source data: [http://dl.dropbox.com/u/33336094/arena.module.zip arena.module]&lt;br /&gt;
&lt;br /&gt;
WAD file: [http://dl.dropbox.com/u/33336094/arena.wad arena.wad]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena</id>
		<title>Modding:Tutorial/The Infinite Arena</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena"/>
				<updated>2012-04-08T16:49:57Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: /* Review */ new link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(NOTE: if you are unfamiliar with the general structure of the Hell's Arena module, it is suggested that you [[Modding:Tutorial/Recreating_Hell's_Arena|read the tutorial]] before proceeding, as many of the topics found there also are here, and will only be touched upon in this tutorial.)&lt;br /&gt;
&lt;br /&gt;
[[Hell's Arena]] is a fun little level, as it can be fairly difficult to complete without some grasp on DoomRL's mechanics, but pillar and monster placement aside, it is still a fairly static map. The following tutorial is a generalized version of Hell's Arena, coined the Infinite Arena, which has been reconstructed based on [[User:Yaflhdztioxo|yaflhdztioxo's]] design from v0.9.9.1. A fair number of seemingly-superfluous tools have also been created as a means to provide easy customization possibilities for those who want to quickly change the settings of the Arena. If nothing else, you will discover a variety of helper tools in this tutorial that may prove to be useful in your own modules.&lt;br /&gt;
&lt;br /&gt;
==Special Concept: Custom Tables and Functions==&lt;br /&gt;
The basics of tables have already been explained in the [[Modding:Tutorial/Game Objects|Game Objects]] tutorial: it was also explained there that building your own tables is generally unnecessary. There are, however, plenty of reasons to make tables for your own purposes:&lt;br /&gt;
&lt;br /&gt;
*You want the game to randomly choose from a group of variables&lt;br /&gt;
*You want to perform calculations or subroutines on many objects simultaneously&lt;br /&gt;
*You are creating an object map that other functions may require (e.g., translation table for .run() )&lt;br /&gt;
*You want to store a number of variables in an organized manner in order to access them easily&lt;br /&gt;
&lt;br /&gt;
There are two kinds of tables. The first kind are what are more commonly referred to as tables, as they contain keys and values in each of their fields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local some_table = {&lt;br /&gt;
    key1 = &amp;quot;value1&amp;quot;,&lt;br /&gt;
    key2 = &amp;quot;value2&amp;quot;,&lt;br /&gt;
    ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In fact, these tables can contain more tables, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local big_table = {&lt;br /&gt;
    small_table1 = {&lt;br /&gt;
        key1 = &amp;quot;value1&amp;quot;,&lt;br /&gt;
        key2 = &amp;quot;value2&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    small_table2 = {&lt;br /&gt;
        key1 = &amp;quot;value3&amp;quot;,&lt;br /&gt;
        key3 = &amp;quot;value4&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that these sub-tables do not have to carry the same information, although you may want them to (depending on the table's purpose). In doing so, you can create very large and intricate tables to suit your needs.&lt;br /&gt;
&lt;br /&gt;
The second kind of table is commonly known in the modding community as an array, and is essentially a table that does not explicitly write keys in each field. The following examples show an array, followed by a table that imitates the functionality of an array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local some_array = {&amp;quot;value1&amp;quot;,&amp;quot;value2&amp;quot;,&amp;quot;value3&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
local some_imit_table = {&lt;br /&gt;
    [1] = &amp;quot;value1&amp;quot;,&lt;br /&gt;
    [2] = &amp;quot;value2&amp;quot;,&lt;br /&gt;
    [3] = &amp;quot;value3&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local big_array = {&lt;br /&gt;
    {&amp;quot;value1&amp;quot;,&amp;quot;value2&amp;quot;,&amp;quot;value3&amp;quot;},&lt;br /&gt;
    {&amp;quot;value4&amp;quot;,&amp;quot;value5&amp;quot;,&amp;quot;value6&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local big_imit_table = {&lt;br /&gt;
    [1] = {&lt;br /&gt;
        [1] = &amp;quot;value1&amp;quot;,&lt;br /&gt;
        [2] = &amp;quot;value2&amp;quot;,&lt;br /&gt;
        [3] = &amp;quot;value3&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    [2] = {&lt;br /&gt;
        [1] = &amp;quot;value4&amp;quot;,&lt;br /&gt;
        [2] = &amp;quot;value5&amp;quot;,&lt;br /&gt;
        [3] = &amp;quot;value6&amp;quot;,&lt;br /&gt;
    }, &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the array format is a lot more compact, but it also forces very specific keys on each field (namely numerical ones). Naturally, tables and arrays can be combined seamlessly, such that you can have a table of arrays or an array or tables (as well as more complicated setups).&lt;br /&gt;
&lt;br /&gt;
When you want to call various parts within a table or array, you can use the following syntax (we will base these on ''big_array'' and ''big_table''):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
big_table.small_table1        --returns the contents of small_table1&lt;br /&gt;
big_table[small_table1]       --identical to above&lt;br /&gt;
&lt;br /&gt;
big_table.small_table1.key1   --returns &amp;quot;value1&amp;quot;&lt;br /&gt;
big_table.small_table1[key1]  --identical to above&lt;br /&gt;
big_table[small_table1].key1  --identical to above&lt;br /&gt;
big_table[small_table1][key1] --identical to above&lt;br /&gt;
&lt;br /&gt;
big_array.1     --returns the contents of the first array in big_array&lt;br /&gt;
big_array[1]    --identical to above&lt;br /&gt;
&lt;br /&gt;
big_array.2.2   --returns &amp;quot;value5&amp;quot;&lt;br /&gt;
big_array.2[2]  --identical to above&lt;br /&gt;
big_array[2].2  --identical to above&lt;br /&gt;
big_array[2][2] --identical to above&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a matter of convention, we will write table-like extensions using the dot syntax and array-like extensions using the bracket syntax. (This is typically how other languages write their arrays and tables, and it is often a good idea to organize your code in such a manner so that it is easier to read when looking back at it.)&lt;br /&gt;
&lt;br /&gt;
Functions, like tables, are mostly known based on using parts of pre-defined object classes: in the case of functions, we should already be fairly familiar with their capabilities when calling engine hooks and API methods. The creation of a function is very simple, nearly identical to engine hooks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function sum_diff(arg1,arg2)&lt;br /&gt;
    val1 = arg1+arg2&lt;br /&gt;
    val2 = arg1-arg2&lt;br /&gt;
    return(val1,val2)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local add_diff = function(arg1,arg2) --this line is identical to the first line of the above function&lt;br /&gt;
    ....&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*First you must give the function a name: the above example is called '''sum_diff()'''.&lt;br /&gt;
*Next you must supply input arguments, if any. These are variables that can be used within the function, which is otherwise self-contained. That is to say, a function can't use any variables from anywhere else in your lua script unless they are given through the input arguments. The above example takes in two arguments, generically named ''arg1'' and ''arg2''.&lt;br /&gt;
*From here we add the script that is to be run when the function is called (this is usually what you concern yourself with when working with the engine hooks). In the above example, the sum of ''arg1'' and ''arg2'' is assigned to ''val1'', and their difference is assigned to ''val2''.&lt;br /&gt;
*Finally, we consider what the function should output. This can be accomplished in two ways when modding:&lt;br /&gt;
**You can simply provide outputs to the function using the return() core method. This immediately stops the function and sends outputs to the line that called the function. In the above example, ''val1'' and ''val2'' are returned. (Note that, when called, the script should contain some variables so that the return values are properly assigned.)&lt;br /&gt;
**You can manipulate objects. Since changing objects (such as their prototype) modify things on the engine side of the game, this can be done without having any particular outputs to the function. Even though the function is self-contained within your script, it can influence things not belonging to the script.&lt;br /&gt;
&lt;br /&gt;
If you want to call a function, use its name with the appropriate input and outputs. For the above example, you could call the function in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local num1 = 5&lt;br /&gt;
local num2 = 4&lt;br /&gt;
&lt;br /&gt;
local sum,diff = sum_diff(num1,num2)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''sum'' variable will have a value of 9, and the ''diff'' variable will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
In the Infinite Arena module, a large portion of the code is dedicated to constructing easy-to-read and well-organized tables, as well as functions that make use of them. The tables and functions will eventually be called in the engine hooks, which leaves us with a relatively small amount of run-time code to sift through. Ideally, modules should have a format in which much of the script is written not as a part of the core module, but as something that the core module will refer to.&lt;br /&gt;
&lt;br /&gt;
==Initialization Code==&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
====mobGenStats====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--customize min_lev/max_lev/weight of each enemy (defaults given)&lt;br /&gt;
--for names of beings, check Object IDs in the modding documentation&lt;br /&gt;
--be aware that JC auto-ends the game unless modified directly&lt;br /&gt;
local mobGenStats = {&lt;br /&gt;
    { being = &amp;quot;former&amp;quot;,         min_lev = 0,   max_lev = 12,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;sergeant&amp;quot;,       min_lev = 2,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;captain&amp;quot;,        min_lev = 8,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''mobGenStats'' is an array of tables: each table contains four fields relating to the being prototype. In each case, a being's identifier ''being'' is given, followed by a ''min_lev'', ''max_lev'', and ''weight'' (all generation parameters). The purpose of ''mobGenStats'' is to switch particular values for others in the being prototypes that already exist. Normally this can be done for a particular enemy with the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
beings.former.weight = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would change the ''weight'' key in the ''former'' table of the ''beings'' array (which holds all being prototypes) to zero, thereby removing the possibility of former humans appearing through standard generation procedures. However, if a modder wants to change many parameters at once, they can use what is done in the Infinite Arena. First is the creation of the above table, and then you use the table in a for loop as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes the generation stats of enemies based on mobGenStats&lt;br /&gt;
for _,v in ipairs(mobGenStats) do&lt;br /&gt;
    beings[v.being].min_lev = v.min_lev&lt;br /&gt;
    beings[v.being].max_lev = v.max_lev&lt;br /&gt;
    beings[v.being].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The conditional statement 'for a,b  in ipairs(array)' breaks down in the following way:&lt;br /&gt;
*''a'' is the iterator of the for loop itself (whenever the code repeats, ''a'' increases by one)&lt;br /&gt;
**As we have no need for a basic iterator, we leave it blank using an underscore.&lt;br /&gt;
*''b'' is the array iterator (directly calls the particular array, similarly increments)&lt;br /&gt;
*in '''ipairs()''' tells the for loop to iterate through values in an array&lt;br /&gt;
*''array'' is the array in question&lt;br /&gt;
&lt;br /&gt;
In this particular case, the loop iterates through each array and sets the being's ''min_lev'', ''max_lev'', and ''weight'' (as found in the being prototype) to the values as determined by ''mobGenStats''. ''v.being'' is the same as a being's identifier from ''mobGenStats'', which is how the loop iterates through all being prototypes. In this way all of the beings in the prototype array can be changed quickly without a bunch of lines specifying each key and value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--enemy scaling for each wave: note that game difficulty will modify scaling independently&lt;br /&gt;
local mob_scale_factor = 0.5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we have a variable that indicates the initial scaling of enemies. For the Infinite Arena, using the base game's scaling is probably too difficult for what a player at a given difficulty would expect, so it is cut in half by default.&lt;br /&gt;
&lt;br /&gt;
====itemGenStats====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--customize level/weight of items (defaults given)&lt;br /&gt;
--for names of items, check Object IDs in the modding documentation&lt;br /&gt;
local itemGenStats = {&lt;br /&gt;
    --Commons&lt;br /&gt;
    &lt;br /&gt;
    --weapons&lt;br /&gt;
    { item = &amp;quot;knife&amp;quot;,        level = 1,  weight = 640 },&lt;br /&gt;
    { item = &amp;quot;pistol&amp;quot;,       level = 1,  weight = 70  },&lt;br /&gt;
    { item = &amp;quot;shotgun&amp;quot;,      level = 2,  weight = 180 },&lt;br /&gt;
    ....&lt;br /&gt;
    --ammo/ammo packs&lt;br /&gt;
    ....&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    ....&lt;br /&gt;
    --consumables&lt;br /&gt;
    ....&lt;br /&gt;
    --powerups&lt;br /&gt;
    ....    &lt;br /&gt;
    --Exotics&lt;br /&gt;
    ....    &lt;br /&gt;
    --Uniques&lt;br /&gt;
    ....    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''itemGenStats'' is just like ''mobGenStats'', except that it is an array of tables regarding generation parameters for items. Note that ''mobGenStats'' and ''itemGenStats'' in the source set all of the monsters and items to their default settings, so there will be no difference between the generation in the base game and in the Infinite Arena unless the modder chooses to customize it personally. (''mobGenStats'' and ''itemGenStats'' are also shortened here: see Review for the full arrays.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes the generation stats of items based on itemGenStats&lt;br /&gt;
for _,v in ipairs(itemGenStats) do&lt;br /&gt;
    items[v.item].level  = v.level&lt;br /&gt;
    items[v.item].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with ''mobGenStats'', a for loop is used to run through all of the variables in the ''itemGenStats'' tables and change the prototypes to anything that the modder wishes to customize.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--item scaling for each wave&lt;br /&gt;
local item_scale_factor = 0.5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The item scaling is also dropped to scale properly with the drop in monster scaling. (Feel free to change these around for your own amusement, of course.)&lt;br /&gt;
&lt;br /&gt;
====anncrMsg and crowdMsg====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--add your own announcer lines here&lt;br /&gt;
local anncrMsg = {&lt;br /&gt;
    --displays whenever player completes wave&lt;br /&gt;
    success = {&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Congratulations mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Impressive mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Most impressive.&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;You are a formidable warrior!&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        ....&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        ....&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    --displays whenever player decides to continue to another wave&lt;br /&gt;
    choice = {&lt;br /&gt;
    ....&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''anncrMsg'' is the opposite of the generation variables: it is a table of arrays. There are two arrays within ''anncrMsg'' labeled ''success'' and ''choice'', each of which carry their own groups of variables. ''anncrMsg'' itself is called whenever the announcer displays a message (after the third wave), using either ''success'' (whenever the player completes the wave) or ''choose'' (whenever the player chooses to continue to the next wave). Since each group of strings should be handled separately, they are grouped separately, hence the need for a table of arrays.&lt;br /&gt;
&lt;br /&gt;
In addition, ''anncrMsg.success'' and ''anncrMsg.choose'' are an array of arrays themselves. The reason for this will be explained in '''build_announcerMsg()'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--add your own crowd lines here&lt;br /&gt;
--displays whenever enemy is killed&lt;br /&gt;
local crowdMsg = {&lt;br /&gt;
    &amp;quot;The crowd goes wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd hisses. \&amp;quot;We came for a REAL fight!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd boos. \&amp;quot;No skill, no kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By contrast, ''crowdMsg'' is a simple array of strings, called whenever a crowd message is necessary. Since the crowd only needs to be called in one case, only one group of strings is initialized, and so a table of arrays is no longer required.&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
====build_gear()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes player equipment&lt;br /&gt;
--add &amp;quot;nil&amp;quot; for any slot that should be empty&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
local function build_gear(weap,prep,body,foot)&lt;br /&gt;
    player.eq:clear()&lt;br /&gt;
    if weap then player.eq.weapon   = item.new(weap) end --main weapon&lt;br /&gt;
    if prep then player.eq.prepared = item.new(prep) end --prepared weapon	&lt;br /&gt;
    if body then player.eq.armor    = item.new(body) end --body armor&lt;br /&gt;
    if foot then player.eq.boots    = item.new(foot) end --boots&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''build_gear()''' is an example of a &amp;quot;helper function&amp;quot;, as it runs a procedure that could easily be reproduced in the run-time code but simplifies the input whenever the code needs to be modified. In this case, the function clears all of the player's equipment and potentially adds a new item in each slot. There are four inputs, each corresponding to a particular slot: if the value in an input argument is not nil, it then adds a new item to that player's equipment slot.&lt;br /&gt;
&lt;br /&gt;
In the run-time code, the player need only change the input variables rather than changing several lines. This may not appear very necessary for '''build_gear()''' but the concept of a helper function can make modifications to code much easier.&lt;br /&gt;
&lt;br /&gt;
====build_pack()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes player inventory&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
local function build_pack(itemPack)&lt;br /&gt;
    player.inv:clear()&lt;br /&gt;
    for _,part in ipairs(itemPack) do&lt;br /&gt;
        if items[part.name].type == ITEMTYPE_AMMO then&lt;br /&gt;
            --ammo is handled separately, loops for however many stacks are needed&lt;br /&gt;
            for n=1,math.ceil(part.amt/items[part.name].ammomax) do&lt;br /&gt;
                local pack = item.new(part.name)&lt;br /&gt;
                if part.amt &amp;lt; pack.ammomax then&lt;br /&gt;
                    --remainder (or single) stack&lt;br /&gt;
                    pack.ammo = part.amt&lt;br /&gt;
                else&lt;br /&gt;
                    --filled (and/or multiple) stacks&lt;br /&gt;
                    pack.ammo = pack.ammomax&lt;br /&gt;
                    part.amt = part.amt - pack.ammomax&lt;br /&gt;
                end&lt;br /&gt;
                player.inv:add(pack)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            --loops for however many items are needed&lt;br /&gt;
            for n=1,part.amt do&lt;br /&gt;
                player.inv:add(part.name)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''build_pack()''' is another helper function, this time clearing the inventory of the player and adding in new items there. It uses the &amp;quot;in '''ipairs()'''&amp;quot; iteration method to check all variables in an array in the following way:&lt;br /&gt;
&lt;br /&gt;
*if the item's ''type'' is ITEMTYPE_AMMO:&lt;br /&gt;
**a new for loop is run, iterating from 1 to ''ammonum''/''ammomax'' for the specific ammo (''ammonum'' currently being how much that the player's inventory receives)&lt;br /&gt;
**first, the new ammo stack is created&lt;br /&gt;
**if ''ammonum'' is less than the ammo's ''ammomax'':&lt;br /&gt;
***set the ammo stack equal to ''ammonum''&lt;br /&gt;
**otherwise:&lt;br /&gt;
***set the ammo stack equal to ''ammomax''&lt;br /&gt;
***subtract ''ammonum'' by ''ammomax''&lt;br /&gt;
**finally, add the ammo stack to the player's inventory (and this process repeats as necessary)&lt;br /&gt;
*if the item's ''type'' is not ITEMTYPE_AMMO:&lt;br /&gt;
**a new for loop is run, iterating as many times as items should be added for the particular item in question&lt;br /&gt;
**the item(s) are then added to the player's inventory, one by one&lt;br /&gt;
&lt;br /&gt;
The input requires an array of tables, although the format is rather simple. Here is an example of an input for '''build_pack()''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local itemPack = {&lt;br /&gt;
    {name = &amp;quot;chaingun&amp;quot;, amt = 1  }&lt;br /&gt;
    {name = &amp;quot;ammo&amp;quot;,     amt = 360}&lt;br /&gt;
    {name = &amp;quot;smed&amp;quot;,     amt = 5  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each table in the array requires only two fields: ''name'', which corresponds to the item's identifier, and ''amt'', which specifies how many of that item should be added. In the case of ammunition, the amount of ammo should be specified instead, as it is handled uniquely in order to produce an ideal number of stacks. The above example would add one chaingun, three 9mm ammo (x100) stacks, one 9mm ammo (x60) stack, and five small med-packs to the player's inventory. Keep in mind that the player can only hold 22 items, and any items added after 22 items have been added to the inventory will be disregarded.&lt;br /&gt;
&lt;br /&gt;
====build_announcerMsg()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function build_announcerMsg(MSG)&lt;br /&gt;
    for _,msgNum in ipairs(MSG) do&lt;br /&gt;
        ui.msg(table.random_pick(msgNum))&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''build_announcerMsg()''' function iterates through an array and selects a random index from a table within the array. The purpose of this simple function is to loop through a series of arrayed strings from ''anncrMsg'' and randomly pick strings from those arrays. '''build_announcerMsg'''(''anncrMsg.success'') sets up three random messages from each array in its array, and '''build_announcerMsg'''(''anncrMsg.choose'') sets up two random messages from each array in its array. (Setting up a lot of tables within tables can be confusing, but it becomes relatively simple as a means to organize variables together when compared to keeping track of each variable separately.)&lt;br /&gt;
&lt;br /&gt;
====get_corpses() and clear_corpses()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--initializes table of cells that only contains corpses&lt;br /&gt;
local corpseCells = {}&lt;br /&gt;
&lt;br /&gt;
local function get_corpses()&lt;br /&gt;
    for i = 1, #cells do&lt;br /&gt;
        if cells[i] and cells[i].flags then&lt;br /&gt;
            if cells[i].flag_set[CF_CORPSE] == true then&lt;br /&gt;
                table.insert(corpseCells, i) --i == sID's numeric value&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''get_corpses()''' is a quick function that creates a table, ''corpseCells'', and loops through all cells in the cell prototype array, selecting only those that contain the CF_CORPSE flag (indicating that the cell acts like a corpse) and adding it to ''corpseCells''. This method is often the most effective way to create a selective table of objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--removes corpses and blood-like cells&lt;br /&gt;
local function clear_corpses()&lt;br /&gt;
    --fade away all blood&lt;br /&gt;
    Generator.transmute(&amp;quot;blood&amp;quot;, &amp;quot;floor&amp;quot;)&lt;br /&gt;
    Generator.transmute(&amp;quot;bloodpool&amp;quot;, &amp;quot;blood&amp;quot;)&lt;br /&gt;
    --changes corpses to blood&lt;br /&gt;
    for i = 1, #corpseCells do&lt;br /&gt;
        Generator.transmute(corpseCells[i], &amp;quot;bloodpool&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''clear_corpses()'' puts our table of corpses to use by transmuting any cells contained in the table into the &amp;quot;bloodpool&amp;quot; cell. Additionally, all blood pools are changed to &amp;quot;blood&amp;quot; and all blood is changed to &amp;quot;floor&amp;quot;. This is added to the Infinite Arena so that a ridiculous number of corpses isn't around when Arch-vile enemies begin to show themselves.&lt;br /&gt;
&lt;br /&gt;
==Engine Hooks==&lt;br /&gt;
&lt;br /&gt;
===.run()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Creation of Infinite Arena&lt;br /&gt;
function inf_arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Infinite Arena&amp;quot;&lt;br /&gt;
    Level.name_number = 0&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)&lt;br /&gt;
    Generator.set_permanence(area.FULL)&lt;br /&gt;
    &lt;br /&gt;
    local translation = {&lt;br /&gt;
    [&amp;quot;.&amp;quot;] = &amp;quot;floor&amp;quot;,&lt;br /&gt;
    [&amp;quot;#&amp;quot;] = {&amp;quot;rwall&amp;quot;, LFPERMANENT = true},&lt;br /&gt;
    [&amp;quot;X&amp;quot;] = &amp;quot;rwall&amp;quot;,&lt;br /&gt;
    [&amp;quot;,&amp;quot;] = &amp;quot;blood&amp;quot;,&lt;br /&gt;
    [&amp;quot;&amp;gt;&amp;quot;] = &amp;quot;stairs&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
....,.......................................................................&lt;br /&gt;
.................................,...,......................................&lt;br /&gt;
.,.....................................,....................................&lt;br /&gt;
..,&amp;gt;.,..........................,...........................................&lt;br /&gt;
.,..,.................................,.,...................................&lt;br /&gt;
................................,..,...,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
]]&lt;br /&gt;
    --change up the column types&lt;br /&gt;
    local column = {&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,XXXX.&lt;br /&gt;
.X##X,&lt;br /&gt;
.XXXX.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,X##X.&lt;br /&gt;
.####,&lt;br /&gt;
.X##X.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]]&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    Level.place_tile(translation,map,2,2)&lt;br /&gt;
    for i=1,11 + math.random(4) do&lt;br /&gt;
        Level.scatter_put( area.new(5,3,68,15), translation, table.random_pick(column), &amp;quot;floor&amp;quot;, 1)&lt;br /&gt;
    end&lt;br /&gt;
    Level.scatter(area.FULL_SHRINKED, &amp;quot;floor&amp;quot;, &amp;quot;blood&amp;quot;, 100)&lt;br /&gt;
    Level.player(38, 10)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''run()''' hook is very similar to that of the Hell's Arena one. In fact, other than the name change, the only real difference is that the ''column'' string has now been expanded to an array of strings, corresponding to an array of pillars. In order to randomly select pillars, '''Level.scatter_put()''' must be iterated a number of times, adding only one pillar each time: then, by adding the '''table.random_pick()''' method to the tiles-to-be-added argument, it randomly selects one of the pillars in the ''column'' array. The result is that the columns randomly have varying degrees of destructibility.&lt;br /&gt;
&lt;br /&gt;
===.OnEnter()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnEnter()&lt;br /&gt;
    --inventory table used for build_pack()&lt;br /&gt;
    local itemPack = {&lt;br /&gt;
        {name = &amp;quot;smed&amp;quot;,  amt = 2},&lt;br /&gt;
        {name = &amp;quot;shell&amp;quot;, amt = 50},&lt;br /&gt;
    }&lt;br /&gt;
    --set up starting eq/inv&lt;br /&gt;
    build_gear(&amp;quot;shotgun&amp;quot;,&amp;quot;pistol&amp;quot;,nil,nil)&lt;br /&gt;
    build_pack(itemPack)&lt;br /&gt;
    &lt;br /&gt;
    --Print announcer messages&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces: \&amp;quot;Welcome to Hell's Arena, mortal! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;You are either very brave or very foolish. Either way I like it! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;And so do the crowds!\&amp;quot; Suddenly you hear screams everywhere! &amp;quot; ..&lt;br /&gt;
	   &amp;quot;\&amp;quot;Blood! Blood! BLOOD!\&amp;quot; \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --spawn first wave&lt;br /&gt;
    Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    Level.result(1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnEnter()''' makes significant use of the helper functions, using '''build_gear()''' and '''build_pack()''' to initialize the player's starting equipment and inventory. Besides the itemPack array, this only takes two lines of code, producing a much cleaner and more organized routine than in the original Hell's Arena.&lt;br /&gt;
&lt;br /&gt;
In addition, rather than directly spawning enemies using the '''Level.summon()''' method, we imitate the base game's generation code by combining '''Generator.being_weight()''', which outputs the danger level for a given map level, and '''Level.flood_monsters()''', which randomly drops enemies on the level for a given danger level. Additionally, the ''mob_scale_factor'' variable is used to change the danger level, thereby changing the scaling of the first wave.&lt;br /&gt;
&lt;br /&gt;
===.OnKill()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnKill(being)&lt;br /&gt;
    --random message from crowdMsg array&lt;br /&gt;
    ui.msg(table.random_pick(crowdMsg))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnKill()''' does exactly the same thing as the one from Hell's Arena, except that the crowd messages have been tabulated and '''table.random_pick()''' is used to choose from one of said messages. Technically, '''build_announcerMsg()''' would also work here, but since both would only require one line of code, it may as well be the simplest one to understand.&lt;br /&gt;
&lt;br /&gt;
===.OnKillAll()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnKillAll()&lt;br /&gt;
    --print more announcer stuff&lt;br /&gt;
    if Level.result() == 1 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you are, &amp;quot; ..&lt;br /&gt;
               &amp;quot;you show some determination.\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; The voice continues, \&amp;quot;I can now &amp;quot; ..&lt;br /&gt;
               &amp;quot;let you go free, or you may try to complete the challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    elseif Level.result() == 2 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination to &amp;quot; ..&lt;br /&gt;
               &amp;quot;survive makes me excited!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; \&amp;quot;I can let you go now, and give you &amp;quot; ..&lt;br /&gt;
               &amp;quot;a small reward, or you can choose to fight an additional challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        --random message from anncrMsg.success array&lt;br /&gt;
        build_announcerMsg(anncrMsg.success)&lt;br /&gt;
    end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
'''OnKillAll()''' has received some simplifications similar to '''OnEnter'''. To start, after the first two waves, rather than dealing with an large number of random messages here, all of it is called from the previous ''anncrMsg'' table and the '''build_announcerMsg()''' function, which randomly picks a string from an array strings, then iterates through the entire array of arrays. In the displayed run-time code, this amounts of a single line (although it is actually running quite a few lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    local choice = ui.msg_confirm(&amp;quot;Round &amp;quot; .. Level.result() + 1 .. &amp;quot; awaits. &amp;quot; ..&lt;br /&gt;
                                  &amp;quot;Do you want to continue the fight?&amp;quot;)&lt;br /&gt;
    if choice == true then --continuing&lt;br /&gt;
        --random message from anncrMsg.choice array&lt;br /&gt;
        build_announcerMsg(anncrMsg.choice)&lt;br /&gt;
        --set up the danger level for the next wave&lt;br /&gt;
        Level.result(Level.result() + 1);&lt;br /&gt;
        Level.danger_level = Level.result();&lt;br /&gt;
        --spawn items for next wave&lt;br /&gt;
        Level.flood_items(Generator.item_amount()*item_scale_factor)&lt;br /&gt;
        --spawn enemies for next wave&lt;br /&gt;
        Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon choosing to continue, we use '''build_announcerMsg()''' for more messages (again, only a single line of code). Then, we increment the level by one and increase the ''danger_level'' using the amount from '''Level.result()'''. (''Level.danger_level'' is actually a property of the level object.) Finally, we use the increased danger level to add items and monsters. '''Level.flood_items(Generator.item_amount())''' is the item equivalent of '''Level.flood_monsters(Generator.being_weight())'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    else --quitting&lt;br /&gt;
        if Level.result() == 1 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
                   &amp;quot;\&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() == 2 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot; ..&lt;br /&gt;
                   &amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() &amp;lt; 10 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;An impressive run, Mortal!  We appreciate &amp;quot; ..&lt;br /&gt;
                   &amp;quot;it!\&amp;quot; The crowd starts to chant! \&amp;quot;Encore! Encore!\&amp;quot;&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;\&amp;quot;Ladies and gentlemen, your champion, &amp;quot;&lt;br /&gt;
                   .. Player.get_name() .. &amp;quot;. He survived &amp;quot; .. Level.result() ..&lt;br /&gt;
                   &amp;quot; rounds in our arena! That has to be some sort of record. &amp;quot; ..&lt;br /&gt;
                   &amp;quot;Give him a hand folks!\&amp;quot; The crowd starts to chant your name &amp;quot; ..&lt;br /&gt;
                   &amp;quot;and they begin throwing items into the ring!&amp;quot;)&lt;br /&gt;
            Level.flood_items(Generator.item_weight())&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Upon choosing not to continue, the announcer displays a variety of messages, although they are few enough (and specific enough) not to create another array for them. (They CAN be tabulated, but it is less bulky than for the other cases.) If the player survived at least ten waves before stopping, the crowd &amp;quot;throws items onto the stage&amp;quot; and you get some pointless gear when you're done, just as before.&lt;br /&gt;
&lt;br /&gt;
===.OnExit()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnExit()&lt;br /&gt;
    if Level.result() &amp;lt; 10 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Remember to come back once you return to Hell &amp;quot; ..&lt;br /&gt;
               &amp;quot;for the extended stay\&amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    --used in .OnMortem()&lt;br /&gt;
    inf_arena.result = &amp;quot;had enough of the gauntlet at wave &amp;quot;..Level.result()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnExit()''' has only gained a cosmetic change in the case where the player survived more than ten waves before retreating.&lt;br /&gt;
&lt;br /&gt;
===.OnMortem()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby --calls kill descriptions from beings&lt;br /&gt;
    if inf_arena.result then kill = inf_arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, had enough of the gauntlet at wave 8&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Infinite Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with '''OnExit()''', '''OnMortem()''' only changes some of the text in the mortem depending on how the player ends the game.&lt;br /&gt;
&lt;br /&gt;
==Review==&lt;br /&gt;
The following is the entire source code for the Infinite Arena.&lt;br /&gt;
{{:Modding:Tutorial/The_Infinite_Arena/Source}}&lt;br /&gt;
&lt;br /&gt;
Source data: [http://dl.dropbox.com/u/54818507/inf_arena.module.zip inf_arena.module]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena/Source</id>
		<title>Modding:Tutorial/The Infinite Arena/Source</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena/Source"/>
				<updated>2012-04-08T16:48:38Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: forgot source tags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
core.declare(&amp;quot;inf_arena&amp;quot;, {} )&lt;br /&gt;
&lt;br /&gt;
--enemy scaling for each wave: note that game difficulty will modify scaling independently&lt;br /&gt;
local mob_scale_factor = 0.5&lt;br /&gt;
--customize min_lev/max_lev/weight of each enemy (defaults given)&lt;br /&gt;
--for names of beings, check Object IDs in the modding documentation&lt;br /&gt;
--be aware that JC auto-ends the game unless modified directly&lt;br /&gt;
local mobGenStats = {&lt;br /&gt;
    { being = &amp;quot;former&amp;quot;,         min_lev = 0,   max_lev = 12,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;sergeant&amp;quot;,       min_lev = 2,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;captain&amp;quot;,        min_lev = 8,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;imp&amp;quot;,            min_lev = 0,   max_lev = 17,  weight = 8  },&lt;br /&gt;
    { being = &amp;quot;demon&amp;quot;,          min_lev = 4,   max_lev = 20,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;lostsoul&amp;quot;,       min_lev = 6,   max_lev = 16,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;knight&amp;quot;,         min_lev = 9,   max_lev = 15,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;cacodemon&amp;quot;,      min_lev = 10,  max_lev = 50,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;commando&amp;quot;,       min_lev = 12,  max_lev = 17,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;pain&amp;quot;,           min_lev = 12,  max_lev = 17,  weight = 2  },&lt;br /&gt;
    { being = &amp;quot;baron&amp;quot;,          min_lev = 12,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;arachno&amp;quot;,        min_lev = 13,  max_lev = 50,  weight = 4  },&lt;br /&gt;
    { being = &amp;quot;revenant&amp;quot;,       min_lev = 13,  max_lev = 200, weight = 5  },&lt;br /&gt;
    { being = &amp;quot;mancubus&amp;quot;,       min_lev = 15,  max_lev = 200, weight = 7  },&lt;br /&gt;
    { being = &amp;quot;arch&amp;quot;,           min_lev = 16,  max_lev = 200, weight = 4  },&lt;br /&gt;
    { being = &amp;quot;nimp&amp;quot;,           min_lev = 30,  max_lev = 60,  weight = 8  },&lt;br /&gt;
    { being = &amp;quot;ndemon&amp;quot;,         min_lev = 40,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;ncacodemon&amp;quot;,     min_lev = 51,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;narachno&amp;quot;,       min_lev = 50,  max_lev = 200, weight = 5  },&lt;br /&gt;
    { being = &amp;quot;narch&amp;quot;,          min_lev = 90,  max_lev = 200, weight = 3  },&lt;br /&gt;
    { being = &amp;quot;bruiser&amp;quot;,        min_lev = 50,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;lava_elemental&amp;quot;, min_lev = 70,  max_lev = 200, weight = 1  },&lt;br /&gt;
    { being = &amp;quot;shambler&amp;quot;,       min_lev = 80,  max_lev = 200, weight = 3  },&lt;br /&gt;
    { being = &amp;quot;agony&amp;quot;,          min_lev = 80,  max_lev = 200, weight = 1  },&lt;br /&gt;
    { being = &amp;quot;cyberdemon&amp;quot;,     min_lev = 80,  max_lev = 200, weight = 1  },&lt;br /&gt;
    { being = &amp;quot;arenamaster&amp;quot;,    min_lev = 0,   max_lev = 0,   weight = 0  },&lt;br /&gt;
    { being = &amp;quot;angel&amp;quot;,          min_lev = 0,   max_lev = 0,   weight = 0  },&lt;br /&gt;
    { being = &amp;quot;jc&amp;quot;,             min_lev = 0,   max_lev = 0,   weight = 0  },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--item scaling for each wave&lt;br /&gt;
local item_scale_factor = 0.5&lt;br /&gt;
--customize level/weight of items (defaults given)&lt;br /&gt;
--for names of items, check Object IDs in the modding documentation&lt;br /&gt;
local itemGenStats = {&lt;br /&gt;
    --Commons&lt;br /&gt;
    &lt;br /&gt;
    --weapons&lt;br /&gt;
    { item = &amp;quot;knife&amp;quot;,        level = 1,  weight = 640 },&lt;br /&gt;
    { item = &amp;quot;pistol&amp;quot;,       level = 1,  weight = 70  },&lt;br /&gt;
    { item = &amp;quot;shotgun&amp;quot;,      level = 2,  weight = 180 },&lt;br /&gt;
    { item = &amp;quot;ashotgun&amp;quot;,     level = 2,  weight = 160 },&lt;br /&gt;
    { item = &amp;quot;dshotgun&amp;quot;,     level = 4,  weight = 100 },&lt;br /&gt;
    { item = &amp;quot;chaingun&amp;quot;,     level = 5,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;bazooka&amp;quot;,      level = 7,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;plasma&amp;quot;,       level = 12, weight = 70  },&lt;br /&gt;
    --ammo/ammo packs&lt;br /&gt;
    { item = &amp;quot;ammo&amp;quot;,         level = 1,  weight = 500 },&lt;br /&gt;
    { item = &amp;quot;pammo&amp;quot;,        level = 3,  weight = 700 },&lt;br /&gt;
    { item = &amp;quot;shell&amp;quot;,        level = 2,  weight = 400 },&lt;br /&gt;
    { item = &amp;quot;pshell&amp;quot;,       level = 4,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;rocket&amp;quot;,       level = 5,  weight = 60  },&lt;br /&gt;
    { item = &amp;quot;procket&amp;quot;,      level = 7,  weight = 60  },&lt;br /&gt;
    { item = &amp;quot;cell&amp;quot;,         level = 8,  weight = 36  },&lt;br /&gt;
    { item = &amp;quot;pcell&amp;quot;,        level = 10, weight = 18  },&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    { item = &amp;quot;garmor&amp;quot;,       level = 1,  weight = 400 },&lt;br /&gt;
    { item = &amp;quot;barmor&amp;quot;,       level = 4,  weight = 240 },&lt;br /&gt;
    { item = &amp;quot;rarmor&amp;quot;,       level = 7,  weight = 150 },&lt;br /&gt;
    { item = &amp;quot;sboots&amp;quot;,       level = 4,  weight = 240 },&lt;br /&gt;
    { item = &amp;quot;pboots&amp;quot;,       level = 7,  weight = 150 },&lt;br /&gt;
    { item = &amp;quot;psboots&amp;quot;,      level = 11, weight = 80  },&lt;br /&gt;
    --consumables&lt;br /&gt;
    { item = &amp;quot;smed&amp;quot;,         level = 1,  weight = 600 },&lt;br /&gt;
    { item = &amp;quot;lmed&amp;quot;,         level = 5,  weight = 400 },&lt;br /&gt;
    { item = &amp;quot;phase&amp;quot;,        level = 5,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;hphase&amp;quot;,       level = 7,  weight = 100 },&lt;br /&gt;
    { item = &amp;quot;epack&amp;quot;,        level = 5,  weight = 100 },&lt;br /&gt;
    { item = &amp;quot;nuke&amp;quot;,         level = 10, weight = 40  },&lt;br /&gt;
    { item = &amp;quot;lava_element&amp;quot;, level = 23, weight = 0   },&lt;br /&gt;
    { item = &amp;quot;mod_power&amp;quot;,    level = 7,  weight = 120 },&lt;br /&gt;
    { item = &amp;quot;mod_tech&amp;quot;,     level = 6,  weight = 120 },&lt;br /&gt;
    { item = &amp;quot;mod_bulk&amp;quot;,     level = 6,  weight = 120 },&lt;br /&gt;
    { item = &amp;quot;mod_agility&amp;quot;,  level = 5,  weight = 120 },&lt;br /&gt;
    --powerups&lt;br /&gt;
    { item = &amp;quot;shglobe&amp;quot;,      level = 1,  weight = 900 },&lt;br /&gt;
    { item = &amp;quot;lhglobe&amp;quot;,      level = 6,  weight = 330 },&lt;br /&gt;
    { item = &amp;quot;scglobe&amp;quot;,      level = 4,  weight = 150 },&lt;br /&gt;
    { item = &amp;quot;bpack&amp;quot;,        level = 1,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;iglobe&amp;quot;,       level = 7,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;msglobe&amp;quot;,      level = 16, weight = 60  },&lt;br /&gt;
    { item = &amp;quot;map&amp;quot;,          level = 1,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;pmap&amp;quot;,         level = 1,  weight = 80  },&lt;br /&gt;
    { item = &amp;quot;ashard&amp;quot;,       level = 5,  weight = 700 },&lt;br /&gt;
    { item = &amp;quot;backpack&amp;quot;,     level = 7,  weight = 0   },&lt;br /&gt;
    &lt;br /&gt;
    --Exotics&lt;br /&gt;
    &lt;br /&gt;
    --weapons&lt;br /&gt;
    { item = &amp;quot;chainsaw&amp;quot;,        level = 12, weight = 3  },&lt;br /&gt;
    { item = &amp;quot;ublaster&amp;quot;,        level = 8,  weight = 2  },&lt;br /&gt;
    { item = &amp;quot;ucpistol&amp;quot;,        level = 4,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;uashotgun&amp;quot;,       level = 6,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;upshotgun&amp;quot;,       level = 12, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;udshotgun&amp;quot;,       level = 10, weight = 5  },&lt;br /&gt;
    { item = &amp;quot;uminigun&amp;quot;,        level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;umbazooka&amp;quot;,       level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;unapalm&amp;quot;,         level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ulaser&amp;quot;,          level = 12, weight = 5  },&lt;br /&gt;
    { item = &amp;quot;unplasma&amp;quot;,        level = 15, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;utristar&amp;quot;,        level = 12, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;bfg9000&amp;quot;,         level = 20, weight = 2  },&lt;br /&gt;
    { item = &amp;quot;unbfg9000&amp;quot;,       level = 22, weight = 2  },&lt;br /&gt;
    { item = &amp;quot;utrans&amp;quot;,          level = 14, weight = 3  },&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    { item = &amp;quot;uoarmor&amp;quot;,         level = 7,  weight = 4  },&lt;br /&gt;
    { item = &amp;quot;uparmor&amp;quot;,         level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;upboots&amp;quot;,         level = 8,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ugarmor&amp;quot;,         level = 15, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ugboots&amp;quot;,         level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;umedarmor&amp;quot;,       level = 5,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;uduelarmor&amp;quot;,      level = 5,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ubulletarmor&amp;quot;,    level = 2,  weight = 4  },&lt;br /&gt;
    { item = &amp;quot;uballisticarmor&amp;quot;, level = 2,  weight = 5  },&lt;br /&gt;
    { item = &amp;quot;ueshieldarmor&amp;quot;,   level = 5,  weight = 3  },&lt;br /&gt;
    { item = &amp;quot;uplasmashield&amp;quot;,   level = 10, weight = 3  },&lt;br /&gt;
    { item = &amp;quot;uenergyshield&amp;quot;,   level = 8,  weight = 3  },&lt;br /&gt;
    { item = &amp;quot;ubalshield&amp;quot;,      level = 6,  weight = 3  },&lt;br /&gt;
    { item = &amp;quot;uacidboots&amp;quot;,      level = 8,  weight = 5  },&lt;br /&gt;
    --consumables&lt;br /&gt;
    { item = &amp;quot;uswpack&amp;quot;,         level = 5,  weight = 10 },&lt;br /&gt;
    { item = &amp;quot;ubskull&amp;quot;,         level = 5,  weight = 8  },&lt;br /&gt;
    { item = &amp;quot;ufskull&amp;quot;,         level = 7,  weight = 8  },&lt;br /&gt;
    { item = &amp;quot;uhskull&amp;quot;,         level = 9,  weight = 8  },&lt;br /&gt;
    { item = &amp;quot;umod_firestorm&amp;quot;,  level = 10, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;umod_sniper&amp;quot;,     level = 10, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;umod_nano&amp;quot;,       level = 10, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;umod_onyx&amp;quot;,       level = 10, weight = 4  },&lt;br /&gt;
    &lt;br /&gt;
    --Uniques&lt;br /&gt;
    &lt;br /&gt;
    --weapons	&lt;br /&gt;
    { item = &amp;quot;ubutcher&amp;quot;,     level = 1,  weight = 2 },&lt;br /&gt;
    { item = &amp;quot;spear&amp;quot;,        level = 16, weight = 0 },&lt;br /&gt;
    { item = &amp;quot;uscythe&amp;quot;,      level = 16, weight = 0 },&lt;br /&gt;
    { item = &amp;quot;udragon&amp;quot;,      level = 16, weight = 1 },&lt;br /&gt;
    { item = &amp;quot;utrigun&amp;quot;,      level = 8,  weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ujackal&amp;quot;,      level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uberetta&amp;quot;,     level = 6,  weight = 3 },&lt;br /&gt;
    { item = &amp;quot;usjack&amp;quot;,       level = 12, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;urbazooka&amp;quot;,    level = 12, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uacid&amp;quot;,        level = 12, weight = 3 },&lt;br /&gt;
    { item = &amp;quot;urailgun&amp;quot;,     level = 15, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ubfg10k&amp;quot;,      level = 20, weight = 1 },&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    { item = &amp;quot;umarmor&amp;quot;,      level = 15, weight = 3 },&lt;br /&gt;
    { item = &amp;quot;ucarmor&amp;quot;,      level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;unarmor&amp;quot;,      level = 10, weight = 3 },&lt;br /&gt;
    { item = &amp;quot;umedparmor&amp;quot;,   level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ulavaarmor&amp;quot;,   level = 12, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uenviroboots&amp;quot;, level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ushieldarmor&amp;quot;, level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uberarmor&amp;quot;,    level = 10, weight = 1 },&lt;br /&gt;
    { item = &amp;quot;aarmor&amp;quot;,       level = 22, weight = 0 },&lt;br /&gt;
    --consumables&lt;br /&gt;
    { item = &amp;quot;uhwpack&amp;quot;,      level = 10, weight = 4 },&lt;br /&gt;
    { item = &amp;quot;umodstaff&amp;quot;,    level = 15, weight = 4 },&lt;br /&gt;
    { item = &amp;quot;uarenastaff&amp;quot;,  level = 4,  weight = 0 },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--changes the generation stats of enemies based on mobGenStats&lt;br /&gt;
for _,v in ipairs(mobGenStats) do&lt;br /&gt;
    beings[v.being].min_lev = v.min_lev&lt;br /&gt;
    beings[v.being].max_lev = v.max_lev&lt;br /&gt;
    beings[v.being].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--changes the generation stats of items based on itemGenStats&lt;br /&gt;
for _,v in ipairs(itemGenStats) do&lt;br /&gt;
    items[v.item].level  = v.level&lt;br /&gt;
    items[v.item].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--add your own announcer lines here&lt;br /&gt;
local anncrMsg = {&lt;br /&gt;
    --displays whenever player completes wave&lt;br /&gt;
    success = {&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Congratulations mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Impressive mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Most impressive.&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;You are a formidable warrior!&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;Each of your triumphs is a work of art!&amp;quot;,&lt;br /&gt;
        &amp;quot;Your ability to survive is incredible!&amp;quot;,&lt;br /&gt;
        &amp;quot;You've given us a great show!&amp;quot;,&lt;br /&gt;
        &amp;quot;You would make a terrific hell warrior!&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;But can you keep going?\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;How much longer can you go?\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;Will you fight with us a little more?\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;I can let you go now if you like, or...\&amp;quot;&amp;quot;,&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    --displays whenever player decides to continue to another wave&lt;br /&gt;
    choice = {&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;I like it! Let the show go on!\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Excellent! May the fight begin!!!\&amp;quot;&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;You hear screams everywhere! \&amp;quot;Kill, Kill, KILL!\&amp;quot;&amp;quot;,&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--add your own crowd lines here&lt;br /&gt;
--displays whenever enemy is killed&lt;br /&gt;
local crowdMsg = {&lt;br /&gt;
    &amp;quot;The crowd goes wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd hisses. \&amp;quot;We came for a REAL fight!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd boos. \&amp;quot;No skill, no kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function build_announcerMsg(MSG)&lt;br /&gt;
    for _,msgNum in ipairs(MSG) do&lt;br /&gt;
        ui.msg(table.random_pick(msgNum))&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--from Skulltag Arena, credit goes to yaflhdztioxo&lt;br /&gt;
--initializes table of cells that contains only corpses&lt;br /&gt;
local corpseCells = {}&lt;br /&gt;
&lt;br /&gt;
local function get_corpses()&lt;br /&gt;
    for i = 1, #cells do&lt;br /&gt;
        if cells[i] and cells[i].flags then&lt;br /&gt;
            if cells[i].flag_set[CF_CORPSE] == true then&lt;br /&gt;
                table.insert(corpseCells, i) --i == sID's numeric value&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--removes corpses and blood-like cells&lt;br /&gt;
local function clear_corpses()&lt;br /&gt;
    --fade away all blood&lt;br /&gt;
    Generator.transmute(&amp;quot;blood&amp;quot;, &amp;quot;floor&amp;quot;)&lt;br /&gt;
    Generator.transmute(&amp;quot;bloodpool&amp;quot;, &amp;quot;blood&amp;quot;)&lt;br /&gt;
    --changes corpses to blood&lt;br /&gt;
    for i = 1, #corpseCells do&lt;br /&gt;
        Generator.transmute(corpseCells[i], &amp;quot;bloodpool&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--changes player equipment&lt;br /&gt;
--add &amp;quot;nil&amp;quot; for any slot that should be empty&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
local function build_gear(weap,prep,body,foot)&lt;br /&gt;
    player.eq:clear()&lt;br /&gt;
    if weap then player.eq.weapon   = item.new(weap) end --main weapon&lt;br /&gt;
    if prep then player.eq.prepared = item.new(prep) end --prepared weapon	&lt;br /&gt;
    if body then player.eq.armor    = item.new(body) end --body armor&lt;br /&gt;
    if foot then player.eq.boots    = item.new(foot) end --boots&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--changes player inventory&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
--[[&lt;br /&gt;
input is an array of tables with two fields:&lt;br /&gt;
-name is the identifier of the item that goes in the inventory&lt;br /&gt;
-amt is how many items should be added (or how many units of ammo)&lt;br /&gt;
example table (based on default inventory):&lt;br /&gt;
&lt;br /&gt;
local starter_pack = {&lt;br /&gt;
    {name = &amp;quot;ammo&amp;quot;, amt = 24},&lt;br /&gt;
    {name = &amp;quot;smed&amp;quot;, amt = 2},&lt;br /&gt;
}&lt;br /&gt;
--]]&lt;br /&gt;
local function build_pack(itemPack)&lt;br /&gt;
    player.inv:clear()&lt;br /&gt;
    for _,part in ipairs(itemPack) do&lt;br /&gt;
        if items[part.name].type == ITEMTYPE_AMMO then&lt;br /&gt;
            --ammo is handled separately, loops for however many stacks are needed&lt;br /&gt;
            for n=1,math.ceil(part.amt/items[part.name].ammomax) do&lt;br /&gt;
                local pack = item.new(part.name)&lt;br /&gt;
                if part.amt &amp;lt; pack.ammomax then&lt;br /&gt;
                    --remainder (or single) stack&lt;br /&gt;
                    pack.ammo = part.amt&lt;br /&gt;
                else&lt;br /&gt;
                    --filled (and/or multiple) stacks&lt;br /&gt;
                    pack.ammo = pack.ammomax&lt;br /&gt;
                    part.amt = part.amt - pack.ammomax&lt;br /&gt;
                end&lt;br /&gt;
                player.inv:add(pack)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            --loops for however many items are needed&lt;br /&gt;
            for n=1,part.amt do&lt;br /&gt;
                player.inv:add(part.name)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnEnter()&lt;br /&gt;
    --inventory table used for build_pack()&lt;br /&gt;
    local itemPack = {&lt;br /&gt;
        {name = &amp;quot;smed&amp;quot;,  amt = 2},&lt;br /&gt;
        {name = &amp;quot;shell&amp;quot;, amt = 50},&lt;br /&gt;
    }&lt;br /&gt;
    --set up starting eq/inv&lt;br /&gt;
    build_gear(&amp;quot;shotgun&amp;quot;,&amp;quot;pistol&amp;quot;,nil,nil)&lt;br /&gt;
    build_pack(itemPack)&lt;br /&gt;
    &lt;br /&gt;
    --Print announcer messages&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces: \&amp;quot;Welcome to Hell's Arena, mortal! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;You are either very brave or very foolish. Either way I like it! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;And so do the crowds!\&amp;quot; Suddenly you hear screams everywhere! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;Blood! Blood! BLOOD!\&amp;quot; \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --spawn first wave&lt;br /&gt;
    Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    Level.result(1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnKill(being)&lt;br /&gt;
    --random message from crowdMsg array&lt;br /&gt;
    ui.msg(table.random_pick(crowdMsg))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnKillAll()&lt;br /&gt;
    --print more announcer stuff&lt;br /&gt;
    if Level.result() == 1 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you are, &amp;quot; ..&lt;br /&gt;
               &amp;quot;you show some determination.\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; The voice continues, \&amp;quot;I can now &amp;quot; ..&lt;br /&gt;
               &amp;quot;let you go free, or you may try to complete the challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    elseif Level.result() == 2 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination to &amp;quot; ..&lt;br /&gt;
               &amp;quot;survive makes me excited!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; \&amp;quot;I can let you go now, and give you &amp;quot; ..&lt;br /&gt;
               &amp;quot;a small reward, or you can choose to fight an additional challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        --random message from anncrMsg.success array&lt;br /&gt;
        build_announcerMsg(anncrMsg.success)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local choice = ui.msg_confirm(&amp;quot;Round &amp;quot; .. Level.result() + 1 .. &amp;quot; awaits. &amp;quot; ..&lt;br /&gt;
                                  &amp;quot;Do you want to continue the fight?&amp;quot;)&lt;br /&gt;
    if choice == true then --continuing&lt;br /&gt;
        --random message from anncrMsg.choice array&lt;br /&gt;
        build_announcerMsg(anncrMsg.choice)&lt;br /&gt;
        --set up the danger level for the next wave&lt;br /&gt;
        Level.result(Level.result() + 1);&lt;br /&gt;
        Level.danger_level = Level.result();&lt;br /&gt;
        --spawn items for next wave&lt;br /&gt;
        Level.flood_items(Generator.item_amount()*item_scale_factor)&lt;br /&gt;
        --spawn enemies for next wave&lt;br /&gt;
        Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    &lt;br /&gt;
    else --quitting&lt;br /&gt;
        if Level.result() == 1 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
                   &amp;quot;\&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() == 2 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot; ..&lt;br /&gt;
                   &amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() &amp;lt; 10 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;An impressive run, Mortal!  We appreciate &amp;quot; ..&lt;br /&gt;
                   &amp;quot;it!\&amp;quot; The crowd starts to chant! \&amp;quot;Encore! Encore!\&amp;quot;&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;\&amp;quot;Ladies and gentlemen, your champion, &amp;quot;&lt;br /&gt;
                   .. Player.get_name() .. &amp;quot;. He survived &amp;quot; .. Level.result() ..&lt;br /&gt;
                   &amp;quot; rounds in our arena! That has to be some sort of record. &amp;quot; ..&lt;br /&gt;
                   &amp;quot;Give him a hand folks!\&amp;quot; The crowd starts to chant your name &amp;quot; ..&lt;br /&gt;
                   &amp;quot;and they begin throwing items into the ring!&amp;quot;)&lt;br /&gt;
            Level.flood_items(Generator.item_weight())&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnExit()&lt;br /&gt;
    if Level.result() &amp;lt; 10 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Remember to come back once you return to Hell &amp;quot; ..&lt;br /&gt;
               &amp;quot;for the extended stay\&amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    --used in .OnMortem()&lt;br /&gt;
    inf_arena.result = &amp;quot;had enough of the gauntlet at wave &amp;quot;..Level.result()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby --calls kill descriptions from beings&lt;br /&gt;
    if inf_arena.result then kill = inf_arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, had enough of the gauntlet at wave 8&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Infinite Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Creation of Infinite Arena&lt;br /&gt;
function inf_arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Infinite Arena&amp;quot;&lt;br /&gt;
    Level.name_number = 0&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    local translation = {&lt;br /&gt;
    [&amp;quot;.&amp;quot;] = &amp;quot;floor&amp;quot;,&lt;br /&gt;
    [&amp;quot;#&amp;quot;] = {&amp;quot;rwall&amp;quot;, LFPERMANENT = true},&lt;br /&gt;
    [&amp;quot;X&amp;quot;] = &amp;quot;rwall&amp;quot;,&lt;br /&gt;
    [&amp;quot;,&amp;quot;] = &amp;quot;blood&amp;quot;,&lt;br /&gt;
    [&amp;quot;&amp;gt;&amp;quot;] = &amp;quot;stairs&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
....,.......................................................................&lt;br /&gt;
.................................,...,......................................&lt;br /&gt;
.,.....................................,....................................&lt;br /&gt;
..,&amp;gt;.,..........................,...........................................&lt;br /&gt;
.,..,.................................,.,...................................&lt;br /&gt;
................................,..,...,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
]]&lt;br /&gt;
    --change up the column types&lt;br /&gt;
    local column = {&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,XXXX.&lt;br /&gt;
.X##X,&lt;br /&gt;
.XXXX.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,X##X.&lt;br /&gt;
.####,&lt;br /&gt;
.X##X.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]]&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    Level.place_tile(translation,map,2,2)&lt;br /&gt;
    for i=1,11 + math.random(4) do&lt;br /&gt;
        Level.scatter_put( area.new(5,3,68,15), translation, table.random_pick(column), &amp;quot;floor&amp;quot;, 1)&lt;br /&gt;
    end&lt;br /&gt;
    Level.scatter(area.FULL_SHRINKED, &amp;quot;floor&amp;quot;, &amp;quot;blood&amp;quot;, 100)&lt;br /&gt;
    Level.player(38, 10)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena/Source</id>
		<title>Modding:Tutorial/The Infinite Arena/Source</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena/Source"/>
				<updated>2012-04-08T16:48:04Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised for 0996&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;core.declare(&amp;quot;inf_arena&amp;quot;, {} )&lt;br /&gt;
&lt;br /&gt;
--enemy scaling for each wave: note that game difficulty will modify scaling independently&lt;br /&gt;
local mob_scale_factor = 0.5&lt;br /&gt;
--customize min_lev/max_lev/weight of each enemy (defaults given)&lt;br /&gt;
--for names of beings, check Object IDs in the modding documentation&lt;br /&gt;
--be aware that JC auto-ends the game unless modified directly&lt;br /&gt;
local mobGenStats = {&lt;br /&gt;
    { being = &amp;quot;former&amp;quot;,         min_lev = 0,   max_lev = 12,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;sergeant&amp;quot;,       min_lev = 2,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;captain&amp;quot;,        min_lev = 8,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;imp&amp;quot;,            min_lev = 0,   max_lev = 17,  weight = 8  },&lt;br /&gt;
    { being = &amp;quot;demon&amp;quot;,          min_lev = 4,   max_lev = 20,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;lostsoul&amp;quot;,       min_lev = 6,   max_lev = 16,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;knight&amp;quot;,         min_lev = 9,   max_lev = 15,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;cacodemon&amp;quot;,      min_lev = 10,  max_lev = 50,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;commando&amp;quot;,       min_lev = 12,  max_lev = 17,  weight = 6  },&lt;br /&gt;
    { being = &amp;quot;pain&amp;quot;,           min_lev = 12,  max_lev = 17,  weight = 2  },&lt;br /&gt;
    { being = &amp;quot;baron&amp;quot;,          min_lev = 12,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;arachno&amp;quot;,        min_lev = 13,  max_lev = 50,  weight = 4  },&lt;br /&gt;
    { being = &amp;quot;revenant&amp;quot;,       min_lev = 13,  max_lev = 200, weight = 5  },&lt;br /&gt;
    { being = &amp;quot;mancubus&amp;quot;,       min_lev = 15,  max_lev = 200, weight = 7  },&lt;br /&gt;
    { being = &amp;quot;arch&amp;quot;,           min_lev = 16,  max_lev = 200, weight = 4  },&lt;br /&gt;
    { being = &amp;quot;nimp&amp;quot;,           min_lev = 30,  max_lev = 60,  weight = 8  },&lt;br /&gt;
    { being = &amp;quot;ndemon&amp;quot;,         min_lev = 40,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;ncacodemon&amp;quot;,     min_lev = 51,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;narachno&amp;quot;,       min_lev = 50,  max_lev = 200, weight = 5  },&lt;br /&gt;
    { being = &amp;quot;narch&amp;quot;,          min_lev = 90,  max_lev = 200, weight = 3  },&lt;br /&gt;
    { being = &amp;quot;bruiser&amp;quot;,        min_lev = 50,  max_lev = 200, weight = 6  },&lt;br /&gt;
    { being = &amp;quot;lava_elemental&amp;quot;, min_lev = 70,  max_lev = 200, weight = 1  },&lt;br /&gt;
    { being = &amp;quot;shambler&amp;quot;,       min_lev = 80,  max_lev = 200, weight = 3  },&lt;br /&gt;
    { being = &amp;quot;agony&amp;quot;,          min_lev = 80,  max_lev = 200, weight = 1  },&lt;br /&gt;
    { being = &amp;quot;cyberdemon&amp;quot;,     min_lev = 80,  max_lev = 200, weight = 1  },&lt;br /&gt;
    { being = &amp;quot;arenamaster&amp;quot;,    min_lev = 0,   max_lev = 0,   weight = 0  },&lt;br /&gt;
    { being = &amp;quot;angel&amp;quot;,          min_lev = 0,   max_lev = 0,   weight = 0  },&lt;br /&gt;
    { being = &amp;quot;jc&amp;quot;,             min_lev = 0,   max_lev = 0,   weight = 0  },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--item scaling for each wave&lt;br /&gt;
local item_scale_factor = 0.5&lt;br /&gt;
--customize level/weight of items (defaults given)&lt;br /&gt;
--for names of items, check Object IDs in the modding documentation&lt;br /&gt;
local itemGenStats = {&lt;br /&gt;
    --Commons&lt;br /&gt;
    &lt;br /&gt;
    --weapons&lt;br /&gt;
    { item = &amp;quot;knife&amp;quot;,        level = 1,  weight = 640 },&lt;br /&gt;
    { item = &amp;quot;pistol&amp;quot;,       level = 1,  weight = 70  },&lt;br /&gt;
    { item = &amp;quot;shotgun&amp;quot;,      level = 2,  weight = 180 },&lt;br /&gt;
    { item = &amp;quot;ashotgun&amp;quot;,     level = 2,  weight = 160 },&lt;br /&gt;
    { item = &amp;quot;dshotgun&amp;quot;,     level = 4,  weight = 100 },&lt;br /&gt;
    { item = &amp;quot;chaingun&amp;quot;,     level = 5,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;bazooka&amp;quot;,      level = 7,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;plasma&amp;quot;,       level = 12, weight = 70  },&lt;br /&gt;
    --ammo/ammo packs&lt;br /&gt;
    { item = &amp;quot;ammo&amp;quot;,         level = 1,  weight = 500 },&lt;br /&gt;
    { item = &amp;quot;pammo&amp;quot;,        level = 3,  weight = 700 },&lt;br /&gt;
    { item = &amp;quot;shell&amp;quot;,        level = 2,  weight = 400 },&lt;br /&gt;
    { item = &amp;quot;pshell&amp;quot;,       level = 4,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;rocket&amp;quot;,       level = 5,  weight = 60  },&lt;br /&gt;
    { item = &amp;quot;procket&amp;quot;,      level = 7,  weight = 60  },&lt;br /&gt;
    { item = &amp;quot;cell&amp;quot;,         level = 8,  weight = 36  },&lt;br /&gt;
    { item = &amp;quot;pcell&amp;quot;,        level = 10, weight = 18  },&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    { item = &amp;quot;garmor&amp;quot;,       level = 1,  weight = 400 },&lt;br /&gt;
    { item = &amp;quot;barmor&amp;quot;,       level = 4,  weight = 240 },&lt;br /&gt;
    { item = &amp;quot;rarmor&amp;quot;,       level = 7,  weight = 150 },&lt;br /&gt;
    { item = &amp;quot;sboots&amp;quot;,       level = 4,  weight = 240 },&lt;br /&gt;
    { item = &amp;quot;pboots&amp;quot;,       level = 7,  weight = 150 },&lt;br /&gt;
    { item = &amp;quot;psboots&amp;quot;,      level = 11, weight = 80  },&lt;br /&gt;
    --consumables&lt;br /&gt;
    { item = &amp;quot;smed&amp;quot;,         level = 1,  weight = 600 },&lt;br /&gt;
    { item = &amp;quot;lmed&amp;quot;,         level = 5,  weight = 400 },&lt;br /&gt;
    { item = &amp;quot;phase&amp;quot;,        level = 5,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;hphase&amp;quot;,       level = 7,  weight = 100 },&lt;br /&gt;
    { item = &amp;quot;epack&amp;quot;,        level = 5,  weight = 100 },&lt;br /&gt;
    { item = &amp;quot;nuke&amp;quot;,         level = 10, weight = 40  },&lt;br /&gt;
    { item = &amp;quot;lava_element&amp;quot;, level = 23, weight = 0   },&lt;br /&gt;
    { item = &amp;quot;mod_power&amp;quot;,    level = 7,  weight = 120 },&lt;br /&gt;
    { item = &amp;quot;mod_tech&amp;quot;,     level = 6,  weight = 120 },&lt;br /&gt;
    { item = &amp;quot;mod_bulk&amp;quot;,     level = 6,  weight = 120 },&lt;br /&gt;
    { item = &amp;quot;mod_agility&amp;quot;,  level = 5,  weight = 120 },&lt;br /&gt;
    --powerups&lt;br /&gt;
    { item = &amp;quot;shglobe&amp;quot;,      level = 1,  weight = 900 },&lt;br /&gt;
    { item = &amp;quot;lhglobe&amp;quot;,      level = 6,  weight = 330 },&lt;br /&gt;
    { item = &amp;quot;scglobe&amp;quot;,      level = 4,  weight = 150 },&lt;br /&gt;
    { item = &amp;quot;bpack&amp;quot;,        level = 1,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;iglobe&amp;quot;,       level = 7,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;msglobe&amp;quot;,      level = 16, weight = 60  },&lt;br /&gt;
    { item = &amp;quot;map&amp;quot;,          level = 1,  weight = 200 },&lt;br /&gt;
    { item = &amp;quot;pmap&amp;quot;,         level = 1,  weight = 80  },&lt;br /&gt;
    { item = &amp;quot;ashard&amp;quot;,       level = 5,  weight = 700 },&lt;br /&gt;
    { item = &amp;quot;backpack&amp;quot;,     level = 7,  weight = 0   },&lt;br /&gt;
    &lt;br /&gt;
    --Exotics&lt;br /&gt;
    &lt;br /&gt;
    --weapons&lt;br /&gt;
    { item = &amp;quot;chainsaw&amp;quot;,        level = 12, weight = 3  },&lt;br /&gt;
    { item = &amp;quot;ublaster&amp;quot;,        level = 8,  weight = 2  },&lt;br /&gt;
    { item = &amp;quot;ucpistol&amp;quot;,        level = 4,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;uashotgun&amp;quot;,       level = 6,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;upshotgun&amp;quot;,       level = 12, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;udshotgun&amp;quot;,       level = 10, weight = 5  },&lt;br /&gt;
    { item = &amp;quot;uminigun&amp;quot;,        level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;umbazooka&amp;quot;,       level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;unapalm&amp;quot;,         level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ulaser&amp;quot;,          level = 12, weight = 5  },&lt;br /&gt;
    { item = &amp;quot;unplasma&amp;quot;,        level = 15, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;utristar&amp;quot;,        level = 12, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;bfg9000&amp;quot;,         level = 20, weight = 2  },&lt;br /&gt;
    { item = &amp;quot;unbfg9000&amp;quot;,       level = 22, weight = 2  },&lt;br /&gt;
    { item = &amp;quot;utrans&amp;quot;,          level = 14, weight = 3  },&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    { item = &amp;quot;uoarmor&amp;quot;,         level = 7,  weight = 4  },&lt;br /&gt;
    { item = &amp;quot;uparmor&amp;quot;,         level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;upboots&amp;quot;,         level = 8,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ugarmor&amp;quot;,         level = 15, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ugboots&amp;quot;,         level = 10, weight = 6  },&lt;br /&gt;
    { item = &amp;quot;umedarmor&amp;quot;,       level = 5,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;uduelarmor&amp;quot;,      level = 5,  weight = 6  },&lt;br /&gt;
    { item = &amp;quot;ubulletarmor&amp;quot;,    level = 2,  weight = 4  },&lt;br /&gt;
    { item = &amp;quot;uballisticarmor&amp;quot;, level = 2,  weight = 5  },&lt;br /&gt;
    { item = &amp;quot;ueshieldarmor&amp;quot;,   level = 5,  weight = 3  },&lt;br /&gt;
    { item = &amp;quot;uplasmashield&amp;quot;,   level = 10, weight = 3  },&lt;br /&gt;
    { item = &amp;quot;uenergyshield&amp;quot;,   level = 8,  weight = 3  },&lt;br /&gt;
    { item = &amp;quot;ubalshield&amp;quot;,      level = 6,  weight = 3  },&lt;br /&gt;
    { item = &amp;quot;uacidboots&amp;quot;,      level = 8,  weight = 5  },&lt;br /&gt;
    --consumables&lt;br /&gt;
    { item = &amp;quot;uswpack&amp;quot;,         level = 5,  weight = 10 },&lt;br /&gt;
    { item = &amp;quot;ubskull&amp;quot;,         level = 5,  weight = 8  },&lt;br /&gt;
    { item = &amp;quot;ufskull&amp;quot;,         level = 7,  weight = 8  },&lt;br /&gt;
    { item = &amp;quot;uhskull&amp;quot;,         level = 9,  weight = 8  },&lt;br /&gt;
    { item = &amp;quot;umod_firestorm&amp;quot;,  level = 10, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;umod_sniper&amp;quot;,     level = 10, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;umod_nano&amp;quot;,       level = 10, weight = 4  },&lt;br /&gt;
    { item = &amp;quot;umod_onyx&amp;quot;,       level = 10, weight = 4  },&lt;br /&gt;
    &lt;br /&gt;
    --Uniques&lt;br /&gt;
    &lt;br /&gt;
    --weapons	&lt;br /&gt;
    { item = &amp;quot;ubutcher&amp;quot;,     level = 1,  weight = 2 },&lt;br /&gt;
    { item = &amp;quot;spear&amp;quot;,        level = 16, weight = 0 },&lt;br /&gt;
    { item = &amp;quot;uscythe&amp;quot;,      level = 16, weight = 0 },&lt;br /&gt;
    { item = &amp;quot;udragon&amp;quot;,      level = 16, weight = 1 },&lt;br /&gt;
    { item = &amp;quot;utrigun&amp;quot;,      level = 8,  weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ujackal&amp;quot;,      level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uberetta&amp;quot;,     level = 6,  weight = 3 },&lt;br /&gt;
    { item = &amp;quot;usjack&amp;quot;,       level = 12, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;urbazooka&amp;quot;,    level = 12, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uacid&amp;quot;,        level = 12, weight = 3 },&lt;br /&gt;
    { item = &amp;quot;urailgun&amp;quot;,     level = 15, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ubfg10k&amp;quot;,      level = 20, weight = 1 },&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    { item = &amp;quot;umarmor&amp;quot;,      level = 15, weight = 3 },&lt;br /&gt;
    { item = &amp;quot;ucarmor&amp;quot;,      level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;unarmor&amp;quot;,      level = 10, weight = 3 },&lt;br /&gt;
    { item = &amp;quot;umedparmor&amp;quot;,   level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ulavaarmor&amp;quot;,   level = 12, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uenviroboots&amp;quot;, level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;ushieldarmor&amp;quot;, level = 10, weight = 2 },&lt;br /&gt;
    { item = &amp;quot;uberarmor&amp;quot;,    level = 10, weight = 1 },&lt;br /&gt;
    { item = &amp;quot;aarmor&amp;quot;,       level = 22, weight = 0 },&lt;br /&gt;
    --consumables&lt;br /&gt;
    { item = &amp;quot;uhwpack&amp;quot;,      level = 10, weight = 4 },&lt;br /&gt;
    { item = &amp;quot;umodstaff&amp;quot;,    level = 15, weight = 4 },&lt;br /&gt;
    { item = &amp;quot;uarenastaff&amp;quot;,  level = 4,  weight = 0 },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--changes the generation stats of enemies based on mobGenStats&lt;br /&gt;
for _,v in ipairs(mobGenStats) do&lt;br /&gt;
    beings[v.being].min_lev = v.min_lev&lt;br /&gt;
    beings[v.being].max_lev = v.max_lev&lt;br /&gt;
    beings[v.being].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--changes the generation stats of items based on itemGenStats&lt;br /&gt;
for _,v in ipairs(itemGenStats) do&lt;br /&gt;
    items[v.item].level  = v.level&lt;br /&gt;
    items[v.item].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--add your own announcer lines here&lt;br /&gt;
local anncrMsg = {&lt;br /&gt;
    --displays whenever player completes wave&lt;br /&gt;
    success = {&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Congratulations mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Impressive mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Most impressive.&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;You are a formidable warrior!&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;Each of your triumphs is a work of art!&amp;quot;,&lt;br /&gt;
        &amp;quot;Your ability to survive is incredible!&amp;quot;,&lt;br /&gt;
        &amp;quot;You've given us a great show!&amp;quot;,&lt;br /&gt;
        &amp;quot;You would make a terrific hell warrior!&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;But can you keep going?\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;How much longer can you go?\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;Will you fight with us a little more?\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;I can let you go now if you like, or...\&amp;quot;&amp;quot;,&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    --displays whenever player decides to continue to another wave&lt;br /&gt;
    choice = {&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;I like it! Let the show go on!\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Excellent! May the fight begin!!!\&amp;quot;&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;You hear screams everywhere! \&amp;quot;More Blood! More BLOOD!\&amp;quot;&amp;quot;,&lt;br /&gt;
        &amp;quot;You hear screams everywhere! \&amp;quot;Kill, Kill, KILL!\&amp;quot;&amp;quot;,&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--add your own crowd lines here&lt;br /&gt;
--displays whenever enemy is killed&lt;br /&gt;
local crowdMsg = {&lt;br /&gt;
    &amp;quot;The crowd goes wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd hisses. \&amp;quot;We came for a REAL fight!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd boos. \&amp;quot;No skill, no kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function build_announcerMsg(MSG)&lt;br /&gt;
    for _,msgNum in ipairs(MSG) do&lt;br /&gt;
        ui.msg(table.random_pick(msgNum))&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--from Skulltag Arena, credit goes to yaflhdztioxo&lt;br /&gt;
--initializes table of cells that contains only corpses&lt;br /&gt;
local corpseCells = {}&lt;br /&gt;
&lt;br /&gt;
local function get_corpses()&lt;br /&gt;
    for i = 1, #cells do&lt;br /&gt;
        if cells[i] and cells[i].flags then&lt;br /&gt;
            if cells[i].flag_set[CF_CORPSE] == true then&lt;br /&gt;
                table.insert(corpseCells, i) --i == sID's numeric value&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--removes corpses and blood-like cells&lt;br /&gt;
local function clear_corpses()&lt;br /&gt;
    --fade away all blood&lt;br /&gt;
    Generator.transmute(&amp;quot;blood&amp;quot;, &amp;quot;floor&amp;quot;)&lt;br /&gt;
    Generator.transmute(&amp;quot;bloodpool&amp;quot;, &amp;quot;blood&amp;quot;)&lt;br /&gt;
    --changes corpses to blood&lt;br /&gt;
    for i = 1, #corpseCells do&lt;br /&gt;
        Generator.transmute(corpseCells[i], &amp;quot;bloodpool&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--changes player equipment&lt;br /&gt;
--add &amp;quot;nil&amp;quot; for any slot that should be empty&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
local function build_gear(weap,prep,body,foot)&lt;br /&gt;
    player.eq:clear()&lt;br /&gt;
    if weap then player.eq.weapon   = item.new(weap) end --main weapon&lt;br /&gt;
    if prep then player.eq.prepared = item.new(prep) end --prepared weapon	&lt;br /&gt;
    if body then player.eq.armor    = item.new(body) end --body armor&lt;br /&gt;
    if foot then player.eq.boots    = item.new(foot) end --boots&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--changes player inventory&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
--[[&lt;br /&gt;
input is an array of tables with two fields:&lt;br /&gt;
-name is the identifier of the item that goes in the inventory&lt;br /&gt;
-amt is how many items should be added (or how many units of ammo)&lt;br /&gt;
example table (based on default inventory):&lt;br /&gt;
&lt;br /&gt;
local starter_pack = {&lt;br /&gt;
    {name = &amp;quot;ammo&amp;quot;, amt = 24},&lt;br /&gt;
    {name = &amp;quot;smed&amp;quot;, amt = 2},&lt;br /&gt;
}&lt;br /&gt;
--]]&lt;br /&gt;
local function build_pack(itemPack)&lt;br /&gt;
    player.inv:clear()&lt;br /&gt;
    for _,part in ipairs(itemPack) do&lt;br /&gt;
        if items[part.name].type == ITEMTYPE_AMMO then&lt;br /&gt;
            --ammo is handled separately, loops for however many stacks are needed&lt;br /&gt;
            for n=1,math.ceil(part.amt/items[part.name].ammomax) do&lt;br /&gt;
                local pack = item.new(part.name)&lt;br /&gt;
                if part.amt &amp;lt; pack.ammomax then&lt;br /&gt;
                    --remainder (or single) stack&lt;br /&gt;
                    pack.ammo = part.amt&lt;br /&gt;
                else&lt;br /&gt;
                    --filled (and/or multiple) stacks&lt;br /&gt;
                    pack.ammo = pack.ammomax&lt;br /&gt;
                    part.amt = part.amt - pack.ammomax&lt;br /&gt;
                end&lt;br /&gt;
                player.inv:add(pack)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            --loops for however many items are needed&lt;br /&gt;
            for n=1,part.amt do&lt;br /&gt;
                player.inv:add(part.name)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnEnter()&lt;br /&gt;
    --inventory table used for build_pack()&lt;br /&gt;
    local itemPack = {&lt;br /&gt;
        {name = &amp;quot;smed&amp;quot;,  amt = 2},&lt;br /&gt;
        {name = &amp;quot;shell&amp;quot;, amt = 50},&lt;br /&gt;
    }&lt;br /&gt;
    --set up starting eq/inv&lt;br /&gt;
    build_gear(&amp;quot;shotgun&amp;quot;,&amp;quot;pistol&amp;quot;,nil,nil)&lt;br /&gt;
    build_pack(itemPack)&lt;br /&gt;
    &lt;br /&gt;
    --Print announcer messages&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces: \&amp;quot;Welcome to Hell's Arena, mortal! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;You are either very brave or very foolish. Either way I like it! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;And so do the crowds!\&amp;quot; Suddenly you hear screams everywhere! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;Blood! Blood! BLOOD!\&amp;quot; \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --spawn first wave&lt;br /&gt;
    Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    Level.result(1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnKill(being)&lt;br /&gt;
    --random message from crowdMsg array&lt;br /&gt;
    ui.msg(table.random_pick(crowdMsg))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnKillAll()&lt;br /&gt;
    --print more announcer stuff&lt;br /&gt;
    if Level.result() == 1 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you are, &amp;quot; ..&lt;br /&gt;
               &amp;quot;you show some determination.\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; The voice continues, \&amp;quot;I can now &amp;quot; ..&lt;br /&gt;
               &amp;quot;let you go free, or you may try to complete the challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    elseif Level.result() == 2 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination to &amp;quot; ..&lt;br /&gt;
               &amp;quot;survive makes me excited!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; \&amp;quot;I can let you go now, and give you &amp;quot; ..&lt;br /&gt;
               &amp;quot;a small reward, or you can choose to fight an additional challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        --random message from anncrMsg.success array&lt;br /&gt;
        build_announcerMsg(anncrMsg.success)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local choice = ui.msg_confirm(&amp;quot;Round &amp;quot; .. Level.result() + 1 .. &amp;quot; awaits. &amp;quot; ..&lt;br /&gt;
                                  &amp;quot;Do you want to continue the fight?&amp;quot;)&lt;br /&gt;
    if choice == true then --continuing&lt;br /&gt;
        --random message from anncrMsg.choice array&lt;br /&gt;
        build_announcerMsg(anncrMsg.choice)&lt;br /&gt;
        --set up the danger level for the next wave&lt;br /&gt;
        Level.result(Level.result() + 1);&lt;br /&gt;
        Level.danger_level = Level.result();&lt;br /&gt;
        --spawn items for next wave&lt;br /&gt;
        Level.flood_items(Generator.item_amount()*item_scale_factor)&lt;br /&gt;
        --spawn enemies for next wave&lt;br /&gt;
        Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    &lt;br /&gt;
    else --quitting&lt;br /&gt;
        if Level.result() == 1 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
                   &amp;quot;\&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() == 2 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot; ..&lt;br /&gt;
                   &amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() &amp;lt; 10 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;An impressive run, Mortal!  We appreciate &amp;quot; ..&lt;br /&gt;
                   &amp;quot;it!\&amp;quot; The crowd starts to chant! \&amp;quot;Encore! Encore!\&amp;quot;&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;\&amp;quot;Ladies and gentlemen, your champion, &amp;quot;&lt;br /&gt;
                   .. Player.get_name() .. &amp;quot;. He survived &amp;quot; .. Level.result() ..&lt;br /&gt;
                   &amp;quot; rounds in our arena! That has to be some sort of record. &amp;quot; ..&lt;br /&gt;
                   &amp;quot;Give him a hand folks!\&amp;quot; The crowd starts to chant your name &amp;quot; ..&lt;br /&gt;
                   &amp;quot;and they begin throwing items into the ring!&amp;quot;)&lt;br /&gt;
            Level.flood_items(Generator.item_weight())&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnExit()&lt;br /&gt;
    if Level.result() &amp;lt; 10 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Remember to come back once you return to Hell &amp;quot; ..&lt;br /&gt;
               &amp;quot;for the extended stay\&amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    --used in .OnMortem()&lt;br /&gt;
    inf_arena.result = &amp;quot;had enough of the gauntlet at wave &amp;quot;..Level.result()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function inf_arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby --calls kill descriptions from beings&lt;br /&gt;
    if inf_arena.result then kill = inf_arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, had enough of the gauntlet at wave 8&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Infinite Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--Creation of Infinite Arena&lt;br /&gt;
function inf_arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Infinite Arena&amp;quot;&lt;br /&gt;
    Level.name_number = 0&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    local translation = {&lt;br /&gt;
    [&amp;quot;.&amp;quot;] = &amp;quot;floor&amp;quot;,&lt;br /&gt;
    [&amp;quot;#&amp;quot;] = {&amp;quot;rwall&amp;quot;, LFPERMANENT = true},&lt;br /&gt;
    [&amp;quot;X&amp;quot;] = &amp;quot;rwall&amp;quot;,&lt;br /&gt;
    [&amp;quot;,&amp;quot;] = &amp;quot;blood&amp;quot;,&lt;br /&gt;
    [&amp;quot;&amp;gt;&amp;quot;] = &amp;quot;stairs&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
....,.......................................................................&lt;br /&gt;
.................................,...,......................................&lt;br /&gt;
.,.....................................,....................................&lt;br /&gt;
..,&amp;gt;.,..........................,...........................................&lt;br /&gt;
.,..,.................................,.,...................................&lt;br /&gt;
................................,..,...,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
]]&lt;br /&gt;
    --change up the column types&lt;br /&gt;
    local column = {&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,XXXX.&lt;br /&gt;
.X##X,&lt;br /&gt;
.XXXX.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,X##X.&lt;br /&gt;
.####,&lt;br /&gt;
.X##X.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]]&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    Level.place_tile(translation,map,2,2)&lt;br /&gt;
    for i=1,11 + math.random(4) do&lt;br /&gt;
        Level.scatter_put( area.new(5,3,68,15), translation, table.random_pick(column), &amp;quot;floor&amp;quot;, 1)&lt;br /&gt;
    end&lt;br /&gt;
    Level.scatter(area.FULL_SHRINKED, &amp;quot;floor&amp;quot;, &amp;quot;blood&amp;quot;, 100)&lt;br /&gt;
    Level.player(38, 10)&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena</id>
		<title>Modding:Tutorial/The Infinite Arena</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/The_Infinite_Arena"/>
				<updated>2012-04-08T16:47:36Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised for 0996&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(NOTE: if you are unfamiliar with the general structure of the Hell's Arena module, it is suggested that you [[Modding:Tutorial/Recreating_Hell's_Arena|read the tutorial]] before proceeding, as many of the topics found there also are here, and will only be touched upon in this tutorial.)&lt;br /&gt;
&lt;br /&gt;
[[Hell's Arena]] is a fun little level, as it can be fairly difficult to complete without some grasp on DoomRL's mechanics, but pillar and monster placement aside, it is still a fairly static map. The following tutorial is a generalized version of Hell's Arena, coined the Infinite Arena, which has been reconstructed based on [[User:Yaflhdztioxo|yaflhdztioxo's]] design from v0.9.9.1. A fair number of seemingly-superfluous tools have also been created as a means to provide easy customization possibilities for those who want to quickly change the settings of the Arena. If nothing else, you will discover a variety of helper tools in this tutorial that may prove to be useful in your own modules.&lt;br /&gt;
&lt;br /&gt;
==Special Concept: Custom Tables and Functions==&lt;br /&gt;
The basics of tables have already been explained in the [[Modding:Tutorial/Game Objects|Game Objects]] tutorial: it was also explained there that building your own tables is generally unnecessary. There are, however, plenty of reasons to make tables for your own purposes:&lt;br /&gt;
&lt;br /&gt;
*You want the game to randomly choose from a group of variables&lt;br /&gt;
*You want to perform calculations or subroutines on many objects simultaneously&lt;br /&gt;
*You are creating an object map that other functions may require (e.g., translation table for .run() )&lt;br /&gt;
*You want to store a number of variables in an organized manner in order to access them easily&lt;br /&gt;
&lt;br /&gt;
There are two kinds of tables. The first kind are what are more commonly referred to as tables, as they contain keys and values in each of their fields:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local some_table = {&lt;br /&gt;
    key1 = &amp;quot;value1&amp;quot;,&lt;br /&gt;
    key2 = &amp;quot;value2&amp;quot;,&lt;br /&gt;
    ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In fact, these tables can contain more tables, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local big_table = {&lt;br /&gt;
    small_table1 = {&lt;br /&gt;
        key1 = &amp;quot;value1&amp;quot;,&lt;br /&gt;
        key2 = &amp;quot;value2&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    small_table2 = {&lt;br /&gt;
        key1 = &amp;quot;value3&amp;quot;,&lt;br /&gt;
        key3 = &amp;quot;value4&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that these sub-tables do not have to carry the same information, although you may want them to (depending on the table's purpose). In doing so, you can create very large and intricate tables to suit your needs.&lt;br /&gt;
&lt;br /&gt;
The second kind of table is commonly known in the modding community as an array, and is essentially a table that does not explicitly write keys in each field. The following examples show an array, followed by a table that imitates the functionality of an array:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local some_array = {&amp;quot;value1&amp;quot;,&amp;quot;value2&amp;quot;,&amp;quot;value3&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
local some_imit_table = {&lt;br /&gt;
    [1] = &amp;quot;value1&amp;quot;,&lt;br /&gt;
    [2] = &amp;quot;value2&amp;quot;,&lt;br /&gt;
    [3] = &amp;quot;value3&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local big_array = {&lt;br /&gt;
    {&amp;quot;value1&amp;quot;,&amp;quot;value2&amp;quot;,&amp;quot;value3&amp;quot;},&lt;br /&gt;
    {&amp;quot;value4&amp;quot;,&amp;quot;value5&amp;quot;,&amp;quot;value6&amp;quot;},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local big_imit_table = {&lt;br /&gt;
    [1] = {&lt;br /&gt;
        [1] = &amp;quot;value1&amp;quot;,&lt;br /&gt;
        [2] = &amp;quot;value2&amp;quot;,&lt;br /&gt;
        [3] = &amp;quot;value3&amp;quot;,&lt;br /&gt;
    },&lt;br /&gt;
    [2] = {&lt;br /&gt;
        [1] = &amp;quot;value4&amp;quot;,&lt;br /&gt;
        [2] = &amp;quot;value5&amp;quot;,&lt;br /&gt;
        [3] = &amp;quot;value6&amp;quot;,&lt;br /&gt;
    }, &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the array format is a lot more compact, but it also forces very specific keys on each field (namely numerical ones). Naturally, tables and arrays can be combined seamlessly, such that you can have a table of arrays or an array or tables (as well as more complicated setups).&lt;br /&gt;
&lt;br /&gt;
When you want to call various parts within a table or array, you can use the following syntax (we will base these on ''big_array'' and ''big_table''):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
big_table.small_table1        --returns the contents of small_table1&lt;br /&gt;
big_table[small_table1]       --identical to above&lt;br /&gt;
&lt;br /&gt;
big_table.small_table1.key1   --returns &amp;quot;value1&amp;quot;&lt;br /&gt;
big_table.small_table1[key1]  --identical to above&lt;br /&gt;
big_table[small_table1].key1  --identical to above&lt;br /&gt;
big_table[small_table1][key1] --identical to above&lt;br /&gt;
&lt;br /&gt;
big_array.1     --returns the contents of the first array in big_array&lt;br /&gt;
big_array[1]    --identical to above&lt;br /&gt;
&lt;br /&gt;
big_array.2.2   --returns &amp;quot;value5&amp;quot;&lt;br /&gt;
big_array.2[2]  --identical to above&lt;br /&gt;
big_array[2].2  --identical to above&lt;br /&gt;
big_array[2][2] --identical to above&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a matter of convention, we will write table-like extensions using the dot syntax and array-like extensions using the bracket syntax. (This is typically how other languages write their arrays and tables, and it is often a good idea to organize your code in such a manner so that it is easier to read when looking back at it.)&lt;br /&gt;
&lt;br /&gt;
Functions, like tables, are mostly known based on using parts of pre-defined object classes: in the case of functions, we should already be fairly familiar with their capabilities when calling engine hooks and API methods. The creation of a function is very simple, nearly identical to engine hooks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function sum_diff(arg1,arg2)&lt;br /&gt;
    val1 = arg1+arg2&lt;br /&gt;
    val2 = arg1-arg2&lt;br /&gt;
    return(val1,val2)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local add_diff = function(arg1,arg2) --this line is identical to the first line of the above function&lt;br /&gt;
    ....&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*First you must give the function a name: the above example is called '''sum_diff()'''.&lt;br /&gt;
*Next you must supply input arguments, if any. These are variables that can be used within the function, which is otherwise self-contained. That is to say, a function can't use any variables from anywhere else in your lua script unless they are given through the input arguments. The above example takes in two arguments, generically named ''arg1'' and ''arg2''.&lt;br /&gt;
*From here we add the script that is to be run when the function is called (this is usually what you concern yourself with when working with the engine hooks). In the above example, the sum of ''arg1'' and ''arg2'' is assigned to ''val1'', and their difference is assigned to ''val2''.&lt;br /&gt;
*Finally, we consider what the function should output. This can be accomplished in two ways when modding:&lt;br /&gt;
**You can simply provide outputs to the function using the return() core method. This immediately stops the function and sends outputs to the line that called the function. In the above example, ''val1'' and ''val2'' are returned. (Note that, when called, the script should contain some variables so that the return values are properly assigned.)&lt;br /&gt;
**You can manipulate objects. Since changing objects (such as their prototype) modify things on the engine side of the game, this can be done without having any particular outputs to the function. Even though the function is self-contained within your script, it can influence things not belonging to the script.&lt;br /&gt;
&lt;br /&gt;
If you want to call a function, use its name with the appropriate input and outputs. For the above example, you could call the function in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local num1 = 5&lt;br /&gt;
local num2 = 4&lt;br /&gt;
&lt;br /&gt;
local sum,diff = sum_diff(num1,num2)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ''sum'' variable will have a value of 9, and the ''diff'' variable will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
In the Infinite Arena module, a large portion of the code is dedicated to constructing easy-to-read and well-organized tables, as well as functions that make use of them. The tables and functions will eventually be called in the engine hooks, which leaves us with a relatively small amount of run-time code to sift through. Ideally, modules should have a format in which much of the script is written not as a part of the core module, but as something that the core module will refer to.&lt;br /&gt;
&lt;br /&gt;
==Initialization Code==&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
====mobGenStats====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--customize min_lev/max_lev/weight of each enemy (defaults given)&lt;br /&gt;
--for names of beings, check Object IDs in the modding documentation&lt;br /&gt;
--be aware that JC auto-ends the game unless modified directly&lt;br /&gt;
local mobGenStats = {&lt;br /&gt;
    { being = &amp;quot;former&amp;quot;,         min_lev = 0,   max_lev = 12,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;sergeant&amp;quot;,       min_lev = 2,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    { being = &amp;quot;captain&amp;quot;,        min_lev = 8,   max_lev = 15,  weight = 10 },&lt;br /&gt;
    ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''mobGenStats'' is an array of tables: each table contains four fields relating to the being prototype. In each case, a being's identifier ''being'' is given, followed by a ''min_lev'', ''max_lev'', and ''weight'' (all generation parameters). The purpose of ''mobGenStats'' is to switch particular values for others in the being prototypes that already exist. Normally this can be done for a particular enemy with the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
beings.former.weight = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would change the ''weight'' key in the ''former'' table of the ''beings'' array (which holds all being prototypes) to zero, thereby removing the possibility of former humans appearing through standard generation procedures. However, if a modder wants to change many parameters at once, they can use what is done in the Infinite Arena. First is the creation of the above table, and then you use the table in a for loop as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes the generation stats of enemies based on mobGenStats&lt;br /&gt;
for _,v in ipairs(mobGenStats) do&lt;br /&gt;
    beings[v.being].min_lev = v.min_lev&lt;br /&gt;
    beings[v.being].max_lev = v.max_lev&lt;br /&gt;
    beings[v.being].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The conditional statement 'for a,b  in ipairs(array)' breaks down in the following way:&lt;br /&gt;
*''a'' is the iterator of the for loop itself (whenever the code repeats, ''a'' increases by one)&lt;br /&gt;
**As we have no need for a basic iterator, we leave it blank using an underscore.&lt;br /&gt;
*''b'' is the array iterator (directly calls the particular array, similarly increments)&lt;br /&gt;
*in '''ipairs()''' tells the for loop to iterate through values in an array&lt;br /&gt;
*''array'' is the array in question&lt;br /&gt;
&lt;br /&gt;
In this particular case, the loop iterates through each array and sets the being's ''min_lev'', ''max_lev'', and ''weight'' (as found in the being prototype) to the values as determined by ''mobGenStats''. ''v.being'' is the same as a being's identifier from ''mobGenStats'', which is how the loop iterates through all being prototypes. In this way all of the beings in the prototype array can be changed quickly without a bunch of lines specifying each key and value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--enemy scaling for each wave: note that game difficulty will modify scaling independently&lt;br /&gt;
local mob_scale_factor = 0.5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we have a variable that indicates the initial scaling of enemies. For the Infinite Arena, using the base game's scaling is probably too difficult for what a player at a given difficulty would expect, so it is cut in half by default.&lt;br /&gt;
&lt;br /&gt;
====itemGenStats====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--customize level/weight of items (defaults given)&lt;br /&gt;
--for names of items, check Object IDs in the modding documentation&lt;br /&gt;
local itemGenStats = {&lt;br /&gt;
    --Commons&lt;br /&gt;
    &lt;br /&gt;
    --weapons&lt;br /&gt;
    { item = &amp;quot;knife&amp;quot;,        level = 1,  weight = 640 },&lt;br /&gt;
    { item = &amp;quot;pistol&amp;quot;,       level = 1,  weight = 70  },&lt;br /&gt;
    { item = &amp;quot;shotgun&amp;quot;,      level = 2,  weight = 180 },&lt;br /&gt;
    ....&lt;br /&gt;
    --ammo/ammo packs&lt;br /&gt;
    ....&lt;br /&gt;
    --armor/boots&lt;br /&gt;
    ....&lt;br /&gt;
    --consumables&lt;br /&gt;
    ....&lt;br /&gt;
    --powerups&lt;br /&gt;
    ....    &lt;br /&gt;
    --Exotics&lt;br /&gt;
    ....    &lt;br /&gt;
    --Uniques&lt;br /&gt;
    ....    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''itemGenStats'' is just like ''mobGenStats'', except that it is an array of tables regarding generation parameters for items. Note that ''mobGenStats'' and ''itemGenStats'' in the source set all of the monsters and items to their default settings, so there will be no difference between the generation in the base game and in the Infinite Arena unless the modder chooses to customize it personally. (''mobGenStats'' and ''itemGenStats'' are also shortened here: see Review for the full arrays.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes the generation stats of items based on itemGenStats&lt;br /&gt;
for _,v in ipairs(itemGenStats) do&lt;br /&gt;
    items[v.item].level  = v.level&lt;br /&gt;
    items[v.item].weight = v.weight&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with ''mobGenStats'', a for loop is used to run through all of the variables in the ''itemGenStats'' tables and change the prototypes to anything that the modder wishes to customize.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--item scaling for each wave&lt;br /&gt;
local item_scale_factor = 0.5&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The item scaling is also dropped to scale properly with the drop in monster scaling. (Feel free to change these around for your own amusement, of course.)&lt;br /&gt;
&lt;br /&gt;
====anncrMsg and crowdMsg====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--add your own announcer lines here&lt;br /&gt;
local anncrMsg = {&lt;br /&gt;
    --displays whenever player completes wave&lt;br /&gt;
    success = {&lt;br /&gt;
        {&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Congratulations mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Impressive mortal!&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;Most impressive.&amp;quot;,&lt;br /&gt;
        &amp;quot;The voice booms, \&amp;quot;You are a formidable warrior!&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        ....&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
        ....&lt;br /&gt;
        }&lt;br /&gt;
    },&lt;br /&gt;
    --displays whenever player decides to continue to another wave&lt;br /&gt;
    choice = {&lt;br /&gt;
    ....&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''anncrMsg'' is the opposite of the generation variables: it is a table of arrays. There are two arrays within ''anncrMsg'' labeled ''success'' and ''choice'', each of which carry their own groups of variables. ''anncrMsg'' itself is called whenever the announcer displays a message (after the third wave), using either ''success'' (whenever the player completes the wave) or ''choose'' (whenever the player chooses to continue to the next wave). Since each group of strings should be handled separately, they are grouped separately, hence the need for a table of arrays.&lt;br /&gt;
&lt;br /&gt;
In addition, ''anncrMsg.success'' and ''anncrMsg.choose'' are an array of arrays themselves. The reason for this will be explained in '''build_announcerMsg()'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--add your own crowd lines here&lt;br /&gt;
--displays whenever enemy is killed&lt;br /&gt;
local crowdMsg = {&lt;br /&gt;
    &amp;quot;The crowd goes wild! \&amp;quot;BLOOD! BLOOD!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Blood! Blood!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd cheers! \&amp;quot;Kill! Kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd hisses. \&amp;quot;We came for a REAL fight!\&amp;quot;&amp;quot;,&lt;br /&gt;
    &amp;quot;The crowd boos. \&amp;quot;No skill, no kill!\&amp;quot;&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By contrast, ''crowdMsg'' is a simple array of strings, called whenever a crowd message is necessary. Since the crowd only needs to be called in one case, only one group of strings is initialized, and so a table of arrays is no longer required.&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
====build_gear()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes player equipment&lt;br /&gt;
--add &amp;quot;nil&amp;quot; for any slot that should be empty&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
local function build_gear(weap,prep,body,foot)&lt;br /&gt;
    player.eq:clear()&lt;br /&gt;
    if weap then player.eq.weapon   = item.new(weap) end --main weapon&lt;br /&gt;
    if prep then player.eq.prepared = item.new(prep) end --prepared weapon	&lt;br /&gt;
    if body then player.eq.armor    = item.new(body) end --body armor&lt;br /&gt;
    if foot then player.eq.boots    = item.new(foot) end --boots&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''build_gear()''' is an example of a &amp;quot;helper function&amp;quot;, as it runs a procedure that could easily be reproduced in the run-time code but simplifies the input whenever the code needs to be modified. In this case, the function clears all of the player's equipment and potentially adds a new item in each slot. There are four inputs, each corresponding to a particular slot: if the value in an input argument is not nil, it then adds a new item to that player's equipment slot.&lt;br /&gt;
&lt;br /&gt;
In the run-time code, the player need only change the input variables rather than changing several lines. This may not appear very necessary for '''build_gear()''' but the concept of a helper function can make modifications to code much easier.&lt;br /&gt;
&lt;br /&gt;
====build_pack()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--changes player inventory&lt;br /&gt;
--always refreshes all slots: do not use to change only one equipment slot&lt;br /&gt;
local function build_pack(itemPack)&lt;br /&gt;
    player.inv:clear()&lt;br /&gt;
    for _,part in ipairs(itemPack) do&lt;br /&gt;
        if items[part.name].type == ITEMTYPE_AMMO then&lt;br /&gt;
            --ammo is handled separately, loops for however many stacks are needed&lt;br /&gt;
            for n=1,math.ceil(part.amt/items[part.name].ammomax) do&lt;br /&gt;
                local pack = item.new(part.name)&lt;br /&gt;
                if part.amt &amp;lt; pack.ammomax then&lt;br /&gt;
                    --remainder (or single) stack&lt;br /&gt;
                    pack.ammo = part.amt&lt;br /&gt;
                else&lt;br /&gt;
                    --filled (and/or multiple) stacks&lt;br /&gt;
                    pack.ammo = pack.ammomax&lt;br /&gt;
                    part.amt = part.amt - pack.ammomax&lt;br /&gt;
                end&lt;br /&gt;
                player.inv:add(pack)&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            --loops for however many items are needed&lt;br /&gt;
            for n=1,part.amt do&lt;br /&gt;
                player.inv:add(part.name)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''build_pack()''' is another helper function, this time clearing the inventory of the player and adding in new items there. It uses the &amp;quot;in '''ipairs()'''&amp;quot; iteration method to check all variables in an array in the following way:&lt;br /&gt;
&lt;br /&gt;
*if the item's ''type'' is ITEMTYPE_AMMO:&lt;br /&gt;
**a new for loop is run, iterating from 1 to ''ammonum''/''ammomax'' for the specific ammo (''ammonum'' currently being how much that the player's inventory receives)&lt;br /&gt;
**first, the new ammo stack is created&lt;br /&gt;
**if ''ammonum'' is less than the ammo's ''ammomax'':&lt;br /&gt;
***set the ammo stack equal to ''ammonum''&lt;br /&gt;
**otherwise:&lt;br /&gt;
***set the ammo stack equal to ''ammomax''&lt;br /&gt;
***subtract ''ammonum'' by ''ammomax''&lt;br /&gt;
**finally, add the ammo stack to the player's inventory (and this process repeats as necessary)&lt;br /&gt;
*if the item's ''type'' is not ITEMTYPE_AMMO:&lt;br /&gt;
**a new for loop is run, iterating as many times as items should be added for the particular item in question&lt;br /&gt;
**the item(s) are then added to the player's inventory, one by one&lt;br /&gt;
&lt;br /&gt;
The input requires an array of tables, although the format is rather simple. Here is an example of an input for '''build_pack()''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local itemPack = {&lt;br /&gt;
    {name = &amp;quot;chaingun&amp;quot;, amt = 1  }&lt;br /&gt;
    {name = &amp;quot;ammo&amp;quot;,     amt = 360}&lt;br /&gt;
    {name = &amp;quot;smed&amp;quot;,     amt = 5  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each table in the array requires only two fields: ''name'', which corresponds to the item's identifier, and ''amt'', which specifies how many of that item should be added. In the case of ammunition, the amount of ammo should be specified instead, as it is handled uniquely in order to produce an ideal number of stacks. The above example would add one chaingun, three 9mm ammo (x100) stacks, one 9mm ammo (x60) stack, and five small med-packs to the player's inventory. Keep in mind that the player can only hold 22 items, and any items added after 22 items have been added to the inventory will be disregarded.&lt;br /&gt;
&lt;br /&gt;
====build_announcerMsg()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local function build_announcerMsg(MSG)&lt;br /&gt;
    for _,msgNum in ipairs(MSG) do&lt;br /&gt;
        ui.msg(table.random_pick(msgNum))&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''build_announcerMsg()''' function iterates through an array and selects a random index from a table within the array. The purpose of this simple function is to loop through a series of arrayed strings from ''anncrMsg'' and randomly pick strings from those arrays. '''build_announcerMsg'''(''anncrMsg.success'') sets up three random messages from each array in its array, and '''build_announcerMsg'''(''anncrMsg.choose'') sets up two random messages from each array in its array. (Setting up a lot of tables within tables can be confusing, but it becomes relatively simple as a means to organize variables together when compared to keeping track of each variable separately.)&lt;br /&gt;
&lt;br /&gt;
====get_corpses() and clear_corpses()====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--initializes table of cells that only contains corpses&lt;br /&gt;
local corpseCells = {}&lt;br /&gt;
&lt;br /&gt;
local function get_corpses()&lt;br /&gt;
    for i = 1, #cells do&lt;br /&gt;
        if cells[i] and cells[i].flags then&lt;br /&gt;
            if cells[i].flag_set[CF_CORPSE] == true then&lt;br /&gt;
                table.insert(corpseCells, i) --i == sID's numeric value&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''get_corpses()''' is a quick function that creates a table, ''corpseCells'', and loops through all cells in the cell prototype array, selecting only those that contain the CF_CORPSE flag (indicating that the cell acts like a corpse) and adding it to ''corpseCells''. This method is often the most effective way to create a selective table of objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--removes corpses and blood-like cells&lt;br /&gt;
local function clear_corpses()&lt;br /&gt;
    --fade away all blood&lt;br /&gt;
    Generator.transmute(&amp;quot;blood&amp;quot;, &amp;quot;floor&amp;quot;)&lt;br /&gt;
    Generator.transmute(&amp;quot;bloodpool&amp;quot;, &amp;quot;blood&amp;quot;)&lt;br /&gt;
    --changes corpses to blood&lt;br /&gt;
    for i = 1, #corpseCells do&lt;br /&gt;
        Generator.transmute(corpseCells[i], &amp;quot;bloodpool&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''clear_corpses()'' puts our table of corpses to use by transmuting any cells contained in the table into the &amp;quot;bloodpool&amp;quot; cell. Additionally, all blood pools are changed to &amp;quot;blood&amp;quot; and all blood is changed to &amp;quot;floor&amp;quot;. This is added to the Infinite Arena so that a ridiculous number of corpses isn't around when Arch-vile enemies begin to show themselves.&lt;br /&gt;
&lt;br /&gt;
==Engine Hooks==&lt;br /&gt;
&lt;br /&gt;
===.run()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Creation of Infinite Arena&lt;br /&gt;
function inf_arena.run()&lt;br /&gt;
    Level.name = &amp;quot;Infinite Arena&amp;quot;&lt;br /&gt;
    Level.name_number = 0&lt;br /&gt;
    Level.fill(&amp;quot;rwall&amp;quot;)&lt;br /&gt;
    Generator.set_permanence(area.FULL)&lt;br /&gt;
    &lt;br /&gt;
    local translation = {&lt;br /&gt;
    [&amp;quot;.&amp;quot;] = &amp;quot;floor&amp;quot;,&lt;br /&gt;
    [&amp;quot;#&amp;quot;] = {&amp;quot;rwall&amp;quot;, LFPERMANENT = true},&lt;br /&gt;
    [&amp;quot;X&amp;quot;] = &amp;quot;rwall&amp;quot;,&lt;br /&gt;
    [&amp;quot;,&amp;quot;] = &amp;quot;blood&amp;quot;,&lt;br /&gt;
    [&amp;quot;&amp;gt;&amp;quot;] = &amp;quot;stairs&amp;quot;,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    local map = [[&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
....,.......................................................................&lt;br /&gt;
.................................,...,......................................&lt;br /&gt;
.,.....................................,....................................&lt;br /&gt;
..,&amp;gt;.,..........................,...........................................&lt;br /&gt;
.,..,.................................,.,...................................&lt;br /&gt;
................................,..,...,....................................&lt;br /&gt;
............................................................................&lt;br /&gt;
............................................................................&lt;br /&gt;
#..........................................................................#&lt;br /&gt;
##........................................................................##&lt;br /&gt;
#####..................................................................#####&lt;br /&gt;
###########.....................................................############&lt;br /&gt;
#######################.............................########################&lt;br /&gt;
]]&lt;br /&gt;
    --change up the column types&lt;br /&gt;
    local column = {&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,XXXX.&lt;br /&gt;
.X##X,&lt;br /&gt;
.XXXX.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,X##X.&lt;br /&gt;
.####,&lt;br /&gt;
.X##X.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]],&lt;br /&gt;
    [[&lt;br /&gt;
,..,.,&lt;br /&gt;
,####.&lt;br /&gt;
.####,&lt;br /&gt;
.####.&lt;br /&gt;
,..,.,&lt;br /&gt;
    ]]&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    Level.place_tile(translation,map,2,2)&lt;br /&gt;
    for i=1,11 + math.random(4) do&lt;br /&gt;
        Level.scatter_put( area.new(5,3,68,15), translation, table.random_pick(column), &amp;quot;floor&amp;quot;, 1)&lt;br /&gt;
    end&lt;br /&gt;
    Level.scatter(area.FULL_SHRINKED, &amp;quot;floor&amp;quot;, &amp;quot;blood&amp;quot;, 100)&lt;br /&gt;
    Level.player(38, 10)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''run()''' hook is very similar to that of the Hell's Arena one. In fact, other than the name change, the only real difference is that the ''column'' string has now been expanded to an array of strings, corresponding to an array of pillars. In order to randomly select pillars, '''Level.scatter_put()''' must be iterated a number of times, adding only one pillar each time: then, by adding the '''table.random_pick()''' method to the tiles-to-be-added argument, it randomly selects one of the pillars in the ''column'' array. The result is that the columns randomly have varying degrees of destructibility.&lt;br /&gt;
&lt;br /&gt;
===.OnEnter()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnEnter()&lt;br /&gt;
    --inventory table used for build_pack()&lt;br /&gt;
    local itemPack = {&lt;br /&gt;
        {name = &amp;quot;smed&amp;quot;,  amt = 2},&lt;br /&gt;
        {name = &amp;quot;shell&amp;quot;, amt = 50},&lt;br /&gt;
    }&lt;br /&gt;
    --set up starting eq/inv&lt;br /&gt;
    build_gear(&amp;quot;shotgun&amp;quot;,&amp;quot;pistol&amp;quot;,nil,nil)&lt;br /&gt;
    build_pack(itemPack)&lt;br /&gt;
    &lt;br /&gt;
    --Print announcer messages&lt;br /&gt;
    ui.msg(&amp;quot;A devilish voice announces: \&amp;quot;Welcome to Hell's Arena, mortal! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;You are either very brave or very foolish. Either way I like it! &amp;quot; ..&lt;br /&gt;
           &amp;quot;\&amp;quot;And so do the crowds!\&amp;quot; Suddenly you hear screams everywhere! &amp;quot; ..&lt;br /&gt;
	   &amp;quot;\&amp;quot;Blood! Blood! BLOOD!\&amp;quot; \&amp;quot;Kill all enemies and I shall reward thee!\&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    --spawn first wave&lt;br /&gt;
    Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    Level.result(1)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnEnter()''' makes significant use of the helper functions, using '''build_gear()''' and '''build_pack()''' to initialize the player's starting equipment and inventory. Besides the itemPack array, this only takes two lines of code, producing a much cleaner and more organized routine than in the original Hell's Arena.&lt;br /&gt;
&lt;br /&gt;
In addition, rather than directly spawning enemies using the '''Level.summon()''' method, we imitate the base game's generation code by combining '''Generator.being_weight()''', which outputs the danger level for a given map level, and '''Level.flood_monsters()''', which randomly drops enemies on the level for a given danger level. Additionally, the ''mob_scale_factor'' variable is used to change the danger level, thereby changing the scaling of the first wave.&lt;br /&gt;
&lt;br /&gt;
===.OnKill()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnKill(being)&lt;br /&gt;
    --random message from crowdMsg array&lt;br /&gt;
    ui.msg(table.random_pick(crowdMsg))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnKill()''' does exactly the same thing as the one from Hell's Arena, except that the crowd messages have been tabulated and '''table.random_pick()''' is used to choose from one of said messages. Technically, '''build_announcerMsg()''' would also work here, but since both would only require one line of code, it may as well be the simplest one to understand.&lt;br /&gt;
&lt;br /&gt;
===.OnKillAll()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnKillAll()&lt;br /&gt;
    --print more announcer stuff&lt;br /&gt;
    if Level.result() == 1 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Not bad mortal! For a weakling that you are, &amp;quot; ..&lt;br /&gt;
               &amp;quot;you show some determination.\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; The voice continues, \&amp;quot;I can now &amp;quot; ..&lt;br /&gt;
               &amp;quot;let you go free, or you may try to complete the challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    elseif Level.result() == 2 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice booms, \&amp;quot;Impressive mortal! Your determination to &amp;quot; ..&lt;br /&gt;
               &amp;quot;survive makes me excited!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
               &amp;quot;\&amp;quot;More Blood! More BLOOD!\&amp;quot; \&amp;quot;I can let you go now, and give you &amp;quot; ..&lt;br /&gt;
               &amp;quot;a small reward, or you can choose to fight an additional challenge!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        --random message from anncrMsg.success array&lt;br /&gt;
        build_announcerMsg(anncrMsg.success)&lt;br /&gt;
    end&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
'''OnKillAll()''' has received some simplifications similar to '''OnEnter'''. To start, after the first two waves, rather than dealing with an large number of random messages here, all of it is called from the previous ''anncrMsg'' table and the '''build_announcerMsg()''' function, which randomly picks a string from an array strings, then iterates through the entire array of arrays. In the displayed run-time code, this amounts of a single line (although it is actually running quite a few lines).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    ....&lt;br /&gt;
    local choice = ui.msg_confirm(&amp;quot;Round &amp;quot; .. Level.result() + 1 .. &amp;quot; awaits. &amp;quot; ..&lt;br /&gt;
                                  &amp;quot;Do you want to continue the fight?&amp;quot;)&lt;br /&gt;
    if choice == true then --continuing&lt;br /&gt;
        --random message from anncrMsg.choice array&lt;br /&gt;
        build_announcerMsg(anncrMsg.choice)&lt;br /&gt;
        --set up the danger level for the next wave&lt;br /&gt;
        Level.result(Level.result() + 1);&lt;br /&gt;
        Level.danger_level = Level.result();&lt;br /&gt;
        --spawn items for next wave&lt;br /&gt;
        Level.flood_items(Generator.item_amount()*item_scale_factor)&lt;br /&gt;
        --spawn enemies for next wave&lt;br /&gt;
        Level.flood_monsters(Generator.being_weight()*mob_scale_factor)&lt;br /&gt;
    ....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Upon choosing to continue, we use '''build_announcerMsg()''' for more messages (again, only a single line of code). Then, we increment the level by one and increase the ''danger_level'' using the amount from '''Level.result()'''. (''Level.danger_level'' is actually a property of the level object.) Finally, we use the increased danger level to add items and monsters. '''Level.flood_items(Generator.item_amount())''' is the item equivalent of '''Level.flood_monsters(Generator.being_weight())'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    else --quitting&lt;br /&gt;
        if Level.result() == 1 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Coward!\&amp;quot; You hear screams everywhere! &amp;quot; ..&lt;br /&gt;
                   &amp;quot;\&amp;quot;Coward! Coward! COWARD!\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() == 2 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;Too bad, you won't make it far then...!\&amp;quot; &amp;quot; ..&lt;br /&gt;
                   &amp;quot;You hear screams everywhere! \&amp;quot;Boooo...\&amp;quot;&amp;quot;)&lt;br /&gt;
        elseif Level.result() &amp;lt; 10 then&lt;br /&gt;
            ui.msg(&amp;quot;The voice booms, \&amp;quot;An impressive run, Mortal!  We appreciate &amp;quot; ..&lt;br /&gt;
                   &amp;quot;it!\&amp;quot; The crowd starts to chant! \&amp;quot;Encore! Encore!\&amp;quot;&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
            ui.msg(&amp;quot;\&amp;quot;Ladies and gentlemen, your champion, &amp;quot;&lt;br /&gt;
                   .. Player.get_name() .. &amp;quot;. He survived &amp;quot; .. Level.result() ..&lt;br /&gt;
                   &amp;quot; rounds in our arena! That has to be some sort of record. &amp;quot; ..&lt;br /&gt;
                   &amp;quot;Give him a hand folks!\&amp;quot; The crowd starts to chant your name &amp;quot; ..&lt;br /&gt;
                   &amp;quot;and they begin throwing items into the ring!&amp;quot;)&lt;br /&gt;
            Level.flood_items(Generator.item_weight())&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Upon choosing not to continue, the announcer displays a variety of messages, although they are few enough (and specific enough) not to create another array for them. (They CAN be tabulated, but it is less bulky than for the other cases.) If the player survived at least ten waves before stopping, the crowd &amp;quot;throws items onto the stage&amp;quot; and you get some pointless gear when you're done, just as before.&lt;br /&gt;
&lt;br /&gt;
===.OnExit()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnExit()&lt;br /&gt;
    if Level.result() &amp;lt; 10 then&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Flee mortal, flee! There's no hiding in hell!\&amp;quot;&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        ui.msg(&amp;quot;The voice laughs, \&amp;quot;Remember to come back once you return to Hell &amp;quot; ..&lt;br /&gt;
               &amp;quot;for the extended stay\&amp;quot;&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    --used in .OnMortem()&lt;br /&gt;
    inf_arena.result = &amp;quot;had enough of the gauntlet at wave &amp;quot;..Level.result()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''OnExit()''' has only gained a cosmetic change in the case where the player survived more than ten waves before retreating.&lt;br /&gt;
&lt;br /&gt;
===.OnMortem()===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function inf_arena.OnMortem()&lt;br /&gt;
    local kill = player.killedby --calls kill descriptions from beings&lt;br /&gt;
    if inf_arena.result then kill = inf_arena.result end&lt;br /&gt;
        player:mortem_print( &amp;quot; &amp;quot;..player.name..&amp;quot;, level &amp;quot;..player.explevel..&amp;quot; &amp;quot;&lt;br /&gt;
                             ..&amp;quot; &amp;quot;..klasses[player.klass].name..&amp;quot;, &amp;quot;..kill )&lt;br /&gt;
        --e.g., &amp;quot;Cool Guy, level 1 Marine, had enough of the gauntlet at wave 8&amp;quot;&lt;br /&gt;
        player:mortem_print(&amp;quot; in the Infinite Arena...&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with '''OnExit()''', '''OnMortem()''' only changes some of the text in the mortem depending on how the player ends the game.&lt;br /&gt;
&lt;br /&gt;
==Review==&lt;br /&gt;
The following is the entire source code for the Infinite Arena.&lt;br /&gt;
{{:Modding:Tutorial/The_Infinite_Arena/Source}}&lt;br /&gt;
&lt;br /&gt;
Source data: [http://dl.dropbox.com/u/33336094/inf_arena.module.zip inf_arena.module]&lt;br /&gt;
&lt;br /&gt;
WAD file: [http://dl.dropbox.com/u/33336094/inf_arena.wad inf_arena.wad]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Mechanics</id>
		<title>Mechanics</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Mechanics"/>
				<updated>2012-03-30T20:21:28Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added Resistance to Combat Mechanics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The pages listed here describe what various numbers mean and how the game works behind the scenes.&lt;br /&gt;
&lt;br /&gt;
==Basics==&lt;br /&gt;
*[[Distance]]&lt;br /&gt;
*[[Time]]&lt;br /&gt;
*[[Dice notation]]&lt;br /&gt;
&lt;br /&gt;
==Player Mechanics==&lt;br /&gt;
*[[Experience]]&lt;br /&gt;
*[[Vision]]&lt;br /&gt;
*[[Tactics]]&lt;br /&gt;
*[[Effects]]&lt;br /&gt;
&lt;br /&gt;
==Combat Mechanics==&lt;br /&gt;
*[[Health]]&lt;br /&gt;
*[[Protection]]&lt;br /&gt;
*[[Resistance]]&lt;br /&gt;
*[[Accuracy]]&lt;br /&gt;
*[[Dodging]]&lt;br /&gt;
*[[Shotguns]]&lt;br /&gt;
*[[Explosions]]&lt;br /&gt;
*[[Corpses]]&lt;br /&gt;
*[[Knockback]]&lt;br /&gt;
*[[Damage type]]&lt;br /&gt;
*[[AI]]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Template:Modarg</id>
		<title>Template:Modarg</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Template:Modarg"/>
				<updated>2012-03-27T17:47:20Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: fixed missile flag link, added empty flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Whenever an input or output argument is required for an API function, one should use &amp;lt;nowiki&amp;gt;{{modarg|arg}}&amp;lt;/nowiki&amp;gt; to express it. This also handles cases where links are required. Some examples:&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;{{modarg|integer}}&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; '''integer'''&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;{{modarg|Being}}&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; '''[[Modding:Being|Being]]'''&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;{{modarg|CoordList}}&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; '''[[Modding:Coord|CoordList]]'''&lt;br /&gt;
If there are more links required, feel free to add a line to the template.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#switch: {{{1}}}&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Cell Flags}}   |{{{1}}} }} =  '''[[Modding:Cell#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Cellset}}      |{{{1}}} }} =  '''[[Modding:Constants#Cellsets|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Cell}}         |{{{1}}} }} =  '''[[Modding:Cell|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ExplosionFlag}}|{{{1}}} }} =  '''[[Modding:Constants#ExplosionFlag|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Empty Flag}}   |{{{1}}} }} =  '''[[Modding:Constants#Empty Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Item Flag}}    |{{{1}}} }} =  '''[[Modding:Item#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Level Flag}}   |{{{1}}} }} =  '''[[Modding:Level#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|LightFlag}}    |{{{1}}} }} =  '''[[Modding:Constants#LightFlag|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Missile Flag}} |{{{1}}} }} =  '''[[Modding:Missile#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Flag}}         |{{{1}}} }} =  '''[[Modding:Constants#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ItemType}}     |{{{1}}} }} =  '''[[Modding:Constants#ItemType|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ItemSet}}      |{{{1}}} }} =  '''[[Modding:ItemSet|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Item}}         |{{{1}}} }} =  '''[[Modding:Item|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Affect}}       |{{{1}}} }} =  '''[[Modding:Affect|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|AltReload}}    |{{{1}}} }} =  '''[[Modding:Constants#AltReload|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|AltFire}}      |{{{1}}} }} =  '''[[Modding:Constants#AltFire|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Area}}         |{{{1}}} }} =  '''[[Modding:Area|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Badge}}        |{{{1}}} }} =  '''[[Modding:Badge|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Being}}        |{{{1}}} }} =  '''[[Modding:Being|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Color}}        |{{{1}}} }} =  '''[[Modding:Constants#Colors|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Coord}}        |{{{1}}} }} =  '''[[Modding:Coord|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|DamageType}}   |{{{1}}} }} =  '''[[Modding:Constants#DamageType|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Klass}}        |{{{1}}} }} =  '''[[Modding:Klass|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Medal}}        |{{{1}}} }} =  '''[[Modding:Medal|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Missile}}      |{{{1}}} }} =  '''[[Modding:Missile|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ModArray}}     |{{{1}}} }} =  '''[[Modding:ModArray|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Player}}       |{{{1}}} }} =  '''[[Modding:Player|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Rank}}         |{{{1}}} }} =  '''[[Modding:Rank|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Resistance}}   |{{{1}}} }} =  '''[[Modding:Constants#Resistance|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Room}}         |{{{1}}} }} =  '''[[Modding:Generator|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|StatusEffect}} |{{{1}}} }} =  '''[[Modding:Constants#StatusEffect|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Trait}}        |{{{1}}} }} =  '''[[Modding:Trait|{{{1}}}]]'''&lt;br /&gt;
  | &amp;lt;b&amp;gt;{{{1}}}&amp;lt;/b&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Missile</id>
		<title>Modding:Missile</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Missile"/>
				<updated>2012-03-27T17:44:40Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised with templates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Missiles are created whenever a [[Modding:Item#Ranged Weapon|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.&lt;br /&gt;
&lt;br /&gt;
== Missile Prototype ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Missile Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;id&amp;lt;/u&amp;gt;|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 [[Modding:Item#Ranged Weapon|inline missile definitions]], this field is created automatically.&lt;br /&gt;
  |{{modarg|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).&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the single character used to represent the missile animation. &amp;quot;-&amp;quot;, the default, is automatically rotated as is commonly seen in DoomRL.&lt;br /&gt;
  |{{modarg|Color}}|&amp;lt;u&amp;gt;color&amp;lt;/u&amp;gt;|This is the color used to draw the missile animation.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;delay&amp;lt;/u&amp;gt;|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.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;miss_base&amp;lt;/u&amp;gt;|When this missile is fired at the player, this is the base [[Dodging|dodge chance]].&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;miss_dist&amp;lt;/u&amp;gt;|When this missile is fired at the player, this is the amount that the dodge chance increases per unit of distance.&lt;br /&gt;
  |{{modarg|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).  &lt;br /&gt;
  |{{modarg|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.&lt;br /&gt;
  |{{modarg|integer}}|maxrange|This field is currently unused. The default is 10.&lt;br /&gt;
  |{{modarg|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.&lt;br /&gt;
  |{{modarg|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.&lt;br /&gt;
  |{{modarg|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.&lt;br /&gt;
  |{{modarg|Color}}|expl_color|This is the color of the explosion animation. Since explosions are mulicolored, not all colors are allowed here. See [[Modding:Level#level_explosion|Level.explosion]] for details. The default is RED.&lt;br /&gt;
  |{{modarg|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.&lt;br /&gt;
  |{{modarg|Cell ID}}|content|If this field is declared, then an explosion will have a chance of transmuting cells into this cell (as described [[Explosions|here]]). This is automatically translated into a numeric id.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Flags ===&lt;br /&gt;
{{drltable|Projectile Missile Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |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|Shambler's]] ranged attack).&lt;br /&gt;
  |MF_HARD|This flag causes the missile to continue after hitting a being (as with the [[Railgun]]).&lt;br /&gt;
  |MF_EXACT|This flag causes the missile to stop at the targeted square (as with the [[Revenant's Launcher]]).&lt;br /&gt;
  |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-vile|Arch-viles']] natural weapon uses this flag.)&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Shotgun Prototype ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{{drltable|(Missile) Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;id&amp;lt;/u&amp;gt;|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.)&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;range&amp;lt;/u&amp;gt;|This is the shotgun's [[Shotguns|range]].&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;spread&amp;lt;/u&amp;gt;|This is the shotgun's [[Shotguns|spread]].&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;reduce&amp;lt;/u&amp;gt;|This is the percentage of the shotgun's damage that decays per unit of distance.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:UI</id>
		<title>Modding:UI</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:UI"/>
				<updated>2012-03-25T00:15:01Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised with new templates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The UI table provides access to functions that work with the user interface.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
{{drltable|UI Interface|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|msg|dot||string|message}}&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|msg_clear|dot}}&lt;br /&gt;
  |{{modarg|string}} |{{moddef|list|msg_history|dot||integer|numMessages}}&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|msg_enter|dot||string|message}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|msg_confirm|dot||string|message|boolean|warning}}&lt;br /&gt;
  |{{modarg|string}} |{{moddef|list|msg_choice|dot||string|message|table|choices}}&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|blood_slide|dot}}&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|blink|dot||Color|color|integer|duration}}&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|set_hint|dot||string|hint_text}}&lt;br /&gt;
  |{{modarg|void}}   |{{moddef|list|plot_screen|dot||string|text}}&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|msg|dot||string|message}}&lt;br /&gt;
:Prints ''message'' to the message area at the top of the screen.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|msg_clear|dot}}&lt;br /&gt;
:Adds two blank lines to the message area, clearing it out.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|msg_history|dot|string|integer|numMessages}}&lt;br /&gt;
:Returns the last ''numMessages'' messages from the message list.  If 0 is entered, it will return only the most recent message.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|msg_enter|dot||string|message}}&lt;br /&gt;
:Prints ''message'' to the message area at the top of the screen, followed by the text &amp;quot;Press Enter...&amp;quot;, and then waits for an Enter press (or click in Graphics mode).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|msg_confirm|dot|boolean|string|message|boolean|warning}}&lt;br /&gt;
:Prints ''message'' to the message area at the top of the screen, followed by &amp;quot;[y/n]&amp;quot;, and waits for the user to hit the y or n key.  Returns true if the y key was pressed, otherwise returns false.  If ''warning'' is true, the confirm response is Shift-Y (similar to quitting and nuking) instead of just y.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|msg_choice|dot|string|string|message|table|choices}}&lt;br /&gt;
:Prints ''message'' to the message area at the top of the screen, followed by the list of possible ''choices'', then waits for the user to make a selection or cancel.  ''Choices'' must be a character array (i.e., a table of length 1 strings) which indicates the valid choices.  The function returns a string containing the choice selected, or the empty string if they hit ESC instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|blood_slide|dot}}&lt;br /&gt;
:Creates the blood slide animation.  Doesn't work in 0.9.9.6, but will in older versions.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|blink|dot||Color|color|integer|duration}}&lt;br /&gt;
:Makes the screen flash ''color'' for ''duration'' milliseconds.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|set_hint|dot||string|hint_text}}&lt;br /&gt;
:Displays ''message'' in the hint area, which is right-aligned and under the message area.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|plot_screen|dot||string|text}}&lt;br /&gt;
:Creates a black screen that writes ''text'' one letter at a time, similar to the intro text.  ''Text'' can be a multi line string, the newlines will be properly displayed.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Template:Moddef</id>
		<title>Template:Moddef</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Template:Moddef"/>
				<updated>2012-03-25T00:14:22Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added UI&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
This is the prototypical template for expressing API functions. It works with the following args:&lt;br /&gt;
#Sets the type of expression. Currently there are two cases:&lt;br /&gt;
#*&amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; is what's used in the table: it automatically comes with the necessary link for the description's anchor.&lt;br /&gt;
#*&amp;lt;tt&amp;gt;desc&amp;lt;/tt&amp;gt; is what's used underneath the table: this provides the anchor that is linked to the list.&lt;br /&gt;
#Sets the function name. For example, if the function is called &amp;lt;tt&amp;gt;Level.place_tile&amp;lt;/tt&amp;gt;, then this should be set to &amp;lt;tt&amp;gt;place_tile&amp;lt;/tt&amp;gt;.&lt;br /&gt;
#Determines the function type. There are two cases:&lt;br /&gt;
#*&amp;lt;tt&amp;gt;dot&amp;lt;/tt&amp;gt; is the dot form&lt;br /&gt;
#*&amp;lt;tt&amp;gt;cln&amp;lt;/tt&amp;gt; is the colon form&lt;br /&gt;
#Sets the output argument, if any. Leaving this blank should always be done for &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt; functions. You can include up to two comma-separated outputs.&lt;br /&gt;
#From here, input arguments are set. These are be handled in pairs: the first should be the arg type, while the second should be the arg name. You can include up to eight arg pairs in this manner.&lt;br /&gt;
Please note that this template is set up to include information based on the page name, so they can only be used on their appropriate pages. Thus, you can write being API functions using this template for the [[Modding:Being|being]] page, but not for the [[Modding:Coord|coord]] page.&lt;br /&gt;
&lt;br /&gt;
See [[Template:Modarg]] for argument handling.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#ifeq:{{{1}}}|desc|{{Anchor|{{lc:{{#sub:{{PAGENAME}}|8|0}}}}_{{{2}}}}}&lt;br /&gt;
;}}{{#switch: {{#sub:{{PAGENAME}}|8|0}}&lt;br /&gt;
  | Coord  = {{#switch: {{{3}}} | dot = coord.  | cln = '''Coord'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Area   = {{#switch: {{{3}}} | dot = area.   | cln = '''Area'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Item   = {{#switch: {{{3}}} | dot = item.   | cln = '''Item'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Being  = {{#switch: {{{3}}} | dot = being.  | cln = '''Being'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | UI     = {{#switch: {{{3}}} | dot = ui.     | cln = '''Being'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Player = {{#switch: {{{3}}} | dot = player. | cln = '''Player'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Thing  = {{#switch: {{{3}}} | dot = thing.  | cln = '''Thing'''&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Level  = {{#switch: {{{3}}} | dot = Level.  | ket = '''Level'''&amp;lt;nowiki&amp;gt;[{{modarg{{{5}}}}}{{{2}}}]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
  | Generator = Generator.&lt;br /&gt;
}}{{#switch: {{{1}}}&lt;br /&gt;
  | list = [[#{{lc:{{#sub:{{PAGENAME}}|8|0}}}}_{{{2}}}|{{{2}}}]]&lt;br /&gt;
  | desc = {{{2}}}&lt;br /&gt;
}}({{#if: {{{5|}}}|{{#if: {{{6|}}} | {{modarg|{{{5}}}}} {{{6}}}}}{{#if:{{{7|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{8|}}} |{{modarg|{{{7}}}}} {{{8}}}}}}}{{#if:{{{9|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{10|}}} |{{modarg|{{{9}}}}} {{{10}}}}}}}{{#if:{{{11|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{12|}}} |{{modarg|{{{11}}}}} {{{12}}}}}}}{{#if:{{{13|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{14|}}} |{{modarg|{{{13}}}}} {{{14}}}}}}}{{#if:{{{15|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{16|}}} |{{modarg|{{{15}}}}} {{{16}}}}}}}{{#if:{{{17|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{18|}}} |{{modarg|{{{17}}}}} {{{18}}}}}}}{{#if:{{{19|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{20|}}} |{{modarg|{{{19}}}}} {{{20}}}}}}}{{#if:{{{21|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{22|}}} |{{modarg|{{{21}}}}} {{{22}}}}}}}{{#if:{{{23|}}}|&amp;lt;nowiki&amp;gt;, &amp;lt;/nowiki&amp;gt;{{#if: {{{24|}}} |{{modarg|{{{23}}}}} {{{24}}}}}}}}}){{#if: {{{4|}}}|&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;&amp;amp;rarr; {{#if: {{#pos:{{{4}}}|,}}|{{modarg|{{#explode:{{{4}}}|,|0}}}},{{modarg|{{#explode:{{{4}}}|,|1}}}}|{{modarg|{{{4}}}}} }} }}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Statistics</id>
		<title>Modding:Statistics</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Statistics"/>
				<updated>2012-03-24T22:12:39Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added real_time_ms, drltable edits&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Statistics are not game objects but, rather, a table of values that are accrued throughout the game. Often they are referenced for the purpose of granting [[Modding:Medal|medals]] and [[Modding:Badge|badges]], although they can be accessed at any time.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Statistics properties can be called using the syntax &amp;quot;''statistics.stat_name''&amp;quot;, where stat_name refers to the property names as explained here. All statistics from the core game can be updated simply by calling them, but they are also updated by default: default updates are mentioned in the statistic's description.&lt;br /&gt;
&lt;br /&gt;
In addition, you can create new statistics using the same syntax and assign them values (e.g., &amp;quot;''statictics.stat_name = 0''&amp;quot;). Values assigned to a statistic must always be an integer.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Statistics|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |bonus_levels_count|The total number of special levels that have appeared in the game. It is updated immediately after the game creates the core game episode.&lt;br /&gt;
  |bonus_levels_visited|The total number of special levels that the player entered. It is updated whenever the player enters a special level.&lt;br /&gt;
  |bonus_levels_completed|The total number of special levels that the player has completed. It is updated whenever the IsCompleted hook for a level is called, or whenever the number of enemies on that level is equal to zero.&lt;br /&gt;
  |damage_on_level|The total amount of damage the player has taken on the current level. It is updated whenever the player takes damage, and resets whenever the player exits a level.&lt;br /&gt;
  |damage_taken|The total amount of damage that the player has taken over the course of a game. It is updated whenever the player takes damage.&lt;br /&gt;
  |entry_time|The amount of game time (that is, measured by in-game turns) that has passed  since the game started. It is updated whenever the player enters a level.&lt;br /&gt;
  |game_time|The amount of game time that has passed since the game started. It is updated whenever a game ends.&lt;br /&gt;
  |kills|The number of enemies that have been killed since the game started. It is updated whenever the player exits a level.&lt;br /&gt;
  |kills_non_damage|The number of enemies that have died while the player has not taken damage. It is tracked (but not necessarily updated) each time an enemy dies.&lt;br /&gt;
  |levels_nuked|The number of levels that have been successfully nuked. It is updated whenever a nuke explodes, or whenever a player leaves a level that had an active nuke on it.&lt;br /&gt;
  |levers_pulled|The number of [[lever|levers]] pulled over the course of a game. It is updated whenever a lever is pulled.&lt;br /&gt;
  |max_kills|The total number of enemies that have appeared since the game started. It is updated upon entering a new level.&lt;br /&gt;
  |real_time|The amount of real time (that is, measured by a clock) that has passed since the game started. It is updated whenever a game ends.&lt;br /&gt;
  |real_time_ms|The number of milliseconds that have passed since the game started. It is updated whenever a game ends.&lt;br /&gt;
  |uniques_found|The total number of [[Specials|uniques]] found over the course of a game. It is updated whenever the player picks up a unique item.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
{{drltable|Statistics Interface|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|statistics.[[#statistics_inc|inc]]('''string''' name, '''integer''' value) &lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|statistics_inc}}&lt;br /&gt;
;statistics.inc('''string''' name, '''integer''' value)&lt;br /&gt;
:This increments the statistic ''name'' by ''value''. ''value'' can be positive (increasing the statistic) or negative (decreasing the statistic).&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Coord</id>
		<title>Modding:Coord</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Coord"/>
				<updated>2012-03-24T22:06:47Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: drltable used&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Coords (short for coordinates) are used to describe positions on the map. They are also occassionally used to indicate relative positions.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Although coords are technically userdata, they can be indexed like normal tables.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Coord|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 3px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''Integer'''|x|This is the x-coordinate of the coord. In DoomRL, x increases going from left to right, starting at 1 on the left edge of the map.&lt;br /&gt;
  |'''Integer'''|y|This is the y-coordinate of the coord. In DoomRL, y increases going from top to bottom, starting at 1 on the upper edge of the map.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
{{drltable|Coord Interface|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_new|new]]('''integer''' x, '''integer''' y) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_unm|unm]]([[Modding:Coord|Coord]] c) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_add|add]]([[Modding:Coord|Coord]] lhs, [[Modding:Coord|Coord]] rhs) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_sub|sub]]([[Modding:Coord|Coord]] lhs, [[Modding:Coord|Coord]] rhs) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_mul|mul]]([[Modding:Coord|Coord]] or '''integer''' lhs, [[Modding:Coord|Coord]] or '''integer''' rhs) &lt;br /&gt;
  |'''boolean'''|coord.[[#coord_eq|eq]]([[Modding:Coord|Coord]] lhs, [[Modding:Coord|Coord]], rhs) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_abs|abs]]([[Modding:Coord|Coord]] c) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_sign|sign]]([[Modding:Coord|Coord]] c) &lt;br /&gt;
  |'''integer'''|coord.[[#coord_distance|distance]]([[Modding:Coord|Coord]] c1, [[Modding:Coord|Coord]] c2) &lt;br /&gt;
  |'''number'''|coord.[[#coord_real_distance|real_distance]]([[Modding:Coord|Coord]] c1, [[Modding:Coord|Coord]] c2) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|coord.[[#coord_random|random]]([[Modding:Coord|Coord]] c1, [[Modding:Coord|Coord]] c2) &lt;br /&gt;
  |'''integer''', '''integer'''|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_get|get]]() &lt;br /&gt;
  |'''string'''|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_tostring|tostring]]() &lt;br /&gt;
  |[[Modding:Coord|Coord]]|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_clone|clone]]() &lt;br /&gt;
  |'''void'''|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_random_shift|random_shift]]('''integer''' value) &lt;br /&gt;
  |[[Modding:Coord|Coord]]|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_random_shifted|random_shifted]]('''integer''' value)&lt;br /&gt;
  |[[Modding:Coord|CoordIterator]]|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_cross_coords|cross_coords]]() &lt;br /&gt;
  |[[Modding:Coord|CoordIterator]]|[[Modding:Coord|Coord]]&amp;amp;#058;[[#coord_around_coords|around_coords]]() &lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|coord_new}}&lt;br /&gt;
;coord.new('''integer''' x, '''integer''' y) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This creates a new coord with the given x and y.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_unm}}&lt;br /&gt;
;coord.unm([[Modding:Coord|Coord]] c) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
;-[[Modding:Coord|Coord]] c &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This creates a new coord whose coordinates are the inverse (negative) of the original coordinates.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_add}}&lt;br /&gt;
;coord.add([[Modding:Coord|Coord]] lhs, [[Modding:Coord|Coord]] rhs) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
;[[Modding:Coord|Coord]] lhs + [[Modding:Coord|Coord]] rhs &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This creates a new coord whose coordinates are the sums of the corresponding coordinates of ''lhs'' and ''rhs''.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_sub}}&lt;br /&gt;
;coord.sub([[Modding:Coord|Coord]] lhs, [[Modding:Coord|Coord]] rhs) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
;[[Modding:Coord|Coord]] lhs - [[Modding:Coord|Coord]] rhs &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This creates a new coord whose coordinates are the differences of the corresponding coordinates of ''lhs'' and ''rhs''.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_mul}}&lt;br /&gt;
;coord.mul([[Modding:Coord|Coord]] or '''integer''' lhs, [[Modding:Coord|Coord]] or '''integer''' rhs) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
;[[Modding:Coord|Coord]] or '''integer''' lhs * [[Modding:Coord|Coord]] or '''integer''' rhs &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:With two coords, this creates a new coord whose coordinates are the products of the corresponding coordinates of ''lhs'' and ''rhs''. With an integer, a new coord is returned with the coordinates of the original coord scaled by the integer. (This doesn't apply to two integers.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_eq}}&lt;br /&gt;
;coord.eq([[Modding:Coord|Coord]] lhs, [[Modding:Coord|Coord]], rhs) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Coord|Coord]] lhs == [[Modding:Coord|Coord]] rhs &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This determines if the given coords are coordinate-wise equal. (They might still be different objects! Beware using coords as table keys.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_abs}}&lt;br /&gt;
;coord.abs([[Modding:Coord|Coord]] c) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This creates a new coord with coordinates that are the absolute value of the corresponding original coordinates.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_sign}}&lt;br /&gt;
;coord.sign([[Modding:Coord|Coord]] c) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This creates a new coord by applying the sign function (1 for positive, 0 for zero, -1 for negative) to each coordinate of the original coord.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_distance}}&lt;br /&gt;
;coord.distance([[Modding:Coord|Coord]] c1, [[Modding:Coord|Coord]] c2) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Calculates the [[distance]] between the given coords.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_real_distance}}&lt;br /&gt;
;coord.real_distance([[Modding:Coord|Coord]] c1, [[Modding:Coord|Coord]] c2) &amp;amp;rarr; '''number'''&lt;br /&gt;
:Calculates the (approximate) Euclidean distance between the biven coords.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_random}}&lt;br /&gt;
;coord.random([[Modding:Coord|Coord]] c1, [[Modding:Coord|Coord]] c2) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:Returns a new coord uniformly at random whose x is between the x coordinates of ''c1'' and ''c2'' (inclusive) and whose y is between the y coordinates of ''c1'' and ''c2''. The coordinates of ''c1'' should be less than or equal to the corresponding coordinates of ''c2''. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_get}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;get() &amp;amp;rarr; '''integer''', '''integer'''&lt;br /&gt;
:Returns the x and y coordinates of the coord (in order).&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_tostring}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;tostring() &amp;amp;rarr; '''string'''&lt;br /&gt;
:Returns a string containing the x and y coordinates separated by a comma.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_clone}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;clone() &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:Returns a copy of the coord.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_random_shift}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;random_shift('''integer''' value) &lt;br /&gt;
:Changes the coord uniformly at random to a different coord (or possibly the same coord) whose x and y are within ''value'' of the originals. ''value'' is optional; it defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_random_shifted}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;random_shifted('''integer''' value) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:As random_shift, except instead of changing the existing coord, a new coord is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_cross_coords}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;cross_coords() &amp;amp;rarr; [[Modding:Coord|Coord]] '''iterator'''&lt;br /&gt;
:Gives an iterator over all coords that are orthogonally adjacent to the given coord (i.e., not diagonals). This is ordered as follows: west, east, north, then south.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|coord_around_coords}}&lt;br /&gt;
;[[Modding:Coord|Coord]]&amp;amp;#058;around_coords() &amp;amp;rarr; [[Modding:Coord|Coord]] '''iterator'''&lt;br /&gt;
:Gives an iterator over all coords adjacent to the given coord. It begins at the coord above and to the left of the given coord, then follows clockwise around the given coord.&lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
{|style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=3 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Constant Coords'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right; vertical-align:top; padding-right: 2ex;&amp;quot;|null&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|coord.UNIT&lt;br /&gt;
|This is a coord with 1 in both coordinates. Be careful not to change it.&lt;br /&gt;
|-style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: right; vertical-align:top; padding-right: 2ex;&amp;quot;|null&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|coord.ZERO&lt;br /&gt;
|This is a coord with 0 in both coordinates. Be careful not to change it.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Template:Modarg</id>
		<title>Template:Modarg</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Template:Modarg"/>
				<updated>2012-03-24T22:03:54Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: some fixes, added StatusEffect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Whenever an input or output argument is required for an API function, one should use &amp;lt;nowiki&amp;gt;{{modarg|arg}}&amp;lt;/nowiki&amp;gt; to express it. This also handles cases where links are required. Some examples:&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;{{modarg|integer}}&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; '''integer'''&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;{{modarg|Being}}&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; '''[[Modding:Being|Being]]'''&lt;br /&gt;
*&amp;lt;nowiki&amp;gt;{{modarg|CoordList}}&amp;lt;/nowiki&amp;gt; &amp;amp;rarr; '''[[Modding:Coord|CoordList]]'''&lt;br /&gt;
If there are more links required, feel free to add a line to the template.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#switch: {{{1}}}&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Cell Flags}}   |{{{1}}} }} =  '''[[Modding:Cell#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Cellset}}      |{{{1}}} }} =  '''[[Modding:Constants#Cellsets|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Cell}}         |{{{1}}} }} =  '''[[Modding:Cell|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ExplosionFlag}}|{{{1}}} }} =  '''[[Modding:Constants#ExplosionFlag|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Item Flag}}    |{{{1}}} }} =  '''[[Modding:Item#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|LightFlag}}    |{{{1}}} }} =  '''[[Modding:Constants#LightFlag|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Level Flag}}   |{{{1}}} }} =  '''[[Modding:Level#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Flag}}         |{{{1}}} }} =  '''[[Modding:Constants#Flags|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ItemType}}     |{{{1}}} }} =  '''[[Modding:Constants#ItemType|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ItemSet}}      |{{{1}}} }} =  '''[[Modding:ItemSet|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Item}}         |{{{1}}} }} =  '''[[Modding:Item|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Affect}}       |{{{1}}} }} =  '''[[Modding:Affect|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|AltReload}}    |{{{1}}} }} =  '''[[Modding:Constants#AltReload|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|AltFire}}      |{{{1}}} }} =  '''[[Modding:Constants#AltFire|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Area}}         |{{{1}}} }} =  '''[[Modding:Area|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Badge}}        |{{{1}}} }} =  '''[[Modding:Badge|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Being}}        |{{{1}}} }} =  '''[[Modding:Being|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Color}}        |{{{1}}} }} =  '''[[Modding:Constants#Colors|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Coord}}        |{{{1}}} }} =  '''[[Modding:Coord|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|DamageType}}   |{{{1}}} }} =  '''[[Modding:Constants#DamageType|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Klass}}        |{{{1}}} }} =  '''[[Modding:Klass|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Medal}}        |{{{1}}} }} =  '''[[Modding:Medal|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Missile}}      |{{{1}}} }} =  '''[[Modding:Missile|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|ModArray}}     |{{{1}}} }} =  '''[[Modding:ModArray|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Player}}       |{{{1}}} }} =  '''[[Modding:Player|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Rank}}         |{{{1}}} }} =  '''[[Modding:Rank|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Resistance}}   |{{{1}}} }} =  '''[[Modding:Constants#Resistance|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Room}}         |{{{1}}} }} =  '''[[Modding:Generator|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|StatusEffect}} |{{{1}}} }} =  '''[[Modding:Constants#StatusEffect|{{{1}}}]]'''&lt;br /&gt;
  | {{#if: {{#pos:{{{1}}}|Trait}}        |{{{1}}} }} =  '''[[Modding:Trait|{{{1}}}]]'''&lt;br /&gt;
  | &amp;lt;b&amp;gt;{{{1}}}&amp;lt;/b&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Affects</id>
		<title>Modding:Affects</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Affects"/>
				<updated>2012-03-24T22:02:48Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: used more effective templates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These represent the various temporary effects in the game.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
&lt;br /&gt;
{{drltable|Affect Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}      |id             |The identifier for the affect.&lt;br /&gt;
  |{{modarg|string}}      |name           |What is displayed in the status line while the effect is active.&lt;br /&gt;
  |{{modarg|Color}}       |color          |The color of the name on the status line while the effect is on.&lt;br /&gt;
  |{{modarg|Color}}       |color_expire   |The color of the name on the status line when the effect is wearing off.&lt;br /&gt;
  |{{modarg|string}}      |message_init   |The message printed when the effect is activated.&lt;br /&gt;
  |{{modarg|string}}      |message_ending |The message printed when the effect is wearing off.  This is unused in 0.9.9.6.&lt;br /&gt;
  |{{modarg|string}}      |message_done   |The message printed when the effect wears off.&lt;br /&gt;
  |{{modarg|StatusEffect}}|status_effect  |The overlay effect that occurs while this effect is active.&lt;br /&gt;
  |{{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.&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
&lt;br /&gt;
{{drltable|Affect Hooks|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|void}}|[[#OnAdd|OnAdd]]('''Affect''' self)&lt;br /&gt;
  |{{modarg|void}}|[[#OnTick|OnTick]]('''Affect''' self)&lt;br /&gt;
  |{{modarg|void}}|[[#OnRemove|OnRemove]]('''Affect''' self)&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{anchor|OnAdd}}&lt;br /&gt;
;OnAdd('''Affect''' self)&lt;br /&gt;
:This is called when the effect is gained.&lt;br /&gt;
----&lt;br /&gt;
{{anchor|OnTick}}&lt;br /&gt;
;OnTick('''Affect''' self)&lt;br /&gt;
:This is called every action while the effect is active.&lt;br /&gt;
----&lt;br /&gt;
{{anchor|OnRemove}}&lt;br /&gt;
;OnRemove('''Affect''' self)&lt;br /&gt;
:This is called when the effect is lost.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:level_blueprint_(0.9.9.7)</id>
		<title>Modding:level blueprint (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:level_blueprint_(0.9.9.7)"/>
				<updated>2012-03-24T01:23:32Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: uncommented push_cell&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Level objects define the properties of fixed special levels. The level API, however, is a general purpose API for manipulating the level. This is used both for map generation (along with the [[Modding:Generator#API|generator API]]) and for changing the level on the fly. The Level variable also has some general properties that don't necessarily correspond to special levels in particular.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
Levels prototypes are only used for special levels and scripted levels, not random levels. They are declared using the Levels function with the ID as the first argument, and a prototype table as the second argument. They are stored by ID in a global table called levels.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |string|ID|The unique identifier used by the engine for this level. Instead of being included in the table, this must be passed as the first argument to the Levels function.&lt;br /&gt;
  |string|name|The name displayed in the HUD.&lt;br /&gt;
  |string|welcome|Optional message displayed on level entry.&lt;br /&gt;
  |integer|chance|Optional percent chance the level will appear. Defaults to 100.&lt;br /&gt;
  |[[Modding:Functions$function_resolve_range|Range]]|level|Level range where the level may appear.&lt;br /&gt;
  |string|entry|Optional mortem history message for level entry.&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
=== Flags ===&lt;br /&gt;
{{drltable|Level Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |LF_NOHOMING|Causes homing phase devices to act like normal phase devices.&lt;br /&gt;
  |LF_UNIQUEITEM|Used by the level generation code to keep track of whether a unique item has dropped on the current level (in order to prevent multiple uniques from dropping on one level). This flag also causes a level feeling to occur indicating that a unique item is present.&lt;br /&gt;
  |LF_BONUS|This flag is automatically set for so-called special levels like [[Halls of Carnage]]. (It is not set for those special levels like [[Hellgate]] that replace normal levels, only by those reached from red stairs.)&lt;br /&gt;
  |LF_RESPAWN|Causes monsters to randomly respawn as when playing the game on Nightmare!&lt;br /&gt;
  |LF_NORESPAWN|Prevents the Nightmare! respawn feature.&lt;br /&gt;
  |LF_NUKED|This flag is automatically set when the level is nuked.&lt;br /&gt;
  |LF_NONUKE|Causes the thermonuclear bomb to have no effect when it is used. It is not respected by other nuke effects.&lt;br /&gt;
  |LF_ITEMSVISIBLE|Allows the player to see all items on the level (as with a [[Computer Map]]).&lt;br /&gt;
  |LF_BEINGSVISIBLE|Allows the player to see all beings on the level (as with a [[Tracking Map]]).&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |void|[[#level_Create|Create]]() &lt;br /&gt;
  |void|[[#level_OnTick|OnTick]]() &lt;br /&gt;
  |void|[[#level_OnEnter|OnEnter]]() &lt;br /&gt;
  |void|[[#level_OnExit|OnExit]]() &lt;br /&gt;
  |void|[[#level_OnKill|OnKill]]() &lt;br /&gt;
  |void|[[#level_OnKillAll|OnKillAll]]() &lt;br /&gt;
  |boolean|[[#level_IsCompleted|IsCompleted]]() &lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|level_Create}}&lt;br /&gt;
;Create() &lt;br /&gt;
:This function should create the layout of the level. It also usually sets up the initial being and item locations. The player's initial location should be set here using Level.player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnTick}}&lt;br /&gt;
;OnTick() &lt;br /&gt;
:This is called every 0.1s of game time. This will happen many times for each of the player's moves, so be careful about putting intense calculations here.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnEnter}}&lt;br /&gt;
;OnEnter() &lt;br /&gt;
:This is triggered just after the player enters the level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnExit}}&lt;br /&gt;
;OnExit() &lt;br /&gt;
:This is triggered when the player leaves the level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnKill}}&lt;br /&gt;
;OnKill() &lt;br /&gt;
:This hook is triggered whenever an enemy is killed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnKillAll}}&lt;br /&gt;
;OnKillAll() &lt;br /&gt;
:After OnKill has triggered, if there are no enemies left on the level, the OnKillAll will be triggered. It is possible for OnKillAll to trigger again later if more enemies are spawned. By default, the &amp;quot;relatively safe&amp;quot; message is displayed. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_IsCompleted}}&lt;br /&gt;
;IsCompleted() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:The game calls this hook to determine if the game statistics should count the level as completed. This is only called for special levels, not scripted levels. By default, all enemies must be dead for the level to be complete.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
These are properties of the global Level variable. They are changed by the engine as the player moves from level to level. For some of the read-only properties, rawset can be used to create a lua property that shadows the pascal property, tricking APIs that are implemented in lua. This is particularly useful for tricking the generator API into using a custom style.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |Word|status|This is for use by level designers. It is preferred to access it through Level.result.&lt;br /&gt;
  |string|name|This is the level name as displayed on the HUD.&lt;br /&gt;
  |Byte|name_number|This controls the &amp;quot;LevX&amp;quot; part of the level name. If zero, it won't be displayed.&lt;br /&gt;
  |Byte|danger_level|Level generation parameter that corresponds to depth.&lt;br /&gt;
  |Byte|style|The style (tile set) used by the level generation functions. This property is read-only.&lt;br /&gt;
  |string|special_exit|The sid of the level that red stairs lead to on the current level number. This property is read-only.&lt;br /&gt;
  |string|special_name|The sid of the current level prototype or the empty string for random levels. This property is read-only.&lt;br /&gt;
  |DWord|item_array_size|Length of the sparse array that stores all the items on the level. This property is read-only.&lt;br /&gt;
  |DWord|being_array_size|Length of the sparse array that stores all the beings on the level. This property is read-only.&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
{{drltable|Level Interface|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|value}}|{{moddef|list|property_get|dot||string|property}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|property_set|dot|string|property|value|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|flag_get|dot||Level Flag|flag}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flag_set|dot||Level Flag|flag|boolean|value}}&lt;br /&gt;
  |{{modarg|value}}|{{moddef|list|roll_weight|dot||list|list|integer|sum}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|weight_list_sum|dot||list|list}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|place_tile|dot||table|translation|string|tile|integer|x|integer|y}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|player|dot||integer|x|integer|y}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|result|dot||integer|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|eye_contact|dot||Coord|c1|Coord|c2}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_visible|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|nuke|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|explosion|dot||Coord|position|integer|radius|integer|delay|integer|damage_dice|integer|damage_sides|Color|color|Sound ID|sound|DamageType|damagetype|ExplosionFlag List|flags|Cell ID|content}}&lt;br /&gt;
  ||'''Cell-specific functions'''&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|light_flag_get|dot||Coord|position|LightFlag|flag}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|light_flag_set|dot||Coord|position|LightFlag|flag|boolean|value}} &lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|hp_get|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|hp_set|dot||Coord|position|integer|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_corpse|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|scan|dot||Area|scan_area|Cell ID|good}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|fill|dot||Cell ID|cell|Area|fill_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood|dot||Cell ID|tile|Area|flood_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|scatter|dot||Area|scatter_area|Cell ID|good|Cell ID|fill|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|scatter_put|dot||Area|scatter_area|table|translation|string|tile|Cell ID|good|integer|count}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|push_cell|dot||Coord|c|Coord|target|boolean|quiet}}&lt;br /&gt;
  ||'''Being-specific functions'''&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|get_being|dot||integer|index}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|get_being_by_uid|dot||integer|uid}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|drop_being|dot||Being ID|bid|Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drop_being_ext|dot||table|being|Coord|position}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|summon|dot||Being ID|bid|integer|count}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|area_summon|dot||Area|where|Being ID|bid|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|clear_being|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|list}}, {{modarg|integer}}|{{moddef|list|get_being_list|dot}}&lt;br /&gt;
  |[[Modding:Being|Being ID]]|{{moddef|list|random_being|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_monster|dot||Being ID|bid|integer|amount}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_monsters|dot||integer|amount}}&lt;br /&gt;
  |{{modarg|Being iterator}}|{{moddef|list|beings|dot}}&lt;br /&gt;
  |{{modarg|Being iterator}}|{{moddef|list|beings_in_range|dot||Coord|position|integer|range}}&lt;br /&gt;
  ||'''Item-specific functions'''&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|get_item|dot||integer|index}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|get_item_by_uid|dot||integer|uid}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|drop_item|dot||Item ID|iid|Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drop_item_ext|dot||table|item|Coord|position}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|drop|dot||Item ID|iid|integer|count}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|area_drop|dot||Area|where|Item ID|iid|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|try_destroy_item|dot||Coord|c}}&lt;br /&gt;
  |{{modarg|list}}, {{modarg|integer}}|{{moddef|list|get_item_list|dot||integer|max_level|integer|unique_mult}}&lt;br /&gt;
  |[[Modding:Item|Item ID]]|{{moddef|list|roll_item_type|dot||ItemType list|itypes|integer|max_level|integer|unique_mod}}&lt;br /&gt;
  |[[Modding:Item|Item ID]]|{{moddef|list|roll_item|dot||integer|max_level|integer|unique_mod}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_items|dot||integer|amount|}}&lt;br /&gt;
  |{{modarg|Item iterator}}|{{moddef|list|items|dot}}&lt;br /&gt;
  |{{modarg|Item iterator}}|{{moddef|list|items_in_range|dot||Coord|position|integer|range}}&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{moddef|desc|property_get|dot|value|string|property}}&lt;br /&gt;
:Gets the value of the given level property. It is preferred to use the Lua dot indexing syntax instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|property_set|dot|string|property|value|value}}&lt;br /&gt;
:Sets the given level property to the given value. It is preferred to use the Lua dot indexing syntax instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flag_get|dot|boolean|Level Flag|flag}}&lt;br /&gt;
;Level.flags&amp;amp;#091;[[Modding:Constants#Level Flags|Level Flag]] flag] &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines the current state of the given level flag.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flag_set|dot||Level Flag|flag|boolean|value}}&lt;br /&gt;
;Level.flags&amp;amp;#091;[[Modding:Constants#Level Flags|Level Flag]] flag] = '''boolean''' value &lt;br /&gt;
:Sets the given level flag to the given value.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_weight|dot|value|list|list|integer|sum}}&lt;br /&gt;
:Randomly chooses an item from the list according to the weight property of the list items. Sum must be the sum of the weights of all the list items.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|weight_list_sum|dot|integer|list|list}}&lt;br /&gt;
:Returns the sum of the weight properties of all the items in the list.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|place_tile|dot||table|translation|string|tile|integer|x|integer|y}}&lt;br /&gt;
:Places the map tile given by ''translation'' and ''tile'' on the map at the position given by ''x'' and ''y''. ''translation'' should be a table that maps single character strings to either cell ids, or to tables. These tables have their first array element be a cell id, but they may also contain a being and''or'' item key that is mapped to a being or item id respectively. Level.drop_being_ext and Level.drop_item_ext syntax is allowed. ''tile'' should be a string of characters that are defined in ''translation''. Line breaks correspond to line breaks on the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|player|dot||integer|x|integer|y}}&lt;br /&gt;
:Sets the initial position of the player for a special or scripted level. This should be called in the Create hook; after that it has no meaningful effect.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|result|dot|integer|integer|value}}&lt;br /&gt;
:If ''value'' is given, updates the level's status and returns nil. If ''value'' is omitted, returns the current status.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|eye_contact|dot|boolean|Coord|c1|Coord|c2}}&lt;br /&gt;
:Determines whether or not there is a line-of-sight path between '''c1''' and '''c2'''. This calculation ignores light flags (such that two beings can have eye contact even if they aren't visible to each other).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_visible|dot|boolean|Coord|position}}&lt;br /&gt;
:Determines if the given position is visible to the player.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|nuke|dot}}&lt;br /&gt;
:Triggers an immediate nuclear explosion as from a [[thermonuclear bomb]].&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|explosion|dot||Coord|position|integer|radius|integer|delay|integer|damage_dice|integer|damage_sides|Color|color|Sound ID|sound|DamageType|damagetype|ExplosionFlag List|flags|Cell ID|content}}&lt;br /&gt;
:Creates an [[explosions|explosion]] centered at the given position with the given parameters. ''radius'' is the size of the explosion. ''delay'' is the delay in milliseconds between animation frames (typically this is around 40). ''damage_dice'' and ''damage_sides'' determine the damage roll for the explosion. For a no-damage explosion, both should be 0. The default damage type is fire. ''content'' determines the cell that is randomly created wherever the explosion does enough damage. By default, there are no flags and there is no content. Only some colors are supported, and these are automatically translated into 3 color combinations used by the explosion animation. The supported colors are LIGHTBLUE, BLUE, MAGENTA, GREEN, LIGHTRED, YELLOW, and the default RED.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|light_flag_get|dot|boolean|Coord|position|LightFlag|flag}}&lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Coord|Coord]] position]&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Gets the value of the given light flag at the given position.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|light_flag_set|dot||Coord|position|LightFlag|flag|boolean|value}} &lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Coord|Coord]] position]&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] = '''boolean''' value &lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] = '''boolean''' value &lt;br /&gt;
:Sets the value of the given light flag at the given position. For the syntax without a position, the light flag will be set at every position on the map. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|hp_get|dot|integer|Coord|position}}&lt;br /&gt;
;Level.hp&amp;amp;#091;[[Modding:Coord|Coord]] position] &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Gets the current hp of the cell at the given position. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|hp_set|dot||Coord|position|integer|value}}&lt;br /&gt;
;Level.hp&amp;amp;#091;[[Modding:Coord|Coord]] position] = '''integer''' value &lt;br /&gt;
:Sets the current hp of the cell at the given position. Setting hp to 0 won't destroy a cell.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_corpse|dot|boolean|Coord|position}}&lt;br /&gt;
:Determines whether the given position has a corpse in it. This counts the cell with id &amp;quot;corpse&amp;quot; as a corpse even though it otherwise isn't a corpse as far as the engine is concerned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scan|dot|boolean|Area|scan_area|Cell ID|good}}&lt;br /&gt;
:Determines if every cell in ''scan_area'' is ''good''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|fill|dot||Cell ID|cell|Area|fill_area}}&lt;br /&gt;
:Sets every cell in the given area to the area. ''fill_area'' is optional; it defaults to the full map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood|dot||Cell ID|tile|Area|flood_area}}&lt;br /&gt;
:Changes CELLSET_FLOORS and CF_LIQUID tiles in the area to ''tile''. If ''tile'' has CF_HAZARD, then it will destroy items.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scatter|dot||Area|scatter_area|Cell ID|good|Cell ID|fill|integer|count}}&lt;br /&gt;
:Chooses ''count'' random tiles in ''scatter_area'' (possibly with duplicates) and sets any chosen cells that are ''good'' to ''fill''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scatter_put|dot||Area|scatter_area|table|translation|string|tile|Cell ID|good|integer|count}}&lt;br /&gt;
:Chooses ''count'' random subareas with upper-left corner in ''scatter_area'' of the size appropriate of ''tile'' (using the first line length and number of lines to define a rectangular area). There may be duplicates or overlaps. For each subarea, if the area is already filled with ''good'', then it is replaced with ''tile'' (according to ''translation''). See Level.place_tile for the semantics of ''translation'' and ''tile''. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|push_cell|dot|boolean|Coord|c|Coord|target|boolean|quiet}}&lt;br /&gt;
:Swaps the content of the cells located in '''c''' and '''target''': this will only occur successfully if '''target''' is a part of CELLSET_FLOORS. If '''target''' has the CF_HAZARD flag, the cell on '''c''' activates its OnDestroy hook. '''quiet''', when set to true, includes messages (mostly specific to barrels, the only object pushed in the base game).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being|dot|Being|integer|index}}&lt;br /&gt;
:Returns the being at the given index in the sparse being array. A being's index won't change as long as it is in the array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being_by_uid|dot|Being|integer|uid}}&lt;br /&gt;
:Returns the being with the given uid, or nil if that being doesn't exist or has been removed from the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_being|dot|Being|Being ID|bid|Coord|position}}&lt;br /&gt;
:Drops a newly created being in the given position. ''bid'' can also be an actual being object, although this should not be used for beings that are already on the map. If the position is occupied, the being will be dropped nearby. The dropped being is returned. If the function fails, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_being_ext|dot||table|being|Coord|position}}&lt;br /&gt;
:As Level.drop_being, except additional values are accetable for ''being'' as Level.drop_item_ext.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|summon|dot|Being|Being ID|bid|integer|count}}&lt;br /&gt;
:Creates new beings of the type given by ''bid'' and amount given by ''count'' and scatters them around the map. The last dropped being (if any) is returned. ''count'' is optional and defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|area_summon|dot|Being|Area|where|Being ID|bid|integer|count}}&lt;br /&gt;
:As Level.summon, but all the summoned beings are randomly placed in ''where'' rather than scattered across the whole map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|clear_being|dot||Coord|position}}&lt;br /&gt;
{{moddef|desc|clear_being|dot||integer|index}}&lt;br /&gt;
:Removes an item from the map at the given position, or from the given index in the item array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being_list|dot|list,integer}}&lt;br /&gt;
:Returns the list and sum (ready to be used with [[#level_roll_weight|Level.roll_weight]]) for beings and beings groups according to Level.danger_level and DIFFICULTY. The result is cached.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|random_being|dot|Being ID}}&lt;br /&gt;
:Returns a random being chosen according to weights from the current level's list. This will never choose a group. The returned id is always a string id.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_monster|dot||Being ID|bid|integer|amount}}&lt;br /&gt;
:Add the given monster type to the level in an amount specified by the total danger value ''amount'' (so it scales appropriately with Level.flood_monsters).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_monsters|dot||integer|amount}}&lt;br /&gt;
:Adds monsters to the level using the normal algorithm for random levels. The ''amount'' is a total danger value such as a value returned by Generator.being_weight.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|beings|dot|Being iterator}}&lt;br /&gt;
:Gives an iterator over all beings in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|beings_in_range|dot|Being iterator|Coord|position|integer|range}}&lt;br /&gt;
:Gives an iterator over all beings within '''range''' units of [[distance]] from '''position''' in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item|dot|Item|integer|index}}&lt;br /&gt;
:Returns the item at the given index in the sparse item array. An item's index won't change as long as it is in the array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item_by_uid|dot|Item|integer|uid}}&lt;br /&gt;
:Returns the item with the given uid, or nil if that item doesn't exist or has been removed from the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_item|dot|Item|Item ID|iid|Coord|position}}&lt;br /&gt;
:Drops a newly created item in the given position. ''iid'' can also be an actual item object, although this should not be used for items that are already on the map. If the position is occupied, the item will be dropped nearby. The dropped item is returned. If the function fails, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_item_ext|dot||table|item|Coord|position}}&lt;br /&gt;
:As Level.drop_item, except additional values are acceptable for ''item''. If ''item'' is a table, the first list element is passed used to determine which item to drop. For other key-value pairs in the table, the property of the dropped item that corresponds to the key will be set to the value.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop|dot|Item|Item ID|iid|integer|count}}&lt;br /&gt;
:Creates new items of the type given by ''iid'' and amount given by ''count'' and scatters them around the map. The last dropped item (if any) is returned. ''count'' is optional and defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|area_drop|dot|Item|Area|where|Item ID|iid|integer|count}}&lt;br /&gt;
:As Level.drop, but all dropped items are randomly placed in ''where'' rather than scattered across the whole map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|try_destroy_item|dot||Coord|c}}&lt;br /&gt;
:Destroys an item at '''position''', if there is one to be found.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item_list|dot|list,integer|integer|max_level|integer|unique_mult}}&lt;br /&gt;
:Returns the list and sum (ready to be used with [[#level_roll_weight|Level.roll_weight]]) for items according to ''max_level'', and ''unique_mult''. ''max_level'' defaults to Level.danger_level, and is used to determine which items fall in the proper level range. Unique items' weights are multiplied by ''unique_mult'' (which defaults to 1). The result is cached.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_item_type|dot|Item ID|ItemType list|itypes|integer|max_level|integer|unique_mod}}&lt;br /&gt;
:Returns a random item chosen from among the given item types according to weights from the list specified by ''max_level'' and ''unique_mod''. The returned id is always a string id.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_item|dot|Item ID|integer|max_level|integer|unique_mod}}&lt;br /&gt;
:As Level.roll_item_type, but the item type of the result isn't restricted.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_items|dot||integer|amount|}}&lt;br /&gt;
:Adds items to the level according to the normal algorithm for random levels (not counting special features). The number of items is given by ''amount''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|items|dot|Item iterator}}&lt;br /&gt;
:Gives an iterator over all items in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|items_in_range|dot|Item iterator|Coord|position|integer|range}}&lt;br /&gt;
:Gives an iterator over all items within '''range''' units of [[distance]] from '''position''' in the level.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:generator_API_(0.9.9.7)</id>
		<title>Modding:generator API (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:generator_API_(0.9.9.7)"/>
				<updated>2012-03-16T04:46:44Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: somehow forgot generate_tiled_dungeon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The generator holds all of the ever-present functions used to create the random maps in DoomRL. It also contains a variety of helper functions, many of them useful if not vital to the creation of intricate and meticulous game design.&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Interface'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333; &lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|Coord}}|{{moddef|list|safe_empty_coord|dot}} &lt;br /&gt;
  |{{modarg|Coord}}|{{moddef|list|standard_empty_coord|dot}} &lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|set_permanence|dot||Area|ar|boolean|val|Cell|tile}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|setup_ice_event|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|setup_perma_event|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|setup_alarm_event|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|setup_deadly_air_event|dot||integer|step}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|setup_nuke_event|dot||integer|minutes}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|setup_flood_event|dot||integer|direction|integer|step|Cell|cell|boolean|pure}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|being_weight|dot}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|item_amount|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|restore_walls|dot||Cell|wall_cell|boolean|keep_fluids}}&lt;br /&gt;
  |{{modarg|Cellset list}}|{{moddef|list|cell_set|dot||list|list}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|horiz_river|dot||Cell|cell|integer|width|boolean|bridge}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|vert_river|dot||Cell|cell|integer|width|boolean|bridge|Coord|pos}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_rivers|dot||boolean|allow_horiz|boolean|allow_more}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drunkard_walk|dot||Coord|start|integer|steps|Cell|cell|Cell list|ignore|boolean|break_on_edge}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drunkard_walks|dot||integer|amount|integer|steps|Cell|cell|Cell list|ignore|boolean|break_on_edge|Area|drunk_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|contd_drunkard_walks|dot||integer|amount|integer|steps|Cell|cell|Coord|edges1|Coord|edges2|Cell list|ignore|boolean|break_on_edge}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|plot_lines|dot||Coord|where|Area|larea|boolean|horiz|Cell|cell|Cell list|block}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|maze_dungeon|dot||Cell|floor_cell|Cell|wall_cell|integer|granularity|integer|tries|integer|minl|integer|maxl}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|warehouse_fill|dot||Cell|wall_cell|Area|fill_area|integer|box_size|integer|amount}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|warehouse_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|add_room|dot||Area|room}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|add_rooms|dot}}&lt;br /&gt;
  |{{modarg|Room}}|{{moddef|list|get_room|dot||integer|min_size|integer|max_x|integer|max_y}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_tiled|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_warehouse_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_tiled_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_tiled_arena_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_city_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_maze_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_archi_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_caves_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_arena_dungeon|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_fluids|dot||Area|drunk_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_barrels|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_stairs|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_special_stairs|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_lever_room|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_teleport_room|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_ammo_room|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_basain|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_warehouse_room|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|generate_vault|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|add_room_feature|dot||boolean|no_monsters}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|handle_rooms|dot||boolean|no_monsters}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|place_player|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|roll_event|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|reset|dot}}&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
;{{moddef|desc|safe_empty_coord|dot}} &lt;br /&gt;
:Gives a coordinate that satisfies all [[Modding:Constants#Empty Flags|empty flags]]. If one cannot be found, another attempt is made that excludes EF_NOSAFE; if one still cannot be found, another attempt is made that additionally excludes EF_NOSTAIRS and EF_NOHARM.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|standard_empty_coord|dot}} &lt;br /&gt;
:Gives a coordinate that satisfies all empty flags other than EF_NOSAFE.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|set_permanence|dot||Area|ar|boolean|val|Cell|tile}}&lt;br /&gt;
:Adds the &amp;quot;frozen&amp;quot; level event to the map and records it in the mortem history. Levels with the frozen event change all walls into ice walls and all fluids into water.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|setup_ice_event|dot}}&lt;br /&gt;
:Adds the &amp;quot;frozen&amp;quot; level event to the map and records it in the mortem history. Levels with the frozen event change all walls into ice walls and all fluids into water.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|setup_perma_event|dot}}&lt;br /&gt;
:Adds the &amp;quot;sturdy&amp;quot; level event to the map and records it in the mortem history. Levels with the sturdy event set all wall tiles to be permanent.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|setup_alarm_event|dot}}&lt;br /&gt;
:Adds the &amp;quot;alarm&amp;quot; level event to the map and records it in the mortem history. Levels with the alarm event set all non-player beings' [[Modding:Constants#Being Flags|BF_HUNTING]] flag to true.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|setup_deadly_air_event|dot||integer|step}}&lt;br /&gt;
:Adds the &amp;quot;deadly air&amp;quot; event to the map and records it in the mortem history. Levels with the deadly air event cause all beings to lose hit points every '''step''' turns.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|setup_nuke_event|dot||integer|minutes}}&lt;br /&gt;
:Adds the &amp;quot;armed nuke&amp;quot; event to the map and records it in the mortem history. Levels with the armed nuke event begin with a [[thermonuclear bomb]] set at the player's starting position, which will explode in ''minutes'' game minutes.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|setup_flood_event|dot||integer|direction|integer|step|Cell|cell|boolean|pure}}&lt;br /&gt;
:Adds the &amp;quot;flood&amp;quot; event to the map and records it in the mortem history. Levels with the flood event are slowly filled with a fluid: ''direction'' determines whether the floor travels from the right (-1) or from the left (+1); every ''step'' turns, ''cell'' will replace all tiles in a next column to be flooded. Setting ''pure'' to false will move the player and stairs to opposite sides of the map, with the player nearest the flood.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|being_weight|dot|integer}}&lt;br /&gt;
:Gives a value equal to the difficulty-adjusted weight of beings for a given danger level. These are the results used for the base game's monster generation parameters.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|item_amount|dot|integer}}&lt;br /&gt;
:Gives a value equal to the number of items spawned for a given danger level. On level types where the this amount isn't preset, this is the result used for the base game's item generation parameters.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|restore_walls|dot||Cell|wall_cell|boolean|keep_fluids}}&lt;br /&gt;
:Sets all cells on the edge of the map to ''wall_cell''. If ''keep_fluids'' is set to true, fluid tiles will be maintained but set as permanent.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|cell_set|dot|Cellset list|list|list}}&lt;br /&gt;
:Creates a cellset for all cells in ''list''. The returned list functions just like any [[Modding:Constants#Cellsets|CELLSET constant]].&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|horiz_river|dot||Cell|cell|integer|width|boolean|bridge}}&lt;br /&gt;
:Adds a horizontal river to the map, created using ''cell'' tiles. ''width'' sets the tile-width of the river. If ''bridge'' is set to true, a non-fluid floor bridge will be created on the river.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|vert_river|dot||Cell|cell|integer|width|boolean|bridge|Coord|pos}}&lt;br /&gt;
;{{moddef|desc|vert_river|dot||Cell|cell|integer|width|boolean|bridge|integer|pos}}&lt;br /&gt;
:Adds a vertical river to the map, created using ''cell'' tiles. ''width'' sets the tile-width of the river, and ''pos'' sets the starting position of the river. If ''pos'' is given as an integer, then the starting y-coordinate of the river is at the top of the map. If ''bridge'' is set to true, a non-fluid floor bridge will be created on the river.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_rivers|dot||boolean|allow_horiz|boolean|allow_more}}&lt;br /&gt;
:Generates a random number of horizontal and vertical rivers on the map. See [[Fluids#Rivers|Rivers]] for more information. The fluid type varies with map depth.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|drunkard_walk|dot||Coord|start|integer|steps|Cell|cell|Cell list|ignore|boolean|break_on_edge}}&lt;br /&gt;
:Generates ''cell'' tiles according to a drunken walk algorithm. It travels ''steps'' times, starting at the coordinate ''start''. Any cells in ''ignore'' will not be set over but the algorithm will still continue. If ''break_on_edge'' is set to true, the drunken walk will stop if it hits a map border: otherwise it will continue, clamping cells within the map as necessary.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|drunkard_walks|dot||integer|amount|integer|steps|Cell|cell|Cell list|ignore|boolean|break_on_edge|Area|drunk_area}}&lt;br /&gt;
:As Generator.drunkard_walk, but repeated ''amount'' times. Additionally, rather than specifically a starting position, all walks are chosen from a random coordinate within ''drunk_area''.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|contd_drunkard_walks|dot||integer|amount|integer|steps|Cell|cell|Coord|edges1|Coord|edges2|Cell list|ignore|boolean|break_on_edge}}&lt;br /&gt;
:As Generator.drunkard_walks, but rather than limiting the walk's starting position, the walk will stop prematurely if it has reached the x- or y-coordinates of both ''edges1'' and ''edges2''.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|plot_lines|dot||Coord|where|Area|larea|boolean|horiz|Cell|cell|Cell list|block}}&lt;br /&gt;
:Generates a line of ''cell'' tiles on the map, starting at ''where'' and extending to the boundaries of ''larea''. ''horiz'' set to true will produce horizontal lines: otherwise it will produce vertical lines. If a cell from ''block'' is found, the line will end prematurely at the end on which it was blocked.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|maze_dungeon|dot||Cell|floor_cell|Cell|wall_cell|integer|granularity|integer|tries|integer|minl|integer|maxl}}&lt;br /&gt;
:Generates a map-wide maze, using ''wall_cell'' as the wall tiles and ''floor_cell'' as the floor tiles. Wall corridors are at least ''minl'' tiles apart and at most ''maxl'' tiles apart: ''granularity'' sets a rough complexity of the map. The number of walls attempted to be made is equal to ''tries''.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|warehouse_fill|dot||Cell|wall_cell|Area|fill_area|integer|box_size|integer|amount}}&lt;br /&gt;
:Generates ''wall_cell'' tiles in the shape of a square within ''fill_area''. ''boxsize'' sets the size of the side of a box, and ''amount'' sets the number of tries for boxes to be added.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|warehouse_dungeon|dot}}&lt;br /&gt;
:Generates a map-wide warehouse setting. Warehouse dungeons are divided into three large rooms, each attempting 50 tries with boxes of side length 3.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|add_room|dot||Area|room}}&lt;br /&gt;
:Adds ''room'' to the Generator.room_list and Generator.room_meta lists. This is used in conjunction with room generation functions.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|add_rooms|dot|boolean}}&lt;br /&gt;
:As Generator.add_room, but locates all rooms on the map and adds them to Generator.room_list and Generator.room_meta instead.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|get_room|dot|Room|integer|min_size|integer|max_x|integer|max_y}}&lt;br /&gt;
:Finds a room that contains at least ''min_size'' in both height and width, and has a width and height no bigger than ''max_x'' and ''max_y'', respectively.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_tiled|dot}}&lt;br /&gt;
:Generates a &amp;quot;normal&amp;quot; map. Normal levels are divided randomly into rectangular rooms.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_warehouse_dungeon|dot}}&lt;br /&gt;
:Builds a &amp;quot;warehouse&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_tiled_dungeon|dot}}&lt;br /&gt;
:Builds a &amp;quot;normal&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_tiled_arena_dungeon|dot}}&lt;br /&gt;
:Builds a &amp;quot;single-monster&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_city_dungeon|dot}}&lt;br /&gt;
:Builds a &amp;quot;city&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_maze_dungeon|dot}}&lt;br /&gt;
:Builds a &amp;quot;maze&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_archi_dungeon|dot}}&lt;br /&gt;
:Builds an &amp;quot;archi&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_caves_dungeon|dot}}&lt;br /&gt;
:Builds a &amp;quot;cave&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_arena_dungeon|dot}}&lt;br /&gt;
:Builds an &amp;quot;arena&amp;quot; level. This includes everything necessary to be played as a typical random level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_fluids|dot||Area|drunk_area}}&lt;br /&gt;
:Generates all non-river fluids on the map using drunken walks, within ''drunk_area''. The fluid type varies with danger level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_barrels|dot}}&lt;br /&gt;
:Generates all barrels on the map, The barrel type varies with danger level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_stairs|dot}}&lt;br /&gt;
:Generates stairs on the map.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_special_stairs|dot}}&lt;br /&gt;
:Generates special stairs on the map, if a special level exists at the current map depth.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_lever_room|dot}}&lt;br /&gt;
:Finds a room of appropriate size and adjusts it into a lever room.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_teleport_room|dot}}&lt;br /&gt;
:Finds a room of appropriate size and adjusts it into a teleporter room.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_ammo_room|dot}}&lt;br /&gt;
:Finds a room of appropriate size and adjusts it into an ammo room. The type of ammo varies with danger level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_basain|dot}}&lt;br /&gt;
:Finds a room of appropriate size and adjusts it into a room filled with fluid.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_warehouse_room|dot}}&lt;br /&gt;
:Finds a room of appropriate size and adjusts it into a room with boxes (as Generator.warehouse_fill).&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|generate_vault|dot}}&lt;br /&gt;
:Finds a room of appropriate size and adjust it into a vault. The monsters, items, and type of vault vary with danger level.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|add_room_feature|dot||boolean|no_monsters}}&lt;br /&gt;
:Randomly selects a room generation function to be added to the map. ''no_monsters'' set to true excludes the possibility of a vault room being generated.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|handle_rooms|dot||boolean|no_monsters}}&lt;br /&gt;
:Generates up to seven special rooms on the map and restores walls that were otherwise removed as a result of the room generation.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|place_player|dot}}&lt;br /&gt;
:Adds to player to the map.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|roll_event|dot}}&lt;br /&gt;
:Randomly select a level event function to be added to the map.&lt;br /&gt;
----&lt;br /&gt;
;{{moddef|desc|reset|dot}}&lt;br /&gt;
:Clears all generation properties and hooks, and changes the map into one bordered with the level style's walls and otherwise filled with the level style's floors.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Tutorial/Basic_Syntax_and_Definitions</id>
		<title>Modding:Tutorial/Basic Syntax and Definitions</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Tutorial/Basic_Syntax_and_Definitions"/>
				<updated>2012-03-11T20:38:14Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: step before last!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following is a very quick explanation of general programming syntax in lua. If you know even a little about programming, you do not likely need to read any of this.&lt;br /&gt;
&lt;br /&gt;
==Variables==&lt;br /&gt;
&lt;br /&gt;
Writing in a computer language is very brief and exact, and never involves any connotations or implications. In fact, with the exception of particular inputs and outputs, all of the language is entirely internal, purposed to communicate with the computer in order to perform calculations. Rather than directly using numbers, which do not allow for changes, you will want to assign any values you use to a variable. In lua, declaring a variable can be done by preceding it with the word &amp;quot;local&amp;quot;, and assigning the variable a value is done using the equal sign.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local yes = 1&lt;br /&gt;
local no = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this code, whenever you would use the variable 'yes', it will be read as a true value, and whenever you would use the variable 'no', it will be read as a false value. (Note that the parameters are not always &amp;quot;local&amp;quot;: this will be covered in detail elsewhere.) Variables can be reassigned as much as you want unless they are read-only on the engine side (this comes up in a few places for our purposes).&lt;br /&gt;
&lt;br /&gt;
Variables in lua can be of a variety of different types. Typically you will use the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local var_void = nil          --singular value, used mostly to be a placeholder&lt;br /&gt;
local var_boolean = true      --double value, true/false meant for satisfying conditions&lt;br /&gt;
local var_number = 3.14159    --double-precision floating-point value, pretty much any number you could possibly want&lt;br /&gt;
local var_string = 'awesome'  --sequence of characters, must have single- or double-quotes around them&lt;br /&gt;
local var_function = print    --subroutine, used to reference pieces of code over an entire file&lt;br /&gt;
local var_table = {1 = 'a'}   --associative array of fields, holds a lot of information in a single place (explained later)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the purpose of modding, you are often restricted by what type you can use based on what is allowed by the API. If an input was expecting a string and you use a boolean value, you will almost certainly get an error. Note that the left side could be just about anything you want: use whatever naming scheme works for you.  There are, however, some exceptions ([http://www.lua.org/pil/1.3.html found here]) and you should be aware of them.&lt;br /&gt;
&lt;br /&gt;
==Operators==&lt;br /&gt;
&lt;br /&gt;
Calculations themselves are based on a variety of operators. The most basic operators are arithmetic, involving simple mathematical calculations (such as addition), and relational, which compare two values on either side of the operator. Logical operators first check the true/false values that are attached to the operator, then determine the true/false value of the whole statement, depending on which operator is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--Arithmetic operators&lt;br /&gt;
2 + 4   --gives a value of 6 (addition)&lt;br /&gt;
10 - 6  --gives a value of 4 (subtraction)&lt;br /&gt;
3 * 7   --gives a value of 21 (multiplication)&lt;br /&gt;
16 / 2  --gives a value of 8 (division)&lt;br /&gt;
-8      --gives a value of negative 8 (unary)&lt;br /&gt;
&lt;br /&gt;
--Relational operators&lt;br /&gt;
3 == 3  --true (note that equality relations are understood with ==)&lt;br /&gt;
12 ~= 1 --true (not equal to)&lt;br /&gt;
6 &amp;gt; 2   --false (greater than)&lt;br /&gt;
6 &amp;lt; 9   --true (less than)&lt;br /&gt;
2 &amp;gt;= 2  --true (greater than or equal to)&lt;br /&gt;
5 &amp;lt;= 4  --false (less than or equal to)&lt;br /&gt;
&lt;br /&gt;
--Logical operators&lt;br /&gt;
0 or 1  --returns true; either value must be true&lt;br /&gt;
0 and 1 --returns false; both values must be true&lt;br /&gt;
not 0   --returns true; negates the value that it operates on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using parentheses to determine the order of operations is usually the best way to write code, although generally arthemetic operations are performed before relational ones, and relational operators are performed before logical ones. (The notable exception are the unary arithmetic and the &amp;quot;not&amp;quot; logical operators, which take precendence over everything.) Finally, for cases of equal priority, the left side is calculated before the right side.&lt;br /&gt;
&lt;br /&gt;
If you want to add variables or line-breaks in a string, end the string, include a double-dot syntax (&amp;quot;..&amp;quot;), and add the variable or start a new line. This is known as concatenation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--displays &amp;quot;Hello world&amp;quot;&lt;br /&gt;
print(&amp;quot;Hello &amp;quot; .. &amp;quot;world&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local var = 300&lt;br /&gt;
--displays &amp;quot;There are 300 bullets in the room.&amp;quot;&lt;br /&gt;
print(&amp;quot;There are &amp;quot; .. var .. &amp;quot; bullets in the room.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
--displays &amp;quot;This is just a single line of text.&amp;quot;&lt;br /&gt;
print(&amp;quot;This is just &amp;quot; ..&lt;br /&gt;
      &amp;quot;a single line &amp;quot; ..&lt;br /&gt;
      &amp;quot;of text.&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Conditional Syntax==&lt;br /&gt;
&lt;br /&gt;
Trying to determine how your code will run is primarily executed through conditional statements. These include:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if condition    --check to see if condition is true&lt;br /&gt;
    then result --if condition was true, do result&lt;br /&gt;
end             --conditional statements must always finish with this line&lt;br /&gt;
&lt;br /&gt;
if condition1     --check to see if condition1 is true&lt;br /&gt;
    then result1  --if condition1 was true, do result1&lt;br /&gt;
elseif condition2 --if condition1 was false, check to see if condition2 is true&lt;br /&gt;
    then result2  --if condition2 was true, do result2&lt;br /&gt;
else&lt;br /&gt;
    result3       --if condition2 (and condition1) was false, do result3&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
while condition --check if condition is true&lt;br /&gt;
   do task      --if condition was true, task is executed; if it was false, skip&lt;br /&gt;
end             --if condition was true, repeat the statement; if it was false, end statement&lt;br /&gt;
&lt;br /&gt;
repeat          --repeat the following lines indefinitely&lt;br /&gt;
   task         --task executes (always executes at least once)&lt;br /&gt;
until condition --if condition is true, end statement&lt;br /&gt;
&lt;br /&gt;
for var=val1,val2,val3 --iterate following lines based on vals&lt;br /&gt;
    do task            --task is executed a number of times equal to the number of vals&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for var=first,last,step --iterate following lines from first to last, using step as iterator&lt;br /&gt;
    do task             --task is executed (last-first+1)/step times (rounded down)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for var,iter in ipairs(array) --iterate following lines for all fields in array, iter acts as index (if necessary)&lt;br /&gt;
    do task                   --task is executed for as many fields as there are in the array&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for var,iter in pairs(table) --same as above but with a table&lt;br /&gt;
    do task                  --task is executed for as many keys as there are in the table&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a lot of these are confusing, don't worry as we'll eventually manage to find ways to include them in the tutorial as we go.&lt;br /&gt;
&lt;br /&gt;
Finally, we have two miscellaneous statements: break and return. Break will prematurely exit a conditional statement, and could be used to, for instance, exit a &amp;quot;while true&amp;quot; loop (although this should probably be avoided). The following example would print the index number of the first true value in binary_array (which should be a 7) and then exit the loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
binary_array = {0,0,0,0,0,0,1,0,0,0,1,0,0,1}&lt;br /&gt;
&lt;br /&gt;
for v,i in ipairs(binary_array) do&lt;br /&gt;
    if i&lt;br /&gt;
        print(i)&lt;br /&gt;
        break&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Return is used with functions.  Calling return in a function ends execution of that function immediately and can be used to return data to whatever called it. Using the previous example, we can instead return the index number rather than printing it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
index = local function findTrueValue(binary_array)&lt;br /&gt;
    for v,i in ipairs(binary_array) do&lt;br /&gt;
    if i&lt;br /&gt;
        return(i)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brief lesson in lua scripting should be all you need in order to understand the various examples found in the tutorial.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Ripper</id>
		<title>Ripper</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Ripper"/>
				<updated>2012-03-05T18:38:03Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: firetime isn't part of melee weapon template: moved attack time mention to comments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
{{melee weapon|&lt;br /&gt;
weapon_name=Ripper|&lt;br /&gt;
weapon_dmg=6d6/6-36|&lt;br /&gt;
weapon_avgdmg=21|&lt;br /&gt;
weapon_dmgtype=[[Damage type#Melee|Melee]]|&lt;br /&gt;
weapon_accuracy=-4|&lt;br /&gt;
weapon_firetime=0.5s|&lt;br /&gt;
weapon_afire=None|&lt;br /&gt;
weapon_get=[[Assemblies|Assembly]]: {{exotic link|chainsaw}} + PPBT|&lt;br /&gt;
weapon_quote=N/A|&lt;br /&gt;
weapon_looks=&amp;lt;font color=&amp;quot;cyan&amp;quot;&amp;gt;&amp;lt;b&amp;gt;\&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;|&lt;br /&gt;
weapon_description=Assembly (same as original)|&lt;br /&gt;
weapon_other=This weapon has a 0.5s attack time.|&lt;br /&gt;
weapon_source=[http://en.wikipedia.org/wiki/Jack_the_Ripper Jack the ''Ripper'']}}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/DRL_Wiki</id>
		<title>DRL Wiki</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/DRL_Wiki"/>
				<updated>2012-02-21T19:45:26Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: it's pretty patched for 0995&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Welcome to the DoomRL Wiki, wherein detailed game information, strategy tips, and modding documentation are found. If you wish to make edits and generally contribute to increasing the sum of knowledge in the community, [[Special:UserLogin|you can log in]] with your [http://forum.chaosforge.org/ ChaosForge.org forum] login and password. (Note that you must have at least 20 forum posts, or be a supporter, in order to login.)&lt;br /&gt;
&lt;br /&gt;
== Game Information ==&lt;br /&gt;
&lt;br /&gt;
This section is meant to be as objective as possible. DO NOT add your opinions in these pages regarding their subject matter. (Naturally, if there are definite errors on any pages in Game Information, you can edit for that purpose.)&lt;br /&gt;
&lt;br /&gt;
* [[Weapons]]&lt;br /&gt;
* [[Armor]]&lt;br /&gt;
* [[Items]]&lt;br /&gt;
* [[Specials]]&lt;br /&gt;
* [[Assemblies]]&lt;br /&gt;
* [[Enemies]]&lt;br /&gt;
* [[Levels]]&lt;br /&gt;
* [[Game Settings]]&lt;br /&gt;
* [[Character Development]]&lt;br /&gt;
* [[Achievements]]&lt;br /&gt;
* [[Documentation]]&lt;br /&gt;
* [[Mechanics]]&lt;br /&gt;
&lt;br /&gt;
== Strategy Emporium ==&lt;br /&gt;
&lt;br /&gt;
Stuff like strategy guides, tips and tricks, etc, goes here. To what extent the big guides go here is debatable, as this is meant to be talk-heavy as opposed to edit-heavy.&lt;br /&gt;
&lt;br /&gt;
* [[Strategy:Guidelines|Guidelines]]&lt;br /&gt;
* [[Strategy:Contest pages|Contest]]&lt;br /&gt;
&lt;br /&gt;
* Strategy-specific pages:&lt;br /&gt;
** [[Strategy:Giftdropping|Giftdropping]]&lt;br /&gt;
&lt;br /&gt;
== Modding Community ==&lt;br /&gt;
* [[Modding:History|History]]&lt;br /&gt;
* [[Modding:Documentation|Documentation]]&lt;br /&gt;
* [[Modding:Tutorial|Tutorial Series]]&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Arachnotron</id>
		<title>Strategy:Arachnotron</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Arachnotron"/>
				<updated>2012-02-14T15:31:40Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: some spacing to differentiate between entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Overview'''&lt;br /&gt;
&lt;br /&gt;
The Arachnotron is a ranged attacker, equipped with a lowish-power (1d5x5) but somewhat accurate (+3) plasma gun. Even in the best circumstances, fighting a ‘tron in an open area is a hairy proposition, but a straight-up gunfight is seriously complicated by an Arachnotron’s 130% Speed. This essentially means that an Arachnotron will get to make (assuming normal move/act speeds for the player) 4 actions for every 3 of your actions. Generally, these actions will be to fire upon the player should s/he be in view, and those extra actions have a nasty tendency to appear at the exact worst times.  &lt;br /&gt;
&lt;br /&gt;
Arachnotrons are fairly durable with 50 hitpoints and 2 points of armor, so fairly heavy firepower is necessary to bring one down efficiently. However, their high speed results in an enemy that can lay down a very heavy field of fire. Circlestrafing or sidestepping is somewhat effective, but two factors work against the player who attempts this. First, the sheer number of shots an Arachnotron can put downrange mean that at least a few bolts will hit you eventually, and Arachnotrons are frighteningly good at getting their extra action while firing on the player.This extra action essentially means that the Arachnotron will get a free cheap shot on a “stationary” player, since the player did not move immediately prior to the Arachnotron’s last move. (For more info, take a look at Dodge) Needless to say, this is very bad for the player.&lt;br /&gt;
&lt;br /&gt;
'''Combat Tactics'''&lt;br /&gt;
&lt;br /&gt;
Now that we know what we’re up against, how do we go about killing these things? As noted above, Arachnotrons are pretty tough, so we’ll probably need a few actions to bring one down. The threat of being counter-attacked should always loom large, so most of our tactics should generally involve firing such that our foe cannot retaliate.&lt;br /&gt;
&lt;br /&gt;
Early-game (Hell’s Armory, ordinary floors at higher difficulty levels), your best bet is some flavor of shotgun and corner-shooting. Shotguns serve very well by permitting the player to attack blindly, and by knocking back the Arachnotron, forcing it to spend an action getting back into position. Knockback can also sometimes be used to push an Arachnotron into acid or lava, killing it more quickly, but often destroying their plasma cells in the process. If an Arachnotron is dumb enough to close into melee range while you have a shotgun equipped, you should think twice before firing at point-blank range. If the ‘tron is badly injured, and you’re certain that your next blast will kill it, then go ahead and fire. Alternatively, if the ‘tron is against a wall and won’t be knocked back, go to town- this particular foe is weak in melee. However, if the Arachnotron is fairly healthy and has a space to be knocked into, you may want to switch weapons- the danger is that you’ll knock the ‘tron out of melee range and it’ll melt you with easy short-range fire on a stationary target.&lt;br /&gt;
&lt;br /&gt;
I generally don’t endorse using rapid-fire weapons against ‘trons unless your build really takes advantage of them. A chaingun in untrained hands will be a difficult and painful gunfight; a plasma rifle should do a bit better owing to the increased damage and armor reduction, but it’ll still be messy. Any rapid-fire master trait (especially Ammochain) lets a player go just about toe-to-toe with a ‘tron, generally by wasting the ‘tron first. Blind-firing into a known position is a fully viable strategy, but may be expensive, ammo-wise. Staying out of an Arachnotron’s sights is generally worth the ammo investment, and plasma users might be able to break even.&lt;br /&gt;
&lt;br /&gt;
An unmodified rocket launcher is a rather poor choice for slaying ‘trons, but pretty much any practical mod setup or special rocket launcher is quite effective. A non-exhaustive list of “good” mod setups would include: 1 bulk mod, a micro launcher, or a tactical rocket launcher. Alternatively, a couple levels in Reloader will work; offsetting that slow reload time is crucial to using rockets against Arachnotrons. Since they already have the potential to double-act, the base reload time only makes that problem worse should you choose to reload at a bad time. Actually fighting Arachnotrons with rockets is pretty simple: check range, aim, shoot, reload and repeat. Rockets should usually deal knockback, and an Arachnotron engaged at the edge of viewing range should seldom retaliate effectively, if at all. 3 rockets will usually do the job, but will destroy the plasma cell drop.&lt;br /&gt;
&lt;br /&gt;
The BFG 9000 is OVERKILL, and if you’re pointing one at an Arachnotron, it better have a lot of nearby ugly friends, or you better be sitting on a trainload of extra cells. The same problem with the rocket launcher (reload time) is also an issue for BFGs.&lt;br /&gt;
&lt;br /&gt;
The last engagement option is to get up close and bash an Arachnotron’s ugly face in with a melee weapon. Surprisingly, this is a pretty good idea: Arachnotrons have -100% (yes, that is a negative) resistance to melee damage. Anybody can easily dispatch a ‘tron with a chainsaw, and a trained Brute can punch one out with little trouble. Arachnotrons can hit back for moderate damage, but it is a lot less than their ranged attack. Of course, the only problem is getting close…&lt;br /&gt;
&lt;br /&gt;
Also, switching to your best armor is seldom a bad idea, just in case. This usually means Red Armor, or something with Plasma resist (if you’ve gotten lucky).&lt;br /&gt;
&lt;br /&gt;
'''Other Considerations'''&lt;br /&gt;
&lt;br /&gt;
Defensive traits such as Ironman and Tough as Nails don’t exactly shine against Arachnotrons, but the extra tankiness is the unsung hero that will keep you alive during a firefight. I typically take Ironman after getting a master trait on just about every build I do. Brute can be valuable as well, but charging an Arachnotron just for the sake of getting a melee kill is a bad idea; baiting a ‘tron into chasing you can simplify the “closing-in” problem, but you may take some hits. Dodgemaster is actually less helpful than you would think, since Arachnotrons attack in bursts, and the trait only affects the first dodge per incoming attack. Rank 2 in Intuition is always good, perhaps even too good- the application should be pretty obvious. Gun Kata has the potential to ruin Arachnotrons so long as your pistols have the capacity to kill your target in one clip. Ammochain is a time-tested classic trait; the near-zero ammo consumption combined with a well-modded weapon allows a player to easily outshoot ‘trons. If you’ve managed to get a really good suit of armor Survivalist has the potential to be absolutely hilarious and can totally negate an incoming volley.&lt;br /&gt;
&lt;br /&gt;
One other thing: Arachnotron Caves (shudder). These fiendish levels have ended many a game for unfortunate Doomguys everywhere. ‘Tron Caves are seldom simple, and a lot of times your best bet is to simply try and bolt for the stairs or pop a Homing Phase. If you feel confident in your gear and your supplies, clearing the cave presents both challenge and opportunity. The challenges lie in the fact that caves combine huge open areas with lots of blind corners. Radar shoot where possible and try and stay behind cover if using shotguns. There are positions where you can see your target but they cannot see you (and thus cannot retaliate); these positions are not intuitive or easy to communicate, but can be figured out over time. If using a well-kitted rocket launcher (or derivative), try to isolate and snipe ‘trons individually just as they enter vision. This is often easier said than done, but a Missile Launcher really helps. Rapid-fire gunners should simply try and stay in cover and poke at Arachnotrons when they wander into view; gunners typically have the firepower to quickly dispatch ‘trons but nobody can really afford to get shot up. Of course, the opportunity presented is the pile of power cells that the Arachnotrons will drop, and occasionally loot and powerups on the floor. [[User:IronBeer|IronBeer]] 19:02, January 27 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Arachnotrons are mean little spiders. Their dealing plasma damage makes them a threat, but 1d5 damage per projectile isn't the end of the world. What's really amazing is that they have 50 health and 2 armor, so they'll take a pretty good beating before going down. Their 130% speed puts them on par with demons, but realize that this affects their firing speed as well as their movement speed. Corner shooting an arachnotron with a combat shotgun is one of the safest ways to take out an arachnotron with ordinary weapons, but in a pinch a rocket launcher is effective, as is a BFG if can spare the cells. Fighting an arachnotron out in the open is dangerous (though this is true against most enemies), but sometimes it is unavoidable; this is really when bringing out the rocket launcher is nice. Some people recommend activating run mode to avoid their projectiles more, but I don't think it's necessary unless you're going to run for cover or are fighting against multiple enemies. I am personally rather stingy with run mode, however, so it could be something to try.&lt;br /&gt;
&lt;br /&gt;
Arachnotrons take double damage from melee and deal rather pitiful melee damage themselves, so killing them with melee is a decent option as long as you have at least a combat knife (though if possible I'd recommend just corner shooting with shotguns if a knife really is your best melee weapon; chainsaw is more doable). If you find yourself a couple of spaces away from an arachnotron with no cover immediately available, charging into melee range is probably your best option (running mode not necessary, in my opinion). Another way to get them into melee range is to just wait around a corner and shoot them to get their attention, and wait.  Charging into melee towards an arachnotron at the edge of your vision is just asking for trouble though: you'll be taking plasma volleys, and in general charging into melee exposes you to fire from other enemies, especially ones that were out of sight behind the one you're after.&lt;br /&gt;
&lt;br /&gt;
The worst case scenario is finding an arachnotron cave. Lots of spiders, lava, and a lack of decent cover makes clearing out the cave a formidable task. Some people would advice phasing past the level or running for the stairs, but I like making enemies dead, so let's assume that option is off the table. How can one clear out an arachnotron cave and live to tell about it?  Well, the first step is usually going to be to find cover immediately, and it's a difficult step. This is a time where I'd recommend activating run mode if there's any arachnotrons around you. Hurry behind any group of rocks you see, and if you have a rocket launcher or even a BFG, this is a good time to bring it out. A melee weapon can actually be really useful here, as there will often be situations where an arachnotron comes sneaking around the corner of your rock cover, where he's too close to blow up (except with a BFG which doesn't hurt you) and where you can't corner shoot him with a shotgun. If you blast it with a shotgun, you'll just be knocking it back, and you won't be in a position to corner shoot, while it will tear you apart with plasma. It will be just a few steps away from melee range though, and melee doesn't cause knockback and will make the arachnotron fall fast. From your cover, try to corner shoot those spider bastards when possible, shoot them with rockets when you're in their line of fire, and melee them if they sneak up on you (probably not with your fists though). [[User:Matt_S|Matt_S]] 00:24, February 02 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some facts, copied from wiki: 130% speed, (1d5)x5 plasma damage, +3 accuracy, 60% chance to attack, -100% melee resistance, 1d3+2 melee damage&lt;br /&gt;
&lt;br /&gt;
As you can see, enemy is fast,very dangerous in ranged combat and pathetic in melee.&lt;br /&gt;
Basic plan is simple - don't let it shoot you.Get behind the corner, or knock it back outside your FOV, or get to it.Even if you are incompetent in melee and don't have any melee wapons, it's still worth it.Just shoot it while it hits you(be careful not to knock it back though!).Pretty simple i think.&lt;br /&gt;
&lt;br /&gt;
And now about caves - main source of hate for these guys.&lt;br /&gt;
Two main strategies: running and sidestepping.Running implies -4 penalty to enemies' accuracy and gives bonus to dodge chance during sidestep.&lt;br /&gt;
&lt;br /&gt;
On HNTR and HMP arachno caves are not that common and they spawn deep enough for you to be prepared for such encounters.BFG from halls of carnage is guaranteed and it works as good as always.Also number of spiders is not that big usually.&lt;br /&gt;
&lt;br /&gt;
Whole 'nother thing is UV and N!. Lvl7 on UV, lvl6 on N! - that's how early i saw caves on that difficulties.&lt;br /&gt;
Number of enemies is high - 6 and more - this number is not a fact, it's just rougly based on my experience. &lt;br /&gt;
Now they have total +5 accuracy which means 74% chance to hit on the edge of your vision.That means if you are not running and not sidestepping then expect to get hit 4 times out of 5(Since they'are not always on max range).&lt;br /&gt;
So if you have 0 armor, 4 arachnotrons can kill you in one turn if you decide on fighting them directly.&lt;br /&gt;
Your usual weapons during early arachnotron cave encounter: pistol, shotgun, chaingun, rocket launcher if HA's completed, chainsaw.&lt;br /&gt;
None of these is enough to kill them before they kill you.&lt;br /&gt;
That leaves you with only one option if you spawn in the middle - tactical retreat.Running somewhere where they can't swarm you.&lt;br /&gt;
&lt;br /&gt;
Start running and carefully sidestep.If you're not sure if your next move is sidestep,or if it's impossible to sidestep all attacks, think and choose best possible.If you can get to you destination in 1 non-sidestep, better do two sidesteps.Hoping that several arachnotrons will all miss is silly, while actually sidestepping all attacks from 2 arachnotrons is quite possible and happened to different people.&lt;br /&gt;
&lt;br /&gt;
Stairs/Invul globe - if you manage to get to it, you're safe.Do not even think about taking small health globes if you'are under enemy fire.Since they restore you from running to normal, arachnotrons again have +5 accuracy instead of +1, and since you spend your move not on sidestep, you'll lose much more than you could gain.Taking large health globes is safer, but even that can kill you.Same thing about using med-packs - beware of using them without cover.Being Technician here is a great help, as you can switch to running back after 0.1s of not-running.Taking berserk pack is safe, but against arachnotrons it's not as effective as usual as each hit will deal at least 1 damage.If you don't see stairs or nice powerup, run to cover.If you don't see one, then hope that you'are running towards something useful - there's not much else to say in such situation. [[User:AlterAsc|AlterAsc]] 15:34, February 03 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Juggler</id>
		<title>Strategy:Juggler</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Juggler"/>
				<updated>2012-02-14T15:31:08Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added contest entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''General'''&lt;br /&gt;
&lt;br /&gt;
If you're like me and like to carry several different weapons at once, Juggler can really come in handy.  Juggler has 2 main parts, each with their own benefits.&lt;br /&gt;
&lt;br /&gt;
First, Juggler lets you use swap your current weapon with your prepared one instantly.  Normally, this would take 8/10 a second of time, which means that you can switch from your long range plasma rifle to your close range double shotgun if a monster suddenly appears next to you, without letting it get a free hit.  Very useful against Lost Souls, as they almost always get free turns since they are so fast.  This also means that swapping weapons this way (or by quickkey) no longer counts as a turn, which can save precious timewhen going for Icarus Cross medals or when under the effects of berserk, invulnerability, envirosuit packs, or light amp, which have durations in turns (if it takes less than 0.1 seconds to do, it doesn't use up a turn).&lt;br /&gt;
&lt;br /&gt;
The second part of juggler lets you switch between the common weapons in your inventory instantly.  This means that you don't have to have your second weapon in your prepared slot if it's one of the 8 common weapons (Combat Knife, Pistol, Shotgun, Combat Shotgun, Double Shotgun, Rocket Launcher, Chaingun, or Plasma Rifle) or the chainsaw or BFG9000.  This means that you can have a ammo box in the prepared slot and still take advantage of the Juggler bonus by using the quick keys.  One very useful thing this does is that it allows you to get the common weapon upgrades -- combat knife to chainsaw, shotgun to combat shotgun and/or double shotgun, chaingun to plasma rifle, and anything to BFG9000 (on bosses) ready faster.  If you have Juggler before getting to the Chained Court, you can pick the chainsaw up, swap it to the prepared slot, then quickkey swap another weapon in your main weapon slot.  You just picked up the chainsaw and readied it and another weapon all in 1 second and still have it ready to tear monsters apart at any time.&lt;br /&gt;
What's really awesome is that Juggler will work with Assemblies too!  Chainswords, High Power Weapons, and other assembled items can be swapped by using the quickkey for the base item.&lt;br /&gt;
&lt;br /&gt;
With Juggler, you can equip and use several different weapons in a row without worrying about reloading in the middle of combat or spending time switching weapons.  It works well against pain elementals and the swarms of lost souls they can produce.  Start with a room clearing weapon -- the double shotgun (or any shotgun really, but the double shotgun's wide spread make it work well).  Fire it, then switch to a rapid fire weapon (like the chaingun, or, better, the plasma rifle).  A prepared melee weapon can be used to take care of any lost souls that actually reach you.&lt;br /&gt;
&lt;br /&gt;
As a convienence factor, the juggler skill lets you attack with a melee weapon if you have it in the prepared slot (so you don't have to keep switching back and forth manually), although manual switching will still be required if you plan on having an non-melee exotic or unique on deck in the prepared slot for instant switching.  &lt;br /&gt;
&lt;br /&gt;
There are a few points that make Juggler flexible and a viable option on most builds.  The first is that it's available as early as level 2 no matter what class you pick, since it only requires 1 point in Finesse.  The second is that only two master traits block Finesse, and therefore block Juggler: Army of the Dead and Entrenchment.  Therefore, juggler is a nice complement that allows you to access most of the tools you need when you need them, without letting the monsters get a turn. [[User:shark20061|shark20061]] 20:32, February 2 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ability to switch weapons instantly might seem minor at first glance, but it can be a lifesaver, or at least an ammo saver, in any game.  Depending on the situation, you may want to use a shotgun to knock something back or spray a group of small enemies, or you might want to use a plasma gun to get something big dead fast, (such as an Arch-Vile) or you might want to use a chaingun for some precision shooting that isn't serious enough to warrant a plasma gun, (such as a Demon next to a barrel that you don't want to blow up since it might destroy useful items) or a rocket launcher to disperse large groups of enemies.  Being able to switch rapidly and repeatedly in the middle of a battle can be essential in order to have the right weapon out at the right second, especially if you empty a weapon and it would be too dangerous to take the time to reload.&lt;br /&gt;
&lt;br /&gt;
The benefits are limited somewhat by the fact that you only get instant switching with the most basic (numbered) weapons, so it's beneficial to make assemblies with them so you have decently powerful weapons to juggle.  You can include one exotic/unique weapon in your jugglable line-up if you keep it in your prepared slot when you're not using it.  (since Juggler allows instant swapping)  Just remember to swap the exotic/unique back into the prepared slot when you want to switch back to your basic weapons.&lt;br /&gt;
&lt;br /&gt;
An additional benefit introduced in version 0.9.9.5 is the fact that, if you have multiple of one kind of weapon in your main inventory, using the number keys to select your basic weapons now selects the one with the most ammo.  (In previous versions, it would select the one with the *least* ammo which would mean you would frequently pull out empty weapons which was as useless as it was frustrating)  This means you can now, for example, have multiple Chainguns in your inventory and if you empty one, instead of taking 2.5 seconds to reload, you can instantaneously switch to the next one and keep firing without a break!  In order to take advantage of this strategy, there are a couple of things to remember:  Using my above example with the Chainguns, after emptying one of them, you would have to first pull out a different weapon, say a shotgun by pressing 3, before pressing 6 to pull out the full Chaingun.  This is because pressing 6 while you're wielding the Chaingun produces the message &amp;quot;you already have the chaingun in your hands&amp;quot; and nothing happens.  The additional step of pulling out the shotgun is also instantaneous, though, so it doesn't really impact gameplay.  The other thing to remember is that if the empty Chaingun is in the prepared slot, the game will default to swapping rather than switching to the full one in the main inventory.  You will have to do a bit of juggling to get the empty one out of the prepared slot before you can take advantage of the ability to instantly switch to the full one.&lt;br /&gt;
&lt;br /&gt;
The fact that Juggler automatically uses a melee weapon in the prepared slot doesn't usually have an advantage unless you happen to have a unique melee weapon, since you can instantly switch to combat knives and chainsaws anyway.  It does have a use in helping achieve medals and badges that require fists only, though, since, for example, if you have a Chainsaw in the prepared slot while your hands are empty and you have Juggler trait, you will do Chainsaw damage to your enemies, but the game will consider them fist kills.  This makes fist-only challenges a lot easier! [[User:Tormuse|Tormuse]] 10:26, February 6 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Former_commando</id>
		<title>Strategy:Former commando</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Former_commando"/>
				<updated>2012-02-14T15:28:42Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added contest entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
Former commandos are the toughest of all formers, and one of the deadliest enemies throughout the whole game. With a good enough accuracy and a plasma rifle in their hands, they can easily take you down in two volleys. Their ranged offensive power is something to be afraid of, but they share all formers offensive weakness - their pitiful melee attack.&lt;br /&gt;
&lt;br /&gt;
On the defensive side they do not go down easily as well. They have natural two points of armor and will happily grab and wear any armor from the ground to become even more hardy. Their double health, compared to other formers, doesn't help either.&lt;br /&gt;
&lt;br /&gt;
So how to deal with them? If possible, don't allow them to get a shot at you. When you see one, retreat behind a corner and wait for them to come into melee range. [[Strategy:Giftdropping|Gift-dropping]] can help a lot, cornershooting can beat them down a bit before they come close. But beware of knockback of your weapons - you don't want to push them away and let them shower you with plasma.&lt;br /&gt;
&lt;br /&gt;
The best position you can get them in is this:&lt;br /&gt;
&lt;br /&gt;
  ###h&lt;br /&gt;
  # #&lt;br /&gt;
  ###&lt;br /&gt;
    @&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  ###&lt;br /&gt;
  # #h&lt;br /&gt;
  ###&lt;br /&gt;
    @&lt;br /&gt;
&lt;br /&gt;
This works for any side of any corner. In these positions, the commando cannot attack you and potencial knockback (for example from shotguns) will send them back along the wall.&lt;br /&gt;
* If retreat to a safe position is not a viable option, you may simply want to whip out the biggest weapon at your disposal and try to one-hit-kill them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Weapon considerations:&lt;br /&gt;
*Melee: Commandos are pushovers in melee combat, but you have to get to their melee range or lure them to you. Again, gift-dropping and waiting around a corner is probably the best idea. Or simply leave them alone.&lt;br /&gt;
*Pistols: Pistols, unless heavily modded, exotic or unique, are very weak against commandos. An unmodded standard pistol would need seven bullets on average to kill them. Thus, it's definitely wise to retreat if you meet one in the open. Unless you can use any of the strategies mentioned before, that is.&lt;br /&gt;
*Shotguns: These fare better against commandos. A double shotgun can fairly reliably kill them point-blank in one shot (approx. 70% chance).&lt;br /&gt;
On the other hand, if you find one on the edge of your line of sight, even a normal shotgun has a good chance of knockback. With the commandos normal speed, they will then return to your line of sight on your reload without firing. This can be a bit ammo-consuming though.&lt;br /&gt;
*Rapid-fire weapons: Chaingun will not make it for you. It takes three volleys on average to kill a commando, and you may not get the chance to fire three times. Plasma gun works quite better - the chance to kill a commando is about 55% when all the shots hit.&lt;br /&gt;
*Rocket launcher: a standard rocket has slightly below 50% chance of one-hit-kill, and even if it does not kill the commando right away, it will push it back. Then you can just wait for it to come into your line of sight again to kill it with a second rocket.&lt;br /&gt;
*BFG 9000: Nearly 100% chance to kill a commando in one hit. And you'll get those 40 plasma cells back if it's plasma rifle is not destroyed in the blast.&lt;br /&gt;
&lt;br /&gt;
There are two more considerations:&lt;br /&gt;
* Sometimes commandos spawn with a pack of 4-6 former humans and sergeants. If you happen to start a level close to them, and you can't retreat, they should be your top kill priority.&lt;br /&gt;
&lt;br /&gt;
* Commandos wield a plasma gun that is left for you to take after their death. On Nightmare! and Angel of Darkness they ressurect with a new, fully loaded one, so farming one commando for plasma cells is a viable option. [[ZicherCZ|ZicherCZ]] 12:00, February 03 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:BFG_9000</id>
		<title>Strategy:BFG 9000</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:BFG_9000"/>
				<updated>2012-02-14T15:27:05Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added contest entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
BFG9000, the ultimate in conventional DoomRL warfare, is highly efficient against practically any foe, but consumes ammunition like there's no tomorrow.&lt;br /&gt;
&lt;br /&gt;
A few tips on efficient use:&lt;br /&gt;
* BFG is the best weapon to use against targets you want to take out really quickly. [[Arch-vile|Archviles]] (doubly so those in the Mortuary) or [[Mancubus|mancubi]] can serve as a prime example, although, more likely than not, these would require two shots to go down. If you don't mind a bit of an overkill, you can, with near-certainty, take out those nasty [[Former_commando|former commandos]] and [[Revenant|revenants]] in one shot as well. [[Cyberdemon|Cyberdemon]] will then die (on average) after 5, 6, 7, 9 and 11 shots (with growing difficulty level). For the [[Spider Mastermind|Mastermind]] and [[John_Carmack|JC]] add 1 to Cyberdemon's numbers.&lt;br /&gt;
* If at all possible, try to hit multiple foes at once. The explosion radius of 10 is a definite help to this.&lt;br /&gt;
* If you happen to find another BFG, take it to save space in your inventory.. Its clip can hold 100 plasma cells, while an inventory slot can hold only 50 (70 with [[Backpack|backpack]]).&lt;br /&gt;
* Bulk-modding the BFG once increases the number of shots without reloading from two to three, which can be a life-saver at times. Another bulk mod will then increase this number to four, another one to five, fourth to seven and fifth then to nine (the exact clip sizes are 130, 169, 219, 285 and 371). With regards to the previous tip, a spare B5-modded BFG can hold more plasma cells than seven inventory slots. [[ZicherCZ|ZicherCZ]] 16:55, February 03 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Arachnotron</id>
		<title>Strategy:Arachnotron</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Arachnotron"/>
				<updated>2012-02-14T15:24:53Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added contest entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Overview'''&lt;br /&gt;
&lt;br /&gt;
The Arachnotron is a ranged attacker, equipped with a lowish-power (1d5x5) but somewhat accurate (+3) plasma gun. Even in the best circumstances, fighting a ‘tron in an open area is a hairy proposition, but a straight-up gunfight is seriously complicated by an Arachnotron’s 130% Speed. This essentially means that an Arachnotron will get to make (assuming normal move/act speeds for the player) 4 actions for every 3 of your actions. Generally, these actions will be to fire upon the player should s/he be in view, and those extra actions have a nasty tendency to appear at the exact worst times.  &lt;br /&gt;
&lt;br /&gt;
Arachnotrons are fairly durable with 50 hitpoints and 2 points of armor, so fairly heavy firepower is necessary to bring one down efficiently. However, their high speed results in an enemy that can lay down a very heavy field of fire. Circlestrafing or sidestepping is somewhat effective, but two factors work against the player who attempts this. First, the sheer number of shots an Arachnotron can put downrange mean that at least a few bolts will hit you eventually, and Arachnotrons are frighteningly good at getting their extra action while firing on the player.This extra action essentially means that the Arachnotron will get a free cheap shot on a “stationary” player, since the player did not move immediately prior to the Arachnotron’s last move. (For more info, take a look at Dodge) Needless to say, this is very bad for the player.&lt;br /&gt;
&lt;br /&gt;
'''Combat Tactics'''&lt;br /&gt;
&lt;br /&gt;
Now that we know what we’re up against, how do we go about killing these things? As noted above, Arachnotrons are pretty tough, so we’ll probably need a few actions to bring one down. The threat of being counter-attacked should always loom large, so most of our tactics should generally involve firing such that our foe cannot retaliate.&lt;br /&gt;
&lt;br /&gt;
Early-game (Hell’s Armory, ordinary floors at higher difficulty levels), your best bet is some flavor of shotgun and corner-shooting. Shotguns serve very well by permitting the player to attack blindly, and by knocking back the Arachnotron, forcing it to spend an action getting back into position. Knockback can also sometimes be used to push an Arachnotron into acid or lava, killing it more quickly, but often destroying their plasma cells in the process. If an Arachnotron is dumb enough to close into melee range while you have a shotgun equipped, you should think twice before firing at point-blank range. If the ‘tron is badly injured, and you’re certain that your next blast will kill it, then go ahead and fire. Alternatively, if the ‘tron is against a wall and won’t be knocked back, go to town- this particular foe is weak in melee. However, if the Arachnotron is fairly healthy and has a space to be knocked into, you may want to switch weapons- the danger is that you’ll knock the ‘tron out of melee range and it’ll melt you with easy short-range fire on a stationary target.&lt;br /&gt;
&lt;br /&gt;
I generally don’t endorse using rapid-fire weapons against ‘trons unless your build really takes advantage of them. A chaingun in untrained hands will be a difficult and painful gunfight; a plasma rifle should do a bit better owing to the increased damage and armor reduction, but it’ll still be messy. Any rapid-fire master trait (especially Ammochain) lets a player go just about toe-to-toe with a ‘tron, generally by wasting the ‘tron first. Blind-firing into a known position is a fully viable strategy, but may be expensive, ammo-wise. Staying out of an Arachnotron’s sights is generally worth the ammo investment, and plasma users might be able to break even.&lt;br /&gt;
&lt;br /&gt;
An unmodified rocket launcher is a rather poor choice for slaying ‘trons, but pretty much any practical mod setup or special rocket launcher is quite effective. A non-exhaustive list of “good” mod setups would include: 1 bulk mod, a micro launcher, or a tactical rocket launcher. Alternatively, a couple levels in Reloader will work; offsetting that slow reload time is crucial to using rockets against Arachnotrons. Since they already have the potential to double-act, the base reload time only makes that problem worse should you choose to reload at a bad time. Actually fighting Arachnotrons with rockets is pretty simple: check range, aim, shoot, reload and repeat. Rockets should usually deal knockback, and an Arachnotron engaged at the edge of viewing range should seldom retaliate effectively, if at all. 3 rockets will usually do the job, but will destroy the plasma cell drop.&lt;br /&gt;
&lt;br /&gt;
The BFG 9000 is OVERKILL, and if you’re pointing one at an Arachnotron, it better have a lot of nearby ugly friends, or you better be sitting on a trainload of extra cells. The same problem with the rocket launcher (reload time) is also an issue for BFGs.&lt;br /&gt;
&lt;br /&gt;
The last engagement option is to get up close and bash an Arachnotron’s ugly face in with a melee weapon. Surprisingly, this is a pretty good idea: Arachnotrons have -100% (yes, that is a negative) resistance to melee damage. Anybody can easily dispatch a ‘tron with a chainsaw, and a trained Brute can punch one out with little trouble. Arachnotrons can hit back for moderate damage, but it is a lot less than their ranged attack. Of course, the only problem is getting close…&lt;br /&gt;
&lt;br /&gt;
Also, switching to your best armor is seldom a bad idea, just in case. This usually means Red Armor, or something with Plasma resist (if you’ve gotten lucky).&lt;br /&gt;
&lt;br /&gt;
'''Other Considerations'''&lt;br /&gt;
&lt;br /&gt;
Defensive traits such as Ironman and Tough as Nails don’t exactly shine against Arachnotrons, but the extra tankiness is the unsung hero that will keep you alive during a firefight. I typically take Ironman after getting a master trait on just about every build I do. Brute can be valuable as well, but charging an Arachnotron just for the sake of getting a melee kill is a bad idea; baiting a ‘tron into chasing you can simplify the “closing-in” problem, but you may take some hits. Dodgemaster is actually less helpful than you would think, since Arachnotrons attack in bursts, and the trait only affects the first dodge per incoming attack. Rank 2 in Intuition is always good, perhaps even too good- the application should be pretty obvious. Gun Kata has the potential to ruin Arachnotrons so long as your pistols have the capacity to kill your target in one clip. Ammochain is a time-tested classic trait; the near-zero ammo consumption combined with a well-modded weapon allows a player to easily outshoot ‘trons. If you’ve managed to get a really good suit of armor Survivalist has the potential to be absolutely hilarious and can totally negate an incoming volley.&lt;br /&gt;
&lt;br /&gt;
One other thing: Arachnotron Caves (shudder). These fiendish levels have ended many a game for unfortunate Doomguys everywhere. ‘Tron Caves are seldom simple, and a lot of times your best bet is to simply try and bolt for the stairs or pop a Homing Phase. If you feel confident in your gear and your supplies, clearing the cave presents both challenge and opportunity. The challenges lie in the fact that caves combine huge open areas with lots of blind corners. Radar shoot where possible and try and stay behind cover if using shotguns. There are positions where you can see your target but they cannot see you (and thus cannot retaliate); these positions are not intuitive or easy to communicate, but can be figured out over time. If using a well-kitted rocket launcher (or derivative), try to isolate and snipe ‘trons individually just as they enter vision. This is often easier said than done, but a Missile Launcher really helps. Rapid-fire gunners should simply try and stay in cover and poke at Arachnotrons when they wander into view; gunners typically have the firepower to quickly dispatch ‘trons but nobody can really afford to get shot up. Of course, the opportunity presented is the pile of power cells that the Arachnotrons will drop, and occasionally loot and powerups on the floor. [[User:IronBeer|IronBeer]] 19:02, January 27 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
Arachnotrons are mean little spiders. Their dealing plasma damage makes them a threat, but 1d5 damage per projectile isn't the end of the world. What's really amazing is that they have 50 health and 2 armor, so they'll take a pretty good beating before going down. Their 130% speed puts them on par with demons, but realize that this affects their firing speed as well as their movement speed. Corner shooting an arachnotron with a combat shotgun is one of the safest ways to take out an arachnotron with ordinary weapons, but in a pinch a rocket launcher is effective, as is a BFG if can spare the cells. Fighting an arachnotron out in the open is dangerous (though this is true against most enemies), but sometimes it is unavoidable; this is really when bringing out the rocket launcher is nice. Some people recommend activating run mode to avoid their projectiles more, but I don't think it's necessary unless you're going to run for cover or are fighting against multiple enemies. I am personally rather stingy with run mode, however, so it could be something to try.&lt;br /&gt;
&lt;br /&gt;
Arachnotrons take double damage from melee and deal rather pitiful melee damage themselves, so killing them with melee is a decent option as long as you have at least a combat knife (though if possible I'd recommend just corner shooting with shotguns if a knife really is your best melee weapon; chainsaw is more doable). If you find yourself a couple of spaces away from an arachnotron with no cover immediately available, charging into melee range is probably your best option (running mode not necessary, in my opinion). Another way to get them into melee range is to just wait around a corner and shoot them to get their attention, and wait.  Charging into melee towards an arachnotron at the edge of your vision is just asking for trouble though: you'll be taking plasma volleys, and in general charging into melee exposes you to fire from other enemies, especially ones that were out of sight behind the one you're after.&lt;br /&gt;
&lt;br /&gt;
The worst case scenario is finding an arachnotron cave. Lots of spiders, lava, and a lack of decent cover makes clearing out the cave a formidable task. Some people would advice phasing past the level or running for the stairs, but I like making enemies dead, so let's assume that option is off the table. How can one clear out an arachnotron cave and live to tell about it?  Well, the first step is usually going to be to find cover immediately, and it's a difficult step. This is a time where I'd recommend activating run mode if there's any arachnotrons around you. Hurry behind any group of rocks you see, and if you have a rocket launcher or even a BFG, this is a good time to bring it out. A melee weapon can actually be really useful here, as there will often be situations where an arachnotron comes sneaking around the corner of your rock cover, where he's too close to blow up (except with a BFG which doesn't hurt you) and where you can't corner shoot him with a shotgun. If you blast it with a shotgun, you'll just be knocking it back, and you won't be in a position to corner shoot, while it will tear you apart with plasma. It will be just a few steps away from melee range though, and melee doesn't cause knockback and will make the arachnotron fall fast. From your cover, try to corner shoot those spider bastards when possible, shoot them with rockets when you're in their line of fire, and melee them if they sneak up on you (probably not with your fists though). [[User:Matt_S|Matt_S]] 00:24, February 02 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
Some facts, copied from wiki: 130% speed, (1d5)x5 plasma damage, +3 accuracy, 60% chance to attack, -100% melee resistance, 1d3+2 melee damage&lt;br /&gt;
&lt;br /&gt;
As you can see, enemy is fast,very dangerous in ranged combat and pathetic in melee.&lt;br /&gt;
Basic plan is simple - don't let it shoot you.Get behind the corner, or knock it back outside your FOV, or get to it.Even if you are incompetent in melee and don't have any melee wapons, it's still worth it.Just shoot it while it hits you(be careful not to knock it back though!).Pretty simple i think.&lt;br /&gt;
&lt;br /&gt;
And now about caves - main source of hate for these guys.&lt;br /&gt;
Two main strategies: running and sidestepping.Running implies -4 penalty to enemies' accuracy and gives bonus to dodge chance during sidestep.&lt;br /&gt;
&lt;br /&gt;
On HNTR and HMP arachno caves are not that common and they spawn deep enough for you to be prepared for such encounters.BFG from halls of carnage is guaranteed and it works as good as always.Also number of spiders is not that big usually.&lt;br /&gt;
&lt;br /&gt;
Whole 'nother thing is UV and N!. Lvl7 on UV, lvl6 on N! - that's how early i saw caves on that difficulties.&lt;br /&gt;
Number of enemies is high - 6 and more - this number is not a fact, it's just rougly based on my experience. &lt;br /&gt;
Now they have total +5 accuracy which means 74% chance to hit on the edge of your vision.That means if you are not running and not sidestepping then expect to get hit 4 times out of 5(Since they'are not always on max range).&lt;br /&gt;
So if you have 0 armor, 4 arachnotrons can kill you in one turn if you decide on fighting them directly.&lt;br /&gt;
Your usual weapons during early arachnotron cave encounter: pistol, shotgun, chaingun, rocket launcher if HA's completed, chainsaw.&lt;br /&gt;
None of these is enough to kill them before they kill you.&lt;br /&gt;
That leaves you with only one option if you spawn in the middle - tactical retreat.Running somewhere where they can't swarm you.&lt;br /&gt;
&lt;br /&gt;
Start running and carefully sidestep.If you're not sure if your next move is sidestep,or if it's impossible to sidestep all attacks, think and choose best possible.If you can get to you destination in 1 non-sidestep, better do two sidesteps.Hoping that several arachnotrons will all miss is silly, while actually sidestepping all attacks from 2 arachnotrons is quite possible and happened to different people.&lt;br /&gt;
&lt;br /&gt;
Stairs/Invul globe - if you manage to get to it, you're safe.Do not even think about taking small health globes if you'are under enemy fire.Since they restore you from running to normal, arachnotrons again have +5 accuracy instead of +1, and since you spend your move not on sidestep, you'll lose much more than you could gain.Taking large health globes is safer, but even that can kill you.Same thing about using med-packs - beware of using them without cover.Being Technician here is a great help, as you can switch to running back after 0.1s of not-running.Taking berserk pack is safe, but against arachnotrons it's not as effective as usual as each hit will deal at least 1 damage.If you don't see stairs or nice powerup, run to cover.If you don't see one, then hope that you'are running towards something useful - there's not much else to say in such situation. [[User:AlterAsc|AlterAsc]] 15:34, February 03 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Levels</id>
		<title>Levels</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Levels"/>
				<updated>2012-02-03T18:57:29Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: updated enough to remove tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
Levels are the heart of DoomRL, and without them there would be no game. It is where the player explores, where enemies roam, where special items lie in wait. They are filled with either fortune or your own personal doom.&lt;br /&gt;
&lt;br /&gt;
==Basic Objects==&lt;br /&gt;
All levels are made of basic objects like floors, walls, and doors.&lt;br /&gt;
*'''HP''': This is one of the parameters that governs how difficulty the object is to destroy. Whenever an object takes damage, it's HP is decreased. Once its HP falls to 0, it changes to a floor tile. Some objects cannot be destroyed; these are indicated as &amp;quot;none&amp;quot;. Also, some objects have two versions: one that can be destroyed and one that can't.&lt;br /&gt;
*'''Armor''': This also makes objects harder to destroy. Whenever an object takes damage, the object's armor is subtracted from the damage before the damage is subtracted from HP. Unlike the armor of the player and his enemies, objects' armor may reduce damage to 0.&lt;br /&gt;
*'''Fragile''': Objects can usually only be damaged by [[Damage type#plasma|plasma]], [[Damage type#fire|fire]], or [[Damage type#acid|acid]] damage. Fragile objects can be damaged by any damage type.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;rules: cols; border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=11 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Basic Objects'''&lt;br /&gt;
|- &lt;br /&gt;
|style=&amp;quot;text-align: center; padding: 1ex; border: solid darkred; border-width: 0 1px 1px 0&amp;quot; width=100|'''Name'''&lt;br /&gt;
|style=&amp;quot;text-align: center; padding: 1ex; border: solid darkred; border-width: 0 1px 1px 1px&amp;quot; width=50|'''Appearance'''&lt;br /&gt;
|style=&amp;quot;text-align: center; padding: 1ex; border: solid darkred; border-width: 0 1px 1px 1px&amp;quot; width=50|'''HP'''&lt;br /&gt;
|style=&amp;quot;text-align: center; padding: 1ex; border: solid darkred; border-width: 0 1px 1px 1px&amp;quot; width=50|'''Armor'''&lt;br /&gt;
|style=&amp;quot;text-align: center; padding: 1ex; border: solid darkred; border-width: 0 1px 1px 1px&amp;quot; width=50|'''Fragile'''&lt;br /&gt;
|style=&amp;quot;text-align: center; padding: 1ex; border: solid darkred; border-width: 0 0 1px 1px&amp;quot;|'''Special'''&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 1px 1px 0 0&amp;quot;|floor&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 1px 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:silver&amp;quot;&amp;gt;'''&amp;amp;middot;'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 1px 1px 0 1px&amp;quot;|none&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 1px 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 1px 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 1px 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|blood&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:maroon&amp;quot;&amp;gt;'''&amp;amp;middot;'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|none&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|pool of blood&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:maroon&amp;quot;&amp;gt;'''&amp;amp;bull;'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|none&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|Phobos rock&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:maroon&amp;quot;&amp;gt;'''.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|none&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|wall, blooded wall&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:silver;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:maroon;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|10&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|10&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|no&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|bloodstone, blooded wall&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:maroon;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|15&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|10&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|no&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|green wall&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|15&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|10&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|no&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|crate, blooded crate&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:olive;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:navy;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;, &amp;lt;span style=&amp;quot;color:maroon;&amp;quot;&amp;gt;'''#'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|5&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|5&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|no&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|closed door&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:olive;&amp;quot;&amp;gt;'''+'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|6&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|4&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|yes&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|Can be opened.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|locked door&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:olive;&amp;quot;&amp;gt;'''+'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|6&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|6&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|yes&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|N/A&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|open door&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:olive;&amp;quot;&amp;gt;'''/'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|none&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|N/A&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|Can be closed.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|[[lever]]&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:white;&amp;quot;&amp;gt;'''&amp;amp;'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|10&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|0&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|no&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|see link in name for details&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|barrel of fuel&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:olive;&amp;quot;&amp;gt;'''0'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|2&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|3&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|yes&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|Can be pushed. When destroyed, creates a radius 4 [[explosions|explosion]] dealing 5d5 [[Damage type#fire|fire damage]].&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|barrel of acid&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;'''0'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|2&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|4&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|yes&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|Can be pushed. When destroyed, creates a radius 4 [[explosions|explosion]] dealing 6d6 [[Damage type#acid|acid damage]], sometimes leaving behind acid tiles.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;text-align: left; padding-right: 1ex; border: solid darkred; border-width: 0 1px 0 0&amp;quot;|barrel of napalm&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''0'''&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|2&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|5&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 1px 0 1px&amp;quot;|yes&lt;br /&gt;
|style=&amp;quot;text-align: center; border: solid darkred; border-width: 0 0 0 1px&amp;quot;|Can be pushed. When destroyed, creates a radius 4 [[explosions|explosion]] dealing 7d7 [[Damage type#fire|fire damage]], sometimes (often) leaving behind lava tiles.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Random levels==&lt;br /&gt;
The archetypical level in DoomRL is a randomly-generated one. It is produced in such a way that no two games are particularly alike. There are many special considerations within the game engine, although many of these are technical and unimportant from a gameplay perspective.&lt;br /&gt;
&lt;br /&gt;
* [[Level type]]&lt;br /&gt;
* [[Level feeling]]&lt;br /&gt;
* [[Level event]]&lt;br /&gt;
* [[Monster Generation]]&lt;br /&gt;
* [[Item Generation]]&lt;br /&gt;
* [[Room Generation]]&lt;br /&gt;
* [[Fluids]]&lt;br /&gt;
&lt;br /&gt;
== Special levels ==&lt;br /&gt;
In stark contrast to random levels, special levels are constant and many of them appear every game. As you gain more experience playing DoomRL, these become stepping stones used as a grip against the turbulent flow of random levels.&lt;br /&gt;
&lt;br /&gt;
For obvious reasons, all of these pages are considered spoilers if you wish to learn how to beat them yourself. Some are particularly spoiler-heavy, though, and are indicated as such here.&lt;br /&gt;
&lt;br /&gt;
* [[Phobos Base Entry]]&lt;br /&gt;
* [[Hell's Arena]]&lt;br /&gt;
* [[The Chained Court]]&lt;br /&gt;
* [[The Wall]]&lt;br /&gt;
* [[Phobos Anomaly]]&lt;br /&gt;
* [[Hell's Armory]]&lt;br /&gt;
* [[Halls of Carnage]]&lt;br /&gt;
* [[City of Skulls]]&lt;br /&gt;
* [[Spider's Lair]]&lt;br /&gt;
* [[Tower of Babel]]&lt;br /&gt;
* [[Unholy Cathedral]] &amp;lt;font color=&amp;quot;#FFFF50&amp;quot;&amp;gt;(SPOILERS!!!)&amp;lt;/font&amp;gt;&lt;br /&gt;
* [[The Vaults]]&lt;br /&gt;
* [[The Mortuary]] &amp;lt;font color=&amp;quot;#FFFF50&amp;quot;&amp;gt;(SPOILERS!!!)&amp;lt;/font&amp;gt;&lt;br /&gt;
* [[The Lava Pits]]&lt;br /&gt;
* [[Dis]] &amp;lt;font color=&amp;quot;#FFFF50&amp;quot;&amp;gt;(MAJOR SPOILERS!!!)&amp;lt;/font&amp;gt;&lt;br /&gt;
* [[Hell Fortress]] &amp;lt;font color=&amp;quot;#FFFF50&amp;quot;&amp;gt;(MAJOR SPOILERS!!!)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Special level placement===&lt;br /&gt;
Some levels don't spawn on I'm Too Young To Die: Hell's Armory, Unholy Cathedral, The Vaults, and The Mortuary.&lt;br /&gt;
&lt;br /&gt;
Special stairs are always placed on a random empty tile.&lt;br /&gt;
&lt;br /&gt;
In 0.995, the generation of special levels is changed - all special levels (with respect to the I'm Too Young To Die restriction) are guaranteed to appear in the game. Also, the generation depth of special levels is now as follows:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|'''Level'''&lt;br /&gt;
|'''Range'''&lt;br /&gt;
|-&lt;br /&gt;
|Hell's Arena&lt;br /&gt;
|2-3&lt;br /&gt;
|-&lt;br /&gt;
|The Chained Court&lt;br /&gt;
|4-5&lt;br /&gt;
|-&lt;br /&gt;
|The Wall&lt;br /&gt;
|7&lt;br /&gt;
|-&lt;br /&gt;
|Hell's Armory&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|Halls of Carnage&lt;br /&gt;
|11-12&lt;br /&gt;
|-&lt;br /&gt;
|City of Skulls&lt;br /&gt;
|13&lt;br /&gt;
|-&lt;br /&gt;
|Spider's Lair&lt;br /&gt;
|14&lt;br /&gt;
|-&lt;br /&gt;
|Unholy Cathedral&lt;br /&gt;
|17&lt;br /&gt;
|-&lt;br /&gt;
|The Vaults&lt;br /&gt;
|18-19&lt;br /&gt;
|-&lt;br /&gt;
|The Mortuary&lt;br /&gt;
|20&lt;br /&gt;
|-&lt;br /&gt;
|The Lava Pits&lt;br /&gt;
|22&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Strategy:Contest_pages</id>
		<title>Strategy:Contest pages</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Strategy:Contest_pages"/>
				<updated>2012-02-02T20:44:46Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: current contest moved back a day&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains all Strategy-based pages included in the strategy contest (found [http://forum.chaosforge.org/index.php/topic,4867.0.html here] on the Chaosforge forums), as well as any winners for them. It also contains information regarding the contest.&lt;br /&gt;
&lt;br /&gt;
==Contest Rules==&lt;br /&gt;
Entries will be graded on the merit of the information given, rather than its sheer volume. While it is true that a large and informative entry will likely be marked higher than a small and informative entry (simply because it contains more amounts of useful information), '''the key factors that attribute to a successful entry are''':&lt;br /&gt;
*Detail - either in having many possible strategies, or explaining the various considerations of a given strategy&lt;br /&gt;
*Originality - creativity, regarding both the strategy itself and how it is presented&lt;br /&gt;
*Accuracy - up-to-date for the current public version, and valid as a strategy itself&lt;br /&gt;
*Comprehension - one with basic knowledge of game [[mechanics]] (and, if necessary, an accompanying Game Data page) should understand the strategy&lt;br /&gt;
*Focus - keep to the scope of the topic at hand&lt;br /&gt;
&lt;br /&gt;
'''All entries should be emailed to [http://mailto:theuberhunter@gmail.com theuberhunter@gmail.com]''' using the following format:&lt;br /&gt;
*The subject line should read &amp;quot;[WIKICOMP#X] Strategy:&amp;quot; (minus quotes, where X is the competition number), followed by the topic&lt;br /&gt;
**example: [WIKICOMP#1] Strategy:Rocket launcher&lt;br /&gt;
*The entry itself can either be written in the body of the email, separate from the rest of the email's content, or as a document file attached to the email. For procedures on formatting, refer to the formatting guidelines just after the rules.&lt;br /&gt;
*Include a username somewhere in the email. Your forum name is recommended (and necessary, if you want to get your prize) but any name will do. If no username is given, it will default to the email address of the submission.&lt;br /&gt;
&lt;br /&gt;
After submitting the email, a reply should be added to the forum topic, stating that (in so many words) you have entered a submission for the current contest. If there is more than one topic for the current contest, also name the topic (or topics) for which you wrote an entry (or entries). While this is not required to enter, it is necessary as validation so that the prize is handed out to the appropriate member. Alternatively, you are allowed to submit your entry through the forum topic, though this carries the risk of letting other contestants view your entry before the deadline has been reached.&lt;br /&gt;
&lt;br /&gt;
Prizes will be determined on a per-topic basis. Some topics will be worth more (in terms of their prize) than others. '''The contest judge (Game Hunter) reserves the right not to award a prize for a given topic in a given contest if none of the entries are of sufficient quality to be worthy of the prize given.'''&lt;br /&gt;
&lt;br /&gt;
A player can submit an entry for each topic during a contest, and can potentially receive the prize for each one. '''Multiple entries should be submitted separately: one email per topic.'''&lt;br /&gt;
&lt;br /&gt;
Each contest will accept entries for about one week: '''the deadline will always be Midnight GMT of that day''' ([http://wwp.greenwichmeantime.com see here for the current GMT time]). After the deadline is reached, there will be, at most, a one-week period during which submissions will be examined and a winner for each topic will be determined. After the grading period, prizes will be handed out to winners.&lt;br /&gt;
&lt;br /&gt;
Regardless of the winner, all entries will have their strategies added to the Wiki. These will initially be posted immediately after the contest ends, ordered by date. After all entries are graded and a winner is chosen, the winner's strategy entry will be placed at the top of the page (with the others left unmoved). This entry will then be used as the basis on which to add other components of strategy: the other entries will eventually be merged into this entry (and will be handled by Game_Hunter).&lt;br /&gt;
&lt;br /&gt;
==Formatting Guidelines==&lt;br /&gt;
Entries are expected to be written in a format appropriate for Wiki reading. A good starting place for this is to use a very basic text program such as Notepad. You can also try to write your entry on the Wiki itself, using &amp;quot;Show Preview&amp;quot; to check for errors, then copy-paste it as your entry.&lt;br /&gt;
&lt;br /&gt;
Basic etiquette is as follows:&lt;br /&gt;
*Do not use typical indentations under any circumstance. Indentations using the TAB key have no effect on the display here, and indentations created with spaces are meant for a different task. If you really want indentation, add a colon (:) where the indent would go.&lt;br /&gt;
*Do not use any program-specific stylizations. Wikipedia standards have [http://meta.wikimedia.org/wiki/Help:Editing their own procedures] for the styles you may want. You are free to use these in your entry if you believe they will improve the organization of what you are writing. (Here are [http://meta.wikimedia.org/wiki/Help:Wikitext_examples additional examples] if you need a full range of possibilities.)&lt;br /&gt;
**The exception of this format is that you should not use section-based formatting (for example, &amp;lt;nowiki&amp;gt;==Title==&amp;lt;/nowiki&amp;gt;) as this is reserved for possible segmentation of the strategy page itself.&lt;br /&gt;
*Paragraphs should be of an appropriate length. If a paragraph is too short, attempt to merge it with another paragraph containing similar ideas. If a paragraph is too long, either split it into separate paragraphs or use a bullet-point format. This is often expected not just on Wikis but on any Internet forum as well.&lt;br /&gt;
*Remove any word-wrapping before submitting an entry. Otherwise the transfer to the Wiki will require a few thousand backspaces, because the copy-paste was messed up due to the way that word-wrapping handles spaces.&lt;br /&gt;
&lt;br /&gt;
==Current Contest==&lt;br /&gt;
===Status===&lt;br /&gt;
Entry period: submissions will be accepted no later than February 4, 2012 at Midnight (GMT).&lt;br /&gt;
&lt;br /&gt;
===Topics===&lt;br /&gt;
#[[Strategy:Arachnotron|Arachnotron]] (prize USD10)&lt;br /&gt;
#[[Strategy:BFG 9000|BFG 9000]] (prize USD10)&lt;br /&gt;
#[[Strategy:Juggler|Juggler]] (prize USD10)&lt;br /&gt;
#[[Strategy:Former commando|Former commando]] (prize USD10)&lt;br /&gt;
&lt;br /&gt;
==Past Contests==&lt;br /&gt;
===November 9-16, 2011===&lt;br /&gt;
#[[Strategy:Rocket launcher|Rocket launcher]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Intuition|Intuition]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
#[[Strategy:Demon|Demon]] (winner: [[User:Elephant|Elephant]])&lt;br /&gt;
&lt;br /&gt;
===November 18-27, 2011===&lt;br /&gt;
#[[Strategy:Combat shotgun|Combat shotgun]] (winner: [[User:GrimmC|GrimmC]])&lt;br /&gt;
#[[Strategy:Shottyman|Shottyman]] (winner: [[User:theduck101|theduck101]])&lt;br /&gt;
&lt;br /&gt;
===January 8-16, 2012===&lt;br /&gt;
#[[Strategy:Double shotgun|Double shotgun]] (winner: [[User:Kashi|Kashi]])&lt;br /&gt;
#[[Strategy:Reloader|Reloader]] (winner: [[User:AlterAsc|AlterAsc]])&lt;br /&gt;
#[[Strategy:Pain elemental|Pain elemental]] (winner: [[User:Tormuse|Tormuse]])&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Item</id>
		<title>Modding:Item</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Item"/>
				<updated>2012-02-02T19:39:49Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: updated for 0995&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DoomRL has many kinds of items. Weapons, powerups, levers, and other things are all items. Items inherit from the [[Modding:Thing|Thing]] class which handles some basic properties in common with beings.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
New items are created from item prototypes. Think of an item prototype as a recipe for creating new items. There can be multiple pistols, but they all came from the same prototype. Prototypes are declared by passing a table with the desired properties to the Items function. The available properties depend on the item type. [[#Engine Hooks|Engine hooks]] may also be included in the prototype. Mostly, the prototype's properties just describe items' initial properties (occasionally with different names). Items' 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 item prototypes are stored in a global table called items. This table can be indexed by id or nid.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Item Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the item's name.&lt;br /&gt;
  |{{modarg|string}}|id|This is the item's sid. It must be distinct from other string ids. (The numeric id is automatically generated and stored in the nid field of the prototype.) It defaults to the first word of the name in all lowercase.&lt;br /&gt;
  |{{modarg|value list}}|overlay|This describes of color transformation of the item's sprite. It is only used in the graphical version. This will create overlay_red, overlay_blue, overlay_green, and overlay_alpha attributes for the prototype.&lt;br /&gt;
  |{{modarg|Color}}|color|This is the item's color. The default is LIGHTGRAY.&lt;br /&gt;
  |{{modarg|string}}|color_id|For the purpose of custom color bindings, this id will be used for the item. Multiple items (like levers) can have the same color_id to prevent them from being distinguished.&lt;br /&gt;
  |{{modarg|integer}}|level|This is an [[Item Generation|item generation]] parameter. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;weight&amp;lt;/u&amp;gt;|This is an [[Item Generation|item generation]] parameter.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This is the item's sprite. This field is only relevant to the graphical version; use 0 for no sprite.&lt;br /&gt;
  |{{modarg|value list}}|coscolor|Some sprites (such as armor and boots) are color-neutral to begin: ''coscolor'' determines the color of the sprite in these cases. The list must be written in this form: {red,green,blue,alpha}, where all of these values range from 0.0 to 1.0.&lt;br /&gt;
  |{{modarg|value list}}|glow|Creates a customized &amp;quot;glow&amp;quot; effect around the sprite. See ''coscolor'' for table specifications.&lt;br /&gt;
  |{{modarg|Item Flag List}}|flags|The flags in this list will automatically be included in the item's flag set. The default is an empty list. Some flags may be added automatically. The prototype will automatically be given a flagSet property containing the flags in set format.&lt;br /&gt;
  |{{modarg|ItemSet ID}}|set|If included, this item will belong to the given item set. This will modify the item's OnEquip and OnRemove hooks.&lt;br /&gt;
  |{{modarg|string}}|firstmsg|If included, this message will be displayed when the an item with this prototype is picked up for the first time. This will modify the item's OnFirstPickup hook.&lt;br /&gt;
  |{{modarg|integer}}|res_bullet|This is the item's res_bullet. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|res_melee|This is the item's res_melee. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|res_shrapnel|This is the item's res_shrapnel. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|res_acid|This is the item's res_acid. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|res_fire|This is the item's res_fire. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|res_plasma|This is the item's res_plasma. The default is 0.&lt;br /&gt;
  |{{modarg|ItemType}}|&amp;lt;u&amp;gt;type&amp;lt;/u&amp;gt;|This is the item's itype. It also determines which other properties can be used in the prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Armor or Boots ===&lt;br /&gt;
These are the fields used by ITEMTYPE_ARMOR and ITEMTYPE_BOOTS. &lt;br /&gt;
&lt;br /&gt;
{{drltable|Armor or Boots Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the armor's description that is displayed in the inventory screen.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;armor&amp;lt;/u&amp;gt;|This is the armor's armor property.&lt;br /&gt;
  |{{modarg|integer}}|durability|This is the armor's maxdurability as well as its initial durability. The default is 100. (This should still be 100 for armors with no durability, as no durability is achieved by a flag.)&lt;br /&gt;
  |{{modarg|integer}}|knockmod|This is the armor's knockmod. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|movemod|This is the armor's movemod. The default is 0.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the armor's picture. It should be a length one string. The default is &amp;quot;[&amp;quot; for body armor and &amp;quot;;&amp;quot; for boots.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Consumable ===&lt;br /&gt;
These are the fields used by ITEMTYPE_PACK. This includes mods and relics.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Consumable Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the pack's description that is displayed in the inventory screen.&lt;br /&gt;
  |{{modarg|string}}|mod_letter|This is the shorthand letter by which the pack will be recognized as a mod. Do not fill this value unless this item is meant to be a mod pack.&lt;br /&gt;
  |{{modarg|function}}|&amp;lt;u&amp;gt;OnUse&amp;lt;/u&amp;gt;|Packs must provide an OnUse hook.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the pack's picture. It should be a length one string. The default is &amp;quot;+&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Powerup ===&lt;br /&gt;
These are the fields used by ITEMTYPE_POWER.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Powerup Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|function}}|&amp;lt;u&amp;gt;OnPickup&amp;lt;/u&amp;gt;|Powerups must provide an OnPickup hook.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the powerup's picture. It should be a length one string. The default is &amp;quot;^&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Ammo ===&lt;br /&gt;
These are the fields used by ITEMTYPE_AMMO.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Ammo Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the ammo's description that is displayed in the inventory screen.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;ammo&amp;lt;/u&amp;gt;|This is the ammo's initial ammo property.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;ammomax&amp;lt;/u&amp;gt;|This is the ammo's ammomax property.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the ammo's picture. It should be a length one string. The default is &amp;quot;&amp;amp;#124;&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Ammo Pack ===&lt;br /&gt;
These are the fields used by ITEMTYPE_AMMOPACK.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Ammo Pack Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the ammo pack's description that is displayed in the inventory screen.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;ammo&amp;lt;/u&amp;gt;|This is the ammo pack's initial ammo property.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;ammomax&amp;lt;/u&amp;gt;|This is the ammo pack's ammomax property.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;ammo_id&amp;lt;/u&amp;gt;|This is the ammo pack's ammoid property.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the ammo pack's picture. It should be a length one string. The default is &amp;quot;!&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Ranged Weapon ===&lt;br /&gt;
These fields are used by ITEMTYPE_RANGED.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Ranged Weapon Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the weapon's description that is displayed in the inventory screen.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;damage&amp;lt;/u&amp;gt;|This should be a string like &amp;quot;2d4&amp;quot;; the weapon's damage_dice and damage_sides will be parsed from this.&lt;br /&gt;
  |{{modarg|DamageType}}|&amp;lt;u&amp;gt;damagetype&amp;lt;/u&amp;gt;|This is the weapon's damagetype.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;psprite&amp;lt;/u&amp;gt;|This is the projectile sprite used with the weapon. It is only relevant in the graphical version.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;group&amp;lt;/u&amp;gt;|This is the weapon's group for purposes of kill counting. The used weapon groups are &amp;quot;weapon-melee&amp;quot;, &amp;quot;weapon-pistol&amp;quot;, &amp;quot;weapon-shotgun&amp;quot;, &amp;quot;weapon-chain&amp;quot;, &amp;quot;weapon-rocket&amp;quot;, &amp;quot;weapon-plasma&amp;quot;, and &amp;quot;weapon-bfg&amp;quot;. The default is &amp;quot;weapon-other&amp;quot;.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;ammo_id&amp;lt;/u&amp;gt;|This is the weapon's ammoID.&lt;br /&gt;
  |{{modarg|integer}}|fire|This is the weapon's usetime. The default is 10.&lt;br /&gt;
  |{{modarg|integer}}|acc|This is the weapon's acc. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|&amp;lt;u&amp;gt;ammomax&amp;lt;/u&amp;gt;|This is the weapon's ammomax and the weapon's initial ammo.&lt;br /&gt;
  |{{modarg|integer}}|radius|This is the weapon's blastradius. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|shots|This is the weapon's shots. The default is 0 (which will still give one shot).&lt;br /&gt;
  |{{modarg|integer}}|shotcost|This is the weapon's shotcost. The default is 0 (which will still require one ammo).&lt;br /&gt;
  |{{modarg|AltFire}}|altfire|This is the weapon's altfire. The default is ALT_NONE.&lt;br /&gt;
  |{{modarg|AltReload}}|altreload|This is the weapon's altreload. The default is RELOAD_NONE.&lt;br /&gt;
  |{{modarg|string}}|altfirename|This is the name the game uses for the weapon's alternate fire mode. Most of the AltFire constants provide defaults.&lt;br /&gt;
  |{{modarg|string}}|altreloadname|This is the name the game uses for the weapon's alternate reload mode. Most of the AltReload constants provide defaults.&lt;br /&gt;
  |{{modarg|string}}|sound_id|The sound_id will be used to look up sounds if there are no sounds defined for the weapon's actual id. By convention, this is set as the usual wielder's id when applicable.&lt;br /&gt;
  |{{modarg|Missile ID}}|overcharge|This field is currently unused.&lt;br /&gt;
  |{{modarg|Missile ID}} or {{modarg|Missile Prototype}}|&amp;lt;u&amp;gt;missile&amp;lt;/u&amp;gt;|This is the weapon's missile. (It will be translated into an nid. To use a shotgun missile, the weapon must have the IF_SHOTGUN flag.) If this property is a table, it will be used to declare a new missile with the same id as the weapon.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the weapon's picture. It should be a length one string. The default is &amp;quot;}&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Natural Ranged Weapon ===&lt;br /&gt;
These fields are used by ITEMTYPE_NRANGED. Natural ranged weapons are usually defined inline in a {{modarg|Being}} definition.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Natural Ranged Weapon Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;damage&amp;lt;/u&amp;gt;|This should be a string like &amp;quot;2d4&amp;quot;; the weapon's damage_dice and damage_sides will be parsed from this.&lt;br /&gt;
  |{{modarg|DamageType}}|&amp;lt;u&amp;gt;damagetype&amp;lt;/u&amp;gt;|This is the weapon's damagetype.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;group&amp;lt;/u&amp;gt;|This is the weapon's group for purposes of kill counting. The used weapon groups are &amp;quot;weapon-melee&amp;quot;, &amp;quot;weapon-pistol&amp;quot;, &amp;quot;weapon-shotgun&amp;quot;, &amp;quot;weapon-chain&amp;quot;, &amp;quot;weapon-rocket&amp;quot;, &amp;quot;weapon-plasma&amp;quot;, and &amp;quot;weapon-bfg&amp;quot;. The default is &amp;quot;weapon-other&amp;quot;.&lt;br /&gt;
  |{{modarg|integer}}|fire|This is the weapon's usetime. The default is 10.&lt;br /&gt;
  |{{modarg|integer}}|acc|This is the weapon's acc. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|radius|This is the weapon's blastradius. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|shots|This is the weapon's shots. The default is 0 (which will still give one shot).&lt;br /&gt;
  |{{modarg|string}}|sound_id|The sound_id will be used to look up sounds if there are no sounds defined for the weapon's actual id. By convention, a natural weapon's soundID is the usual wielder's id.&lt;br /&gt;
  |{{modarg|Missile ID}} or {{modarg|Missile Prototype}}|&amp;lt;u&amp;gt;missile&amp;lt;/u&amp;gt;|This is the weapon's missile. (It will be translated into an nid. To use a shotgun missile, the weapon must have the IF_SHOTGUN flag.) If this property is a table, it will be used to declare a new missile with the same id as the weapon.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the weapon's picture. It should be a length one string. The default is &amp;quot;?&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Melee Weapon ===&lt;br /&gt;
These fields are used by ITEMTYPE_MELEE.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Melee Weapon Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the weapon's description that is displayed in the inventory screen.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;damage&amp;lt;/u&amp;gt;|This should be a string like &amp;quot;2d4&amp;quot;; the weapon's damage_dice and damage_sides will be parsed from this.&lt;br /&gt;
  |{{modarg|DamageType}}|&amp;lt;u&amp;gt;damagetype&amp;lt;/u&amp;gt;|This is the weapon's damagetype.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;psprite&amp;lt;/u&amp;gt;|This is the projectile sprite used with the weapon. It is only relevant in the graphical version.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;group&amp;lt;/u&amp;gt;|This is the weapon's group for purposes of kill counting. The used weapon groups are &amp;quot;weapon-melee&amp;quot;, &amp;quot;weapon-pistol&amp;quot;, &amp;quot;weapon-shotgun&amp;quot;, &amp;quot;weapon-chain&amp;quot;, &amp;quot;weapon-rocket&amp;quot;, &amp;quot;weapon-plasma&amp;quot;, and &amp;quot;weapon-bfg&amp;quot;. The default is &amp;quot;weapon-other&amp;quot;.&lt;br /&gt;
  |{{modarg|integer}}|fire|This is the weapon's usetime. The default is 10.&lt;br /&gt;
  |{{modarg|integer}}|acc|This is the weapon's acc. The default is 0.&lt;br /&gt;
  |{{modarg|integer}}|shotcost|This is the weapon's shotcost. The default is 0 (which will still require one ammo).&lt;br /&gt;
  |{{modarg|AltFire}}|altfire|This is the weapon's altfire. The default is ALT_NONE.&lt;br /&gt;
  |{{modarg|string}}|altfirename|This is the name the game uses for the weapon's alternate fire mode. Most of the AltFire constants provide defaults.&lt;br /&gt;
  |{{modarg|Missile ID}} or {{modarg|Missile Prototype}}|missile|This is the missile used if for the throw alternate fire mode.&lt;br /&gt;
  |{{modarg|Item ID}}|throw_id|In the case where the melee weapon can be thrown, this is the item that appears after the item is thrown. It defaults to the item itself.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the weapon's picture. It should be a length one string. The default is &amp;quot;\&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Lever ===&lt;br /&gt;
These fields are used by ITEMTYPE_LEVER. DoomRL levers usually also have a target_area custom property.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Lever Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the full description of the lever used if the player has BF_LEVERSENSE2.&lt;br /&gt;
  |{{modarg|string}}|&amp;lt;u&amp;gt;good&amp;lt;/u&amp;gt;|This is the qualitative description of the lever used if the player has BF_LEVERSENSE1. By convention, this should be &amp;quot;beneficial&amp;quot;, &amp;quot;neutral&amp;quot;, or &amp;quot;dangerous&amp;quot;.&lt;br /&gt;
  |{{modarg|integer}}|fullchance|The level generation code will set the lever's target_area to the full map fullchance percent of the time. The default is 0. (To be fair, the level generation code won't generate custom levers.)&lt;br /&gt;
  |{{modarg|string}}|warning|This message will be displayed by the level generation code if the fullchance roll succeeds.&lt;br /&gt;
  |null|&amp;lt;u&amp;gt;color_id&amp;lt;/u&amp;gt;|This field is required for levers. By convention, it is set to &amp;quot;lever&amp;quot;.&lt;br /&gt;
  |null|sound_id|If the particular lever doesn't have sound bindings, the game will use the sound ID to look for sound bindings. By default, this is &amp;quot;lever&amp;quot;.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the lever's picture. It should be a length one string. The default is &amp;quot;&amp;amp;&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teleporter ===&lt;br /&gt;
These fields are used by ITEMTYPE_TELE. The built-in teleport item has a custom target property. This can be set to any coord to control the destination.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Teleporter Prototype|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|function}}|&amp;lt;u&amp;gt;OnEnter&amp;lt;/u&amp;gt;|This hook is required for teleporters.&lt;br /&gt;
  |{{modarg|string}}|ascii|This is the teleporter's picture. It should be a length one string. The default is &amp;quot;*&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Flags ===&lt;br /&gt;
{{drltable|Item Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |IF_CHAMBEREMPTY|For IF_PUMPACTION weapons, this flag indicates whether ammo is in the chamber or not.&lt;br /&gt;
  |IF_UNIQUE|This flag is set for unique items. Unique items add a player history message when picked up as well as doing a screen blink. Unique items are also not destroyable.&lt;br /&gt;
  |IF_EXOTIC|This flag is set for exotic items. This is used by the game to compile the special items list.&lt;br /&gt;
  |IF_MODIFIED|This flag is automatically set for items that have been modded.&lt;br /&gt;
  |IF_HALFKNOCK|If a weapon with this flag is wielded, all knockback against the wielder will be halved.&lt;br /&gt;
  |IF_GLOBE|This is a marker flag for items that are disallowed in Angel of Masochism.&lt;br /&gt;
  |IF_CURSED|Items with this flag cannot be unequipped.&lt;br /&gt;
  |IF_RECHARGE|Items with this flag regenerate ammo or durability as with a [[Nano Pack]].&lt;br /&gt;
  |IF_CLEAVE|Items with this flag give the wielder the benefits of the [[Traits#Blademaster|Blademaster]] trait (as [[Butcher's Cleaver]]).&lt;br /&gt;
  |IF_NOAMMO|Items with this flag don't consume ammo when fired. For the player, a weapon still must have ammo loaded to be fired.&lt;br /&gt;
  |IF_NECROCHARGE|Items with this flag recharge as with IF_RECHARGE, but reduce the weilder's health by 1 for each point of recharge (as with [[Necroarmor]]).&lt;br /&gt;
  |IF_PUMPACTION|Ranged weapons with this flag must be pumped after each shot as with the combat shotgun.&lt;br /&gt;
  |IF_SINGLERELOAD|Ranged weapons with this flag only reload one ammo at a time (as with the missile launcher) instead of all at once.&lt;br /&gt;
  |IF_PISTOL|This flag indicates whether the weapon counts as a pistol for the purposes of the [[Traits#Son of a Gun|Son of a Gun]] and [[Traits#Dualgunner|Dualgunner]] traits. (For kill counting, the weapon group is used instead.)&lt;br /&gt;
  |IF_SHOTGUN|This flag causes a weapon's missile to be treated as a shotgun id rather than a missile id. Also, this flag is used to decide if the [[Traits#Shottyman|Shottyman]] trait should count the weapon as a shotgun. (For kill counting, the weapon group is used instead.)&lt;br /&gt;
  |IF_SPREAD|Ranged weapons with this flag fire three shots at once (as the [[tristar blaster]] and [[mancubus]] natural weapon). In 0.9.9.4, this flag is a bit buggy.&lt;br /&gt;
  |IF_SCATTER|For ranged weapons with this flag, each shot is aimed at a different cell near the real target (as with the [[BFG 10K]]).&lt;br /&gt;
  |IF_MODABLE|Allows a unique item to be fully modded.&lt;br /&gt;
  |IF_SINGLEMOD|Restricts the number of allowed mods on the item to one. (For unique items, this must be used along with IF_MODABLE.)&lt;br /&gt;
  |IF_DUALSHOTGUN|For multi-shot weapons, this flag eliminates all delay between shots and causes the firing sound to play only once.&lt;br /&gt;
  |IF_AIHEALPACK|This flag allows the default AI to pick up and use the item.&lt;br /&gt;
  |IF_NOUNLOAD|Ranged weapons with this flag cannot be unloaded.&lt;br /&gt;
  |IF_NUKERESIST|Items with this flag will not be destroyed by nuking.&lt;br /&gt;
  |IF_NODROP|Items with this flag will not be dropped when the carrier/wearer dies.&lt;br /&gt;
  |IF_AUTOHIT|Weapons with this flag never miss (as with items modified by a sniper weapon pack).&lt;br /&gt;
  |IF_SETITEM|This flag is automatically set for items that specify a set.&lt;br /&gt;
  |IF_NODURABILITY|Armors and boots with this flag have no durability (as with items modified by an Onyx Armor Pack).&lt;br /&gt;
  |IF_NODESTROY|Armors with this flag cannot be destroyed by damage. Also, items on the ground with this flag will not be destroyed by explosions.&lt;br /&gt;
  |IF_NONMODABLE|Items with this flag cannot be modded.&lt;br /&gt;
  |IF_NOREPAIR|Armors and boots with this flag cannot be repaired by normal methods (ie item:fix). Directly setting item.durability bypasses this prohibition.&lt;br /&gt;
  |IF_ASSEMBLED|This flag is automatically set on assemblies. Items with this flag cannot be used for the base of any other assembly.&lt;br /&gt;
  |IF_DESTROY|Weapons with this flag will be destroyed after firing (with a default message). The flag is used for overcharged weapons.&lt;br /&gt;
  |IF_BLADE|Weapons with this flag are considered blades for the purpose of activating the flags used for [[Traits#Malicious Blades|Malicious Blades]].&lt;br /&gt;
  |IF_DESTRUCTIVE|Weapons with this flag deal double damage to cells (if they can hurt cells, see [[Modding:Cell|CF_FRAGILE]].)&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
These hooks can give greater flexibility for how items work. For some item types, a hook provides the primary function. Sometimes, the engine will add to explicitly defined hooks, but this shouldn't interfere with a modder's use of the hooks. However, modders should be careful when changing hooks.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Item Hooks&lt;br /&gt;
{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnCreate|OnCreate]]({{modarg|Item}} self) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnPickup|OnPickup]]({{modarg|Item}} self, {{modarg|Being}} getter) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnFirstPickup|OnFirstPickup]]({{modarg|Item}} self, {{modarg|Being}} getter) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnPickupCheck|OnPickupCheck]]({{modarg|Item}} self, {{modarg|Being}} getter) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnUse|OnUse]]({{modarg|Item}} self, {{modarg|Being}} user) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnUseCheck|OnUseCheck]]({{modarg|Item}} self, {{modarg|Being}} user) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnReload|OnReload]]({{modarg|Item}} self, {{modarg|Being}} reloader) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnAltFire|OnAltFire]]({{modarg|Item}} self, {{modarg|Being}} firer) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnAltReload|OnAltReload]]({{modarg|Item}} self, {{modarg|Being}} reloader) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnEquip|OnEquip]]({{modarg|Item}} self, {{modarg|Being}} equipper) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnEquipTick|OnEquipTick]]({{modarg|Item}} self, {{modarg|Being}} wearer) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnEquipCheck|OnEquipCheck]]({{modarg|Item}} self, {{modarg|Being}} equipper) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnRemove|OnRemove]]({{modarg|Item}} self, {{modarg|Being}} wearer) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnKill|OnKill]]({{modarg|Item}} self, {{modarg|Being}} dier, {{modarg|Being}} wearer) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnHitBeing|OnHitBeing]]({{modarg|Item}} self, {{modarg|Being}} attacker, {{modarg|Being}} target) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnEnter|OnEnter]]({{modarg|Item}} self, {{modarg|Being}} enterer) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnFire|OnFire]]({{modarg|Item}} self, {{modarg|Being}} firer) &lt;br /&gt;
  |{{modarg|boolean}}|[[#item_OnFired|OnFired]]({{modarg|Item}} self, {{modarg|Being}} firer) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|item_OnCreate}}&lt;br /&gt;
;OnCreate({{modarg|Item}} self) &lt;br /&gt;
:This hook is called when the item is created. For ammo, beware: the game creates and destroys ammo items liberally as a normal part of ammo management.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnPickup}}&lt;br /&gt;
;OnPickup({{modarg|Item}} self, {{modarg|Being}} getter) &lt;br /&gt;
:When an item is picked up, this hook is called with the being that is picking the item up. This is most commonly used to implement powerups.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnFirstPickup}}&lt;br /&gt;
;OnFirstPickup({{modarg|Item}} self, {{modarg|Being}} getter) &lt;br /&gt;
:When an item with a given id is picked up for the first time, the function is called. This only works for items that go into the inventory.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnPickupCheck}}&lt;br /&gt;
;OnPickupCheck({{modarg|Item}} self, {{modarg|Being}} getter) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:When a being tries to pick up an item, this function is called with the being that is trying to pick it up. If the return value is true, then the being is allowed to pick the item up, otherwise the being can't. For the player, both cases include the item in the player's previously found items. (This can affect OnFirstPickup.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnUse}}&lt;br /&gt;
;OnUse({{modarg|Item}} self, {{modarg|Being}} user) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook is called when levers are used and when packs are used with the being that it using the item. For packs, if the return value is true, the item is consumed, otherwise it is left in the inventory. For levers, the return value is ignored and it is safe not to have a return value.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnUseCheck}}&lt;br /&gt;
;OnUseCheck({{modarg|Item}} self, {{modarg|Being}} user) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook is called called before OnUse for levers and packs. If the return value is false, then the being can't use the item, otherwise it can. For levers, this can control whether the lever statistic is increased.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnReload}}&lt;br /&gt;
;OnReload({{modarg|Item}} self, {{modarg|Being}} reloader) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:If it is declared, this hook is called when a weapon is reloaded. If the return value is false, then the normal reload procedure is aborted. This can be used to prevent reloading or to implement a custom reloading mechanism (like for the [[Acid Spitter]]). If true is returned, the weapon is reloaded normally afterwards.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnAltFire}}&lt;br /&gt;
;OnAltFire({{modarg|Item}} self, {{modarg|Being}} firer) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook works exactly like the OnFire hook, except it is called when the weapon's alternate fire mode is used for weapons with ALT_SCRIPT altfire.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnAltReload}}&lt;br /&gt;
;OnAltReload({{modarg|Item}} self, {{modarg|Being}} reloader) &lt;br /&gt;
:If the weapon's altreload is RELOAD_SCRIPT, then this hook is called with when the weapon's alternate reload mode is used.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEquip}}&lt;br /&gt;
;OnEquip({{modarg|Item}} self, {{modarg|Being}} equipper) &lt;br /&gt;
:This hook is called when the item is equipped in any equipment slot. Due to a bug, equipper is the active being. This is always correct during normal play, but modders must be careful when manually equipping items with this hook. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEquipTick}}&lt;br /&gt;
;OnEquipTick({{modarg|Item}} self, {{modarg|Being}} wearer) &lt;br /&gt;
:While this item is equipped in any slot (including the prepared slot), this function is called on each of the being's actions. (Despite the name, it probably won't be called on every tick; it depends on the being's speed.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEquipCheck}}&lt;br /&gt;
;OnEquipCheck({{modarg|Item}} self, {{modarg|Being}} equipper) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This function is called (before OnEquip) when the player tries to equip an item. If the return value is true, then the player is allowed to equip the item; otherwise the player isn't allowed to equip the item.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnRemove}}&lt;br /&gt;
;OnRemove({{modarg|Item}} self, {{modarg|Being}} wearer) &lt;br /&gt;
:This hook is called when a being unequips the item, or when the item is otherwise removed from the being's equipment. This includes armor being destroyed by damage. Like OnEquip, this is called with the active being which can cause problems especially if this hook is called for armor destruction.  &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnKill}}&lt;br /&gt;
;OnKill({{modarg|Item}} self, {{modarg|Being}} dier, {{modarg|Being}} wearer) &lt;br /&gt;
:When a being dies, this hook is called on all of the active being's equipment. This includes the prepared slot. (Weapons can check what slot they are in inside of this hook.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnHitBeing}}&lt;br /&gt;
;OnHitBeing({{modarg|Item}} self, {{modarg|Being}} attacker, {{modarg|Being}} target) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:For weapons with no blastradius, this hook is called whenever a being is hit with the weapon. This hook is called before applying damage. If the return value is true, damage is applied as usual. Otherwise, the damage phase is skipped.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEnter}}&lt;br /&gt;
;OnEnter({{modarg|Item}} self, {{modarg|Being}} enterer) &lt;br /&gt;
:This function is called whenever a being enters a cell that has the item lying on the floor. For the player, this supresses the usual &amp;quot;There is an item lying here&amp;quot; message. This is used in DoomRL to implement teleports.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnFire}}&lt;br /&gt;
;OnFire({{modarg|Item}} self, {{modarg|Being}} firer) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook is called when a weapon is fired. This only works for normal firing, not alternative firing (see OnAltFire). This hook is called before a target is selected. If the return value is true, then the rest of the normal firing operation is aborted. If the return value is false, then it continues as usual. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnFired}}&lt;br /&gt;
;OnFired({{modarg|Item}} self, {{modarg|Being}} firer) &lt;br /&gt;
:This hook is called after a weapon is fired. This is after the entire usual firing procedure including damage, etc. Currently, this only works for the player.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Items also have all the [[Modding:Thing|Thing]] properties in addition to those listed below. For items, the meaning of the resistance fields vary depending on the item type. For armor and boots, the resistances are applied only to attacks to the corresponding target. For other equipment, the resistance applies to all attacks. For non-equipment, the resistances aren't used. Also, some properties are only valid for armor, and some are only valid for weapons. For these purposes, armor are items with itype ITEMTYPE_ARMOR and ITEMTYPE_BOOTS and weapons are items with itype ITEMTYPE_AMMO, ITEMTYPE_MELEE, ITEMTYPE_NRANGED, ITEMTYPE_RANGED, and ITEMTYPE_AMMOPACK. Properties of the incorrect type are always indexable, but they may share a memory address with properties of the opposite type, so modders should only use this feature very carefully. The type of such properties is noted. Also, the meaning of many fields is slightly different depending on the itype; these differences are also described.&lt;br /&gt;
&lt;br /&gt;
{{drltable|Item|3|{{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |{{modarg|ItemType}}|itype|This determines the basic features of the item. ITEMTYPE_NONE has no features; it can't be picked up or used. ITEMTYPE_RANGED can be picked up and wielded as a ranged weapon. ITEMTYPE_NRANGED is like ITEMTYPE_RANGED, but it isn't designed to exist on the map. ITEMTYPE_ARMOR can be picked up and equipped as armor. ITEMTYPE_MELEE can be picked up and wielded as a melee weapon. ITEMTYPE_AMMO is always a new ammo type that can be picked up and stacked. ITEMTYPE_PACK items can be picked up and used. ITEMTYPE_POWER items are consumed when they are picked up. ITEMTYPE_BOOTS can be picked up and worn as boots. ITEMTYPE_TELE have no special features, but by convention they interact with OnEnter. ITEMTYPE_LEVER have special description routines, and they can be used while on the floor. ITEMTYPE_AMMOPACK can be picked up and wielded in the prepared slot. They provide reloading benefits. While it is possible to change an item's itype, this should almost never be done. If it is done, care must be taken to account for overlapping weapon and armor properties.&lt;br /&gt;
  |{{modarg|byte}}|armor|For armor and boots, this is the amount of [[protection]] provided at full durability. Weapons in the main slot may also provide a (universal) protection bonus with this field.&lt;br /&gt;
  |{{modarg|word}}|durability|For armor and boots, this is the current amount of durability of the item. This property is armor-specific.&lt;br /&gt;
  |{{modarg|word}}|maxdurability|For armor and boots, this is the maximum amount of durability. Most effects won't raise the durability above maxdurability. This property is armor-specific.&lt;br /&gt;
  |{{modarg|integer}}|movemod|For armor and boots, this percentage movement speed modifier is applied while the item is equipped. This property is armor-specific.&lt;br /&gt;
  |{{modarg|integer}}|knockmod|For armor and boots, this percentage [[knockback]] modifier is applied while the item is equipped. This property is armor-specific.&lt;br /&gt;
  |[[Modding:Item|Item ID]]|ammoid|This must always be a number id. For ranged weapons, this is the item id of the kind of ammo the weapon uses. For ammo packs, this is the kind of ammo provided by the pack. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|word}}|ammo|For ranged weapons, this is the amount of currently-loaded ammo. For ammo packs and ammo stacks, this is the amount of ammo inside. This property is weapon-specific. &lt;br /&gt;
  |{{modarg|word}}|ammomax|For ranged weapons, this is the size of the magazine. For ammo stacks, this is the maximum stack size (unaffected by BF_BACKPACK). For ammo packs, this is the initial amount of ammo. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|word}}|acc|For ranged and melee weapons, this is an [[accuracy]] modifier applied to attacks with the weapon. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|word}}|damage_sides|For weapons, this is the number of dice rolled for damage (e.g. the X of XdY). This property is weapon-specific.&lt;br /&gt;
  |{{modarg|word}}|damage_dice|For weapons, this is the number of sides on each die rolled for damage (e.g. the Y of XdY). This property is weapon-specific.&lt;br /&gt;
  |{{modarg|integer}}|damage_add|For weapons, this is a flat bonus added to all damage rolls. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|Missile ID}}|missile|This must always be a number id. For ranged weapons, this is the missile used by the weapon. For melee weapons, this is the missile used by the throw alternate fire mode (if any). This property is weapon-specific.&lt;br /&gt;
  |{{modarg|byte}}|blastradius|This is the [[Distance|radius]] of the explosion caused by a ranged weapon. This should be 0 for weapons with no explosion. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|byte}}|shots|This is the number of shots fired by a rapid-fire ranged weapon. This should be 0 (not 1) for single-shot weapons. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|byte}}|shotcost|This is the amount of ammo consumed by each shot with a ranged weapon. This should be 0 (not 1) for weapons that take only one ammo per shot. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|byte}}|reloadtime|This is the number of 0.1s intervals it takes (without modifiers) to reload a ranged weapon. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|byte}}|usetime|This is the number of 0.1s intervals it takes (without modifiers) to fire/use a weapon. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|DamageType}}|damagetype|This is the [[Damage type|type]] of the damage caused by a weapon. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|AltFire}}|altfire|This is the alternate fire mode of a weapon. For ALT_SCRIPT, the details depend on the OnAltFire hook. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|AltReload}}|altreload|This is the alternate reload mode of a ranged weapon. For RELOAD_SCRIPT, the details depend on the OnAltReload hook. This property is weapon-specific.&lt;br /&gt;
  |{{modarg|string}}|desc|This is the string used to describe the item in the inventory list. For the description in the inventory sidebar, use .proto.desc. This property is read-only.&lt;br /&gt;
  |{{modarg|Item Prototype}}|__proto|This is the item's prototype. You can access item prototype fields using this (e.g., item.__proto.color).&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
The [[Modding:Thing#API|Thing API]] can also be used with items.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Item Interface&lt;br /&gt;
{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|new|dot||Item ID|iid}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|add_mod|cln||string|modletter}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|can_mod|cln||string|modletter}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|get_mod|cln||string|modletter}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|clear_mods|cln}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_damaged|cln}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|fix|cln||integer|amount}}&lt;br /&gt;
  |{{modarg|table}}|{{moddef|list|get_mods|cln}}&lt;br /&gt;
  |{{modarg|table}}|{{moddef|list|get_mod|ids|cln}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|can_overcharge|cln}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|check_mod_array|cln||string|nextmod|integer|techbonus}}&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{moddef|desc|new|dot|Item|Item ID|iid}}&lt;br /&gt;
:This returns a newly allocated item create from the specified prototype. This item doesn't exist in the game yet; it must be dropped on the level, added to an inventory, or equipped.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|add_mod|cln|boolean|string|modletter}}&lt;br /&gt;
:Adds a mod to the item's mod list and sets the IF_MODIFIED flag. This does not apply any affects of the mod, it is only a primitive operation for accessing the mod list. ''modletter'' should be a single uppercase letter representing the mod. This will check modding restrictions (as [[#item_can_mod|can_mod]]) and return true on success, false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|can_mod|cln|boolean|string|modletter}}&lt;br /&gt;
:Determines if the given mod can be added to the item. ''modletter'' should be a single uppercase letter representing the mod. This will always use the player's techbonus. It also accounts for limits on the number of mods of a given type and various modability item flags.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_mod|cln|integer|string|modletter}}&lt;br /&gt;
:Counts the number of the given mod that have already been added to the item. ''modletter'' should be a single uppercase letter representing the mod.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|clear_mods|cln|boolean}}&lt;br /&gt;
:Clears the counts of all mods for the item. The does not undo the affects of the mods nor does it change any flags (including IF_MODIFIED).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_damaged|cln|boolean}}&lt;br /&gt;
:This determines if the item's durability is less than its maxdurability. For items with IF_NOREPAIR, this function always returns false. (So, in effect this function determines if the item needs to be repaired.)&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|fix|cln|boolean|integer|amount}}&lt;br /&gt;
:This will increase the item's durability by amount, respecting maxdurability. It returns true is the item is no longer is_damaged. ''amount'' is optional; by default the item is completely repaired.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_mods|cln|table}}&lt;br /&gt;
:This will return a table that maps single character mod letters to the corresponding amount of mods that have been applied to the item. Mod letters that have not been applied are not included as keys.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|list|get_mod|ids|cln|table}}&lt;br /&gt;
:As get_mods, but the table returned gives all mods in terms of their sID.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|can_overcharge|cln|boolean}}&lt;br /&gt;
:This will determine if the item can be overcharged. To be overcharged, an item can't already by overcharged (IF_DESTROY), and must be fully loaded. The ui part of overcharging is included. On success, IF_DESTROY and IF_NOUNLOAD are set, but other affects must be applied by the caller.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|check_mod_array|cln|boolean|string|nextmod|integer|techbonus}}&lt;br /&gt;
:This will check if the mod indicated by ''nextmod'' (the single uppercase character representing the mod) could form an assembly (given the provided techbonus). If so, the assembly is created on the item (if the player confirms the ui message) with all associated side effects. Returns true only if the assembly is actually created.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Talk:Bruiser_brother</id>
		<title>Talk:Bruiser brother</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Talk:Bruiser_brother"/>
				<updated>2012-02-01T18:27:18Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: answer'd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==health==&lt;br /&gt;
&lt;br /&gt;
As far as I know, this page was never changed to reflect the enemy's health change since the three-episode restructure. [[User:GrimmC|GrimmC]] 23:01, 31 January 2012 (CET)&lt;br /&gt;
*Took care of the HP and fixed up the other stats while I was at it. Looking at these, however, they're way too easy for the experience receieved (they're even easier than Barons on ITYTD) so that'll need to be toned down in the next release. [[User:Game Hunter|Game Hunter]] 19:27, 1 February 2012 (CET)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Bruiser_brother</id>
		<title>Bruiser brother</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Bruiser_brother"/>
				<updated>2012-02-01T18:25:30Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: updated stats&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infostrat switch}}&lt;br /&gt;
{{Monsters|&lt;br /&gt;
monster_name=Bruiser brother|&lt;br /&gt;
monster_looks=&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;B&amp;lt;/b&amp;gt;&amp;lt;/font&amp;gt;|&lt;br /&gt;
monster_hp=60+3&amp;amp;times;difficulty&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; = 63,72,87,108,135|&lt;br /&gt;
monster_ac=2|&lt;br /&gt;
monster_acc=+5 melee, +5 ranged|&lt;br /&gt;
monster_melee=1d3+8 = 9-11 = 10 avg|&lt;br /&gt;
monster_projectile=4d5 = 4-20 = 12 avg: [[damage type#acid|acid damage]], [[explosions|radius]] 2|&lt;br /&gt;
monster_speed=100%|&lt;br /&gt;
monster_dlvl=[[Phobos Hellgate]], or 50 and lower on A100|&lt;br /&gt;
monster_xp=608|&lt;br /&gt;
monster_inventory=None|&lt;br /&gt;
monster_pickup=Yes|&lt;br /&gt;
monster_doors=Yes|&lt;br /&gt;
monster_atkchance=40|&lt;br /&gt;
monster_abilities=Takes no damage from [[fluids]]. Has 50% acid [[resistance]].|&lt;br /&gt;
monster_description=''Tough as a dump truck and nearly as big, these Goliaths are the worst thing on two legs since Tyrannosaurus rex.''|&lt;br /&gt;
monster_other=Hunts player precisely: will run through any fluid to reach player.}}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Constants</id>
		<title>Modding:Constants</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Constants"/>
				<updated>2012-01-31T21:16:44Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: removed all object-specific flags (they have been relocated to their respective document)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
== Engine Enums ==&lt;br /&gt;
&lt;br /&gt;
==== ItemType ====&lt;br /&gt;
&lt;br /&gt;
Every item has a type that determines how the engine treats it.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TItemType'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_NONE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_RANGED&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_NRANGED&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_ARMOR&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_MELEE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_AMMO&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_PACK&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_POWER&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_BOOTS&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_TELE&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_LEVER&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ITEMTYPE_AMMOPACK&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== BodyTarget ====&lt;br /&gt;
&lt;br /&gt;
Sources of damage must specify a body target to determine which sources of armor are used. Inherent armor bonuses always apply.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TBodyTarget'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|TARGET_INTERNAL&lt;br /&gt;
|Protection from boots and armor will be ignored.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|TARGET_TORSO&lt;br /&gt;
|Protection from armor counts but protection from boots does not.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|TARGET_FEET&lt;br /&gt;
|Protection from boots counts but protection from armor does not.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== EqSlot ====&lt;br /&gt;
&lt;br /&gt;
It is preferred to use the (equivalent) [[#Equip Slots|slot]] constants.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TEqSlot'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFTORSO&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFWEAPON&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFBOOTS&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFWEAPON2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== StatusEffect ====&lt;br /&gt;
&lt;br /&gt;
[[Modding:Affect|Affects]] specify one of these status effects that will apply a color scheme to all the tiles on the HUD.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TStatusEffect'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|STATUSNORMAL&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|STATUSINVERT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|STATUSRED&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|STATUSGREEN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== DamageType ====&lt;br /&gt;
&lt;br /&gt;
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 [[Damage type|here]].&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TDamageType'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_BULLET&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_MELEE&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_SHARPNEL [sic]&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_ACID&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_FIRE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DAMAGE_IGNOREARMOR&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== AltFire ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TAltFire'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_NONE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_CHAIN&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_THROW&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_SCRIPT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_AIMED&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_SINGLE&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|ALT_WHIRLWIND&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== AltReload ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TAltReload'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RELOAD_NONE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RELOAD_SCRIPT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RELOAD_FULL&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RELOAD_DUAL&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RELOAD_SINGLE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== ExplosionFlag ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=3 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TExplosionFlag'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFSELFHALF&lt;br /&gt;
|Deals half damage to the active being.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFSELFKNOCKBACK&lt;br /&gt;
|Gives extra knockback to the active being.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFSELFSAFE&lt;br /&gt;
|Deals no damage to the active being.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFAFTERBLINK&lt;br /&gt;
|Blinks the screen after the explosion finishes.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFCHAIN&lt;br /&gt;
|Causes secondary explosions (as the [[BFG 9000]]).&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFHALFKNOCK&lt;br /&gt;
|Causes half the usual knockback.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFNOKNOCK&lt;br /&gt;
|Doesn't cause knockback.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EFRANDOMCONTENT&lt;br /&gt;
|Transmutes some cells in the explosion to the explosion's content cell; the rules is to transmute when damage is greater than 20.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====LightFlag====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''TLightFlag'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LFEXPLORED&lt;br /&gt;
|This flag is set for explored cells. It can be modified to create computer map-like effects or Angel of Darkness-like effects.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LFVISIBLE&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LFLIGHTED&lt;br /&gt;
|This flag is always set on the same cells as LFVISIBLE; both flags must be set for a cell to be visible.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LFDAMAGE&lt;br /&gt;
|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.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LFFRESH&lt;br /&gt;
|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.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LFNOSPAWN&lt;br /&gt;
|Cells with this flag are counted as non-empty by the EF_NOSPAWN empty flag.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Constants ==&lt;br /&gt;
&lt;br /&gt;
==== Maximums ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Maximums'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAXX || 78&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAXY || 20&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|BOSS_LEVEL || 25&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAXDEPTH || 26&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAXAFFECT || 5&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAX_INV_SIZE || 22&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAX_EQ_SIZE || 4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Cellsets ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Cellsets'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CELLSET_WALLS&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CELLSET_FLOORS&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CELLSET_CORPSES&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Challenges ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Challenges'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_BERSERK&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_MARKSMANSHIP&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_SHOTGUNNERY&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_LIGHTTRAVEL&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_IMPATIENCE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_HASTE&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_PURITY&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_REDALERT&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_CARNAGE&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_MASOCHISM&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_100&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_PACIFISM&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CHALLENGE_HUMANITY&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Difficulty ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Difficulty'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DIFF_EASY&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DIFF_MEDIUM&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DIFF_HARD&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DIFF_VERYHARD&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DIFF_NIGHTMARE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== PlayerRank ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''PlayerRank'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANKEXP&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANKSKILL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Player Statistics ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Player Statistics'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANK_KILLTOTAL&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANK_KILLMELEE&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANK_KILLPISTOL&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANK_LEVEL&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RANK_BADGE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Equip Slots ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Equip Slots'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|SLOT_ARMOR&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|SLOT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|SLOT_BOOTS&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|SLOT_PREPARED&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Colors ====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Also, note that the exact color the end-user sees may depend on his system settings.&lt;br /&gt;
&lt;br /&gt;
For the basic 16 colors, the valkyrie string coloring escape is noted.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=4 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Colors'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|BLACK&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: black;&amp;quot;|&lt;br /&gt;
|@D&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|BLUE&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: navy;&amp;quot;|&lt;br /&gt;
|@b&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|GREEN&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: green;&amp;quot;|&lt;br /&gt;
|@g&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|CYAN&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: teal;&amp;quot;|&lt;br /&gt;
|@c&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|RED&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: maroon;&amp;quot;|&lt;br /&gt;
|@r&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MAGENTA&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: purple;&amp;quot;|&lt;br /&gt;
|@v&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|BROWN&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: olive;&amp;quot;|&lt;br /&gt;
|@n or @N&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LIGHTGRAY&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: silver;&amp;quot;|&lt;br /&gt;
|@l&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|DARKGRAY&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: gray;&amp;quot;|&lt;br /&gt;
|@d&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LIGHTBLUE&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: blue;&amp;quot;|&lt;br /&gt;
|@B&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LIGHTGREEN&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: lime;&amp;quot;|&lt;br /&gt;
|@G&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LIGHTCYAN&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: aqua;&amp;quot;|&lt;br /&gt;
|@C&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LIGHTRED&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: red;&amp;quot;|&lt;br /&gt;
|@R&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|LIGHTMAGENTA&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: fuchsia;&amp;quot;|&lt;br /&gt;
|@V&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|YELLOW&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: yellow;&amp;quot;|&lt;br /&gt;
|@y or @Y&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|WHITE&lt;br /&gt;
|width=&amp;quot;100&amp;quot; style=&amp;quot;background: white;&amp;quot;|&lt;br /&gt;
|@L&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MULTIBLUE&lt;br /&gt;
|&lt;br /&gt;
|Randomly chosen from BLUE, LIGHTBLUE, and WHITE. Only works for missiles.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MULTIYELLOW&lt;br /&gt;
|&lt;br /&gt;
|Randomly chosen from YELLOW, LIGHTGREEN, and WHITE. Only works for missiles.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|MULTIPORTAL&lt;br /&gt;
|&lt;br /&gt;
|Cycles between LIGHTMAGENTA, MAGENTA, and WHITE. Only works for things displayed in the map.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|COLOR_WATER&lt;br /&gt;
|&lt;br /&gt;
|Alternates between BLUE and LIGHTBLUE. Only works for things displayed in the map.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|COLOR_ACID&lt;br /&gt;
|&lt;br /&gt;
|Alternates between GREEN and LIGHTGREEN. Only works for things displayed in the map.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|COLOR_LAVA&lt;br /&gt;
|&lt;br /&gt;
|Alternates between RED and YELLOW. Only works for things displayed in the map.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Flags ==&lt;br /&gt;
&lt;br /&gt;
==== Generic Flags ====&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=3 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Generic Flags'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|F_OVERLAY&lt;br /&gt;
|This flag is related to the graphical version.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Empty Flags ====&lt;br /&gt;
Empty flags are used with various functions to control the selection of random coords.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
|colspan=2 style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Empty Flags'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOITEMS&lt;br /&gt;
|Excludes cells that contain an item.&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOBEINGS&lt;br /&gt;
|Excludes cells that contain a being.&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOBLOCK&lt;br /&gt;
|Excludes cells that block movement (CF_BLOCKMOVE).&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOVISION&lt;br /&gt;
|Excludes cells that block vision (CF_BLOCKLOS).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOSTAIRS&lt;br /&gt;
|Excludes stairs (cells with an OnExit hook).&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOTELE&lt;br /&gt;
|Excludes cells with a teleporter (an item with ITEMTYPE_TELE).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOHARM&lt;br /&gt;
|Excludes hazardous cells (CF_HAZARD).&lt;br /&gt;
|- style=&amp;quot;background: #333;&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOSAFE&lt;br /&gt;
|Excludes cells that are too near to the player (currently the threshold is less than or equal to distance of 5).&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;vertical-align:top; padding-right: 2ex;&amp;quot;|EF_NOSPAWN&lt;br /&gt;
|Excludes cells with LF_NOSPAWN.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Missile</id>
		<title>Modding:Missile</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Missile"/>
				<updated>2012-01-31T21:15:54Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: moved missile flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Missiles are created whenever a [[Modding:Item#Ranged Weapon|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.&lt;br /&gt;
&lt;br /&gt;
== Missile Prototype ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|(Projectile) Missile Prototype&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;id&amp;lt;/u&amp;gt;|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 [[Modding:Item#Ranged Weapon|inline missile definitions]], this field is created automatically.&lt;br /&gt;
  |'''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).&lt;br /&gt;
  |'''string'''|ascii|This is the single character used to represent the missile animation. &amp;quot;-&amp;quot;, the default, is automatically rotated as is commonly seen in DoomRL.&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|&amp;lt;u&amp;gt;color&amp;lt;/u&amp;gt;|This is the color used to draw the missile animation.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;delay&amp;lt;/u&amp;gt;|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.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;miss_base&amp;lt;/u&amp;gt;|When this missile is fired at the player, this is the base [[Dodging|dodge chance]].&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;miss_dist&amp;lt;/u&amp;gt;|When this missile is fired at the player, this is the amount that the dodge chance increases per unit of distance.&lt;br /&gt;
  |'''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).  &lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''integer'''|maxrange|This field is currently unused. The default is 10.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |[[Modding:Constants#Missile Flags|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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|expl_color|This is the color of the explosion animation. Since explosions are mulicolored, not all colors are allowed here. See [[Modding:Level#level_explosion|Level.explosion]] for details. The default is RED.&lt;br /&gt;
  |[[Modding:Constants#ExplosionFlag|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.&lt;br /&gt;
  |[[Modding:Cell|Cell ID]]|content|If this field is declared, then an explosion will have a chance of transmuting cells into this cell (as described [[Explosions|here]]). This is automatically translated into a numeric id.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Flags ===&lt;br /&gt;
{{drltable|Projectile Missile Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |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|Shambler's]] ranged attack).&lt;br /&gt;
  |MF_HARD|This flag causes the missile to continue after hitting a being (as with the [[Railgun]]).&lt;br /&gt;
  |MF_EXACT|This flag causes the missile to stop at the targeted square (as with the [[Revenant's Launcher]]).&lt;br /&gt;
  |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-vile|Arch-viles']] natural weapon uses this flag.)&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Shotgun Prototype ==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Shotgun (Missile) Prototype&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;id&amp;lt;/u&amp;gt;|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.)&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;range&amp;lt;/u&amp;gt;|This is the shotgun's [[Shotguns|range]].&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;spread&amp;lt;/u&amp;gt;|This is the shotgun's [[Shotguns|spread]].&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;reduce&amp;lt;/u&amp;gt;|This is the percentage of the shotgun's damage that decays per unit of distance.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Item</id>
		<title>Modding:Item</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Item"/>
				<updated>2012-01-31T21:13:36Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: moved and updated item flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;DoomRL has many kinds of items. Weapons, powerups, levers, and other things are all items. Items inherit from the [[Modding:Thing|Thing]] class which handles some basic properties in common with beings.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
New items are created from item prototypes. Think of an item prototype as a recipe for creating new items. There can be multiple pistols, but they all came from the same prototype. Prototypes are declared by passing a table with the desired properties to the Items function. The available properties depend on the item type. [[#Engine Hooks|Engine hooks]] may also be included in the prototype. Mostly, the prototype's properties just describe items' initial properties (occasionally with different names). Items' 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 item prototypes are stored in a global table called items. This table can be indexed by id or nid.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Item Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the item's name.&lt;br /&gt;
  |'''string'''|id|This is the item's sid. It must be distinct from other string ids. (The numeric id is automatically generated and stored in the nid field of the prototype.) It defaults to the first word of the name in all lowercase.&lt;br /&gt;
  |'''integer''' '''list'''|overlay|This describes of color transformation of the item's sprite. It is only used in the graphical version. This will create overlay_red, overlay_blue, overlay_green, and overlay_alpha attributes for the prototype.&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|color|This is the item's color. The default is LIGHTGRAY.&lt;br /&gt;
  |'''integer'''|level|This is an [[Item Generation|item generation]] parameter. The default is 0.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;weight&amp;lt;/u&amp;gt;|This is an [[Item Generation|item generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This is the item's sprite. This field is only relevant to the graphical version; use 0 for no sprite.&lt;br /&gt;
  |[[Modding:Constants#Item Flags|Item Flag]] '''list'''|flags|The flags in this list will automatically be included in the item's flag set. The default is an empty list. Some flags may be added automatically. The prototype will automatically be given a flagSet property containing the flags in set format.&lt;br /&gt;
  |[[Modding:ItemSet|ItemSet ID]]|set|If included, this item will belong to the given item set. This will modify the item's OnEquip and OnRemove hooks.&lt;br /&gt;
  |'''string'''|firstmsg|If included, this message will be displayed when the an item with this prototype is picked up for the first time. This will modify the item's OnFirstPickup hook.&lt;br /&gt;
  |'''integer'''|slevel|This property is unused.&lt;br /&gt;
  |'''string'''|color_id|For the purpose of custom color bindings, this id will be used for the item. Multiple items (like levers) can have the same color_id to prevent them from being distinguished.&lt;br /&gt;
  |'''integer'''|res_bullet|This is the item's res_bullet. The default is 0.&lt;br /&gt;
  |'''integer'''|res_melee|This is the item's res_melee. The default is 0.&lt;br /&gt;
  |'''integer'''|res_shrapnel|This is the item's res_shrapnel. The default is 0.&lt;br /&gt;
  |'''integer'''|res_acid|This is the item's res_acid. The default is 0.&lt;br /&gt;
  |'''integer'''|res_fire|This is the item's res_fire. The default is 0.&lt;br /&gt;
  |'''integer'''|res_plasma|This is the item's res_plasma. The default is 0.&lt;br /&gt;
  |[[Modding:Constants#ItemType|ItemType]]|&amp;lt;u&amp;gt;type&amp;lt;/u&amp;gt;|This is the item's itype. It also determines which other properties can be used in the prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Armor or Boots ===&lt;br /&gt;
These are the fields used by ITEMTYPE_ARMOR and ITEMTYPE_BOOTS. &lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Armor or Boots Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the armor's description that is displayed in the inventory screen.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;armor&amp;lt;/u&amp;gt;|This is the armor's armor property.&lt;br /&gt;
  |'''integer'''|durability|This is the armor's maxdurability as well as its initial durability. The default is 100. (This should still be 100 for armors with no durability, as no durability is achieved by a flag.)&lt;br /&gt;
  |'''integer'''|knockmod|This is the armor's knockmod. The default is 0.&lt;br /&gt;
  |'''integer'''|movemod|This is the armor's movemod. The default is 0.&lt;br /&gt;
  |'''string'''|ascii|This is the armor's picture. It should be a length one string. The default is &amp;quot;[&amp;quot; for body armor and &amp;quot;;&amp;quot; for boots.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Consumable ===&lt;br /&gt;
These are the fields used by ITEMTYPE_PACK. This includes mods and relics.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Consuamble Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the pack's description that is displayed in the inventory screen.&lt;br /&gt;
  |'''function'''|&amp;lt;u&amp;gt;OnUse&amp;lt;/u&amp;gt;|Packs must provide an OnUse hook.&lt;br /&gt;
  |'''string'''|ascii|This is the pack's picture. It should be a length one string. The default is &amp;quot;+&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Powerups ===&lt;br /&gt;
These are the fields used by ITEMTYPE_POWER.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Powerups Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''function'''|&amp;lt;u&amp;gt;OnPickup&amp;lt;/u&amp;gt;|Powerups must provide an OnPickup hook.&lt;br /&gt;
  |'''string'''|ascii|This is the powerup's picture. It should be a length one string. The default is &amp;quot;^&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ammo ===&lt;br /&gt;
These are the fields used by ITEMTYPE_AMMO.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Ammo Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the ammo's description that is displayed in the inventory screen.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;ammo&amp;lt;/u&amp;gt;|This is the ammo's initial ammo property.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;ammomax&amp;lt;/u&amp;gt;|This is the ammo's ammomax property.&lt;br /&gt;
  |'''string'''|ascii|This is the ammo's picture. It should be a length one string. The default is &amp;quot;&amp;amp;#124;&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ammo Pack ===&lt;br /&gt;
These are the fields used by ITEMTYPE_AMMOPACK.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Ammo Pack Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the ammo pack's description that is displayed in the inventory screen.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;ammo&amp;lt;/u&amp;gt;|This is the ammo pack's initial ammo property.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;ammomax&amp;lt;/u&amp;gt;|This is the ammo pack's ammomax property.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ammoID&amp;lt;/u&amp;gt;|This is the ammo pack's ammoid property.&lt;br /&gt;
  |'''string'''|ascii|This is the ammo pack's picture. It should be a length one string. The default is &amp;quot;!&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Ranged Weapon ===&lt;br /&gt;
These fields are used by ITEMTYPE_RANGED.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Ranged Weapon Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the weapon's description that is displayed in the inventory screen.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;damage&amp;lt;/u&amp;gt;|This should be a string like &amp;quot;2d4&amp;quot;; the weapon's damage_dice and damage_sides will be parsed from this.&lt;br /&gt;
  |[[Modding:Constants#DamageType|DamageType]]|&amp;lt;u&amp;gt;damagetype&amp;lt;/u&amp;gt;|This is the weapon's damagetype.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;group&amp;lt;/u&amp;gt;|This is the weapon's group for purposes of kill counting. The used weapon groups are &amp;quot;weapon-melee&amp;quot;, &amp;quot;weapon-pistol&amp;quot;, &amp;quot;weapon-shotgun&amp;quot;, &amp;quot;weapon-chain&amp;quot;, &amp;quot;weapon-rocket&amp;quot;, &amp;quot;weapon-plasma&amp;quot;, and &amp;quot;weapon-bfg&amp;quot;. The default is &amp;quot;weapon-other&amp;quot;.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ammoID&amp;lt;/u&amp;gt;|This is the weapon's ammoID.&lt;br /&gt;
  |'''integer'''|fire|This is the weapon's usetime. The default is 10.&lt;br /&gt;
  |'''integer'''|acc|This is the weapon's acc. The default is 0.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;ammomax&amp;lt;/u&amp;gt;|This is the weapon's ammomax and the weapon's initial ammo.&lt;br /&gt;
  |'''integer'''|radius|This is the weapon's blastradius. The default is 0.&lt;br /&gt;
  |'''integer'''|shots|This is the weapon's shots. The default is 0 (which will still give one shot).&lt;br /&gt;
  |'''integer'''|shotcost|This is the weapon's shotcost. The default is 0 (which will still require one ammo).&lt;br /&gt;
  |[[Modding:Constants#AltFire|AltFire]]|altfire|This is the weapon's altfire. The default is ALT_NONE.&lt;br /&gt;
  |[[Modding:Constants#AltReload|AltReload]]|altreload|This is the weapon's altreload. The default is RELOAD_NONE.&lt;br /&gt;
  |'''string'''|altfirename|This is the name the game uses for the weapon's alternate fire mode. Most of the AltFire constants provide defaults.&lt;br /&gt;
  |'''string'''|altreloadname|This is the name the game uses for the weapon's alternate reload mode. Most of the AltReload constants provide defaults.&lt;br /&gt;
  |[[Modding:Missile|Missile ID]]|overcharge|This field is currently unused.&lt;br /&gt;
  |[[Modding:Missile|Missile ID]] or [[Modding:Missile|Missile Prototype]]|&amp;lt;u&amp;gt;missile&amp;lt;/u&amp;gt;|This is the weapon's missile. (It will be translated into an nid. To use a shotgun missile, the weapon must have the IF_SHOTGUN flag.) If this property is a table, it will be used to declare a new missile with the same id as the weapon.&lt;br /&gt;
  |'''string'''|ascii|This is the weapon's picture. It should be a length one string. The default is &amp;quot;}&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Natural Ranged Weapon ===&lt;br /&gt;
These fields are used by ITEMTYPE_NRANGED. Natural ranged weapons are usually defined inline in a [[Modding:Being|being]] definition.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Natural Ranged Weapon Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;damage&amp;lt;/u&amp;gt;|This should be a string like &amp;quot;2d4&amp;quot;; the weapon's damage_dice and damage_sides will be parsed from this.&lt;br /&gt;
  |[[Modding:Constants#DamageType|DamageType]]|&amp;lt;u&amp;gt;damagetype&amp;lt;/u&amp;gt;|This is the weapon's damagetype.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;group&amp;lt;/u&amp;gt;|This is the weapon's group for purposes of kill counting. The used weapon groups are &amp;quot;weapon-melee&amp;quot;, &amp;quot;weapon-pistol&amp;quot;, &amp;quot;weapon-shotgun&amp;quot;, &amp;quot;weapon-chain&amp;quot;, &amp;quot;weapon-rocket&amp;quot;, &amp;quot;weapon-plasma&amp;quot;, and &amp;quot;weapon-bfg&amp;quot;. The default is &amp;quot;weapon-other&amp;quot;.&lt;br /&gt;
  |'''integer'''|fire|This is the weapon's usetime. The default is 10.&lt;br /&gt;
  |'''integer'''|acc|This is the weapon's acc. The default is 0.&lt;br /&gt;
  |'''integer'''|radius|This is the weapon's blastradius. The default is 0.&lt;br /&gt;
  |'''integer'''|shots|This is the weapon's shots. The default is 0 (which will still give one shot).&lt;br /&gt;
  |'''string'''|soundID|The soundID will be used to look up sounds if there are no sounds defined for the weapon's actual id. By convention, a natural weapon's soundID is the usual wielder's id.&lt;br /&gt;
  |[[Modding:Missile|Missile ID]] or [[Modding:Missile|Missile Prototype]]|&amp;lt;u&amp;gt;missile&amp;lt;/u&amp;gt;|This is the weapon's missile. (It will be translated into an nid. To use a shotgun missile, the weapon must have the IF_SHOTGUN flag.) If this property is a table, it will be used to declare a new missile with the same id as the weapon.&lt;br /&gt;
  |'''string'''|ascii|This is the weapon's picture. It should be a length one string. The default is &amp;quot;?&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Melee Weapon ===&lt;br /&gt;
These fields are used by ITEMTYPE_MELEE.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Melee Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the weapon's description that is displayed in the inventory screen.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;damage&amp;lt;/u&amp;gt;|This should be a string like &amp;quot;2d4&amp;quot;; the weapon's damage_dice and damage_sides will be parsed from this.&lt;br /&gt;
  |[[Modding:Constants#DamageType|DamageType]]|&amp;lt;u&amp;gt;damagetype&amp;lt;/u&amp;gt;|This is the weapon's damagetype.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;group&amp;lt;/u&amp;gt;|This is the weapon's group for purposes of kill counting. The used weapon groups are &amp;quot;weapon-melee&amp;quot;, &amp;quot;weapon-pistol&amp;quot;, &amp;quot;weapon-shotgun&amp;quot;, &amp;quot;weapon-chain&amp;quot;, &amp;quot;weapon-rocket&amp;quot;, &amp;quot;weapon-plasma&amp;quot;, and &amp;quot;weapon-bfg&amp;quot;. The default is &amp;quot;weapon-other&amp;quot;.&lt;br /&gt;
  |'''integer'''|fire|This is the weapon's usetime. The default is 10.&lt;br /&gt;
  |'''integer'''|acc|This is the weapon's acc. The default is 0.&lt;br /&gt;
  |'''integer'''|shotcost|This is the weapon's shotcost. The default is 0 (which will still require one ammo).&lt;br /&gt;
  |[[Modding:Constants#AltFire|AltFire]]|altfire|This is the weapon's altfire. The default is ALT_NONE.&lt;br /&gt;
  |'''string'''|altfirename|This is the name the game uses for the weapon's alternate fire mode. Most of the AltFire constants provide defaults.&lt;br /&gt;
  |[[Modding:Missile|Missile ID]] or [[Modding:Missile|Missile Prototype]]|missile|This is the missile used if for the throw alternate fire mode.&lt;br /&gt;
  |'''string'''|ascii|This is the weapon's picture. It should be a length one string. The default is &amp;quot;\&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Lever ===&lt;br /&gt;
These fields are used by ITEMTYPE_LEVER. DoomRL levers usually also have a target_area custom property.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Lever Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the full description of the lever used if the player has BF_LEVERSENSE2.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;good&amp;lt;/u&amp;gt;|This is the qualitative description of the lever used if the player has BF_LEVERSENSE1. By convention, this should be &amp;quot;beneficial&amp;quot;, &amp;quot;neutral&amp;quot;, or &amp;quot;dangerous&amp;quot;.&lt;br /&gt;
  |'''integer'''|fullchance|The level generation code will set the lever's target_area to the full map fullchance percent of the time. The default is 0. (To be fair, the level generation code won't generate custom levers.)&lt;br /&gt;
  |'''string'''|warning|This message will be displayed by the level generation code if the fullchance roll succeeds.&lt;br /&gt;
  |null|&amp;lt;u&amp;gt;color_id&amp;lt;/u&amp;gt;|This field is required for levers. By convention, it is set to &amp;quot;lever&amp;quot;.&lt;br /&gt;
  |null|soundID|If the particular lever doesn't have sound bindings, the game will use the sound ID to look for sound bindings. By default, this is &amp;quot;lever&amp;quot;.&lt;br /&gt;
  |'''string'''|ascii|This is the lever's picture. It should be a length one string. The default is &amp;quot;&amp;amp;&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Teleporter ===&lt;br /&gt;
These fields are used by ITEMTYPE_TELE. The built-in teleport item has a custom target property. This can be set to any coord to control the destination.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Teleporter Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''function'''|&amp;lt;u&amp;gt;OnEnter&amp;lt;/u&amp;gt;|This hook is required for teleporters.&lt;br /&gt;
  |'''string'''|ascii|This is the teleporter's picture. It should be a length one string. The default is &amp;quot;*&amp;quot;.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Flags ===&lt;br /&gt;
{{drltable|Item Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |IF_CHAMBEREMPTY|For IF_PUMPACTION weapons, this flag indicates whether ammo is in the chamber or not.&lt;br /&gt;
  |IF_UNIQUE|This flag is set for unique items. Unique items add a player history message when picked up as well as doing a screen blink. Unique items are also not destroyable.&lt;br /&gt;
  |IF_EXOTIC|This flag is set for exotic items. This is used by the game to compile the special items list.&lt;br /&gt;
  |IF_MODIFIED|This flag is automatically set for items that have been modded.&lt;br /&gt;
  |IF_HALFKNOCK|If a weapon with this flag is wielded, all knockback against the wielder will be halved.&lt;br /&gt;
  |IF_GLOBE|This is a marker flag for items that are disallowed in Angel of Masochism.&lt;br /&gt;
  |IF_CURSED|Items with this flag cannot be unequipped.&lt;br /&gt;
  |IF_RECHARGE|Items with this flag regenerate ammo or durability as with a [[Nano Pack]].&lt;br /&gt;
  |IF_CLEAVE|Items with this flag give the wielder the benefits of the [[Traits#Blademaster|Blademaster]] trait (as [[Butcher's Cleaver]]).&lt;br /&gt;
  |IF_NOAMMO|Items with this flag don't consume ammo when fired. For the player, a weapon still must have ammo loaded to be fired.&lt;br /&gt;
  |IF_NECROCHARGE|Items with this flag recharge as with IF_RECHARGE, but reduce the weilder's health by 1 for each point of recharge (as with [[Necroarmor]]).&lt;br /&gt;
  |IF_PUMPACTION|Ranged weapons with this flag must be pumped after each shot as with the combat shotgun.&lt;br /&gt;
  |IF_SINGLERELOAD|Ranged weapons with this flag only reload one ammo at a time (as with the missile launcher) instead of all at once.&lt;br /&gt;
  |IF_PISTOL|This flag indicates whether the weapon counts as a pistol for the purposes of the [[Traits#Son of a Gun|Son of a Gun]] and [[Traits#Dualgunner|Dualgunner]] traits. (For kill counting, the weapon group is used instead.)&lt;br /&gt;
  |IF_SHOTGUN|This flag causes a weapon's missile to be treated as a shotgun id rather than a missile id. Also, this flag is used to decide if the [[Traits#Shottyman|Shottyman]] trait should count the weapon as a shotgun. (For kill counting, the weapon group is used instead.)&lt;br /&gt;
  |IF_SPREAD|Ranged weapons with this flag fire three shots at once (as the [[tristar blaster]] and [[mancubus]] natural weapon). In 0.9.9.4, this flag is a bit buggy.&lt;br /&gt;
  |IF_SCATTER|For ranged weapons with this flag, each shot is aimed at a different cell near the real target (as with the [[BFG 10K]]).&lt;br /&gt;
  |IF_MODABLE|Allows a unique item to be fully modded.&lt;br /&gt;
  |IF_SINGLEMOD|Restricts the number of allowed mods on the item to one. (For unique items, this must be used along with IF_MODABLE.)&lt;br /&gt;
  |IF_DUALSHOTGUN|For multi-shot weapons, this flag eliminates all delay between shots and causes the firing sound to play only once.&lt;br /&gt;
  |IF_AIHEALPACK|This flag allows the default AI to pick up and use the item.&lt;br /&gt;
  |IF_NOUNLOAD|Ranged weapons with this flag cannot be unloaded.&lt;br /&gt;
  |IF_NUKERESIST|Items with this flag will not be destroyed by nuking.&lt;br /&gt;
  |IF_NODROP|Items with this flag will not be dropped when the carrier/wearer dies.&lt;br /&gt;
  |IF_AUTOHIT|Weapons with this flag never miss (as with items modified by a sniper weapon pack).&lt;br /&gt;
  |IF_SETITEM|This flag is automatically set for items that specify a set.&lt;br /&gt;
  |IF_NODURABILITY|Armors and boots with this flag have no durability (as with items modified by an Onyx Armor Pack).&lt;br /&gt;
  |IF_NODESTROY|Armors with this flag cannot be destroyed by damage. Also, items on the ground with this flag will not be destroyed by explosions.&lt;br /&gt;
  |IF_NONMODABLE|Items with this flag cannot be modded.&lt;br /&gt;
  |IF_NOREPAIR|Armors and boots with this flag cannot be repaired by normal methods (ie item:fix). Directly setting item.durability bypasses this prohibition.&lt;br /&gt;
  |IF_ASSEMBLED|This flag is automatically set on assemblies. Items with this flag cannot be used for the base of any other assembly.&lt;br /&gt;
  |IF_DESTROY|Weapons with this flag will be destroyed after firing (with a default message). The flag is used for overcharged weapons.&lt;br /&gt;
  |IF_BLADE|Weapons with this flag are considered blades for the purpose of activating the flags used for [[Traits#Malicious Blades|Malicious Blades]].&lt;br /&gt;
  |IF_DESTRUCTIVE|Weapons with this flag deal double damage to cells (if they can hurt cells, see [[Modding:Cell|CF_FRAGILE]].)&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
These hooks can give greater flexibility for how items work. For some item types, a hook provides the primary function. Sometimes, the engine will add to explicitly defined hooks, but this shouldn't interfere with a modder's use of the hooks. However, modders should be careful when changing hooks.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Item Hooks&lt;br /&gt;
{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|[[#item_OnCreate|OnCreate]]([[Modding:Item|Item]] self) &lt;br /&gt;
  |'''void'''|[[#item_OnPickup|OnPickup]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] getter) &lt;br /&gt;
  |'''void'''|[[#item_OnFirstPickup|OnFirstPickup]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] getter) &lt;br /&gt;
  |'''boolean'''|[[#item_OnPickupCheck|OnPickupCheck]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] getter) &lt;br /&gt;
  |'''boolean'''|[[#item_OnUse|OnUse]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] user) &lt;br /&gt;
  |'''boolean'''|[[#item_OnUseCheck|OnUseCheck]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] user) &lt;br /&gt;
  |'''boolean'''|[[#item_OnReload|OnReload]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] reloader) &lt;br /&gt;
  |'''boolean'''|[[#item_OnAltFire|OnAltFire]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] firer) &lt;br /&gt;
  |'''void'''|[[#item_OnAltReload|OnAltReload]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] reloader) &lt;br /&gt;
  |'''void'''|[[#item_OnEquip|OnEquip]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] equipper) &lt;br /&gt;
  |'''void'''|[[#item_OnEquipTick|OnEquipTick]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] wearer) &lt;br /&gt;
  |'''boolean'''|[[#item_OnEquipCheck|OnEquipCheck]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] equipper) &lt;br /&gt;
  |'''void'''|[[#item_OnRemove|OnRemove]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] wearer) &lt;br /&gt;
  |'''void'''|[[#item_OnKill|OnKill]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] dier, [[Modding:Being|Being]] wearer) &lt;br /&gt;
  |'''boolean'''|[[#item_OnHitBeing|OnHitBeing]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] attacker, [[Modding:Being|Being]] target) &lt;br /&gt;
  |'''void'''|[[#item_OnEnter|OnEnter]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] enterer) &lt;br /&gt;
  |'''boolean'''|[[#item_OnFire|OnFire]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] firer) &lt;br /&gt;
  |'''void'''|[[#item_OnFired|OnFired]]([[Modding:Item|Item]] self, [[Modding:Being|Being]] firer) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|item_OnCreate}}&lt;br /&gt;
;OnCreate([[Modding:Item|Item]] self) &lt;br /&gt;
:This hook is called when the item is created. For ammo, beware: the game creates and destroys ammo items liberally as a normal part of ammo management.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnPickup}}&lt;br /&gt;
;OnPickup([[Modding:Item|Item]] self, [[Modding:Being|Being]] getter) &lt;br /&gt;
:When an item is picked up, this hook is called with the being that is picking the item up. This is most commonly used to implement powerups.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnFirstPickup}}&lt;br /&gt;
;OnFirstPickup([[Modding:Item|Item]] self, [[Modding:Being|Being]] getter) &lt;br /&gt;
:When an item with a given id is picked up for the first time, the function is called. This only works for items that go into the inventory.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnPickupCheck}}&lt;br /&gt;
;OnPickupCheck([[Modding:Item|Item]] self, [[Modding:Being|Being]] getter) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:When a being tries to pick up an item, this function is called with the being that is trying to pick it up. If the return value is true, then the being is allowed to pick the item up, otherwise the being can't. For the player, both cases include the item in the player's previously found items. (This can affect OnFirstPickup.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnUse}}&lt;br /&gt;
;OnUse([[Modding:Item|Item]] self, [[Modding:Being|Being]] user) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook is called when levers are used and when packs are used with the being that it using the item. For packs, if the return value is true, the item is consumed, otherwise it is left in the inventory. For levers, the return value is ignored and it is safe not to have a return value.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnUseCheck}}&lt;br /&gt;
;OnUseCheck([[Modding:Item|Item]] self, [[Modding:Being|Being]] user) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook is called called before OnUse for levers and packs. If the return value is false, then the being can't use the item, otherwise it can. For levers, this can control whether the lever statistic is increased.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnReload}}&lt;br /&gt;
;OnReload([[Modding:Item|Item]] self, [[Modding:Being|Being]] reloader) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:If it is declared, this hook is called when a weapon is reloaded. If the return value is false, then the normal reload procedure is aborted. This can be used to prevent reloading or to implement a custom reloading mechanism (like for the [[Acid Spitter]]). If true is returned, the weapon is reloaded normally afterwards.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnAltFire}}&lt;br /&gt;
;OnAltFire([[Modding:Item|Item]] self, [[Modding:Being|Being]] firer) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook works exactly like the OnFire hook, except it is called when the weapon's alternate fire mode is used for weapons with ALT_SCRIPT altfire.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnAltReload}}&lt;br /&gt;
;OnAltReload([[Modding:Item|Item]] self, [[Modding:Being|Being]] reloader) &lt;br /&gt;
:If the weapon's altreload is RELOAD_SCRIPT, then this hook is called with when the weapon's alternate reload mode is used.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEquip}}&lt;br /&gt;
;OnEquip([[Modding:Item|Item]] self, [[Modding:Being|Being]] equipper) &lt;br /&gt;
:This hook is called when the item is equipped in any equipment slot. Due to a bug, equipper is the active being. This is always correct during normal play, but modders must be careful when manually equipping items with this hook. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEquipTick}}&lt;br /&gt;
;OnEquipTick([[Modding:Item|Item]] self, [[Modding:Being|Being]] wearer) &lt;br /&gt;
:While this item is equipped in any slot (including the prepared slot), this function is called on each of the being's actions. (Despite the name, it probably won't be called on every tick; it depends on the being's speed.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEquipCheck}}&lt;br /&gt;
;OnEquipCheck([[Modding:Item|Item]] self, [[Modding:Being|Being]] equipper) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This function is called (before OnEquip) when the player tries to equip an item. If the return value is true, then the player is allowed to equip the item; otherwise the player isn't allowed to equip the item.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnRemove}}&lt;br /&gt;
;OnRemove([[Modding:Item|Item]] self, [[Modding:Being|Being]] wearer) &lt;br /&gt;
:This hook is called when a being unequips the item, or when the item is otherwise removed from the being's equipment. This includes armor being destroyed by damage. Like OnEquip, this is called with the active being which can cause problems especially if this hook is called for armor destruction.  &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnKill}}&lt;br /&gt;
;OnKill([[Modding:Item|Item]] self, [[Modding:Being|Being]] dier, [[Modding:Being|Being]] wearer) &lt;br /&gt;
:When a being dies, this hook is called on all of the active being's equipment. This includes the prepared slot. (Weapons can check what slot they are in inside of this hook.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnHitBeing}}&lt;br /&gt;
;OnHitBeing([[Modding:Item|Item]] self, [[Modding:Being|Being]] attacker, [[Modding:Being|Being]] target) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:For weapons with no blastradius, this hook is called whenever a being is hit with the weapon. This hook is called before applying damage. If the return value is true, damage is applied as usual. Otherwise, the damage phase is skipped.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnEnter}}&lt;br /&gt;
;OnEnter([[Modding:Item|Item]] self, [[Modding:Being|Being]] enterer) &lt;br /&gt;
:This function is called whenever a being enters a cell that has the item lying on the floor. For the player, this supresses the usual &amp;quot;There is an item lying here&amp;quot; message. This is used in DoomRL to implement teleports.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnFire}}&lt;br /&gt;
;OnFire([[Modding:Item|Item]] self, [[Modding:Being|Being]] firer) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This hook is called when a weapon is fired. This only works for normal firing, not alternative firing (see OnAltFire). This hook is called before a target is selected. If the return value is true, then the rest of the normal firing operation is aborted. If the return value is false, then it continues as usual. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_OnFired}}&lt;br /&gt;
;OnFired([[Modding:Item|Item]] self, [[Modding:Being|Being]] firer) &lt;br /&gt;
:This hook is called after a weapon is fired. This is after the entire usual firing procedure including damage, etc. Currently, this only works for the player.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Items also have all the [[Modding:Thing|Thing]] properties in addition to those listed below. For items, the meaning of the resistance fields vary depending on the item type. For armor and boots, the resistances are applied only to attacks to the corresponding target. For other equipment, the resistance applies to all attacks. For non-equipment, the resistances aren't used. Also, some properties are only valid for armor, and some are only valid for weapons. For these purposes, armor are items with itype ITEMTYPE_ARMOR and ITEMTYPE_BOOTS and weapons are items with itype ITEMTYPE_AMMO, ITEMTYPE_MELEE, ITEMTYPE_NRANGED, ITEMTYPE_RANGED, and ITEMTYPE_AMMOPACK. Properties of the incorrect type are always indexable, but they may share a memory address with properties of the opposite type, so modders should only use this feature very carefully. The type of such properties is noted. Also, the meaning of many fields is slightly different depending on the itype; these differences are also described.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Item'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Constants#ItemType|ItemType]]|itype|This determines the basic features of the item. ITEMTYPE_NONE has no features; it can't be picked up or used. ITEMTYPE_RANGED can be picked up and wielded as a ranged weapon. ITEMTYPE_NRANGED is like ITEMTYPE_RANGED, but it isn't designed to exist on the map. ITEMTYPE_ARMOR can be picked up and equipped as armor. ITEMTYPE_MELEE can be picked up and wielded as a melee weapon. ITEMTYPE_AMMO is always a new ammo type that can be picked up and stacked. ITEMTYPE_PACK items can be picked up and used. ITEMTYPE_POWER items are consumed when they are picked up. ITEMTYPE_BOOTS can be picked up and worn as boots. ITEMTYPE_TELE have no special features, but by convention they interact with OnEnter. ITEMTYPE_LEVER have special description routines, and they can be used while on the floor. ITEMTYPE_AMMOPACK can be picked up and wielded in the prepared slot. They provide reloading benefits. While it is possible to change an item's itype, this should almost never be done. If it is done, care must be taken to account for overlapping weapon and armor properties.&lt;br /&gt;
  |'''Byte'''|armor|For armor and boots, this is the amount of [[protection]] provided at full durability. Weapons in the main slot may also provide a (universal) protection bonus with this field.&lt;br /&gt;
  |'''Word'''|durability|For armor and boots, this is the current amount of durability of the item. This property is armor-specific.&lt;br /&gt;
  |'''Word'''|maxdurability|For armor and boots, this is the maximum amount of durability. Most effects won't raise the durability above maxdurability. This property is armor-specific.&lt;br /&gt;
  |'''Integer'''|movemod|For armor and boots, this percentage movement speed modifier is applied while the item is equipped. This property is armor-specific.&lt;br /&gt;
  |'''Integer'''|knockback|For armor and boots, this percentage [[knockback]] modifier is applied while the item is equipped. This property is armor-specific.&lt;br /&gt;
  |[[Modding:Item|Item ID]]|ammoid|This must always be a number id. For ranged weapons, this is the item id of the kind of ammo the weapon uses. For ammo packs, this is the kind of ammo provided by the pack. This property is weapon-specific.&lt;br /&gt;
  |'''Word'''|ammo|For ranged weapons, this is the amount of currently-loaded ammo. For ammo packs and ammo stacks, this is the amount of ammo inside. This property is weapon-specific. &lt;br /&gt;
  |'''Word'''|ammomax|For ranged weapons, this is the size of the magazine. For ammo stacks, this is the maximum stack size (unaffected by BF_BACKPACK). For ammo packs, this is the initial amount of ammo. This property is weapon-specific.&lt;br /&gt;
  |'''Word'''|acc|For ranged and melee weapons, this is an [[accuracy]] modifier applied to attacks with the weapon. This property is weapon-specific.&lt;br /&gt;
|'''Word'''|damage_sides|For weapons, this is the number of dice rolled for damage (e.g. the X of XdY). This property is weapon-specific.&lt;br /&gt;
  |'''Word'''|damage_dice|For weapons, this is the number of sides on each die rolled for damage (e.g. the Y of XdY). This property is weapon-specific.&lt;br /&gt;
  |'''Integer'''|damage_add|For weapons, this is a flat bonus added to all damage rolls. This property is weapon-specific.&lt;br /&gt;
  |[[Modding:Missile|Missile ID]]|missile|This must always be a number id. For ranged weapons, this is the missile used by the weapon. For melee weapons, this is the missile used by the throw alternate fire mode (if any). This property is weapon-specific.&lt;br /&gt;
  |'''Byte'''|blastradius|This is the [[Distance|radius]] of the explosion caused by a ranged weapon. This should be 0 for weapons with no explosion. This property is weapon-specific.&lt;br /&gt;
  |'''Byte'''|shots|This is the number of shots fired by a rapid-fire ranged weapon. This should be 0 (not 1) for single-shot weapons. This property is weapon-specific.&lt;br /&gt;
  |'''Byte'''|shotcost|This is the amount of ammo consumed by each shot with a ranged weapon. This should be 0 (not 1) for weapons that take only one ammo per shot. This property is weapon-specific.&lt;br /&gt;
  |'''Byte'''|reloadtime|This is the number of 0.1s intervals it takes (without modifiers) to reload a ranged weapon. This property is weapon-specific.&lt;br /&gt;
  |'''Byte'''|usetime|This is the number of 0.1s intervals it takes (without modifiers) to fire/use a weapon. This property is weapon-specific.&lt;br /&gt;
  |[[Modding:Constants#DamageType|DamageType]]|damagetype|This is the [[Damage type|type]] of the damage caused by a weapon. This property is weapon-specific.&lt;br /&gt;
  |[[Modding:Constants#AltFire|AltFire]]|altfire|This is the alternate fire mode of a weapon. For ALT_SCRIPT, the details depend on the OnAltFire hook. This property is weapon-specific.&lt;br /&gt;
  |[[Modding:Constants#AltReload|AltReload]]|altreload|This is the alternate reload mode of a ranged weapon. For RELOAD_SCRIPT, the details depend on the OnAltReload hook. This property is weapon-specific.&lt;br /&gt;
  |'''string'''|desc|This is the string used to describe the item in the inventory list. For the description in the inventory sidebar, use .proto.desc. This property is read-only.&lt;br /&gt;
  |[[Modding:Item|Item Prototype]]|proto|This is the item's prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
== API ==&lt;br /&gt;
&lt;br /&gt;
The [[Modding:Thing#API|Thing API]] can also be used with items.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Item Interface&lt;br /&gt;
{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Item|Item]]|item.[[#item_new|new]]([[Modding:Item|Item ID]] id) &lt;br /&gt;
  |'''boolean'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_add_mod|add_mod]]('''string''' modletter) &lt;br /&gt;
  |'''boolean'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_can_mod|can_mod]]('''string''' modletter) &lt;br /&gt;
  |'''integer'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_get_mod|get_mod]]('''string''' modletter) &lt;br /&gt;
  |'''void'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_clear_mods|clear_mods]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_is_damaged|is_damaged]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_fix|fix]]('''integer''' amount) &lt;br /&gt;
  |'''table'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_get_mods|get_mods]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_can_overcharge|can_overcharge]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Item|Item]]&amp;amp;#058;[[#item_check_mod_array|check_mod_array]]('''string''' nextmod, '''integer''' techbonus) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|item_new}}&lt;br /&gt;
;item.new([[Modding:Item|Item ID]] id) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:This returns a newly allocated item create from the specified prototype. This item doesn't exist in the game yet; it must be dropped on the level, added to an inventory, or equipped.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_add_mod}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;add_mod('''string''' modletter) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Adds a mod to the item's mod list and sets the IF_MODIFIED flag. This does not apply any affects of the mod, it is only a primitive operation for accessing the mod list. ''modletter'' should be a single uppercase letter representing the mod. This will check modding restrictions (as [[#item_can_mod|can_mod]]) and return true on success, false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_can_mod}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;can_mod('''string''' modletter) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the given mod can be added to the item. ''modletter'' should be a single uppercase letter representing the mod. This will always use the player's techbonus. It also accounts for limits on the number of mods of a given type and various modability item flags.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_get_mod}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;get_mod('''string''' modletter) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Counts the number of the given mod that have already been added to the item. ''modletter'' should be a single uppercase letter representing the mod.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_clear_mods}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;clear_mods() &lt;br /&gt;
:Clears the counts of all mods for the item. The does not undo the affects of the mods nor does it change any flags (including IF_MODIFIED).&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_is_damaged}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;is_damaged() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This determines if the item's durability is less than its maxdurability. For items with IF_NOREPAIR, this function always returns false. (So, in effect this function determines if the item needs to be repaired.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_fix}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;fix('''integer''' amount) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This will increase the item's durability by amount, respecting maxdurability. It returns true is the item is no longer is_damaged. ''amount'' is optional; by default the item is completely repaired.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_get_mods}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;get_mods() &amp;amp;rarr; '''table'''&lt;br /&gt;
:This will return a table that maps single character mod letters to the corresponding amount of mods that have been applied to the item. Mod letters that have not been applied are not included as keys.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_can_overcharge}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;can_overcharge() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This will determine if the item can be overcharged. To be overcharged, an item can't already by overcharged (IF_DESTROY), and must be fully loaded. The ui part of overcharging is included. On success, IF_DESTROY and IF_NOUNLOAD are set, but other affects must be applied by the caller.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|item_check_mod_array}}&lt;br /&gt;
;[[Modding:Item|Item]]&amp;amp;#058;check_mod_array('''string''' nextmod, '''integer''' techbonus) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This will check if the mod indicated by ''nextmod'' (the single uppercase character representing the mod) could form an assembly (given the provided techbonus). If so, the assembly is created on the item (if the player confirms the ui message) with all associated side effects. Returns true only if the assembly is actually created.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)</id>
		<title>Modding:being (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)"/>
				<updated>2012-01-31T21:06:31Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: quick format fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the being's name.&lt;br /&gt;
  |'''string'''|name_plural|This is the being's name_plural. By default, this is the name with an &amp;quot;s&amp;quot; appended.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ascii&amp;lt;/u&amp;gt;|This is the being's picture. It should be a single character string.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''integer'''|XP|This is the being's expvalue. By default, it is &amp;lt;font-family: monospace&amp;gt;3xD&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;+20, where D is the being's &amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt; (see below).&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This is the being's sprite. (Use 0 for no sprite.)&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|&amp;lt;u&amp;gt;color&amp;lt;/u&amp;gt;|This is the being's color.&lt;br /&gt;
  |'''integer'''|toDam|This is the being's toDam. (This bonus only applies to melee attacks.) The default is 0.&lt;br /&gt;
  |'''integer'''|toHit|This is the being's toHit. The default is 0.&lt;br /&gt;
  |'''integer'''|speed|This is the being's speed. (Remember, the maximum allowed speed is 255.) The default is 100.&lt;br /&gt;
  |'''integer'''|armor|This is the being's armor. The default is 0.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;weight&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;minLev&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|maxLev|This is a [[Monster Generation|monster generation]] parameter. The default is 200.&lt;br /&gt;
  |'''integer'''|HP|This is the being's hpmax and starting hp. The default is 10.&lt;br /&gt;
  |'''integer'''|bulk|This parameter is unused. The default is 100.&lt;br /&gt;
  |'''integer'''|group|Monsters from different groups will fight each other if they use the default AI. Oddly, the default is &amp;quot;weapon-other&amp;quot; which, as a string, translates to 0. The player is in group 1.&lt;br /&gt;
  |'''integer'''|attackchance|This is the being's attackchance The default is 75.&lt;br /&gt;
  |'''integer'''|toHitMelee|This is the being's toHitMelee. The default is 0.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |[[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.)&lt;br /&gt;
  |'''integer'''|vision|This is the being's vision. The default is 9. (The player also has vision 9 by default.)&lt;br /&gt;
  |'''integer'''|res_bullet|This is the being's res_bullet. The default is 0.&lt;br /&gt;
  |'''integer'''|res_melee|This is the being's res_melee. The default is 0.&lt;br /&gt;
  |'''integer'''|res_shrapnel|This is the being's res_shrapnel. The default is 0.&lt;br /&gt;
  |'''integer'''|res_acid|This is the being's res_acid. The default is 0.&lt;br /&gt;
  |'''integer'''|res_fire|This is the being's res_fire. The default is 0.&lt;br /&gt;
  |'''integer'''|res_plasma|This is the being's res_plasma. The default is 0.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the description of the being displayed in the more information view.&lt;br /&gt;
  |'''string'''|kill_desc|If included, this being will have a special kill description in the mortem.&lt;br /&gt;
  |'''string'''|kill_desc_melee|As kill_desc, but for melee kills.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
=== Flags ===&lt;br /&gt;
==== Being Flags ====&lt;br /&gt;
{{drltable|Being Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BERSERK|Gives the damage reduction and melee damage bonus of [[Effects#Berserk|berserk]]. (The speed bonus is not included.)&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BACKPACK|Gives the ammo-stacking benefits of the [[Backpack]] powerup.&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_STAIRSENSE|For the player, reveals the stairs tile(s) as the [[Scout]] class bonus.&lt;br /&gt;
  |BF_INSTAUSE|Allows consumable items to be used in 0.1s instead of the usual 1.0s, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MAPEXPERT|Makes computer maps work like tracking maps, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MODEXPERT|Allows the being to mod unique items.&lt;br /&gt;
  |BF_QUICKSWAP|Gives the benefits of the Juggler trait.&lt;br /&gt;
  |BF_BERSERKER|Gives the benefits of the [[Traits#Berserker|Berserker]] trait.&lt;br /&gt;
  |BF_DUALGUN|Gives the benefits of the dualgunner trait.&lt;br /&gt;
  |BF_MASTERDODGE|Gives the benefits of the [[Traits#Dodgemaster|Dodgemaster]] trait.&lt;br /&gt;
  |BF_SHOTTYMAN|Gives the benefits of the [[Traits#Shottyman|Shottyman]] trait.&lt;br /&gt;
  |BF_POWERSENSE|For the player, shows the locations of all powerups (as the first level of the [[Traits#Intuition|Intuition]] trait).&lt;br /&gt;
  |BF_BEINGSENSE|For the player, shows the locations of enemies (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE1|For the player, gives partial information about levers (as the first level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE2|For the player, shows the exact effect of levers (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_VAMPYRE|Gives the benefits of the [[Traits#Vampyre|Vampyre]] trait.&lt;br /&gt;
  |BF_BULLETDANCE|Gives the benefits of the [[Traits#Bullet Dance|Bullet Dance]] trait.&lt;br /&gt;
  |BF_ARMYDEAD|Gives the benefits of the [[Traits#Army of the Dead|Army of the Dead]] trait.&lt;br /&gt;
  |BF_AMMOCHAIN|Gives the benefits of the [[Traits#Ammochain|Ammochain]] trait.&lt;br /&gt;
  |BF_MEDPLUS|Allows med-packs to heal beyond 100% health (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_HARDY|Allows protection to reduce damage all the way to zero (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_CLEAVE|Gives the benefits of the [[Traits#Blademaster|Blademaster]] trait.&lt;br /&gt;
  |BF_GUNKATA|Gives the benefits of the [[Traits#Gun Kata|Gun Kata]] trait.&lt;br /&gt;
  |BF_SHOTTYHEAD|Gives the benefits of the [[Traits#Shottyhead|Shottyhead]] trait.&lt;br /&gt;
  |BF_NORUNPENALTY|Gives the benefits of the [[Traits#Running Man|Running Man]] trait.&lt;br /&gt;
  |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).&lt;br /&gt;
  |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]].&lt;br /&gt;
  |BF_PISTOLMAX|Gives the benefits of the [[Sharpshooter]] trait.&lt;br /&gt;
  |BF_FIREANGEL|Gives the benefits of the [[Traits#Fireangel|Fireangel]] trait.&lt;br /&gt;
  |BF_ENTRENCHMENT|Gives the benefits of the [[Traits#Entrenchment|Entrenchment]] trait.&lt;br /&gt;
  |BF_SCAVENGER|Gives the benefits of the [[Scavenger]] trait (useless on anything other than the player).&lt;br /&gt;
  |BF_IMPATIENT|This flag causes packs to be automatically used when picked up as [[Angel of Impatience]].&lt;br /&gt;
  |BF_DARKNESS|For the player, stops exploration from being recorded as in [[Angel of Darkness]].&lt;br /&gt;
  |BF_MAXDAMAGE|Beings with this flag always roll maximum damage as in [[Angel of Max Carnage]].&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_SESSILE|Beings with this flag cannot move.&lt;br /&gt;
  |BF_NOMELEE|This flag stops the being from doing any type of melee attack.&lt;br /&gt;
  |BF_REGENERATE|Beings with this flag regenerate one health per second if they have less than 20 health remaining.&lt;br /&gt;
  |BF_SELFIMMUNE|Makes the being immune to its own attacks.&lt;br /&gt;
  |BF_KNOCKIMMUNE|Makes the being immune to [[knockback]].&lt;br /&gt;
  |BF_UNIQUENAME|This flag makes the game treat the being's name as a proper noun.&lt;br /&gt;
  |BF_ENTERBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_ENTERBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |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.)&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_OPENDOORS|This is a flag for the default AI. Beings with this flag will open doors.&lt;br /&gt;
  |BF_NODROP|Beings with this flag will not drop their inventory or equipment when they die.&lt;br /&gt;
  |BF_NOEXP|Beings with this flag will not award experience to the player.&lt;br /&gt;
  |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.&lt;br /&gt;
  |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.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
Specifying one or more of these hooks in the prototype will allow for greater customization.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|[[#being_OnCreate|OnCreate]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnAction|OnAction]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnDie|OnDie]]([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_OnCreate}}&lt;br /&gt;
;OnCreate([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called when the being is created.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnAction}}&lt;br /&gt;
;OnAction([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called at the beginning of each of the being's turns. (Note that turns are only differentiated if time elapses in between.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnDie}}&lt;br /&gt;
;OnDie([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
:This is called when the being dies. ''overkill'' is true if the being was gibbed.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Beings also have all the [[Modding:Thing|Thing]] properties in addition to those listed below. For beings, the resistance fields are inherent resistances that apply to all attacks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''Byte'''|attackchance|This is how likely (in percent) a monster is to use a ranged attack on its turn. The exact interpretation may depend on the AI. This property is read-only.&lt;br /&gt;
  |'''Integer'''|hp|This is the being's current [[health]].&lt;br /&gt;
  |'''Word'''|hpmax|This is the being's maximum health.&lt;br /&gt;
  |'''Byte'''|vision|This is the being's vision radius. (It is up to the AI to respect this radius.)&lt;br /&gt;
  |'''LongInt'''|scount|This is the being's speed count or energy. It counts up by the being's speed every 0.1s, and when it reaches 5000, the being gets to act. For details, see [[Time#Fractional Time|here]].&lt;br /&gt;
  |'''ShortInt'''|tohit|This [[accuracy]] modifier is applied to all of the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|todam|This damage modifier is applied to all the being's melee attacks.&lt;br /&gt;
  |'''ShortInt'''|todamall|This damage modifier is applied to all the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|tohitmelee|This accuracy modifier is applied to the being's melee attacks.&lt;br /&gt;
  |'''Byte'''|speed|This is the rate at which the being's scount increases. It affects the speed of all actions.&lt;br /&gt;
  |'''Byte'''|armor|This is the being's natural armor. It appears as [[protection]] against all attacks.&lt;br /&gt;
  |'''Word'''|expvalue|This is the amount of [[experience]] that is awarded to the player when the being dies.&lt;br /&gt;
  |'''ShortInt'''|techbonus|This usually corresponds to [[Whizkid]] levels; it affects the number of mods that can be applied and the level of assemblies that can be constructed.&lt;br /&gt;
  |'''ShortInt'''|pistolbonus|This usually corresponds to [[Son of a Gun]] levels; it affects pistol firing time and damage.&lt;br /&gt;
  |'''ShortInt'''|rapidbonus|This usually corresponds to [[Triggerhappy]] levels; it affects the number of shots fired by rapid-fire weapons.&lt;br /&gt;
  |'''ShortInt'''|bodybonus|This is the property used to implement [[Badass]]. Each point reduces [[knockback]] by one, and anything above zero stops health decay.&lt;br /&gt;
  |'''Byte'''|reloadtime|This is the percentage of normal reload time that the being takes to reload. (It is used to implement [[Reloader]].)&lt;br /&gt;
  |'''Byte'''|firetime|This is the percentage of normal fire time that the being takes to fire. (It is used to implement [[Finesse]].)&lt;br /&gt;
  |'''Byte'''|movetime|This is the percentage of normal movement time that the being takes to move. For the player, anything less than 100 applies a corresponding dodge bonus. (This is used to implement [[Hellrunner]].)&lt;br /&gt;
  |'''Word'''|soundact|This is the being's .act sound.&lt;br /&gt;
  |'''Word'''|soundhit|This is the being's .hit sound.&lt;br /&gt;
  |'''Word'''|sounddie|This is the being's .die sound.&lt;br /&gt;
  |'''Word'''|soundattack|This is the being's .attack sound.&lt;br /&gt;
  |'''Word'''|soundmelee|This is the being's .melee sound.&lt;br /&gt;
  |'''Word'''|soundhoof|This is the being's .hoof sound.&lt;br /&gt;
  |[[Modding:Being|Being Prototype]]|proto|This is the being's prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
The [[Modding:Thing#API|Thing API]] can also be used with beings.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being Interface&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Being|Being]]|being.[[#being_new|new]]([[Modding:Being|Being ID]] id) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_destroy|destroy]]('''boolean''' silent) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_kill|kill]]('''boolean''' overkill) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_ressurect|ressurect]]('''integer''' rrange) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_apply_damage|apply_damage]]('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
  |'''string'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_name|get_name]]('''boolean''' known, '''boolean''' capitalized) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_inv_item|get_inv_item]]('''integer''' slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_inv_item|set_inv_item]]('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_eq_item|get_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_eq_item|set_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_play_sound|play_sound]]('''Sound ID''' sound) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_total_resistance|get_total_resistance]]([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_use|use]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_wear|wear]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pickup|pickup]]([[Modding:Coord|Coord]] pos) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_attack|attack]]([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_fire|fire]]([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_reload|reload]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_direct_seek|direct_seek]]([[Modding:Coord|Coord]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_find|path_find]]([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_next|path_next]]() &lt;br /&gt;
  |[[Modding:Coord|Coord]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_flock_target|flock_target]]('''integer''' range, '''integer''' mind, '''integer''' maxd) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_msg|msg]]('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_select_slot_by_letter|select_slot_by_letter]]('''string''' letter) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_phase|phase]]([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_spawn|spawn]]([[Modding:Being|Being ID]] being) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_visible|is_visible]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_player|is_player]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_items|set_items]]([[Modding:ItemSet|ItemSet]] set) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_nuke|nuke]]('''integer''' time) &lt;br /&gt;
  |[[Modding:Item|Item]], '''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pick_mod_item|pick_mod_item]]('''string''' modletter, '''integer''' techbonus)&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_new}}&lt;br /&gt;
;being.new([[Modding:Being|Being ID]] id) &amp;amp;rarr; [[Modding:Being|Being]]&lt;br /&gt;
:This creates a newly allocated being of the appropriate type. The being won't exist on the map until it is placed by e.g. Level.drop_being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_destroy}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;destroy('''boolean''' silent) &lt;br /&gt;
:Deallocates the memory associated with the being and removes it from the level (if applicable). The normal results of killing a being (e.g. leaving a corpse) are ignored. The ''silent'' parameter is optional. If true, applicable OnKill and OnKillAll hooks and events will also be ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_kill}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;kill('''boolean''' overkill) &lt;br /&gt;
:Kills the being. If the optional ''overkill'' parameter is true, then the being will be gibbed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_ressurect}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;ressurect('''integer''' rrange) &lt;br /&gt;
:Resurrects a single corpse that is found within a square of side-length 2 &amp;amp;times; ''rrange'' + 1, centered around the being. Nearer corpses are preferred. The corpse must not have another being standing on it and must be within sight of the being (as determined by the enemy line-of-sight algorithm). The resurrected being (if any) will have BF_NOEXP set. Messages are included.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_apply_damage}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;apply_damage('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
:Deals damage to the being using the given body target and damage type. (The default damage type is bullet damage.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_name}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_name('''boolean''' known, '''boolean''' capitalized) &amp;amp;rarr; '''string'''&lt;br /&gt;
:Returns the name of the being. If ''known'' is true, &amp;quot;the&amp;quot; is added, otherwise &amp;quot;a&amp;quot; or &amp;quot;an&amp;quot; is added. If BF_UNIQUENAME is set for the being, then no article is used in either case. If ''capitalized'' is true, then the first letter will be capitalized.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_inv_item('''integer''' slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given slot in the being's inventory. If the slot is empty, nil is returned instead.  &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_inv_item('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the given slot in the being's inventory to the given item. If the slot wasn't empty before, the previous constents are lost.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given equipment slot of the being. If the slot is empty, nil is returned instead. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the being's equipment slot to the given item. Any item that was previously in that slot is lost. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_play_sound}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;play_sound('''Sound ID''' sound) &lt;br /&gt;
:Plays the given sound as if it came from the being's position.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_total_resistance}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_total_resistance([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Calculates the being's effective resistance against attacks of the given target (default is body). This accounts for inherent resists as well as equipment bonuses.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_use}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being use the given consumable item from its inventory. The function always returns false. (Bug: it is supposed to return true on success.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_wear}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being wear the given eqipment from its inventory. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pickup}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pickup([[Modding:Coord|Coord]] pos) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being pick up the item at the given position. ''pos'' is optional; it defaults to the being's position. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_attack}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;attack([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
:This makes the being do a standard melee attack against the targeted being or coord.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_fire}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;fire([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
:This makes the being fire at ''target'' with ''weapon''.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_reload}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;reload() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being reload its currently equipped weapon. The return value is true if there being had at least some of the appropriate ammo to attempt reloading with.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_direct_seek}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;direct_seek([[Modding:Coord|Coord]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This makes the being take a step towards the target. The being will always try to travel in a direct path. The return value is either 0, 1, 2, or 3. 0 indicates success, 1 indicates that a wall blocked the move, 2 indicates that a door blocked the move, and 3 indicates that a being blocked the move.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_find}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_find([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This attempts to calculate a path between the being and ''target''. The ''cutoff'' and ''maximum'' parameters are somewhat technical, but basically they indicate how much time should be spend searching for a path. DoomRL uses 40, 200 for bosses and 10, 40 for normal enemies. The path will be remembered by the being, and can be followed using path_next. Modders should keep in mind that path-finding is a somewhat expensive operation, especially for large ''cutoff'' and ''maximum''. The return value indicates whether a path was found. Even if no path was found, a path will be loaded that will try to take the being closer to the target (although this path may be empty). This uses the AStar searching algorithm using Euclidean distance as a heuristic. The search is aborted if ''maximum'' nodes are expanded without finding the target or it ''cutoff'' nodes are expanded without getting closer to the target. When aborted, a path is created to the closest expanded node to the target in terms of the heuristic.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_next}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_next() &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This causes the being to take a step along the path last calculated by path_find. The return value follows the pattern of direct_seek.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_flock_target}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;flock_target('''integer''' range, '''integer''' mind, '''integer''' maxd) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This looks for the closest being of the same type to the being (within a square ''range''). If the being is farther than ''maxd'' away, then its position is returned. If it is closer than ''mind'', then a position opposite from the closest with respect to the being is returned. Otherwise (or if there is no nearby being of the same type), a random coord from the scanning area is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_msg}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;msg('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
:If the being is the player, then ''msg_player'' is displayed. If the being is not the player, but visible to the player, the ''msg_being'' is displayed. If either message is nil it is ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_select_slot_by_letter}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;select_slot_by_letter('''string''' letter) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the one of the being's equipment where &amp;quot;a&amp;quot; is for armor, &amp;quot;b&amp;quot; is for boots, &amp;quot;w&amp;quot; is for weapon, and &amp;quot;p&amp;quot; is for the prepared slot. If the slot is empty, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_phase}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;phase([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
:If ''cell'' is omitted, then the being is displaced randomly as if it used a [[phase device]] (without the flashy interface stuff). If the cell is included, the being is displaced to a random cell of the given cell id. If the chosen cell is occupied, a nearby cell is used. If no such cell exists, a random cell is chosen.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_spawn}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being ID]] being) &lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being]] being) &lt;br /&gt;
:Drops a new being of the appropriate type (or the given being) nearby. The dropped being is set with the BF_NOEXP flag.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_visible}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_visible() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the player can see the being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_player}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_player() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the being is the player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_items}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_items([[Modding:ItemSet|ItemSet]] set) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Counts the number of the being's equipped items that belong to the given set.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_nuke}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;nuke('''integer''' time) &lt;br /&gt;
:Sets the nuke timer to ''time'' and changes the cell under the being to the nuke cell. By default, ''time'' is 1. (Setting the nuke time to 0 will disable the countdown.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pick_mod_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pick_mod_item('''string''' modletter, '''integer''' techbonus) &amp;amp;rarr; [[Modding:Item|Item]], '''boolean'''&lt;br /&gt;
:This only works for the player. This gives the player the item select menu used by mods, and calculates whether the mod is legal (using the given ''techbonus''). This includes assembly checking. The first return value is the item on success. The second return value is true on success and false on failure. (''modletter'' should be the length one string corresponding to the mod type.)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)</id>
		<title>Modding:being (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)"/>
				<updated>2012-01-31T21:04:25Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: also it's IF_BLADE not IF_BLADED&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the being's name.&lt;br /&gt;
  |'''string'''|name_plural|This is the being's name_plural. By default, this is the name with an &amp;quot;s&amp;quot; appended.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ascii&amp;lt;/u&amp;gt;|This is the being's picture. It should be a single character string.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''integer'''|XP|This is the being's expvalue. By default, it is &amp;lt;font-family: monospace&amp;gt;3xD&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;+20, where D is the being's &amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt; (see below).&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This is the being's sprite. (Use 0 for no sprite.)&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|&amp;lt;u&amp;gt;color&amp;lt;/u&amp;gt;|This is the being's color.&lt;br /&gt;
  |'''integer'''|toDam|This is the being's toDam. (This bonus only applies to melee attacks.) The default is 0.&lt;br /&gt;
  |'''integer'''|toHit|This is the being's toHit. The default is 0.&lt;br /&gt;
  |'''integer'''|speed|This is the being's speed. (Remember, the maximum allowed speed is 255.) The default is 100.&lt;br /&gt;
  |'''integer'''|armor|This is the being's armor. The default is 0.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;weight&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;minLev&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|maxLev|This is a [[Monster Generation|monster generation]] parameter. The default is 200.&lt;br /&gt;
  |'''integer'''|HP|This is the being's hpmax and starting hp. The default is 10.&lt;br /&gt;
  |'''integer'''|bulk|This parameter is unused. The default is 100.&lt;br /&gt;
  |'''integer'''|group|Monsters from different groups will fight each other if they use the default AI. Oddly, the default is &amp;quot;weapon-other&amp;quot; which, as a string, translates to 0. The player is in group 1.&lt;br /&gt;
  |'''integer'''|attackchance|This is the being's attackchance The default is 75.&lt;br /&gt;
  |'''integer'''|toHitMelee|This is the being's toHitMelee. The default is 0.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |[[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.)&lt;br /&gt;
  |'''integer'''|vision|This is the being's vision. The default is 9. (The player also has vision 9 by default.)&lt;br /&gt;
  |'''integer'''|res_bullet|This is the being's res_bullet. The default is 0.&lt;br /&gt;
  |'''integer'''|res_melee|This is the being's res_melee. The default is 0.&lt;br /&gt;
  |'''integer'''|res_shrapnel|This is the being's res_shrapnel. The default is 0.&lt;br /&gt;
  |'''integer'''|res_acid|This is the being's res_acid. The default is 0.&lt;br /&gt;
  |'''integer'''|res_fire|This is the being's res_fire. The default is 0.&lt;br /&gt;
  |'''integer'''|res_plasma|This is the being's res_plasma. The default is 0.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the description of the being displayed in the more information view.&lt;br /&gt;
  |'''string'''|kill_desc|If included, this being will have a special kill description in the mortem.&lt;br /&gt;
  |'''string'''|kill_desc_melee|As kill_desc, but for melee kills.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
=== Flags ===&lt;br /&gt;
==== Being Flags ====&lt;br /&gt;
{{drltable|Being Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BERSERK|Gives the damage reduction and melee damage bonus of [[Effects#Berserk|berserk]]. (The speed bonus is not included.)&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BACKPACK|Gives the ammo-stacking benefits of the [[Backpack]] powerup.&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_STAIRSENSE|For the player, reveals the stairs tile(s) as the [[Scout]] class bonus.&lt;br /&gt;
  |BF_INSTAUSE|Allows consumable items to be used in 0.1s instead of the usual 1.0s, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MAPEXPERT|Makes computer maps work like tracking maps, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MODEXPERT|Allows the being to mod unique items.&lt;br /&gt;
  |BF_QUICKSWAP|Gives the benefits of the Juggler trait.&lt;br /&gt;
  |BF_BERSERKER|Gives the benefits of the [[Traits#Berserker|Berserker]] trait.&lt;br /&gt;
  |BF_DUALGUN|Gives the benefits of the dualgunner trait.&lt;br /&gt;
  |BF_MASTERDODGE|Gives the benefits of the [[Traits#Dodgemaster|Dodgemaster]] trait.&lt;br /&gt;
  |BF_SHOTTYMAN|Gives the benefits of the [[Traits#Shottyman|Shottyman]] trait.&lt;br /&gt;
  |BF_POWERSENSE|For the player, shows the locations of all powerups (as the first level of the [[Traits#Intuition|Intuition]] trait).&lt;br /&gt;
  |BF_BEINGSENSE|For the player, shows the locations of enemies (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE1|For the player, gives partial information about levers (as the first level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE2|For the player, shows the exact effect of levers (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_VAMPYRE|Gives the benefits of the [[Traits#Vampyre|Vampyre]] trait.&lt;br /&gt;
  |BF_BULLETDANCE|Gives the benefits of the [[Traits#Bullet Dance|Bullet Dance]] trait.&lt;br /&gt;
  |BF_ARMYDEAD|Gives the benefits of the [[Traits#Army of the Dead|Army of the Dead]] trait.&lt;br /&gt;
  |BF_AMMOCHAIN|Gives the benefits of the [[Traits#Ammochain|Ammochain]] trait.&lt;br /&gt;
  |BF_MEDPLUS|Allows med-packs to heal beyond 100% health (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_HARDY|Allows protection to reduce damage all the way to zero (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_CLEAVE|Gives the benefits of the [[Traits#Blademaster|Blademaster]] trait.&lt;br /&gt;
  |BF_GUNKATA|Gives the benefits of the [[Traits#Gun Kata|Gun Kata]] trait.&lt;br /&gt;
  |BF_SHOTTYHEAD|Gives the benefits of the [[Traits#Shottyhead|Shottyhead]] trait.&lt;br /&gt;
  |BF_NORUNPENALTY|Gives the benefits of the [[Traits#Running Man|Running Man]] trait.&lt;br /&gt;
  |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).&lt;br /&gt;
  |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]].&lt;br /&gt;
  |BF_PISTOLMAX|Gives the benefits of the [[Sharpshooter]] trait.&lt;br /&gt;
  |BF_FIREANGEL|Gives the benefits of the [[Traits#Fireangel|Fireangel]] trait.&lt;br /&gt;
  |BF_ENTRENCHMENT|Gives the benefits of the [[Traits#Entrenchment|Entrenchment]] trait.&lt;br /&gt;
  |BF_SCAVENGER|Gives the benefits of the [[Scavenger]] trait (useless on anything other than the player).&lt;br /&gt;
  |BF_IMPATIENT|This flag causes packs to be automatically used when picked up as [[Angel of Impatience]].&lt;br /&gt;
  |BF_DARKNESS|For the player, stops exploration from being recorded as in [[Angel of Darkness]].&lt;br /&gt;
  |BF_MAXDAMAGE|Beings with this flag always roll maximum damage as in [[Angel of Max Carnage]].&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_SESSILE|Beings with this flag cannot move.&lt;br /&gt;
  |BF_NOMELEE|This flag stops the being from doing any type of melee attack.&lt;br /&gt;
  |BF_REGENERATE|Beings with this flag regenerate one health per second if they have less than 20 health remaining.&lt;br /&gt;
  |BF_SELFIMMUNE|Makes the being immune to its own attacks.&lt;br /&gt;
  |BF_KNOCKIMMUNE|Makes the being immune to [[knockback]].&lt;br /&gt;
  |BF_UNIQUENAME|This flag makes the game treat the being's name as a proper noun.&lt;br /&gt;
  |BF_ENTERBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_ENTERBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |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.)&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_OPENDOORS|This is a flag for the default AI. Beings with this flag will open doors.&lt;br /&gt;
  |BF_NODROP|Beings with this flag will not drop their inventory or equipment when they die.&lt;br /&gt;
  |BF_NOEXP|Beings with this flag will not award experience to the player.&lt;br /&gt;
  |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.&lt;br /&gt;
  |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.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
Specifying one or more of these hooks in the prototype will allow for greater customization.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|[[#being_OnCreate|OnCreate]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnAction|OnAction]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnDie|OnDie]]([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_OnCreate}}&lt;br /&gt;
;OnCreate([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called when the being is created.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnAction}}&lt;br /&gt;
;OnAction([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called at the beginning of each of the being's turns. (Note that turns are only differentiated if time elapses in between.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnDie}}&lt;br /&gt;
;OnDie([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
:This is called when the being dies. ''overkill'' is true if the being was gibbed.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Beings also have all the [[Modding:Thing|Thing]] properties in addition to those listed below. For beings, the resistance fields are inherent resistances that apply to all attacks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''Byte'''|attackchance|This is how likely (in percent) a monster is to use a ranged attack on its turn. The exact interpretation may depend on the AI. This property is read-only.&lt;br /&gt;
  |'''Integer'''|hp|This is the being's current [[health]].&lt;br /&gt;
  |'''Word'''|hpmax|This is the being's maximum health.&lt;br /&gt;
  |'''Byte'''|vision|This is the being's vision radius. (It is up to the AI to respect this radius.)&lt;br /&gt;
  |'''LongInt'''|scount|This is the being's speed count or energy. It counts up by the being's speed every 0.1s, and when it reaches 5000, the being gets to act. For details, see [[Time#Fractional Time|here]].&lt;br /&gt;
  |'''ShortInt'''|tohit|This [[accuracy]] modifier is applied to all of the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|todam|This damage modifier is applied to all the being's melee attacks.&lt;br /&gt;
  |'''ShortInt'''|todamall|This damage modifier is applied to all the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|tohitmelee|This accuracy modifier is applied to the being's melee attacks.&lt;br /&gt;
  |'''Byte'''|speed|This is the rate at which the being's scount increases. It affects the speed of all actions.&lt;br /&gt;
  |'''Byte'''|armor|This is the being's natural armor. It appears as [[protection]] against all attacks.&lt;br /&gt;
  |'''Word'''|expvalue|This is the amount of [[experience]] that is awarded to the player when the being dies.&lt;br /&gt;
  |'''ShortInt'''|techbonus|This usually corresponds to [[Whizkid]] levels; it affects the number of mods that can be applied and the level of assemblies that can be constructed.&lt;br /&gt;
  |'''ShortInt'''|pistolbonus|This usually corresponds to [[Son of a Gun]] levels; it affects pistol firing time and damage.&lt;br /&gt;
  |'''ShortInt'''|rapidbonus|This usually corresponds to [[Triggerhappy]] levels; it affects the number of shots fired by rapid-fire weapons.&lt;br /&gt;
  |'''ShortInt'''|bodybonus|This is the property used to implement [[Badass]]. Each point reduces [[knockback]] by one, and anything above zero stops health decay.&lt;br /&gt;
  |'''Byte'''|reloadtime|This is the percentage of normal reload time that the being takes to reload. (It is used to implement [[Reloader]].)&lt;br /&gt;
  |'''Byte'''|firetime|This is the percentage of normal fire time that the being takes to fire. (It is used to implement [[Finesse]].)&lt;br /&gt;
  |'''Byte'''|movetime|This is the percentage of normal movement time that the being takes to move. For the player, anything less than 100 applies a corresponding dodge bonus. (This is used to implement [[Hellrunner]].)&lt;br /&gt;
  |'''Word'''|soundact|This is the being's .act sound.&lt;br /&gt;
  |'''Word'''|soundhit|This is the being's .hit sound.&lt;br /&gt;
  |'''Word'''|sounddie|This is the being's .die sound.&lt;br /&gt;
  |'''Word'''|soundattack|This is the being's .attack sound.&lt;br /&gt;
  |'''Word'''|soundmelee|This is the being's .melee sound.&lt;br /&gt;
  |'''Word'''|soundhoof|This is the being's .hoof sound.&lt;br /&gt;
  |[[Modding:Being|Being Prototype]]|proto|This is the being's prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
The [[Modding:Thing#API|Thing API]] can also be used with beings.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being Interface&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Being|Being]]|being.[[#being_new|new]]([[Modding:Being|Being ID]] id) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_destroy|destroy]]('''boolean''' silent) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_kill|kill]]('''boolean''' overkill) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_ressurect|ressurect]]('''integer''' rrange) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_apply_damage|apply_damage]]('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
  |'''string'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_name|get_name]]('''boolean''' known, '''boolean''' capitalized) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_inv_item|get_inv_item]]('''integer''' slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_inv_item|set_inv_item]]('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_eq_item|get_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_eq_item|set_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_play_sound|play_sound]]('''Sound ID''' sound) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_total_resistance|get_total_resistance]]([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_use|use]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_wear|wear]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pickup|pickup]]([[Modding:Coord|Coord]] pos) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_attack|attack]]([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_fire|fire]]([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_reload|reload]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_direct_seek|direct_seek]]([[Modding:Coord|Coord]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_find|path_find]]([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_next|path_next]]() &lt;br /&gt;
  |[[Modding:Coord|Coord]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_flock_target|flock_target]]('''integer''' range, '''integer''' mind, '''integer''' maxd) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_msg|msg]]('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_select_slot_by_letter|select_slot_by_letter]]('''string''' letter) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_phase|phase]]([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_spawn|spawn]]([[Modding:Being|Being ID]] being) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_visible|is_visible]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_player|is_player]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_items|set_items]]([[Modding:ItemSet|ItemSet]] set) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_nuke|nuke]]('''integer''' time) &lt;br /&gt;
  |[[Modding:Item|Item]], '''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pick_mod_item|pick_mod_item]]('''string''' modletter, '''integer''' techbonus)&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_new}}&lt;br /&gt;
;being.new([[Modding:Being|Being ID]] id) &amp;amp;rarr; [[Modding:Being|Being]]&lt;br /&gt;
:This creates a newly allocated being of the appropriate type. The being won't exist on the map until it is placed by e.g. Level.drop_being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_destroy}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;destroy('''boolean''' silent) &lt;br /&gt;
:Deallocates the memory associated with the being and removes it from the level (if applicable). The normal results of killing a being (e.g. leaving a corpse) are ignored. The ''silent'' parameter is optional. If true, applicable OnKill and OnKillAll hooks and events will also be ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_kill}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;kill('''boolean''' overkill) &lt;br /&gt;
:Kills the being. If the optional ''overkill'' parameter is true, then the being will be gibbed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_ressurect}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;ressurect('''integer''' rrange) &lt;br /&gt;
:Resurrects a single corpse that is found within a square of side-length 2 &amp;amp;times; ''rrange'' + 1, centered around the being. Nearer corpses are preferred. The corpse must not have another being standing on it and must be within sight of the being (as determined by the enemy line-of-sight algorithm). The resurrected being (if any) will have BF_NOEXP set. Messages are included.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_apply_damage}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;apply_damage('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
:Deals damage to the being using the given body target and damage type. (The default damage type is bullet damage.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_name}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_name('''boolean''' known, '''boolean''' capitalized) &amp;amp;rarr; '''string'''&lt;br /&gt;
:Returns the name of the being. If ''known'' is true, &amp;quot;the&amp;quot; is added, otherwise &amp;quot;a&amp;quot; or &amp;quot;an&amp;quot; is added. If BF_UNIQUENAME is set for the being, then no article is used in either case. If ''capitalized'' is true, then the first letter will be capitalized.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_inv_item('''integer''' slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given slot in the being's inventory. If the slot is empty, nil is returned instead.  &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_inv_item('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the given slot in the being's inventory to the given item. If the slot wasn't empty before, the previous constents are lost.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given equipment slot of the being. If the slot is empty, nil is returned instead. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the being's equipment slot to the given item. Any item that was previously in that slot is lost. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_play_sound}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;play_sound('''Sound ID''' sound) &lt;br /&gt;
:Plays the given sound as if it came from the being's position.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_total_resistance}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_total_resistance([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Calculates the being's effective resistance against attacks of the given target (default is body). This accounts for inherent resists as well as equipment bonuses.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_use}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being use the given consumable item from its inventory. The function always returns false. (Bug: it is supposed to return true on success.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_wear}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being wear the given eqipment from its inventory. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pickup}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pickup([[Modding:Coord|Coord]] pos) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being pick up the item at the given position. ''pos'' is optional; it defaults to the being's position. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_attack}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;attack([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
:This makes the being do a standard melee attack against the targeted being or coord.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_fire}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;fire([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
:This makes the being fire at ''target'' with ''weapon''.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_reload}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;reload() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being reload its currently equipped weapon. The return value is true if there being had at least some of the appropriate ammo to attempt reloading with.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_direct_seek}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;direct_seek([[Modding:Coord|Coord]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This makes the being take a step towards the target. The being will always try to travel in a direct path. The return value is either 0, 1, 2, or 3. 0 indicates success, 1 indicates that a wall blocked the move, 2 indicates that a door blocked the move, and 3 indicates that a being blocked the move.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_find}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_find([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This attempts to calculate a path between the being and ''target''. The ''cutoff'' and ''maximum'' parameters are somewhat technical, but basically they indicate how much time should be spend searching for a path. DoomRL uses 40, 200 for bosses and 10, 40 for normal enemies. The path will be remembered by the being, and can be followed using path_next. Modders should keep in mind that path-finding is a somewhat expensive operation, especially for large ''cutoff'' and ''maximum''. The return value indicates whether a path was found. Even if no path was found, a path will be loaded that will try to take the being closer to the target (although this path may be empty). This uses the AStar searching algorithm using Euclidean distance as a heuristic. The search is aborted if ''maximum'' nodes are expanded without finding the target or it ''cutoff'' nodes are expanded without getting closer to the target. When aborted, a path is created to the closest expanded node to the target in terms of the heuristic.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_next}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_next() &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This causes the being to take a step along the path last calculated by path_find. The return value follows the pattern of direct_seek.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_flock_target}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;flock_target('''integer''' range, '''integer''' mind, '''integer''' maxd) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This looks for the closest being of the same type to the being (within a square ''range''). If the being is farther than ''maxd'' away, then its position is returned. If it is closer than ''mind'', then a position opposite from the closest with respect to the being is returned. Otherwise (or if there is no nearby being of the same type), a random coord from the scanning area is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_msg}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;msg('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
:If the being is the player, then ''msg_player'' is displayed. If the being is not the player, but visible to the player, the ''msg_being'' is displayed. If either message is nil it is ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_select_slot_by_letter}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;select_slot_by_letter('''string''' letter) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the one of the being's equipment where &amp;quot;a&amp;quot; is for armor, &amp;quot;b&amp;quot; is for boots, &amp;quot;w&amp;quot; is for weapon, and &amp;quot;p&amp;quot; is for the prepared slot. If the slot is empty, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_phase}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;phase([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
:If ''cell'' is omitted, then the being is displaced randomly as if it used a [[phase device]] (without the flashy interface stuff). If the cell is included, the being is displaced to a random cell of the given cell id. If the chosen cell is occupied, a nearby cell is used. If no such cell exists, a random cell is chosen.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_spawn}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being ID]] being) &lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being]] being) &lt;br /&gt;
:Drops a new being of the appropriate type (or the given being) nearby. The dropped being is set with the BF_NOEXP flag.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_visible}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_visible() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the player can see the being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_player}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_player() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the being is the player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_items}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_items([[Modding:ItemSet|ItemSet]] set) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Counts the number of the being's equipped items that belong to the given set.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_nuke}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;nuke('''integer''' time) &lt;br /&gt;
:Sets the nuke timer to ''time'' and changes the cell under the being to the nuke cell. By default, ''time'' is 1. (Setting the nuke time to 0 will disable the countdown.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pick_mod_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pick_mod_item('''string''' modletter, '''integer''' techbonus) &amp;amp;rarr; [[Modding:Item|Item]], '''boolean'''&lt;br /&gt;
:This only works for the player. This gives the player the item select menu used by mods, and calculates whether the mod is legal (using the given ''techbonus''). This includes assembly checking. The first return value is the item on success. The second return value is true on success and false on failure. (''modletter'' should be the length one string corresponding to the mod type.)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)</id>
		<title>Modding:being (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)"/>
				<updated>2012-01-31T21:03:35Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: BF_MODEXPERT now correct!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the being's name.&lt;br /&gt;
  |'''string'''|name_plural|This is the being's name_plural. By default, this is the name with an &amp;quot;s&amp;quot; appended.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ascii&amp;lt;/u&amp;gt;|This is the being's picture. It should be a single character string.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''integer'''|XP|This is the being's expvalue. By default, it is &amp;lt;font-family: monospace&amp;gt;3xD&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;+20, where D is the being's &amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt; (see below).&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This is the being's sprite. (Use 0 for no sprite.)&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|&amp;lt;u&amp;gt;color&amp;lt;/u&amp;gt;|This is the being's color.&lt;br /&gt;
  |'''integer'''|toDam|This is the being's toDam. (This bonus only applies to melee attacks.) The default is 0.&lt;br /&gt;
  |'''integer'''|toHit|This is the being's toHit. The default is 0.&lt;br /&gt;
  |'''integer'''|speed|This is the being's speed. (Remember, the maximum allowed speed is 255.) The default is 100.&lt;br /&gt;
  |'''integer'''|armor|This is the being's armor. The default is 0.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;weight&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;minLev&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|maxLev|This is a [[Monster Generation|monster generation]] parameter. The default is 200.&lt;br /&gt;
  |'''integer'''|HP|This is the being's hpmax and starting hp. The default is 10.&lt;br /&gt;
  |'''integer'''|bulk|This parameter is unused. The default is 100.&lt;br /&gt;
  |'''integer'''|group|Monsters from different groups will fight each other if they use the default AI. Oddly, the default is &amp;quot;weapon-other&amp;quot; which, as a string, translates to 0. The player is in group 1.&lt;br /&gt;
  |'''integer'''|attackchance|This is the being's attackchance The default is 75.&lt;br /&gt;
  |'''integer'''|toHitMelee|This is the being's toHitMelee. The default is 0.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |[[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.)&lt;br /&gt;
  |'''integer'''|vision|This is the being's vision. The default is 9. (The player also has vision 9 by default.)&lt;br /&gt;
  |'''integer'''|res_bullet|This is the being's res_bullet. The default is 0.&lt;br /&gt;
  |'''integer'''|res_melee|This is the being's res_melee. The default is 0.&lt;br /&gt;
  |'''integer'''|res_shrapnel|This is the being's res_shrapnel. The default is 0.&lt;br /&gt;
  |'''integer'''|res_acid|This is the being's res_acid. The default is 0.&lt;br /&gt;
  |'''integer'''|res_fire|This is the being's res_fire. The default is 0.&lt;br /&gt;
  |'''integer'''|res_plasma|This is the being's res_plasma. The default is 0.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the description of the being displayed in the more information view.&lt;br /&gt;
  |'''string'''|kill_desc|If included, this being will have a special kill description in the mortem.&lt;br /&gt;
  |'''string'''|kill_desc_melee|As kill_desc, but for melee kills.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
=== Flags ===&lt;br /&gt;
==== Being Flags ====&lt;br /&gt;
{{drltable|Being Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BERSERK|Gives the damage reduction and melee damage bonus of [[Effects#Berserk|berserk]]. (The speed bonus is not included.)&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BACKPACK|Gives the ammo-stacking benefits of the [[Backpack]] powerup.&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_STAIRSENSE|For the player, reveals the stairs tile(s) as the [[Scout]] class bonus.&lt;br /&gt;
  |BF_INSTAUSE|Allows consumable items to be used in 0.1s instead of the usual 1.0s, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MAPEXPERT|Makes computer maps work like tracking maps, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MODEXPERT|Allows the being to mod unique items.&lt;br /&gt;
  |BF_QUICKSWAP|Gives the benefits of the Juggler trait.&lt;br /&gt;
  |BF_BERSERKER|Gives the benefits of the [[Traits#Berserker|Berserker]] trait.&lt;br /&gt;
  |BF_DUALGUN|Gives the benefits of the dualgunner trait.&lt;br /&gt;
  |BF_MASTERDODGE|Gives the benefits of the [[Traits#Dodgemaster|Dodgemaster]] trait.&lt;br /&gt;
  |BF_SHOTTYMAN|Gives the benefits of the [[Traits#Shottyman|Shottyman]] trait.&lt;br /&gt;
  |BF_POWERSENSE|For the player, shows the locations of all powerups (as the first level of the [[Traits#Intuition|Intuition]] trait).&lt;br /&gt;
  |BF_BEINGSENSE|For the player, shows the locations of enemies (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE1|For the player, gives partial information about levers (as the first level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE2|For the player, shows the exact effect of levers (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_VAMPYRE|Gives the benefits of the [[Traits#Vampyre|Vampyre]] trait.&lt;br /&gt;
  |BF_BULLETDANCE|Gives the benefits of the [[Traits#Bullet Dance|Bullet Dance]] trait.&lt;br /&gt;
  |BF_ARMYDEAD|Gives the benefits of the [[Traits#Army of the Dead|Army of the Dead]] trait.&lt;br /&gt;
  |BF_AMMOCHAIN|Gives the benefits of the [[Traits#Ammochain|Ammochain]] trait.&lt;br /&gt;
  |BF_MEDPLUS|Allows med-packs to heal beyond 100% health (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_HARDY|Allows protection to reduce damage all the way to zero (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_CLEAVE|Gives the benefits of the [[Traits#Blademaster|Blademaster]] trait.&lt;br /&gt;
  |BF_GUNKATA|Gives the benefits of the [[Traits#Gun Kata|Gun Kata]] trait.&lt;br /&gt;
  |BF_SHOTTYHEAD|Gives the benefits of the [[Traits#Shottyhead|Shottyhead]] trait.&lt;br /&gt;
  |BF_NORUNPENALTY|Gives the benefits of the [[Traits#Running Man|Running Man]] trait.&lt;br /&gt;
  |BF_DUALBLADE|If both weapons in the being's equipment slots have IF_BLADED, 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).&lt;br /&gt;
  |BF_BLADEDEFEND|If the weapon in the being's prepared slot has IF_BLADED, this flag grants the being with resistances as [[Traits#Malicious Blades|Malicious Blades]].&lt;br /&gt;
  |BF_PISTOLMAX|Gives the benefits of the [[Sharpshooter]] trait.&lt;br /&gt;
  |BF_FIREANGEL|Gives the benefits of the [[Traits#Fireangel|Fireangel]] trait.&lt;br /&gt;
  |BF_ENTRENCHMENT|Gives the benefits of the [[Traits#Entrenchment|Entrenchment]] trait.&lt;br /&gt;
  |BF_SCAVENGER|Gives the benefits of the [[Scavenger]] trait (useless on anything other than the player).&lt;br /&gt;
  |BF_IMPATIENT|This flag causes packs to be automatically used when picked up as [[Angel of Impatience]].&lt;br /&gt;
  |BF_DARKNESS|For the player, stops exploration from being recorded as in [[Angel of Darkness]].&lt;br /&gt;
  |BF_MAXDAMAGE|Beings with this flag always roll maximum damage as in [[Angel of Max Carnage]].&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_SESSILE|Beings with this flag cannot move.&lt;br /&gt;
  |BF_NOMELEE|This flag stops the being from doing any type of melee attack.&lt;br /&gt;
  |BF_REGENERATE|Beings with this flag regenerate one health per second if they have less than 20 health remaining.&lt;br /&gt;
  |BF_SELFIMMUNE|Makes the being immune to its own attacks.&lt;br /&gt;
  |BF_KNOCKIMMUNE|Makes the being immune to [[knockback]].&lt;br /&gt;
  |BF_UNIQUENAME|This flag makes the game treat the being's name as a proper noun.&lt;br /&gt;
  |BF_ENTERBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_ENTERBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |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.)&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_OPENDOORS|This is a flag for the default AI. Beings with this flag will open doors.&lt;br /&gt;
  |BF_NODROP|Beings with this flag will not drop their inventory or equipment when they die.&lt;br /&gt;
  |BF_NOEXP|Beings with this flag will not award experience to the player.&lt;br /&gt;
  |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.&lt;br /&gt;
  |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.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
Specifying one or more of these hooks in the prototype will allow for greater customization.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|[[#being_OnCreate|OnCreate]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnAction|OnAction]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnDie|OnDie]]([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_OnCreate}}&lt;br /&gt;
;OnCreate([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called when the being is created.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnAction}}&lt;br /&gt;
;OnAction([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called at the beginning of each of the being's turns. (Note that turns are only differentiated if time elapses in between.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnDie}}&lt;br /&gt;
;OnDie([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
:This is called when the being dies. ''overkill'' is true if the being was gibbed.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Beings also have all the [[Modding:Thing|Thing]] properties in addition to those listed below. For beings, the resistance fields are inherent resistances that apply to all attacks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''Byte'''|attackchance|This is how likely (in percent) a monster is to use a ranged attack on its turn. The exact interpretation may depend on the AI. This property is read-only.&lt;br /&gt;
  |'''Integer'''|hp|This is the being's current [[health]].&lt;br /&gt;
  |'''Word'''|hpmax|This is the being's maximum health.&lt;br /&gt;
  |'''Byte'''|vision|This is the being's vision radius. (It is up to the AI to respect this radius.)&lt;br /&gt;
  |'''LongInt'''|scount|This is the being's speed count or energy. It counts up by the being's speed every 0.1s, and when it reaches 5000, the being gets to act. For details, see [[Time#Fractional Time|here]].&lt;br /&gt;
  |'''ShortInt'''|tohit|This [[accuracy]] modifier is applied to all of the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|todam|This damage modifier is applied to all the being's melee attacks.&lt;br /&gt;
  |'''ShortInt'''|todamall|This damage modifier is applied to all the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|tohitmelee|This accuracy modifier is applied to the being's melee attacks.&lt;br /&gt;
  |'''Byte'''|speed|This is the rate at which the being's scount increases. It affects the speed of all actions.&lt;br /&gt;
  |'''Byte'''|armor|This is the being's natural armor. It appears as [[protection]] against all attacks.&lt;br /&gt;
  |'''Word'''|expvalue|This is the amount of [[experience]] that is awarded to the player when the being dies.&lt;br /&gt;
  |'''ShortInt'''|techbonus|This usually corresponds to [[Whizkid]] levels; it affects the number of mods that can be applied and the level of assemblies that can be constructed.&lt;br /&gt;
  |'''ShortInt'''|pistolbonus|This usually corresponds to [[Son of a Gun]] levels; it affects pistol firing time and damage.&lt;br /&gt;
  |'''ShortInt'''|rapidbonus|This usually corresponds to [[Triggerhappy]] levels; it affects the number of shots fired by rapid-fire weapons.&lt;br /&gt;
  |'''ShortInt'''|bodybonus|This is the property used to implement [[Badass]]. Each point reduces [[knockback]] by one, and anything above zero stops health decay.&lt;br /&gt;
  |'''Byte'''|reloadtime|This is the percentage of normal reload time that the being takes to reload. (It is used to implement [[Reloader]].)&lt;br /&gt;
  |'''Byte'''|firetime|This is the percentage of normal fire time that the being takes to fire. (It is used to implement [[Finesse]].)&lt;br /&gt;
  |'''Byte'''|movetime|This is the percentage of normal movement time that the being takes to move. For the player, anything less than 100 applies a corresponding dodge bonus. (This is used to implement [[Hellrunner]].)&lt;br /&gt;
  |'''Word'''|soundact|This is the being's .act sound.&lt;br /&gt;
  |'''Word'''|soundhit|This is the being's .hit sound.&lt;br /&gt;
  |'''Word'''|sounddie|This is the being's .die sound.&lt;br /&gt;
  |'''Word'''|soundattack|This is the being's .attack sound.&lt;br /&gt;
  |'''Word'''|soundmelee|This is the being's .melee sound.&lt;br /&gt;
  |'''Word'''|soundhoof|This is the being's .hoof sound.&lt;br /&gt;
  |[[Modding:Being|Being Prototype]]|proto|This is the being's prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
The [[Modding:Thing#API|Thing API]] can also be used with beings.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being Interface&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Being|Being]]|being.[[#being_new|new]]([[Modding:Being|Being ID]] id) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_destroy|destroy]]('''boolean''' silent) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_kill|kill]]('''boolean''' overkill) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_ressurect|ressurect]]('''integer''' rrange) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_apply_damage|apply_damage]]('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
  |'''string'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_name|get_name]]('''boolean''' known, '''boolean''' capitalized) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_inv_item|get_inv_item]]('''integer''' slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_inv_item|set_inv_item]]('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_eq_item|get_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_eq_item|set_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_play_sound|play_sound]]('''Sound ID''' sound) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_total_resistance|get_total_resistance]]([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_use|use]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_wear|wear]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pickup|pickup]]([[Modding:Coord|Coord]] pos) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_attack|attack]]([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_fire|fire]]([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_reload|reload]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_direct_seek|direct_seek]]([[Modding:Coord|Coord]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_find|path_find]]([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_next|path_next]]() &lt;br /&gt;
  |[[Modding:Coord|Coord]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_flock_target|flock_target]]('''integer''' range, '''integer''' mind, '''integer''' maxd) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_msg|msg]]('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_select_slot_by_letter|select_slot_by_letter]]('''string''' letter) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_phase|phase]]([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_spawn|spawn]]([[Modding:Being|Being ID]] being) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_visible|is_visible]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_player|is_player]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_items|set_items]]([[Modding:ItemSet|ItemSet]] set) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_nuke|nuke]]('''integer''' time) &lt;br /&gt;
  |[[Modding:Item|Item]], '''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pick_mod_item|pick_mod_item]]('''string''' modletter, '''integer''' techbonus)&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_new}}&lt;br /&gt;
;being.new([[Modding:Being|Being ID]] id) &amp;amp;rarr; [[Modding:Being|Being]]&lt;br /&gt;
:This creates a newly allocated being of the appropriate type. The being won't exist on the map until it is placed by e.g. Level.drop_being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_destroy}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;destroy('''boolean''' silent) &lt;br /&gt;
:Deallocates the memory associated with the being and removes it from the level (if applicable). The normal results of killing a being (e.g. leaving a corpse) are ignored. The ''silent'' parameter is optional. If true, applicable OnKill and OnKillAll hooks and events will also be ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_kill}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;kill('''boolean''' overkill) &lt;br /&gt;
:Kills the being. If the optional ''overkill'' parameter is true, then the being will be gibbed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_ressurect}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;ressurect('''integer''' rrange) &lt;br /&gt;
:Resurrects a single corpse that is found within a square of side-length 2 &amp;amp;times; ''rrange'' + 1, centered around the being. Nearer corpses are preferred. The corpse must not have another being standing on it and must be within sight of the being (as determined by the enemy line-of-sight algorithm). The resurrected being (if any) will have BF_NOEXP set. Messages are included.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_apply_damage}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;apply_damage('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
:Deals damage to the being using the given body target and damage type. (The default damage type is bullet damage.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_name}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_name('''boolean''' known, '''boolean''' capitalized) &amp;amp;rarr; '''string'''&lt;br /&gt;
:Returns the name of the being. If ''known'' is true, &amp;quot;the&amp;quot; is added, otherwise &amp;quot;a&amp;quot; or &amp;quot;an&amp;quot; is added. If BF_UNIQUENAME is set for the being, then no article is used in either case. If ''capitalized'' is true, then the first letter will be capitalized.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_inv_item('''integer''' slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given slot in the being's inventory. If the slot is empty, nil is returned instead.  &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_inv_item('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the given slot in the being's inventory to the given item. If the slot wasn't empty before, the previous constents are lost.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given equipment slot of the being. If the slot is empty, nil is returned instead. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the being's equipment slot to the given item. Any item that was previously in that slot is lost. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_play_sound}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;play_sound('''Sound ID''' sound) &lt;br /&gt;
:Plays the given sound as if it came from the being's position.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_total_resistance}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_total_resistance([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Calculates the being's effective resistance against attacks of the given target (default is body). This accounts for inherent resists as well as equipment bonuses.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_use}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being use the given consumable item from its inventory. The function always returns false. (Bug: it is supposed to return true on success.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_wear}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being wear the given eqipment from its inventory. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pickup}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pickup([[Modding:Coord|Coord]] pos) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being pick up the item at the given position. ''pos'' is optional; it defaults to the being's position. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_attack}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;attack([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
:This makes the being do a standard melee attack against the targeted being or coord.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_fire}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;fire([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
:This makes the being fire at ''target'' with ''weapon''.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_reload}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;reload() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being reload its currently equipped weapon. The return value is true if there being had at least some of the appropriate ammo to attempt reloading with.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_direct_seek}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;direct_seek([[Modding:Coord|Coord]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This makes the being take a step towards the target. The being will always try to travel in a direct path. The return value is either 0, 1, 2, or 3. 0 indicates success, 1 indicates that a wall blocked the move, 2 indicates that a door blocked the move, and 3 indicates that a being blocked the move.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_find}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_find([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This attempts to calculate a path between the being and ''target''. The ''cutoff'' and ''maximum'' parameters are somewhat technical, but basically they indicate how much time should be spend searching for a path. DoomRL uses 40, 200 for bosses and 10, 40 for normal enemies. The path will be remembered by the being, and can be followed using path_next. Modders should keep in mind that path-finding is a somewhat expensive operation, especially for large ''cutoff'' and ''maximum''. The return value indicates whether a path was found. Even if no path was found, a path will be loaded that will try to take the being closer to the target (although this path may be empty). This uses the AStar searching algorithm using Euclidean distance as a heuristic. The search is aborted if ''maximum'' nodes are expanded without finding the target or it ''cutoff'' nodes are expanded without getting closer to the target. When aborted, a path is created to the closest expanded node to the target in terms of the heuristic.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_next}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_next() &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This causes the being to take a step along the path last calculated by path_find. The return value follows the pattern of direct_seek.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_flock_target}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;flock_target('''integer''' range, '''integer''' mind, '''integer''' maxd) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This looks for the closest being of the same type to the being (within a square ''range''). If the being is farther than ''maxd'' away, then its position is returned. If it is closer than ''mind'', then a position opposite from the closest with respect to the being is returned. Otherwise (or if there is no nearby being of the same type), a random coord from the scanning area is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_msg}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;msg('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
:If the being is the player, then ''msg_player'' is displayed. If the being is not the player, but visible to the player, the ''msg_being'' is displayed. If either message is nil it is ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_select_slot_by_letter}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;select_slot_by_letter('''string''' letter) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the one of the being's equipment where &amp;quot;a&amp;quot; is for armor, &amp;quot;b&amp;quot; is for boots, &amp;quot;w&amp;quot; is for weapon, and &amp;quot;p&amp;quot; is for the prepared slot. If the slot is empty, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_phase}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;phase([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
:If ''cell'' is omitted, then the being is displaced randomly as if it used a [[phase device]] (without the flashy interface stuff). If the cell is included, the being is displaced to a random cell of the given cell id. If the chosen cell is occupied, a nearby cell is used. If no such cell exists, a random cell is chosen.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_spawn}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being ID]] being) &lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being]] being) &lt;br /&gt;
:Drops a new being of the appropriate type (or the given being) nearby. The dropped being is set with the BF_NOEXP flag.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_visible}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_visible() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the player can see the being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_player}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_player() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the being is the player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_items}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_items([[Modding:ItemSet|ItemSet]] set) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Counts the number of the being's equipped items that belong to the given set.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_nuke}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;nuke('''integer''' time) &lt;br /&gt;
:Sets the nuke timer to ''time'' and changes the cell under the being to the nuke cell. By default, ''time'' is 1. (Setting the nuke time to 0 will disable the countdown.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pick_mod_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pick_mod_item('''string''' modletter, '''integer''' techbonus) &amp;amp;rarr; [[Modding:Item|Item]], '''boolean'''&lt;br /&gt;
:This only works for the player. This gives the player the item select menu used by mods, and calculates whether the mod is legal (using the given ''techbonus''). This includes assembly checking. The first return value is the item on success. The second return value is true on success and false on failure. (''modletter'' should be the length one string corresponding to the mod type.)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)</id>
		<title>Modding:being (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:being_(0.9.9.7)"/>
				<updated>2012-01-31T20:57:26Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: added and updated being flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;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.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the being's name.&lt;br /&gt;
  |'''string'''|name_plural|This is the being's name_plural. By default, this is the name with an &amp;quot;s&amp;quot; appended.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ascii&amp;lt;/u&amp;gt;|This is the being's picture. It should be a single character string.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |'''integer'''|XP|This is the being's expvalue. By default, it is &amp;lt;font-family: monospace&amp;gt;3xD&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;+20, where D is the being's &amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt; (see below).&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This is the being's sprite. (Use 0 for no sprite.)&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|&amp;lt;u&amp;gt;color&amp;lt;/u&amp;gt;|This is the being's color.&lt;br /&gt;
  |'''integer'''|toDam|This is the being's toDam. (This bonus only applies to melee attacks.) The default is 0.&lt;br /&gt;
  |'''integer'''|toHit|This is the being's toHit. The default is 0.&lt;br /&gt;
  |'''integer'''|speed|This is the being's speed. (Remember, the maximum allowed speed is 255.) The default is 100.&lt;br /&gt;
  |'''integer'''|armor|This is the being's armor. The default is 0.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;danger&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;weight&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;minLev&amp;lt;/u&amp;gt;|This is a [[Monster Generation|monster generation]] parameter.&lt;br /&gt;
  |'''integer'''|maxLev|This is a [[Monster Generation|monster generation]] parameter. The default is 200.&lt;br /&gt;
  |'''integer'''|HP|This is the being's hpmax and starting hp. The default is 10.&lt;br /&gt;
  |'''integer'''|bulk|This parameter is unused. The default is 100.&lt;br /&gt;
  |'''integer'''|group|Monsters from different groups will fight each other if they use the default AI. Oddly, the default is &amp;quot;weapon-other&amp;quot; which, as a string, translates to 0. The player is in group 1.&lt;br /&gt;
  |'''integer'''|attackchance|This is the being's attackchance The default is 75.&lt;br /&gt;
  |'''integer'''|toHitMelee|This is the being's toHitMelee. The default is 0.&lt;br /&gt;
  |[[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.&lt;br /&gt;
  |'''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.&lt;br /&gt;
  |[[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.)&lt;br /&gt;
  |'''integer'''|vision|This is the being's vision. The default is 9. (The player also has vision 9 by default.)&lt;br /&gt;
  |'''integer'''|res_bullet|This is the being's res_bullet. The default is 0.&lt;br /&gt;
  |'''integer'''|res_melee|This is the being's res_melee. The default is 0.&lt;br /&gt;
  |'''integer'''|res_shrapnel|This is the being's res_shrapnel. The default is 0.&lt;br /&gt;
  |'''integer'''|res_acid|This is the being's res_acid. The default is 0.&lt;br /&gt;
  |'''integer'''|res_fire|This is the being's res_fire. The default is 0.&lt;br /&gt;
  |'''integer'''|res_plasma|This is the being's res_plasma. The default is 0.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;desc&amp;lt;/u&amp;gt;|This is the description of the being displayed in the more information view.&lt;br /&gt;
  |'''string'''|kill_desc|If included, this being will have a special kill description in the mortem.&lt;br /&gt;
  |'''string'''|kill_desc_melee|As kill_desc, but for melee kills.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
=== Flags ===&lt;br /&gt;
==== Being Flags ====&lt;br /&gt;
{{drltable|Being Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BERSERK|Gives the damage reduction and melee damage bonus of [[Effects#Berserk|berserk]]. (The speed bonus is not included.)&lt;br /&gt;
  |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.)&lt;br /&gt;
  |BF_BACKPACK|Gives the ammo-stacking benefits of the [[Backpack]] powerup.&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_STAIRSENSE|For the player, reveals the stairs tile(s) as the [[Scout]] class bonus.&lt;br /&gt;
  |BF_INSTAUSE|Allows consumable items to be used in 0.1s instead of the usual 1.0s, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_MAPEXPERT|Makes computer maps work like tracking maps, as the [[Technician]] class bonus.&lt;br /&gt;
  |BF_QUICKSWAP|Gives the benefits of the Juggler trait.&lt;br /&gt;
  |BF_BERSERKER|Gives the benefits of the [[Traits#Berserker|Berserker]] trait.&lt;br /&gt;
  |BF_DUALGUN|Gives the benefits of the dualgunner trait.&lt;br /&gt;
  |BF_MASTERDODGE|Gives the benefits of the [[Traits#Dodgemaster|Dodgemaster]] trait.&lt;br /&gt;
  |BF_SHOTTYMAN|Gives the benefits of the [[Traits#Shottyman|Shottyman]] trait.&lt;br /&gt;
  |BF_POWERSENSE|For the player, shows the locations of all powerups (as the first level of the [[Traits#Intuition|Intuition]] trait).&lt;br /&gt;
  |BF_BEINGSENSE|For the player, shows the locations of enemies (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE1|For the player, gives partial information about levers (as the first level of the Intuition trait).&lt;br /&gt;
  |BF_LEVERSENSE2|For the player, shows the exact effect of levers (as the second level of the Intuition trait).&lt;br /&gt;
  |BF_VAMPYRE|Gives the benefits of the [[Traits#Vampyre|Vampyre]] trait.&lt;br /&gt;
  |BF_BULLETDANCE|Gives the benefits of the [[Traits#Bullet Dance|Bullet Dance]] trait.&lt;br /&gt;
  |BF_ARMYDEAD|Gives the benefits of the [[Traits#Army of the Dead|Army of the Dead]] trait.&lt;br /&gt;
  |BF_AMMOCHAIN|Gives the benefits of the [[Traits#Ammochain|Ammochain]] trait.&lt;br /&gt;
  |BF_MEDPLUS|Allows med-packs to heal beyond 100% health (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_HARDY|Allows protection to reduce damage all the way to zero (part of the [[Survivalist]] trait).&lt;br /&gt;
  |BF_CLEAVE|Gives the benefits of the [[Traits#Blademaster|Blademaster]] trait.&lt;br /&gt;
  |BF_GUNKATA|Gives the benefits of the [[Traits#Gun Kata|Gun Kata]] trait.&lt;br /&gt;
  |BF_SHOTTYHEAD|Gives the benefits of the [[Traits#Shottyhead|Shottyhead]] trait.&lt;br /&gt;
  |BF_NORUNPENALTY|Gives the benefits of the [[Traits#Running Man|Running Man]] trait.&lt;br /&gt;
  |BF_DUALBLADE|If both weapons in the being's equipment slots have IF_BLADED, 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).&lt;br /&gt;
  |BF_BLADEDEFEND|If the weapon in the being's prepared slot has IF_BLADED, this flag grants the being with resistances as [[Traits#Malicious Blades|Malicious Blades]].&lt;br /&gt;
  |BF_PISTOLMAX|Gives the benefits of the [[Sharpshooter]] trait.&lt;br /&gt;
  |BF_FIREANGEL|Gives the benefits of the [[Traits#Fireangel|Fireangel]] trait.&lt;br /&gt;
  |BF_ENTRENCHMENT|Gives the benefits of the [[Traits#Entrenchment|Entrenchment]] trait.&lt;br /&gt;
  |BF_SCAVENGER|Gives the benefits of the [[Scavenger]] trait (useless on anything other than the player).&lt;br /&gt;
  |BF_IMPATIENT|This flag causes packs to be automatically used when picked up as [[Angel of Impatience]].&lt;br /&gt;
  |BF_DARKNESS|For the player, stops exploration from being recorded as in [[Angel of Darkness]].&lt;br /&gt;
  |BF_MAXDAMAGE|Beings with this flag always roll maximum damage as in [[Angel of Max Carnage]].&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_SESSILE|Beings with this flag cannot move.&lt;br /&gt;
  |BF_NOMELEE|This flag stops the being from doing any type of melee attack.&lt;br /&gt;
  |BF_REGENERATE|Beings with this flag regenerate one health per second if they have less than 20 health remaining.&lt;br /&gt;
  |BF_SELFIMMUNE|Makes the being immune to its own attacks.&lt;br /&gt;
  |BF_KNOCKIMMUNE|Makes the being immune to [[knockback]].&lt;br /&gt;
  |BF_UNIQUENAME|This flag makes the game treat the being's name as a proper noun.&lt;br /&gt;
  |BF_MODEXPERT|Allows the being to mod assemblies exactly once.&lt;br /&gt;
  |BF_ENTERBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS1|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_ENTERBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |BF_KILLBOSS2|This is a flag for the player that helps determine which victory message to use in the mortem.&lt;br /&gt;
  |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.)&lt;br /&gt;
  |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.&lt;br /&gt;
  |BF_OPENDOORS|This is a flag for the default AI. Beings with this flag will open doors.&lt;br /&gt;
  |BF_NODROP|Beings with this flag will not drop their inventory or equipment when they die.&lt;br /&gt;
  |BF_NOEXP|Beings with this flag will not award experience to the player.&lt;br /&gt;
  |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.&lt;br /&gt;
  |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.&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
Specifying one or more of these hooks in the prototype will allow for greater customization.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Being Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|[[#being_OnCreate|OnCreate]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnAction|OnAction]]([[Modding:Being|Being]] self) &lt;br /&gt;
  |'''void'''|[[#being_OnDie|OnDie]]([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_OnCreate}}&lt;br /&gt;
;OnCreate([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called when the being is created.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnAction}}&lt;br /&gt;
;OnAction([[Modding:Being|Being]] self) &lt;br /&gt;
:This is called at the beginning of each of the being's turns. (Note that turns are only differentiated if time elapses in between.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_OnDie}}&lt;br /&gt;
;OnDie([[Modding:Being|Being]] self, '''boolean''' overkill) &lt;br /&gt;
:This is called when the being dies. ''overkill'' is true if the being was gibbed.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
Beings also have all the [[Modding:Thing|Thing]] properties in addition to those listed below. For beings, the resistance fields are inherent resistances that apply to all attacks.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''Byte'''|attackchance|This is how likely (in percent) a monster is to use a ranged attack on its turn. The exact interpretation may depend on the AI. This property is read-only.&lt;br /&gt;
  |'''Integer'''|hp|This is the being's current [[health]].&lt;br /&gt;
  |'''Word'''|hpmax|This is the being's maximum health.&lt;br /&gt;
  |'''Byte'''|vision|This is the being's vision radius. (It is up to the AI to respect this radius.)&lt;br /&gt;
  |'''LongInt'''|scount|This is the being's speed count or energy. It counts up by the being's speed every 0.1s, and when it reaches 5000, the being gets to act. For details, see [[Time#Fractional Time|here]].&lt;br /&gt;
  |'''ShortInt'''|tohit|This [[accuracy]] modifier is applied to all of the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|todam|This damage modifier is applied to all the being's melee attacks.&lt;br /&gt;
  |'''ShortInt'''|todamall|This damage modifier is applied to all the being's attacks.&lt;br /&gt;
  |'''ShortInt'''|tohitmelee|This accuracy modifier is applied to the being's melee attacks.&lt;br /&gt;
  |'''Byte'''|speed|This is the rate at which the being's scount increases. It affects the speed of all actions.&lt;br /&gt;
  |'''Byte'''|armor|This is the being's natural armor. It appears as [[protection]] against all attacks.&lt;br /&gt;
  |'''Word'''|expvalue|This is the amount of [[experience]] that is awarded to the player when the being dies.&lt;br /&gt;
  |'''ShortInt'''|techbonus|This usually corresponds to [[Whizkid]] levels; it affects the number of mods that can be applied and the level of assemblies that can be constructed.&lt;br /&gt;
  |'''ShortInt'''|pistolbonus|This usually corresponds to [[Son of a Gun]] levels; it affects pistol firing time and damage.&lt;br /&gt;
  |'''ShortInt'''|rapidbonus|This usually corresponds to [[Triggerhappy]] levels; it affects the number of shots fired by rapid-fire weapons.&lt;br /&gt;
  |'''ShortInt'''|bodybonus|This is the property used to implement [[Badass]]. Each point reduces [[knockback]] by one, and anything above zero stops health decay.&lt;br /&gt;
  |'''Byte'''|reloadtime|This is the percentage of normal reload time that the being takes to reload. (It is used to implement [[Reloader]].)&lt;br /&gt;
  |'''Byte'''|firetime|This is the percentage of normal fire time that the being takes to fire. (It is used to implement [[Finesse]].)&lt;br /&gt;
  |'''Byte'''|movetime|This is the percentage of normal movement time that the being takes to move. For the player, anything less than 100 applies a corresponding dodge bonus. (This is used to implement [[Hellrunner]].)&lt;br /&gt;
  |'''Word'''|soundact|This is the being's .act sound.&lt;br /&gt;
  |'''Word'''|soundhit|This is the being's .hit sound.&lt;br /&gt;
  |'''Word'''|sounddie|This is the being's .die sound.&lt;br /&gt;
  |'''Word'''|soundattack|This is the being's .attack sound.&lt;br /&gt;
  |'''Word'''|soundmelee|This is the being's .melee sound.&lt;br /&gt;
  |'''Word'''|soundhoof|This is the being's .hoof sound.&lt;br /&gt;
  |[[Modding:Being|Being Prototype]]|proto|This is the being's prototype.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
The [[Modding:Thing#API|Thing API]] can also be used with beings.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Being Interface&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |[[Modding:Being|Being]]|being.[[#being_new|new]]([[Modding:Being|Being ID]] id) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_destroy|destroy]]('''boolean''' silent) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_kill|kill]]('''boolean''' overkill) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_ressurect|ressurect]]('''integer''' rrange) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_apply_damage|apply_damage]]('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
  |'''string'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_name|get_name]]('''boolean''' known, '''boolean''' capitalized) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_inv_item|get_inv_item]]('''integer''' slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_inv_item|set_inv_item]]('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_eq_item|get_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_eq_item|set_eq_item]]([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_play_sound|play_sound]]('''Sound ID''' sound) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_get_total_resistance|get_total_resistance]]([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_use|use]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_wear|wear]]('''integer''' slot) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pickup|pickup]]([[Modding:Coord|Coord]] pos) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_attack|attack]]([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_fire|fire]]([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_reload|reload]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_direct_seek|direct_seek]]([[Modding:Coord|Coord]] target) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_find|path_find]]([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_path_next|path_next]]() &lt;br /&gt;
  |[[Modding:Coord|Coord]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_flock_target|flock_target]]('''integer''' range, '''integer''' mind, '''integer''' maxd) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_msg|msg]]('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
  |[[Modding:Item|Item]]|[[Modding:Being|Being]]&amp;amp;#058;[[#being_select_slot_by_letter|select_slot_by_letter]]('''string''' letter) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_phase|phase]]([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_spawn|spawn]]([[Modding:Being|Being ID]] being) &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_visible|is_visible]]() &lt;br /&gt;
  |'''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_is_player|is_player]]() &lt;br /&gt;
  |'''integer'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_set_items|set_items]]([[Modding:ItemSet|ItemSet]] set) &lt;br /&gt;
  |'''void'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_nuke|nuke]]('''integer''' time) &lt;br /&gt;
  |[[Modding:Item|Item]], '''boolean'''|[[Modding:Being|Being]]&amp;amp;#058;[[#being_pick_mod_item|pick_mod_item]]('''string''' modletter, '''integer''' techbonus)&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|being_new}}&lt;br /&gt;
;being.new([[Modding:Being|Being ID]] id) &amp;amp;rarr; [[Modding:Being|Being]]&lt;br /&gt;
:This creates a newly allocated being of the appropriate type. The being won't exist on the map until it is placed by e.g. Level.drop_being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_destroy}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;destroy('''boolean''' silent) &lt;br /&gt;
:Deallocates the memory associated with the being and removes it from the level (if applicable). The normal results of killing a being (e.g. leaving a corpse) are ignored. The ''silent'' parameter is optional. If true, applicable OnKill and OnKillAll hooks and events will also be ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_kill}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;kill('''boolean''' overkill) &lt;br /&gt;
:Kills the being. If the optional ''overkill'' parameter is true, then the being will be gibbed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_ressurect}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;ressurect('''integer''' rrange) &lt;br /&gt;
:Resurrects a single corpse that is found within a square of side-length 2 &amp;amp;times; ''rrange'' + 1, centered around the being. Nearer corpses are preferred. The corpse must not have another being standing on it and must be within sight of the being (as determined by the enemy line-of-sight algorithm). The resurrected being (if any) will have BF_NOEXP set. Messages are included.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_apply_damage}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;apply_damage('''integer''' damage, [[Modding:Constants#BodyTarget|BodyTarget]] target, [[Modding:Constants#DamageType|DamageType]] damageType) &lt;br /&gt;
:Deals damage to the being using the given body target and damage type. (The default damage type is bullet damage.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_name}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_name('''boolean''' known, '''boolean''' capitalized) &amp;amp;rarr; '''string'''&lt;br /&gt;
:Returns the name of the being. If ''known'' is true, &amp;quot;the&amp;quot; is added, otherwise &amp;quot;a&amp;quot; or &amp;quot;an&amp;quot; is added. If BF_UNIQUENAME is set for the being, then no article is used in either case. If ''capitalized'' is true, then the first letter will be capitalized.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_inv_item('''integer''' slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given slot in the being's inventory. If the slot is empty, nil is returned instead.  &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_inv_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_inv_item('''integer''' slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].inv&amp;amp;#091;'''integer''' slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the given slot in the being's inventory to the given item. If the slot wasn't empty before, the previous constents are lost.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the item in the given equipment slot of the being. If the slot is empty, nil is returned instead. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_eq_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_eq_item([[Modding:Constants#Equip Slots|Equip Slot]] slot, [[Modding:Item|Item]] item) &lt;br /&gt;
;[[Modding:Being|Being]].eq&amp;amp;#091;[[Modding:Constants#Equip Slots|Equip Slot]] slot] = [[Modding:Item|Item]] item &lt;br /&gt;
:Sets the being's equipment slot to the given item. Any item that was previously in that slot is lost. There are additional shorthands for each equipment slot: the ''eq'' table has .weapon, .prepared, .armor, and .boots fields.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_play_sound}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;play_sound('''Sound ID''' sound) &lt;br /&gt;
:Plays the given sound as if it came from the being's position.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_get_total_resistance}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;get_total_resistance([[Modding:Constants#Resistance|Resistance]] resistance, [[Modding:Constants#BodyTarget|BodyTarget]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Calculates the being's effective resistance against attacks of the given target (default is body). This accounts for inherent resists as well as equipment bonuses.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_use}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;use([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being use the given consumable item from its inventory. The function always returns false. (Bug: it is supposed to return true on success.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_wear}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear('''integer''' slot) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;wear([[Modding:Item|Item]] item) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being wear the given eqipment from its inventory. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pickup}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pickup([[Modding:Coord|Coord]] pos) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being pick up the item at the given position. ''pos'' is optional; it defaults to the being's position. Returns true on success and false on failure.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_attack}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;attack([[Modding:Coord|Coord]] or [[Modding:Being|Being]] target) &lt;br /&gt;
:This makes the being do a standard melee attack against the targeted being or coord.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_fire}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;fire([[Modding:Coord|Coord]] target, [[Modding:Item|Item]] weapon) &lt;br /&gt;
:This makes the being fire at ''target'' with ''weapon''.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_reload}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;reload() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This makes the being reload its currently equipped weapon. The return value is true if there being had at least some of the appropriate ammo to attempt reloading with.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_direct_seek}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;direct_seek([[Modding:Coord|Coord]] target) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This makes the being take a step towards the target. The being will always try to travel in a direct path. The return value is either 0, 1, 2, or 3. 0 indicates success, 1 indicates that a wall blocked the move, 2 indicates that a door blocked the move, and 3 indicates that a being blocked the move.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_find}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_find([[Modding:Coord|Coord]] target, '''integer''' cutoff, '''integer''' maximum) &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:This attempts to calculate a path between the being and ''target''. The ''cutoff'' and ''maximum'' parameters are somewhat technical, but basically they indicate how much time should be spend searching for a path. DoomRL uses 40, 200 for bosses and 10, 40 for normal enemies. The path will be remembered by the being, and can be followed using path_next. Modders should keep in mind that path-finding is a somewhat expensive operation, especially for large ''cutoff'' and ''maximum''. The return value indicates whether a path was found. Even if no path was found, a path will be loaded that will try to take the being closer to the target (although this path may be empty). This uses the AStar searching algorithm using Euclidean distance as a heuristic. The search is aborted if ''maximum'' nodes are expanded without finding the target or it ''cutoff'' nodes are expanded without getting closer to the target. When aborted, a path is created to the closest expanded node to the target in terms of the heuristic.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_path_next}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;path_next() &amp;amp;rarr; '''integer'''&lt;br /&gt;
:This causes the being to take a step along the path last calculated by path_find. The return value follows the pattern of direct_seek.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_flock_target}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;flock_target('''integer''' range, '''integer''' mind, '''integer''' maxd) &amp;amp;rarr; [[Modding:Coord|Coord]]&lt;br /&gt;
:This looks for the closest being of the same type to the being (within a square ''range''). If the being is farther than ''maxd'' away, then its position is returned. If it is closer than ''mind'', then a position opposite from the closest with respect to the being is returned. Otherwise (or if there is no nearby being of the same type), a random coord from the scanning area is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_msg}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;msg('''string''' msg_player, '''string''' msg_being) &lt;br /&gt;
:If the being is the player, then ''msg_player'' is displayed. If the being is not the player, but visible to the player, the ''msg_being'' is displayed. If either message is nil it is ignored.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_select_slot_by_letter}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;select_slot_by_letter('''string''' letter) &amp;amp;rarr; [[Modding:Item|Item]]&lt;br /&gt;
:Returns the one of the being's equipment where &amp;quot;a&amp;quot; is for armor, &amp;quot;b&amp;quot; is for boots, &amp;quot;w&amp;quot; is for weapon, and &amp;quot;p&amp;quot; is for the prepared slot. If the slot is empty, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_phase}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;phase([[Modding:Cell|Cell ID]] cell) &lt;br /&gt;
:If ''cell'' is omitted, then the being is displaced randomly as if it used a [[phase device]] (without the flashy interface stuff). If the cell is included, the being is displaced to a random cell of the given cell id. If the chosen cell is occupied, a nearby cell is used. If no such cell exists, a random cell is chosen.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_spawn}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being ID]] being) &lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;spawn([[Modding:Being|Being]] being) &lt;br /&gt;
:Drops a new being of the appropriate type (or the given being) nearby. The dropped being is set with the BF_NOEXP flag.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_visible}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_visible() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the player can see the being.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_is_player}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;is_player() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines if the being is the player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_set_items}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;set_items([[Modding:ItemSet|ItemSet]] set) &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Counts the number of the being's equipped items that belong to the given set.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_nuke}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;nuke('''integer''' time) &lt;br /&gt;
:Sets the nuke timer to ''time'' and changes the cell under the being to the nuke cell. By default, ''time'' is 1. (Setting the nuke time to 0 will disable the countdown.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|being_pick_mod_item}}&lt;br /&gt;
;[[Modding:Being|Being]]&amp;amp;#058;pick_mod_item('''string''' modletter, '''integer''' techbonus) &amp;amp;rarr; [[Modding:Item|Item]], '''boolean'''&lt;br /&gt;
:This only works for the player. This gives the player the item select menu used by mods, and calculates whether the mod is legal (using the given ''techbonus''). This includes assembly checking. The first return value is the item on success. The second return value is true on success and false on failure. (''modletter'' should be the length one string corresponding to the mod type.)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:level_blueprint_(0.9.9.7)</id>
		<title>Modding:level blueprint (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:level_blueprint_(0.9.9.7)"/>
				<updated>2012-01-31T20:16:57Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: moved and updated level flags&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Level objects define the properties of fixed special levels. The level API, however, is a general purpose API for manipulating the level. This is used both for map generation (along with the [[Modding:Generator#API|generator API]]) and for changing the level on the fly. The Level variable also has some general properties that don't necessarily correspond to special levels in particular.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
Levels prototypes are only used for special levels and scripted levels, not random levels. They are declared using the Levels function with the ID as the first argument, and a prototype table as the second argument. They are stored by ID in a global table called levels.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |string|ID|The unique identifier used by the engine for this level. Instead of being included in the table, this must be passed as the first argument to the Levels function.&lt;br /&gt;
  |string|name|The name displayed in the HUD.&lt;br /&gt;
  |string|welcome|Optional message displayed on level entry.&lt;br /&gt;
  |integer|chance|Optional percent chance the level will appear. Defaults to 100.&lt;br /&gt;
  |[[Modding:Functions$function_resolve_range|Range]]|level|Level range where the level may appear.&lt;br /&gt;
  |string|entry|Optional mortem history message for level entry.&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
=== Flags ===&lt;br /&gt;
{{drltable|Level Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |LF_NOHOMING|Causes homing phase devices to act like normal phase devices.&lt;br /&gt;
  |LF_UNIQUEITEM|Used by the level generation code to keep track of whether a unique item has dropped on the current level (in order to prevent multiple uniques from dropping on one level). This flag also causes a level feeling to occur indicating that a unique item is present.&lt;br /&gt;
  |LF_BONUS|This flag is automatically set for so-called special levels like [[Halls of Carnage]]. (It is not set for those special levels like [[Hellgate]] that replace normal levels, only by those reached from red stairs.)&lt;br /&gt;
  |LF_RESPAWN|Causes monsters to randomly respawn as when playing the game on Nightmare!&lt;br /&gt;
  |LF_NORESPAWN|Prevents the Nightmare! respawn feature.&lt;br /&gt;
  |LF_NUKED|This flag is automatically set when the level is nuked.&lt;br /&gt;
  |LF_NONUKE|Causes the thermonuclear bomb to have no effect when it is used. It is not respected by other nuke effects.&lt;br /&gt;
  |LF_ITEMSVISIBLE|Allows the player to see all items on the level (as with a [[Computer Map]]).&lt;br /&gt;
  |LF_BEINGSVISIBLE|Allows the player to see all beings on the level (as with a [[Tracking Map]]).&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |void|[[#level_Create|Create]]() &lt;br /&gt;
  |void|[[#level_OnTick|OnTick]]() &lt;br /&gt;
  |void|[[#level_OnEnter|OnEnter]]() &lt;br /&gt;
  |void|[[#level_OnExit|OnExit]]() &lt;br /&gt;
  |void|[[#level_OnKill|OnKill]]() &lt;br /&gt;
  |void|[[#level_OnKillAll|OnKillAll]]() &lt;br /&gt;
  |boolean|[[#level_IsCompleted|IsCompleted]]() &lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|level_Create}}&lt;br /&gt;
;Create() &lt;br /&gt;
:This function should create the layout of the level. It also usually sets up the initial being and item locations. The player's initial location should be set here using Level.player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnTick}}&lt;br /&gt;
;OnTick() &lt;br /&gt;
:This is called every 0.1s of game time. This will happen many times for each of the player's moves, so be careful about putting intense calculations here.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnEnter}}&lt;br /&gt;
;OnEnter() &lt;br /&gt;
:This is triggered just after the player enters the level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnExit}}&lt;br /&gt;
;OnExit() &lt;br /&gt;
:This is triggered when the player leaves the level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnKill}}&lt;br /&gt;
;OnKill() &lt;br /&gt;
:This hook is triggered whenever an enemy is killed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnKillAll}}&lt;br /&gt;
;OnKillAll() &lt;br /&gt;
:After OnKill has triggered, if there are no enemies left on the level, the OnKillAll will be triggered. It is possible for OnKillAll to trigger again later if more enemies are spawned. By default, the &amp;quot;relatively safe&amp;quot; message is displayed. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_IsCompleted}}&lt;br /&gt;
;IsCompleted() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:The game calls this hook to determine if the game statistics should count the level as completed. This is only called for special levels, not scripted levels. By default, all enemies must be dead for the level to be complete.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
These are properties of the global Level variable. They are changed by the engine as the player moves from level to level. For some of the read-only properties, rawset can be used to create a lua property that shadows the pascal property, tricking APIs that are implemented in lua. This is particularly useful for tricking the generator API into using a custom style.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |Word|status|This is for use by level designers. It is preferred to access it through Level.result.&lt;br /&gt;
  |string|name|This is the level name as displayed on the HUD.&lt;br /&gt;
  |Byte|name_number|This controls the &amp;quot;LevX&amp;quot; part of the level name. If zero, it won't be displayed.&lt;br /&gt;
  |Byte|danger_level|Level generation parameter that corresponds to depth.&lt;br /&gt;
  |Byte|style|The style (tile set) used by the level generation functions. This property is read-only.&lt;br /&gt;
  |string|special_exit|The sid of the level that red stairs lead to on the current level number. This property is read-only.&lt;br /&gt;
  |string|special_name|The sid of the current level prototype or the empty string for random levels. This property is read-only.&lt;br /&gt;
  |DWord|item_array_size|Length of the sparse array that stores all the items on the level. This property is read-only.&lt;br /&gt;
  |DWord|being_array_size|Length of the sparse array that stores all the beings on the level. This property is read-only.&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
{{drltable|Level Interface|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|value}}|{{moddef|list|property_get|dot||string|property}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|property_set|dot|string|property|value|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|flag_get|dot||Level Flag|flag}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flag_set|dot||Level Flag|flag|boolean|value}}&lt;br /&gt;
  |{{modarg|value}}|{{moddef|list|roll_weight|dot||list|list|integer|sum}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|weight_list_sum|dot||list|list}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|place_tile|dot||table|translation|string|tile|integer|x|integer|y}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|player|dot||integer|x|integer|y}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|result|dot||integer|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|eye_contact|dot||Coord|c1|Coord|c2}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_visible|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|nuke|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|explosion|dot||Coord|position|integer|radius|integer|delay|integer|damage_dice|integer|damage_sides|Color|color|Sound ID|sound|DamageType|damagetype|ExplosionFlag List|flags|Cell ID|content}}&lt;br /&gt;
  ||'''Cell-specific functions'''&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|light_flag_get|dot||Coord|position|LightFlag|flag}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|light_flag_set|dot||Coord|position|LightFlag|flag|boolean|value}} &lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|hp_get|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|hp_set|dot||Coord|position|integer|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_corpse|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|scan|dot||Area|scan_area|Cell ID|good}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|fill|dot||Cell ID|cell|Area|fill_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood|dot||Cell ID|tile|Area|flood_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|scatter|dot||Area|scatter_area|Cell ID|good|Cell ID|fill|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|scatter_put|dot||Area|scatter_area|table|translation|string|tile|Cell ID|good|integer|count}}&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|{{modarg|boolean}}|{{moddef|list|push_cell|dot||Coord|c|Coord|target|boolean|quiet}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
  ||'''Being-specific functions'''&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|get_being|dot||integer|index}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|get_being_by_uid|dot||integer|uid}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|drop_being|dot||Being ID|bid|Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drop_being_ext|dot||table|being|Coord|position}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|summon|dot||Being ID|bid|integer|count}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|area_summon|dot||Area|where|Being ID|bid|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|clear_being|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|list}}, {{modarg|integer}}|{{moddef|list|get_being_list|dot}}&lt;br /&gt;
  |[[Modding:Being|Being ID]]|{{moddef|list|random_being|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_monster|dot||Being ID|bid|integer|amount}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_monsters|dot||integer|amount}}&lt;br /&gt;
  |{{modarg|Being iterator}}|{{moddef|list|beings|dot}}&lt;br /&gt;
  |{{modarg|Being iterator}}|{{moddef|list|beings_in_range|dot||Coord|position|integer|range}}&lt;br /&gt;
  ||'''Item-specific functions'''&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|get_item|dot||integer|index}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|get_item_by_uid|dot||integer|uid}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|drop_item|dot||Item ID|iid|Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drop_item_ext|dot||table|item|Coord|position}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|drop|dot||Item ID|iid|integer|count}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|area_drop|dot||Area|where|Item ID|iid|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|try_destroy_item|dot||Coord|c}}&lt;br /&gt;
  |{{modarg|list}}, {{modarg|integer}}|{{moddef|list|get_item_list|dot||integer|max_level|integer|unique_mult}}&lt;br /&gt;
  |[[Modding:Item|Item ID]]|{{moddef|list|roll_item_type|dot||ItemType list|itypes|integer|max_level|integer|unique_mod}}&lt;br /&gt;
  |[[Modding:Item|Item ID]]|{{moddef|list|roll_item|dot||integer|max_level|integer|unique_mod}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_items|dot||integer|amount|}}&lt;br /&gt;
  |{{modarg|Item iterator}}|{{moddef|list|items|dot}}&lt;br /&gt;
  |{{modarg|Item iterator}}|{{moddef|list|items_in_range|dot||Coord|position|integer|range}}&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{moddef|desc|property_get|dot|value|string|property}}&lt;br /&gt;
:Gets the value of the given level property. It is preferred to use the Lua dot indexing syntax instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|property_set|dot|string|property|value|value}}&lt;br /&gt;
:Sets the given level property to the given value. It is preferred to use the Lua dot indexing syntax instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flag_get|dot|boolean|Level Flag|flag}}&lt;br /&gt;
;Level.flags&amp;amp;#091;[[Modding:Constants#Level Flags|Level Flag]] flag] &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines the current state of the given level flag.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flag_set|dot||Level Flag|flag|boolean|value}}&lt;br /&gt;
;Level.flags&amp;amp;#091;[[Modding:Constants#Level Flags|Level Flag]] flag] = '''boolean''' value &lt;br /&gt;
:Sets the given level flag to the given value.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_weight|dot|value|list|list|integer|sum}}&lt;br /&gt;
:Randomly chooses an item from the list according to the weight property of the list items. Sum must be the sum of the weights of all the list items.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|weight_list_sum|dot|integer|list|list}}&lt;br /&gt;
:Returns the sum of the weight properties of all the items in the list.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|place_tile|dot||table|translation|string|tile|integer|x|integer|y}}&lt;br /&gt;
:Places the map tile given by ''translation'' and ''tile'' on the map at the position given by ''x'' and ''y''. ''translation'' should be a table that maps single character strings to either cell ids, or to tables. These tables have their first array element be a cell id, but they may also contain a being and''or'' item key that is mapped to a being or item id respectively. Level.drop_being_ext and Level.drop_item_ext syntax is allowed. ''tile'' should be a string of characters that are defined in ''translation''. Line breaks correspond to line breaks on the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|player|dot||integer|x|integer|y}}&lt;br /&gt;
:Sets the initial position of the player for a special or scripted level. This should be called in the Create hook; after that it has no meaningful effect.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|result|dot|integer|integer|value}}&lt;br /&gt;
:If ''value'' is given, updates the level's status and returns nil. If ''value'' is omitted, returns the current status.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|eye_contact|dot|boolean|Coord|c1|Coord|c2}}&lt;br /&gt;
:Determines whether or not there is a line-of-sight path between '''c1''' and '''c2'''. This calculation ignores light flags (such that two beings can have eye contact even if they aren't visible to each other).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_visible|dot|boolean|Coord|position}}&lt;br /&gt;
:Determines if the given position is visible to the player.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|nuke|dot}}&lt;br /&gt;
:Triggers an immediate nuclear explosion as from a [[thermonuclear bomb]].&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|explosion|dot||Coord|position|integer|radius|integer|delay|integer|damage_dice|integer|damage_sides|Color|color|Sound ID|sound|DamageType|damagetype|ExplosionFlag List|flags|Cell ID|content}}&lt;br /&gt;
:Creates an [[explosions|explosion]] centered at the given position with the given parameters. ''radius'' is the size of the explosion. ''delay'' is the delay in milliseconds between animation frames (typically this is around 40). ''damage_dice'' and ''damage_sides'' determine the damage roll for the explosion. For a no-damage explosion, both should be 0. The default damage type is fire. ''content'' determines the cell that is randomly created wherever the explosion does enough damage. By default, there are no flags and there is no content. Only some colors are supported, and these are automatically translated into 3 color combinations used by the explosion animation. The supported colors are LIGHTBLUE, BLUE, MAGENTA, GREEN, LIGHTRED, YELLOW, and the default RED.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|light_flag_get|dot|boolean|Coord|position|LightFlag|flag}}&lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Coord|Coord]] position]&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Gets the value of the given light flag at the given position.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|light_flag_set|dot||Coord|position|LightFlag|flag|boolean|value}} &lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Coord|Coord]] position]&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] = '''boolean''' value &lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] = '''boolean''' value &lt;br /&gt;
:Sets the value of the given light flag at the given position. For the syntax without a position, the light flag will be set at every position on the map. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|hp_get|dot|integer|Coord|position}}&lt;br /&gt;
;Level.hp&amp;amp;#091;[[Modding:Coord|Coord]] position] &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Gets the current hp of the cell at the given position. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|hp_set|dot||Coord|position|integer|value}}&lt;br /&gt;
;Level.hp&amp;amp;#091;[[Modding:Coord|Coord]] position] = '''integer''' value &lt;br /&gt;
:Sets the current hp of the cell at the given position. Setting hp to 0 won't destroy a cell.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_corpse|dot|boolean|Coord|position}}&lt;br /&gt;
:Determines whether the given position has a corpse in it. This counts the cell with id &amp;quot;corpse&amp;quot; as a corpse even though it otherwise isn't a corpse as far as the engine is concerned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scan|dot|boolean|Area|scan_area|Cell ID|good}}&lt;br /&gt;
:Determines if every cell in ''scan_area'' is ''good''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|fill|dot||Cell ID|cell|Area|fill_area}}&lt;br /&gt;
:Sets every cell in the given area to the area. ''fill_area'' is optional; it defaults to the full map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood|dot||Cell ID|tile|Area|flood_area}}&lt;br /&gt;
:Changes CELLSET_FLOORS and CF_LIQUID tiles in the area to ''tile''. If ''tile'' has CF_HAZARD, then it will destroy items.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scatter|dot||Area|scatter_area|Cell ID|good|Cell ID|fill|integer|count}}&lt;br /&gt;
:Chooses ''count'' random tiles in ''scatter_area'' (possibly with duplicates) and sets any chosen cells that are ''good'' to ''fill''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scatter_put|dot||Area|scatter_area|table|translation|string|tile|Cell ID|good|integer|count}}&lt;br /&gt;
:Chooses ''count'' random subareas with upper-left corner in ''scatter_area'' of the size appropriate of ''tile'' (using the first line length and number of lines to define a rectangular area). There may be duplicates or overlaps. For each subarea, if the area is already filled with ''good'', then it is replaced with ''tile'' (according to ''translation''). See Level.place_tile for the semantics of ''translation'' and ''tile''. &lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{moddef|desc|push_cell|dot|boolean|Coord|c|Coord|target|boolean|quiet}}&lt;br /&gt;
:Swaps the content of the cells located in '''c''' and '''target''': this will only occur successfully if '''target''' is a part of CELLSET_FLOORS. If '''target''' has the CF_HAZARD flag, the cell on '''c''' activates its OnDestroy hook. '''quiet''', when set to true, includes messages (mostly specific to barrels, the only object pushed in the base game).&lt;br /&gt;
----&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
{{moddef|desc|get_being|dot|Being|integer|index}}&lt;br /&gt;
:Returns the being at the given index in the sparse being array. A being's index won't change as long as it is in the array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being_by_uid|dot|Being|integer|uid}}&lt;br /&gt;
:Returns the being with the given uid, or nil if that being doesn't exist or has been removed from the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_being|dot|Being|Being ID|bid|Coord|position}}&lt;br /&gt;
:Drops a newly created being in the given position. ''bid'' can also be an actual being object, although this should not be used for beings that are already on the map. If the position is occupied, the being will be dropped nearby. The dropped being is returned. If the function fails, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_being_ext|dot||table|being|Coord|position}}&lt;br /&gt;
:As Level.drop_being, except additional values are accetable for ''being'' as Level.drop_item_ext.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|summon|dot|Being|Being ID|bid|integer|count}}&lt;br /&gt;
:Creates new beings of the type given by ''bid'' and amount given by ''count'' and scatters them around the map. The last dropped being (if any) is returned. ''count'' is optional and defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|area_summon|dot|Being|Area|where|Being ID|bid|integer|count}}&lt;br /&gt;
:As Level.summon, but all the summoned beings are randomly placed in ''where'' rather than scattered across the whole map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|clear_being|dot||Coord|position}}&lt;br /&gt;
{{moddef|desc|clear_being|dot||integer|index}}&lt;br /&gt;
:Removes an item from the map at the given position, or from the given index in the item array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being_list|dot|list,integer}}&lt;br /&gt;
:Returns the list and sum (ready to be used with [[#level_roll_weight|Level.roll_weight]]) for beings and beings groups according to Level.danger_level and DIFFICULTY. The result is cached.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|random_being|dot|Being ID}}&lt;br /&gt;
:Returns a random being chosen according to weights from the current level's list. This will never choose a group. The returned id is always a string id.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_monster|dot||Being ID|bid|integer|amount}}&lt;br /&gt;
:Add the given monster type to the level in an amount specified by the total danger value ''amount'' (so it scales appropriately with Level.flood_monsters).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_monsters|dot||integer|amount}}&lt;br /&gt;
:Adds monsters to the level using the normal algorithm for random levels. The ''amount'' is a total danger value such as a value returned by Generator.being_weight.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|beings|dot|Being iterator}}&lt;br /&gt;
:Gives an iterator over all beings in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|beings_in_range|dot|Being iterator|Coord|position|integer|range}}&lt;br /&gt;
:Gives an iterator over all beings within '''range''' units of [[distance]] from '''position''' in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item|dot|Item|integer|index}}&lt;br /&gt;
:Returns the item at the given index in the sparse item array. An item's index won't change as long as it is in the array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item_by_uid|dot|Item|integer|uid}}&lt;br /&gt;
:Returns the item with the given uid, or nil if that item doesn't exist or has been removed from the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_item|dot|Item|Item ID|iid|Coord|position}}&lt;br /&gt;
:Drops a newly created item in the given position. ''iid'' can also be an actual item object, although this should not be used for items that are already on the map. If the position is occupied, the item will be dropped nearby. The dropped item is returned. If the function fails, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_item_ext|dot||table|item|Coord|position}}&lt;br /&gt;
:As Level.drop_item, except additional values are acceptable for ''item''. If ''item'' is a table, the first list element is passed used to determine which item to drop. For other key-value pairs in the table, the property of the dropped item that corresponds to the key will be set to the value.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop|dot|Item|Item ID|iid|integer|count}}&lt;br /&gt;
:Creates new items of the type given by ''iid'' and amount given by ''count'' and scatters them around the map. The last dropped item (if any) is returned. ''count'' is optional and defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|area_drop|dot|Item|Area|where|Item ID|iid|integer|count}}&lt;br /&gt;
:As Level.drop, but all dropped items are randomly placed in ''where'' rather than scattered across the whole map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|try_destroy_item|dot||Coord|c}}&lt;br /&gt;
:Destroys an item at '''position''', if there is one to be found.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item_list|dot|list,integer|integer|max_level|integer|unique_mult}}&lt;br /&gt;
:Returns the list and sum (ready to be used with [[#level_roll_weight|Level.roll_weight]]) for items according to ''max_level'', and ''unique_mult''. ''max_level'' defaults to Level.danger_level, and is used to determine which items fall in the proper level range. Unique items' weights are multiplied by ''unique_mult'' (which defaults to 1). The result is cached.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_item_type|dot|Item ID|ItemType list|itypes|integer|max_level|integer|unique_mod}}&lt;br /&gt;
:Returns a random item chosen from among the given item types according to weights from the list specified by ''max_level'' and ''unique_mod''. The returned id is always a string id.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_item|dot|Item ID|integer|max_level|integer|unique_mod}}&lt;br /&gt;
:As Level.roll_item_type, but the item type of the result isn't restricted.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_items|dot||integer|amount|}}&lt;br /&gt;
:Adds items to the level according to the normal algorithm for random levels (not counting special features). The number of items is given by ''amount''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|items|dot|Item iterator}}&lt;br /&gt;
:Gives an iterator over all items in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|items_in_range|dot|Item iterator|Coord|position|integer|range}}&lt;br /&gt;
:Gives an iterator over all items within '''range''' units of [[distance]] from '''position''' in the level.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:Cell</id>
		<title>Modding:Cell</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:Cell"/>
				<updated>2012-01-31T20:08:52Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: moved cell flags (Modding:Constants will eventually be stripped)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cells are what make up the game world. You walk over them, open them, travel down their stairs, and blow up their barrels. Unlinke [[Modding:Being|beings]] and [[Modding:Item|items]], cells aren't instantiated. All cells of a given type are exactly the same except for hp and light flags both of which must be accessed through the [[Modding:Level#API|Level API]].&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
Once a cell is registered, changing the lua object will have no effect on how the cell operates (although it can affect some of the APIs). The exception to this is that hooks can be redefined (although which hooks are present can't be changed). Cell prototypes are declared by passing a table with the desired properties and hooks to the global Cells function. Required properties are underlined. Cells prototypes are stored in a global table called cells that can be indexed by string id or numeric id.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Cell Prototype&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;name&amp;lt;/u&amp;gt;|This is the name of the cell that is displayed in game messages.&lt;br /&gt;
  |'''string'''|id|This is the string id that is used to reference the cell prototype internally. (A numeric id called nid is generated automatically.) The default is the first word of the name in all lowercase.&lt;br /&gt;
  |'''string'''|&amp;lt;u&amp;gt;ascii&amp;lt;/u&amp;gt;|This should be a single character string. It is used to display cells on the map.&lt;br /&gt;
  |'''string'''|asciilow|If the ascii property is not once of the standard visible ASCII characters, then asciilow should be one of these standard characters to accomodate players that don't have support for an extended character selection. Whether or not to use asciilow is configurable by the player in config.lua.&lt;br /&gt;
  |'''integer'''|&amp;lt;u&amp;gt;sprite&amp;lt;/u&amp;gt;|This indicates the sprite used to represent the cell in the graphical version. Use 0 to indicate no sprite.&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|color|This is the color used to draw the cell when it is in the player's line-of-sight. The default is LIGHTGRAY.&lt;br /&gt;
  |[[Modding:Constants#Colors|Color]]|color_dark|This is the color used to draw the cell when it has been explored, but is not in the player's line-of-sight. The default is DARKGRAY.&lt;br /&gt;
  |'''string'''|color_id|If this is defined, then for the purposes of user color configuration, this is the cell's ID. Use this to force several cells to have the same color even if the user tries to redefine them.&lt;br /&gt;
  |'''integer'''|effect|This is a multi-purpose cell property. Currently it is only used to specify the corresponding being ID for corpses (as 100 plus the being ID). As most corpses are [[Modding:Being#Prototype|generated automatically]], most modders won't need to worry about this. The default is 0.&lt;br /&gt;
  |'''integer'''|armor|This is the amount of armor the cell has. All damage to the cell is reduced by this value (regardless of damage type, although some damage types may not affect the cell at all; see CF_FRAGILE). This can reduce damage to 0. If the cell's armor is 0, then it cannot be destroyed by damage. The default is 0.&lt;br /&gt;
  |'''integer'''|hp|This is the initial amount of hp for the cell. If the cell is damaged, the hp for that particular cell (not the prototype) is reduced, and the cell isn't destroyed until it drops to 0. Cells with 0 hp must still be damaged to be destroyed. Be careful: changing cells after the beginning of the level doesn't usually update cells' current hp. The default is 0.&lt;br /&gt;
  |Cell Flag '''list'''|flags|The flags in this list will be included in the cell's flag set. A property called flag_set is automatically created containing these flags in set format. The default is an empty list.&lt;br /&gt;
  |[[Modding:Cell|Cell ID]]|bloodto|If defined, then the cell will transmute to the given new cell when it is affected by blood. This must be a string id.&lt;br /&gt;
  |[[Modding:Cell|Cell ID]]|destroyto|If the cell is destroyed, it will transmute to the given new cell. This must be a string id. The default is &amp;quot;floor&amp;quot;.&lt;br /&gt;
  |[[Modding:Constants#Cellsets|Cellset]]|set|The cellsets are groupings for cells. They aren't used very much. Most notably, beings will only leave corpses on cells in CELLSET_FLOORS. By default, the cell won't be included in a set.&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
=== Cell Flags ===&lt;br /&gt;
{{drltable|Cell Flags|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-family:monospace; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |CF_BLOCKMOVE|Cells with this flag block movement and projectiles.&lt;br /&gt;
  |CF_BLOCKLOS|Cells with this flag block vision.&lt;br /&gt;
  |CF_CORPSE|This flag is set for autogenerated corpses. Only cells with this flag can be ressurected. The being created by resurrection can be specified by setting the cell's effect parameter to 100 + being.id. Note that the &amp;quot;corpse&amp;quot; cell does not have this flag. To include this cell, use Level.is_corpse.&lt;br /&gt;
  |CF_NOCHANGE|Currently, this flag is only checked by the map powerups. The map powerups reveal cells with this flag (as well as CF_BLOCKMOVE cells).&lt;br /&gt;
  |CF_NORUN|The run command (not the run tactic) will stop the player before he steps on a cell with this flag.&lt;br /&gt;
  |CF_PUSHABLE|Cells with this flag can be pushed (like barrels in DoomRL). Pushing is mostly hard-coded.&lt;br /&gt;
  |CF_FRAGILE|Cells with this flag can be destroyed by any damage type (assuming they have HP or armor) whereas cells cannot usually be damaged by bullet, melee, shrapnel, or piercing damage.&lt;br /&gt;
  |CF_HAZARD|This flag should be set for cells that are dangerous to step on. The AI will usually avoid these tiles. This flag is also used with the EF_NOHARM empty flag.&lt;br /&gt;
  |CF_OVERLAY|This flag is related to the graphical version.&lt;br /&gt;
  |CF_MULTISPRITE|This flag is related to the graphical version.&lt;br /&gt;
  |CF_STICKWALL|This flag is related to the graphical version.&lt;br /&gt;
  |CF_LIQUID|This flag is used to mark liquid cells (water, acid, lava). Currently, it is only checked by Level.flood which will flood over CELLSET_FLOORS cells and CF_LIQUID cells.&lt;br /&gt;
  |CF_OPENABLE|This flag indicates that the cell can be opened. What happens when the cells is opened is determined by the cell's OnAct hook.&lt;br /&gt;
  |CF_CLOSABLE|As CF_OPENABLE, but for the close command.&lt;br /&gt;
  |CF_RUNSTOP|Cells with this flag will stop the player's run when the player is orthogonally adjacent. Contrast with CF_NORUN.&lt;br /&gt;
  |CF_NUKABLE|Cells with this flag will be destroyed be a nuke even if they are normally not destructible.&lt;br /&gt;
  |CF_CRITICAL|Cells with this flag should usually not be altered or destroyed be the game. It is currently only checked by the flooding level event. Stairs have this flag.&lt;br /&gt;
  |CF_HIGHLIGHT|This flag determines whether the light or dark color variant is used when a StatusEffect overlay is being applied.&lt;br /&gt;
  |CF_BLOODY|When a being walks on one of these cells, its feet won't become less bloody. (See CF_BLOODY.)&lt;br /&gt;
  |CF_VBLOODY|When a being walks on one of these cells, its feet will become bloody and it will temporarily leave a trail of blood.&lt;br /&gt;
  |CF_STAIRS|Stairs are marked with this flag. (New stairs cells should include this.)&lt;br /&gt;
  |}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
Although these hooks should be defined with a coord as the first argument, they are immediately translated into a new function that has x and y as its first two arguments. This is important when replacing the hooks after the fact or calling the hooks manually. For all hooks, the first argument is the coord of the cell that caused the hook.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|Cell Hooks&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |'''void'''|[[#cell_OnEnter|OnEnter]]([[Modding:Coord|Coord]] c, [[Modding:Being|Being]] enterer) &lt;br /&gt;
  |'''void'''|[[#cell_OnExit|OnExit]]([[Modding:Coord|Coord]] c) &lt;br /&gt;
  |'''void'''|[[#cell_OnAct|OnAct]]([[Modding:Coord|Coord]] c, [[Modding:Being|Being]] actor) &lt;br /&gt;
  |'''string'''|[[#cell_OnDescribe|OnDescribe]]([[Modding:Coord|Coord]] c) &lt;br /&gt;
  |'''void'''|[[#cell_OnDestroy|OnDestroy]]([[Modding:Coord|Coord]] c)&lt;br /&gt;
  |}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|cell_OnEnter}}&lt;br /&gt;
;OnEnter([[Modding:Coord|Coord]] c, [[Modding:Being|Being]] enterer) &lt;br /&gt;
:This hooks is called at the beginning of a being's turn if it is standing on the cell. (This triggers even if the being hasn't moved since its last turn.)&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|cell_OnExit}}&lt;br /&gt;
;OnExit([[Modding:Coord|Coord]] c) &lt;br /&gt;
:This hook is called if the player uses the descend stairs action on the cell. That action is only allowed if this hook is defined. This hook also allows saving which is designed to work it the hook moves the player to the next level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|cell_OnAct}}&lt;br /&gt;
;OnAct([[Modding:Coord|Coord]] c, [[Modding:Being|Being]] actor) &lt;br /&gt;
:This hook is called when a being opens or closes a cell. Opening and closing must be allowed by the CF_OPENABLE and CF_CLOSEABLE flags respectively.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|cell_OnDescribe}}&lt;br /&gt;
;OnDescribe([[Modding:Coord|Coord]] c) &amp;amp;rarr; '''string'''&lt;br /&gt;
:If this hook is defined, then it is used instead of the cell name for in game messages.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|cell_OnDestroy}}&lt;br /&gt;
;OnDestroy([[Modding:Coord|Coord]] c) &lt;br /&gt;
:This hook is called after a cell is destroyed. (The hook for the previous cell is used even though the cell has already been transmuted to the destroyto value.)&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	<entry>
		<id>https://drl.chaosforge.org/wiki/Modding:level_blueprint_(0.9.9.7)</id>
		<title>Modding:level blueprint (0.9.9.7)</title>
		<link rel="alternate" type="text/html" href="https://drl.chaosforge.org/wiki/Modding:level_blueprint_(0.9.9.7)"/>
				<updated>2012-01-28T21:30:46Z</updated>
		
		<summary type="html">&lt;p&gt;Game Hunter: revised with new templates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Level objects define the properties of fixed special levels. The level API, however, is a general purpose API for manipulating the level. This is used both for map generation (along with the [[Modding:Generator#API|generator API]]) and for changing the level on the fly. The Level variable also has some general properties that don't necessarily correspond to special levels in particular.&lt;br /&gt;
&lt;br /&gt;
== Prototype ==&lt;br /&gt;
Levels prototypes are only used for special levels and scripted levels, not random levels. They are declared using the Levels function with the ID as the first argument, and a prototype table as the second argument. They are stored by ID in a global table called levels.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Prototype'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |string|ID|The unique identifier used by the engine for this level. Instead of being included in the table, this must be passed as the first argument to the Levels function.&lt;br /&gt;
  |string|name|The name displayed in the HUD.&lt;br /&gt;
  |string|welcome|Optional message displayed on level entry.&lt;br /&gt;
  |integer|chance|Optional percent chance the level will appear. Defaults to 100.&lt;br /&gt;
  |[[Modding:Functions$function_resolve_range|Range]]|level|Level range where the level may appear.&lt;br /&gt;
  |string|entry|Optional mortem history message for level entry.&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Engine Hooks ==&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;2&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level Hooks'''&lt;br /&gt;
 {{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |void|[[#level_Create|Create]]() &lt;br /&gt;
  |void|[[#level_OnTick|OnTick]]() &lt;br /&gt;
  |void|[[#level_OnEnter|OnEnter]]() &lt;br /&gt;
  |void|[[#level_OnExit|OnExit]]() &lt;br /&gt;
  |void|[[#level_OnKill|OnKill]]() &lt;br /&gt;
  |void|[[#level_OnKillAll|OnKillAll]]() &lt;br /&gt;
  |boolean|[[#level_IsCompleted|IsCompleted]]() &lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Anchor|level_Create}}&lt;br /&gt;
;Create() &lt;br /&gt;
:This function should create the layout of the level. It also usually sets up the initial being and item locations. The player's initial location should be set here using Level.player.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnTick}}&lt;br /&gt;
;OnTick() &lt;br /&gt;
:This is called every 0.1s of game time. This will happen many times for each of the player's moves, so be careful about putting intense calculations here.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnEnter}}&lt;br /&gt;
;OnEnter() &lt;br /&gt;
:This is triggered just after the player enters the level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnExit}}&lt;br /&gt;
;OnExit() &lt;br /&gt;
:This is triggered when the player leaves the level.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnKill}}&lt;br /&gt;
;OnKill() &lt;br /&gt;
:This hook is triggered whenever an enemy is killed.&lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_OnKillAll}}&lt;br /&gt;
;OnKillAll() &lt;br /&gt;
:After OnKill has triggered, if there are no enemies left on the level, the OnKillAll will be triggered. It is possible for OnKillAll to trigger again later if more enemies are spawned. By default, the &amp;quot;relatively safe&amp;quot; message is displayed. &lt;br /&gt;
----&lt;br /&gt;
{{Anchor|level_IsCompleted}}&lt;br /&gt;
;IsCompleted() &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:The game calls this hook to determine if the game statistics should count the level as completed. This is only called for special levels, not scripted levels. By default, all enemies must be dead for the level to be complete.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
These are properties of the global Level variable. They are changed by the engine as the player moves from level to level. For some of the read-only properties, rawset can be used to create a lua property that shadows the pascal property, tricking APIs that are implemented in lua. This is particularly useful for tricking the generator API into using a custom style.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;&amp;quot;&lt;br /&gt;
 ! colspan=&amp;quot;3&amp;quot; style=&amp;quot;background: darkred; color: yellow; font-size: 120%; text-align: center&amp;quot;|'''Level'''&lt;br /&gt;
 {{Table3Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c3=padding:0px 2px;&lt;br /&gt;
  |Word|status|This is for use by level designers. It is preferred to access it through Level.result.&lt;br /&gt;
  |string|name|This is the level name as displayed on the HUD.&lt;br /&gt;
  |Byte|name_number|This controls the &amp;quot;LevX&amp;quot; part of the level name. If zero, it won't be displayed.&lt;br /&gt;
  |Byte|danger_level|Level generation parameter that corresponds to depth.&lt;br /&gt;
  |Byte|style|The style (tile set) used by the level generation functions. This property is read-only.&lt;br /&gt;
  |string|special_exit|The sid of the level that red stairs lead to on the current level number. This property is read-only.&lt;br /&gt;
  |string|special_name|The sid of the current level prototype or the empty string for random levels. This property is read-only.&lt;br /&gt;
  |DWord|item_array_size|Length of the sparse array that stores all the items on the level. This property is read-only.&lt;br /&gt;
  |DWord|being_array_size|Length of the sparse array that stores all the beings on the level. This property is read-only.&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== API ==&lt;br /&gt;
{{drltable|Level Interface|2|{{Table2Col&lt;br /&gt;
  |es=background: #333;&lt;br /&gt;
  |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;&lt;br /&gt;
  |c2=padding:0px 2px;&lt;br /&gt;
  |{{modarg|value}}|{{moddef|list|property_get|dot||string|property}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|property_set|dot|string|property|value|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|flag_get|dot||Level Flag|flag}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flag_set|dot||Level Flag|flag|boolean|value}}&lt;br /&gt;
  |{{modarg|value}}|{{moddef|list|roll_weight|dot||list|list|integer|sum}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|weight_list_sum|dot||list|list}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|place_tile|dot||table|translation|string|tile|integer|x|integer|y}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|player|dot||integer|x|integer|y}}&lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|result|dot||integer|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|eye_contact|dot||Coord|c1|Coord|c2}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_visible|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|nuke|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|explosion|dot||Coord|position|integer|radius|integer|delay|integer|damage_dice|integer|damage_sides|Color|color|Sound ID|sound|DamageType|damagetype|ExplosionFlag List|flags|Cell ID|content}}&lt;br /&gt;
  ||'''Cell-specific functions'''&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|light_flag_get|dot||Coord|position|LightFlag|flag}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|light_flag_set|dot||Coord|position|LightFlag|flag|boolean|value}} &lt;br /&gt;
  |{{modarg|integer}}|{{moddef|list|hp_get|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|hp_set|dot||Coord|position|integer|value}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|is_corpse|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|boolean}}|{{moddef|list|scan|dot||Area|scan_area|Cell ID|good}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|fill|dot||Cell ID|cell|Area|fill_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood|dot||Cell ID|tile|Area|flood_area}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|scatter|dot||Area|scatter_area|Cell ID|good|Cell ID|fill|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|scatter_put|dot||Area|scatter_area|table|translation|string|tile|Cell ID|good|integer|count}}&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
|{{modarg|boolean}}|{{moddef|list|push_cell|dot||Coord|c|Coord|target|boolean|quiet}}&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
  ||'''Being-specific functions'''&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|get_being|dot||integer|index}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|get_being_by_uid|dot||integer|uid}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|drop_being|dot||Being ID|bid|Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drop_being_ext|dot||table|being|Coord|position}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|summon|dot||Being ID|bid|integer|count}}&lt;br /&gt;
  |{{modarg|Being}}|{{moddef|list|area_summon|dot||Area|where|Being ID|bid|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|clear_being|dot||Coord|position}}&lt;br /&gt;
  |{{modarg|list}}, {{modarg|integer}}|{{moddef|list|get_being_list|dot}}&lt;br /&gt;
  |[[Modding:Being|Being ID]]|{{moddef|list|random_being|dot}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_monster|dot||Being ID|bid|integer|amount}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_monsters|dot||integer|amount}}&lt;br /&gt;
  |{{modarg|Being iterator}}|{{moddef|list|beings|dot}}&lt;br /&gt;
  |{{modarg|Being iterator}}|{{moddef|list|beings_in_range|dot||Coord|position|integer|range}}&lt;br /&gt;
  ||'''Item-specific functions'''&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|get_item|dot||integer|index}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|get_item_by_uid|dot||integer|uid}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|drop_item|dot||Item ID|iid|Coord|position}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|drop_item_ext|dot||table|item|Coord|position}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|drop|dot||Item ID|iid|integer|count}}&lt;br /&gt;
  |{{modarg|Item}}|{{moddef|list|area_drop|dot||Area|where|Item ID|iid|integer|count}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|try_destroy_item|dot||Coord|c}}&lt;br /&gt;
  |{{modarg|list}}, {{modarg|integer}}|{{moddef|list|get_item_list|dot||integer|max_level|integer|unique_mult}}&lt;br /&gt;
  |[[Modding:Item|Item ID]]|{{moddef|list|roll_item_type|dot||ItemType list|itypes|integer|max_level|integer|unique_mod}}&lt;br /&gt;
  |[[Modding:Item|Item ID]]|{{moddef|list|roll_item|dot||integer|max_level|integer|unique_mod}}&lt;br /&gt;
  |{{modarg|void}}|{{moddef|list|flood_items|dot||integer|amount|}}&lt;br /&gt;
  |{{modarg|Item iterator}}|{{moddef|list|items|dot}}&lt;br /&gt;
  |{{modarg|Item iterator}}|{{moddef|list|items_in_range|dot||Coord|position|integer|range}}&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{moddef|desc|property_get|dot|value|string|property}}&lt;br /&gt;
:Gets the value of the given level property. It is preferred to use the Lua dot indexing syntax instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|property_set|dot|string|property|value|value}}&lt;br /&gt;
:Sets the given level property to the given value. It is preferred to use the Lua dot indexing syntax instead.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flag_get|dot|boolean|Level Flag|flag}}&lt;br /&gt;
;Level.flags&amp;amp;#091;[[Modding:Constants#Level Flags|Level Flag]] flag] &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Determines the current state of the given level flag.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flag_set|dot||Level Flag|flag|boolean|value}}&lt;br /&gt;
;Level.flags&amp;amp;#091;[[Modding:Constants#Level Flags|Level Flag]] flag] = '''boolean''' value &lt;br /&gt;
:Sets the given level flag to the given value.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_weight|dot|value|list|list|integer|sum}}&lt;br /&gt;
:Randomly chooses an item from the list according to the weight property of the list items. Sum must be the sum of the weights of all the list items.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|weight_list_sum|dot|integer|list|list}}&lt;br /&gt;
:Returns the sum of the weight properties of all the items in the list.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|place_tile|dot||table|translation|string|tile|integer|x|integer|y}}&lt;br /&gt;
:Places the map tile given by ''translation'' and ''tile'' on the map at the position given by ''x'' and ''y''. ''translation'' should be a table that maps single character strings to either cell ids, or to tables. These tables have their first array element be a cell id, but they may also contain a being and''or'' item key that is mapped to a being or item id respectively. Level.drop_being_ext and Level.drop_item_ext syntax is allowed. ''tile'' should be a string of characters that are defined in ''translation''. Line breaks correspond to line breaks on the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|player|dot||integer|x|integer|y}}&lt;br /&gt;
:Sets the initial position of the player for a special or scripted level. This should be called in the Create hook; after that it has no meaningful effect.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|result|dot|integer|integer|value}}&lt;br /&gt;
:If ''value'' is given, updates the level's status and returns nil. If ''value'' is omitted, returns the current status.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|eye_contact|dot|boolean|Coord|c1|Coord|c2}}&lt;br /&gt;
:Determines whether or not there is a line-of-sight path between '''c1''' and '''c2'''. This calculation ignores light flags (such that two beings can have eye contact even if they aren't visible to each other).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_visible|dot|boolean|Coord|position}}&lt;br /&gt;
:Determines if the given position is visible to the player.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|nuke|dot}}&lt;br /&gt;
:Triggers an immediate nuclear explosion as from a [[thermonuclear bomb]].&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|explosion|dot||Coord|position|integer|radius|integer|delay|integer|damage_dice|integer|damage_sides|Color|color|Sound ID|sound|DamageType|damagetype|ExplosionFlag List|flags|Cell ID|content}}&lt;br /&gt;
:Creates an [[explosions|explosion]] centered at the given position with the given parameters. ''radius'' is the size of the explosion. ''delay'' is the delay in milliseconds between animation frames (typically this is around 40). ''damage_dice'' and ''damage_sides'' determine the damage roll for the explosion. For a no-damage explosion, both should be 0. The default damage type is fire. ''content'' determines the cell that is randomly created wherever the explosion does enough damage. By default, there are no flags and there is no content. Only some colors are supported, and these are automatically translated into 3 color combinations used by the explosion animation. The supported colors are LIGHTBLUE, BLUE, MAGENTA, GREEN, LIGHTRED, YELLOW, and the default RED.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|light_flag_get|dot|boolean|Coord|position|LightFlag|flag}}&lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Coord|Coord]] position]&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] &amp;amp;rarr; '''boolean'''&lt;br /&gt;
:Gets the value of the given light flag at the given position.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|light_flag_set|dot||Coord|position|LightFlag|flag|boolean|value}} &lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Coord|Coord]] position]&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] = '''boolean''' value &lt;br /&gt;
;Level.light&amp;amp;#091;[[Modding:Constants#LightFlag|LightFlag]] flag] = '''boolean''' value &lt;br /&gt;
:Sets the value of the given light flag at the given position. For the syntax without a position, the light flag will be set at every position on the map. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|hp_get|dot|integer|Coord|position}}&lt;br /&gt;
;Level.hp&amp;amp;#091;[[Modding:Coord|Coord]] position] &amp;amp;rarr; '''integer'''&lt;br /&gt;
:Gets the current hp of the cell at the given position. &lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|hp_set|dot||Coord|position|integer|value}}&lt;br /&gt;
;Level.hp&amp;amp;#091;[[Modding:Coord|Coord]] position] = '''integer''' value &lt;br /&gt;
:Sets the current hp of the cell at the given position. Setting hp to 0 won't destroy a cell.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|is_corpse|dot|boolean|Coord|position}}&lt;br /&gt;
:Determines whether the given position has a corpse in it. This counts the cell with id &amp;quot;corpse&amp;quot; as a corpse even though it otherwise isn't a corpse as far as the engine is concerned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scan|dot|boolean|Area|scan_area|Cell ID|good}}&lt;br /&gt;
:Determines if every cell in ''scan_area'' is ''good''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|fill|dot||Cell ID|cell|Area|fill_area}}&lt;br /&gt;
:Sets every cell in the given area to the area. ''fill_area'' is optional; it defaults to the full map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood|dot||Cell ID|tile|Area|flood_area}}&lt;br /&gt;
:Changes CELLSET_FLOORS and CF_LIQUID tiles in the area to ''tile''. If ''tile'' has CF_HAZARD, then it will destroy items.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scatter|dot||Area|scatter_area|Cell ID|good|Cell ID|fill|integer|count}}&lt;br /&gt;
:Chooses ''count'' random tiles in ''scatter_area'' (possibly with duplicates) and sets any chosen cells that are ''good'' to ''fill''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|scatter_put|dot||Area|scatter_area|table|translation|string|tile|Cell ID|good|integer|count}}&lt;br /&gt;
:Chooses ''count'' random subareas with upper-left corner in ''scatter_area'' of the size appropriate of ''tile'' (using the first line length and number of lines to define a rectangular area). There may be duplicates or overlaps. For each subarea, if the area is already filled with ''good'', then it is replaced with ''tile'' (according to ''translation''). See Level.place_tile for the semantics of ''translation'' and ''tile''. &lt;br /&gt;
----&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
{{moddef|desc|push_cell|dot|boolean|Coord|c|Coord|target|boolean|quiet}}&lt;br /&gt;
:Swaps the content of the cells located in '''c''' and '''target''': this will only occur successfully if '''target''' is a part of CELLSET_FLOORS. If '''target''' has the CF_HAZARD flag, the cell on '''c''' activates its OnDestroy hook. '''quiet''', when set to true, includes messages (mostly specific to barrels, the only object pushed in the base game).&lt;br /&gt;
----&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
{{moddef|desc|get_being|dot|Being|integer|index}}&lt;br /&gt;
:Returns the being at the given index in the sparse being array. A being's index won't change as long as it is in the array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being_by_uid|dot|Being|integer|uid}}&lt;br /&gt;
:Returns the being with the given uid, or nil if that being doesn't exist or has been removed from the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_being|dot|Being|Being ID|bid|Coord|position}}&lt;br /&gt;
:Drops a newly created being in the given position. ''bid'' can also be an actual being object, although this should not be used for beings that are already on the map. If the position is occupied, the being will be dropped nearby. The dropped being is returned. If the function fails, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_being_ext|dot||table|being|Coord|position}}&lt;br /&gt;
:As Level.drop_being, except additional values are accetable for ''being'' as Level.drop_item_ext.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|summon|dot|Being|Being ID|bid|integer|count}}&lt;br /&gt;
:Creates new beings of the type given by ''bid'' and amount given by ''count'' and scatters them around the map. The last dropped being (if any) is returned. ''count'' is optional and defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|area_summon|dot|Being|Area|where|Being ID|bid|integer|count}}&lt;br /&gt;
:As Level.summon, but all the summoned beings are randomly placed in ''where'' rather than scattered across the whole map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|clear_being|dot||Coord|position}}&lt;br /&gt;
{{moddef|desc|clear_being|dot||integer|index}}&lt;br /&gt;
:Removes an item from the map at the given position, or from the given index in the item array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_being_list|dot|list,integer}}&lt;br /&gt;
:Returns the list and sum (ready to be used with [[#level_roll_weight|Level.roll_weight]]) for beings and beings groups according to Level.danger_level and DIFFICULTY. The result is cached.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|random_being|dot|Being ID}}&lt;br /&gt;
:Returns a random being chosen according to weights from the current level's list. This will never choose a group. The returned id is always a string id.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_monster|dot||Being ID|bid|integer|amount}}&lt;br /&gt;
:Add the given monster type to the level in an amount specified by the total danger value ''amount'' (so it scales appropriately with Level.flood_monsters).&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_monsters|dot||integer|amount}}&lt;br /&gt;
:Adds monsters to the level using the normal algorithm for random levels. The ''amount'' is a total danger value such as a value returned by Generator.being_weight.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|beings|dot|Being iterator}}&lt;br /&gt;
:Gives an iterator over all beings in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|beings_in_range|dot|Being iterator|Coord|position|integer|range}}&lt;br /&gt;
:Gives an iterator over all beings within '''range''' units of [[distance]] from '''position''' in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item|dot|Item|integer|index}}&lt;br /&gt;
:Returns the item at the given index in the sparse item array. An item's index won't change as long as it is in the array.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item_by_uid|dot|Item|integer|uid}}&lt;br /&gt;
:Returns the item with the given uid, or nil if that item doesn't exist or has been removed from the map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_item|dot|Item|Item ID|iid|Coord|position}}&lt;br /&gt;
:Drops a newly created item in the given position. ''iid'' can also be an actual item object, although this should not be used for items that are already on the map. If the position is occupied, the item will be dropped nearby. The dropped item is returned. If the function fails, nil is returned.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop_item_ext|dot||table|item|Coord|position}}&lt;br /&gt;
:As Level.drop_item, except additional values are acceptable for ''item''. If ''item'' is a table, the first list element is passed used to determine which item to drop. For other key-value pairs in the table, the property of the dropped item that corresponds to the key will be set to the value.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|drop|dot|Item|Item ID|iid|integer|count}}&lt;br /&gt;
:Creates new items of the type given by ''iid'' and amount given by ''count'' and scatters them around the map. The last dropped item (if any) is returned. ''count'' is optional and defaults to 1.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|area_drop|dot|Item|Area|where|Item ID|iid|integer|count}}&lt;br /&gt;
:As Level.drop, but all dropped items are randomly placed in ''where'' rather than scattered across the whole map.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|try_destroy_item|dot||Coord|c}}&lt;br /&gt;
:Destroys an item at '''position''', if there is one to be found.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|get_item_list|dot|list,integer|integer|max_level|integer|unique_mult}}&lt;br /&gt;
:Returns the list and sum (ready to be used with [[#level_roll_weight|Level.roll_weight]]) for items according to ''max_level'', and ''unique_mult''. ''max_level'' defaults to Level.danger_level, and is used to determine which items fall in the proper level range. Unique items' weights are multiplied by ''unique_mult'' (which defaults to 1). The result is cached.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_item_type|dot|Item ID|ItemType list|itypes|integer|max_level|integer|unique_mod}}&lt;br /&gt;
:Returns a random item chosen from among the given item types according to weights from the list specified by ''max_level'' and ''unique_mod''. The returned id is always a string id.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|roll_item|dot|Item ID|integer|max_level|integer|unique_mod}}&lt;br /&gt;
:As Level.roll_item_type, but the item type of the result isn't restricted.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|flood_items|dot||integer|amount|}}&lt;br /&gt;
:Adds items to the level according to the normal algorithm for random levels (not counting special features). The number of items is given by ''amount''.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|items|dot|Item iterator}}&lt;br /&gt;
:Gives an iterator over all items in the level.&lt;br /&gt;
----&lt;br /&gt;
{{moddef|desc|items_in_range|dot|Item iterator|Coord|position|integer|range}}&lt;br /&gt;
:Gives an iterator over all items within '''range''' units of [[distance]] from '''position''' in the level.&lt;/div&gt;</summary>
		<author><name>Game Hunter</name></author>	</entry>

	</feed>