Manual:DIL Manual/full

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 23:13, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

full

Field (integer, read/write; units: PC).

pc.full : integer

How well fed the player is. Higher is better: 24 is full, below 0 the player is hungry. The stomach@update program lowers it every mud hour, and update.zon's gain_cond keeps it between -96 and 24 and tells the player: "hungry" from 3 down, then "very hungry", "starving" and "starving to death". Eating raises it.

A value of 48 or more is never changed by gain_cond: the player doesn't get hungry.

Notes

  • Players only. On an NPC, an object, a room or null the field fails.
  • Stored as an 8-bit signed number: values outside -128 to 127 wrap around. Keep to -96 to 24, or 48 for "never hungry".
  • A program that assigns it should clamp it to 24 itself, as basis.zon does.
  • While full or thirst is below 0, a player regains hit points, mana and endurance more slowly, and when they are low enough, loses them (vmelimits.cpp).

Example

dilbegin feed(u : unitptr, amount : integer);
code
{
   if (u.type != UNIT_ST_PC)
      return;
   if (u.full >= 48)
      return;
   u.full := u.full + amount;
   if (u.full > 24)
      u.full := 24;
   return;
}
dilend

Feeds a player without going over full, as the food in basis.zon does.

See also