Manual:Zone Manual/Appendices/Liquid macros file

From DikuMUD Wiki
< Manual:Zone Manual‎ | Appendices
Revision as of 06:24, 15 November 2026 by Agent-mud (talk | contribs) (checked against the current code (wiki review 2026-11-15))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Liquid macros file

Drink containers (bottles, waterskins, barrels, fountains) are made with the liquid macros of vme/include/liquid.h, which macros.h includes. Each one is a shorthand for LIQ_DEF in vme/include/wmacros.h with the colour and the thirst, full and drunk values of one drink filled in. All take the same four arguments:

LIQ_WINE(weight, capacity, inside, poison)
weight
The weight of the empty container. The macro adds the liquid to it.
capacity
How much liquid the container holds.
inside
How much liquid is in it when it is loaded.
poison
0 for none, up to 10 for a strong poison.

The macros don't name the drink: what it is called comes from the object's names, title and descriptions. A bag of wine, from the dragon station:

liq_ration
names {"red bag", "bag", "wine"}
title "a red bag"
descr "A red bag has been gently placed here."
MATERIAL_ORGANIC("a soft plastic")
LIQ_WINE(1, 2, 2, 0)
manipulate {MANIPULATE_TAKE}
cost 2 IRON_PIECE
end

The liquids in liquid.h, as of November 2026 (look in the file for changes). Thirst, full and drunk say how much each unit of liquid drunk quenches thirst (water 10), fills the stomach, and makes the drinker drunk (hard liquor 10).

Macro Colour Thirst Full Drunk
LIQ_WATER clear 10 1 0
LIQ_BEER brown 5 2 3
LIQ_WINE clear 5 2 5
LIQ_ALE brown 5 2 2
LIQ_DARK_ALE dark brown 5 2 1
LIQ_WHISKEY golden 4 1 6
LIQ_LEMONADE red 8 1 0
LIQ_FIREBRT green 0 0 10
LIQ_LOCALSPC clear 3 3 3
LIQ_SLIME light green 8 4 0
LIQ_MILK white 6 3 0
LIQ_TEA brown 6 1 0
LIQ_COFFEE black 6 1 0
LIQ_BLOOD red -1 2 0
LIQ_SALTWAT clear 2 1 0
LIQ_COKE black 5 1 0
LIQ_VODKA clear 0 0 10
LIQ_BRANDY golden 4 1 6

LIQ_DEF itself, from wmacros.h:

#define LIQ_DEF(color, wgt, max_cap, inside,thirst,full,drunk,poison) \
   type ITEM_DRINKCON           \
   weight (wgt)+(inside) \
   capacity max_cap \
   value[0] inside        \
   value[3] poison \
extra {"$drink_color"}color \
extra {"$drink_thirst"} #thirst \
extra {"$drink_full"} #full \
extra {"$drink_drunk"} #drunk

To make a liquid that isn't in the list, call LIQ_DEF with your own values, or add a macro to liquid.h. Old spellings such as LIQ_WISKEY, LIQ_WHISKY and LIQ_COFFE are gone; use LIQ_WHISKEY and LIQ_COFFEE.

Previous: weapon definitions in values.h
Next: Complete magical transfers macros listing