<?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%2Falignment</id>
	<title>Manual:DIL Manual/alignment - 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%2Falignment"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/alignment&amp;action=history"/>
	<updated>2026-11-22T22:01:22Z</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/alignment&amp;diff=2896&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/alignment&amp;diff=2896&amp;oldid=prev"/>
		<updated>2026-11-14T23:11:37Z</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;= alignment =&lt;br /&gt;
'''Field''' (integer, read/write; units: all).&lt;br /&gt;
&lt;br /&gt;
 u.alignment : integer&lt;br /&gt;
&lt;br /&gt;
How good or evil the unit is, from -1000 (evil) to 1000 (good). The macros in wmacros.h draw the lines: &amp;lt;code&amp;gt;IS_GOOD(a)&amp;lt;/code&amp;gt; is 350 and up, &amp;lt;code&amp;gt;IS_EVIL(a)&amp;lt;/code&amp;gt; -350 and down, &amp;lt;code&amp;gt;IS_NEUTRAL(a)&amp;lt;/code&amp;gt; in between. Objects and rooms have an alignment too (detect alignment shows an object's aura from it in baselook.zon).&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Assigning isn't clamped: the zone compiler keeps alignments within -1000 to 1000, but DIL can store anything from -32768 to 32767 (a 16-bit number; beyond that it wraps). Keep it in range yourself.&lt;br /&gt;
* On null it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin string aura(u : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if (u.alignment &amp;gt;= 350)&lt;br /&gt;
      return (&amp;quot;blue&amp;quot;);&lt;br /&gt;
   else if (u.alignment &amp;lt;= -350)&lt;br /&gt;
      return (&amp;quot;red&amp;quot;);&lt;br /&gt;
   return (&amp;quot;green&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The colour of a unit's aura, as get_aura in baselook.zon.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/Fields|Fields]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>