<?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_hp</id>
	<title>Manual:DIL Manual/max hp - 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_hp"/>
	<link rel="alternate" type="text/html" href="https://wiki.dikumud.com/index.php?title=Manual:DIL_Manual/max_hp&amp;action=history"/>
	<updated>2026-11-23T21:08:52Z</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_hp&amp;diff=2889&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_hp&amp;diff=2889&amp;oldid=prev"/>
		<updated>2026-11-14T23:11:16Z</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 hp =&lt;br /&gt;
'''Field''' (integer, read/write; units: all; on players writable only from access-0 zones).&lt;br /&gt;
&lt;br /&gt;
 u.max_hp : integer&lt;br /&gt;
&lt;br /&gt;
The unit's maximum hit points; [[Manual:DIL Manual/hp|hp]] holds the current ones. Characters have it from their HP ability: &amp;lt;code&amp;gt;3 * HP + 20&amp;lt;/code&amp;gt; for a player (1 for a mortal past their [[Manual:DIL Manual/lifespan|lifespan]]), &amp;lt;code&amp;gt;3 * HP + 10&amp;lt;/code&amp;gt; for an NPC. Objects have hit points too: weapons, shields and armour get them from their craftsmanship (1000 for an ordinary one).&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* On a player, only a program in a zone with access level 0 (the fourth column of &amp;lt;code&amp;gt;vme/etc/zonelist&amp;lt;/code&amp;gt;) can assign it. Elsewhere vmc accepts the assignment, but at run time the program logs &amp;quot;DIL SERIOUS: ... Type error in lvalue assignemt&amp;quot; and stops. On NPCs, objects and rooms any zone can assign it, and every zone can read it.&lt;br /&gt;
* The game sets a character's maximum again from the HP ability whenever that ability changes (training, an affect on it), so a change made in DIL lasts only until then. To change it for good, change the ability with an affect (&amp;lt;code&amp;gt;APF_ABILITY&amp;lt;/code&amp;gt; on &amp;lt;code&amp;gt;ABIL_HP&amp;lt;/code&amp;gt;).&lt;br /&gt;
* Assigning it doesn't change &amp;lt;code&amp;gt;hp&amp;lt;/code&amp;gt; at once: after lowering the maximum, the current hit points can be above it for a while.&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 full_heal(u : unitptr);&lt;br /&gt;
code&lt;br /&gt;
{&lt;br /&gt;
   if ((u.type != UNIT_ST_PC) and (u.type != UNIT_ST_NPC))&lt;br /&gt;
      return;&lt;br /&gt;
   u.hp := u.max_hp;&lt;br /&gt;
   act(&amp;quot;You feel completely healed.&amp;quot;, A_ALWAYS, u, null, null, TO_CHAR);&lt;br /&gt;
   return;&lt;br /&gt;
}&lt;br /&gt;
dilend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Heals a character fully.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Manual:DIL Manual/hp|hp]]&lt;br /&gt;
* [[Manual:DIL Manual/max mana|max_mana]]&lt;br /&gt;
* [[Manual:DIL Manual/max endurance|max_endurance]]&lt;br /&gt;
* [[Manual:DIL Manual/abilities|abilities]]&lt;br /&gt;
* [[Manual:DIL Manual/addaff()|addaff()]]&lt;/div&gt;</summary>
		<author><name>Agent-mud</name></author>
		
	</entry>
</feed>