<?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%2Fmax_mana</id>
	<title>Manual:DIL Manual/max mana - 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%2Fmax_mana"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/max_mana&amp;action=history"/>
	<updated>2026-11-23T20:44:59Z</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/max_mana&amp;diff=2890&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/max_mana&amp;diff=2890&amp;oldid=prev"/>
		<updated>2026-11-14T23:11:19Z</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;= max mana =&lt;br /&gt;
'''Field''' (integer, read-only; units: characters).&lt;br /&gt;
&lt;br /&gt;
 ch.max_mana : integer&lt;br /&gt;
&lt;br /&gt;
The character's maximum mana; [[Manual:DIL Manual/mana|mana]] holds the current amount. The game works it out each time it is read: &amp;lt;code&amp;gt;100 + (BRA + CHA) / 2&amp;lt;/code&amp;gt;, at most 200, from the character's brain and charisma abilities. For a mortal player it is then scaled by age.&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* It can't be assigned (vmc: &amp;quot;Illegal lvalue&amp;quot;). Raise it by raising the abilities, for example with an affect (&amp;lt;code&amp;gt;APF_ABILITY&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;lt;code&amp;gt;mana&amp;lt;/code&amp;gt; isn't capped by it when assigned in DIL: &amp;lt;code&amp;gt;pc.mana := pc.mana + 50;&amp;lt;/code&amp;gt; can go above the maximum. Compare first, as halfzon.zon does.&lt;br /&gt;
* On an object, a room or null it fails.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dilbegin restore_mana(pc : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if ((pc.type != UNIT_ST_PC) and (pc.type != UNIT_ST_NPC))&lt;br /&gt;
      return;&lt;br /&gt;
   pc.mana := pc.mana + 50;&lt;br /&gt;
   if (pc.mana &amp;gt; pc.max_mana)&lt;br /&gt;
      pc.mana := pc.max_mana;&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Gives a character 50 mana, but not above the maximum.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/mana|mana]]&lt;br /&gt;
* [[Manual:DIL Manual/max hp|max_hp]]&lt;br /&gt;
* [[Manual:DIL Manual/max endurance|max_endurance]]&lt;br /&gt;
* [[Manual:DIL Manual/abilities|abilities]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>