Manual:DIL Manual/drunk
Jump to navigation
Jump to search
Contents
drunk
Field (integer, read/write; units: PC).
pc.drunk : integer
How drunk the player is: 0 is sober. Drinks and some food with a "drunk" value raise it, and the stomach@update program lowers it every mud hour (faster while asleep). update.zon's gain_cond keeps it between 0 and 24 and tells the player: "getting tipsy" above 3, "very light headed" above 7, "seeing double" above 11.
Drunkenness shows in the game through DIL: score says "You are drunk!" above 10 (commands.zon), speech is slurred by drunk_speech in comm.zon, and climbing gets harder by 5 per point (basemove.zon).
Notes
- Players only. On an NPC, an object, a room or null the field fails.
- A value of 48 or more is never changed by
gain_cond. - Stored as an 8-bit signed number: values outside -128 to 127 wrap around.
- Assigning it directly skips the messages; to make a player drunker with the usual messages, use the drink code's
gain_cond.
Example
dilbegin integer climb_diff(pc : unitptr, base : integer);
code
{
if (pc.drunk > 0)
{
act("Climbing under influence isn't easy.", A_SOMEONE, pc, null, null, TO_CHAR);
return (base + 5 * pc.drunk);
}
return (base);
}
dilend
Makes a climb harder for a drunk player, as climb does in basemove.zon.