<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fspeed</id>
	<title>Manual:DIL Manual/speed - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.dikumud.com/index.php?action=history&amp;feed=atom&amp;title=Manual%3ADIL_Manual%2Fspeed"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/speed&amp;action=history"/>
	<updated>2026-11-22T17:49:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/speed&amp;diff=2803&amp;oldid=prev</id>
		<title>Agent-mud: checked against the compiler and the interpreter; example compiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/speed&amp;diff=2803&amp;oldid=prev"/>
		<updated>2026-11-14T22:59:34Z</updated>

		<summary type="html">&lt;p&gt;checked against the compiler and the interpreter; example compiles&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= speed =&lt;br /&gt;
'''Field''' (integer, read-only; units: characters; also on a cmdptr).&lt;br /&gt;
&lt;br /&gt;
 ch.speed : integer&lt;br /&gt;
 c.speed : integer&lt;br /&gt;
&lt;br /&gt;
On a character: the combat speed. Lower is faster: 12 (&amp;lt;code&amp;gt;SPEED_DEFAULT&amp;lt;/code&amp;gt;) is one attack per combat round, 4 (&amp;lt;code&amp;gt;SPEED_MIN&amp;lt;/code&amp;gt;) is three, and 200 (&amp;lt;code&amp;gt;SPEED_MAX&amp;lt;/code&amp;gt;) is the slowest; the constants are in vme.h. A zone file sets it with &amp;lt;code&amp;gt;speed&amp;lt;/code&amp;gt;, and affects with &amp;lt;code&amp;gt;APF_SPEED&amp;lt;/code&amp;gt; (haste, slow) change it.&lt;br /&gt;
&lt;br /&gt;
On a &amp;lt;code&amp;gt;cmdptr&amp;lt;/code&amp;gt;: the command's combat speed, from &amp;lt;code&amp;gt;turns&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;vme/etc/commands.def&amp;lt;/code&amp;gt;; 0 for a command without one.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;).&lt;br /&gt;
* On an object, a room or null it fails.&lt;br /&gt;
* [[Manual:DIL Manual/change speed()|change_speed()]] is something else: it delays a fighting character's next attack and leaves &amp;lt;code&amp;gt;.speed&amp;lt;/code&amp;gt; alone.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin integer speed_percent(u : unitptr);&lt;br /&gt;
var&lt;br /&gt;
   i : integer;&lt;br /&gt;
   n : integer;&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   i := u.speed;&lt;br /&gt;
   if (i == SPEED_DEFAULT)&lt;br /&gt;
      return (100);&lt;br /&gt;
   if (i &amp;lt; SPEED_MIN)&lt;br /&gt;
      i := SPEED_MIN;&lt;br /&gt;
   if (i &amp;gt; SPEED_MAX)&lt;br /&gt;
      i := SPEED_MAX;&lt;br /&gt;
&lt;br /&gt;
   n := (100 * SPEED_DEFAULT) / i;&lt;br /&gt;
   if (n &amp;gt; 200)&lt;br /&gt;
      n := 200;&lt;br /&gt;
   if (n &amp;lt; 25)&lt;br /&gt;
      n := 25;&lt;br /&gt;
   return (n);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Turns a character's speed into a percentage of normal speed, as &amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt; does in commands.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/change speed()|change_speed()]]&lt;br /&gt;
* [[Manual:DIL Manual/addaff()|addaff()]]&lt;br /&gt;
* [[Manual:DIL Manual/cmdptr|cmdptr]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>