OBJECT
pub
LAST UPDATE
Tune, Wed 30-Jul-97 00:35:17 CET
SYNOPSIS
inherit "std/pub";
#include <properties.h>
#include <rooms.h>
DESCRIPTION
A pub is a special kind of room where food and drinks can be bought
and consumed instantly. The pub defines three commands for the player:
"read menu" to read the menu, "buy" and "order" (which are equivalent)
to order something listed in the menu. Players may either buy food
and drink for themselves, or for another player who is in the room.
FUNCTIONS
AddDrink(string name | string *name, int heal, int strength,
int soak, int value, [string drinkmsg]);
Adds a drink to the pub's menu. Parameters are:
o name
The name of the drink. Will be capitalized in the menu.
If you give an array instead of a string, the first entry
in the array will show up in the menu; the other entries
may be used as aliases.
o heal
The amount of hit points which will be regained by the
player immediately after having bought the drink.
o strength
The alcoholic content of the drink, which is used by
drink_alcohol() in player.c. <health.h> defines some
standard values (low alc, beer alc, wine alc and hard alc).
Please use these! You can adjust the values by + or -.
o soak
The amount of liquid which is used by drink_soft() in
player.c. A pint of liquid should have about 12 soaked
units.
o value
The amount of money (in monetary units (MU); see documentation
to /std/money for an elaboration on this) the player will
have to pay for the drink (which also will show up on the
menu). This amount should be calculated according to the
rules. If you give a value which is too low, it will be
replaced by one computed by the pub itself.
If you are unsure about the rules, give a value of 0 MU.
o drinkmsg
This string is given to the player when he/she consumes
the drink. The parameter is optional; if not used, the
player will get the message "You drink a [name]".
AddFood(string name | string *name, int heal, int stuff,
int value, [string eatmsg]);
Adds a meal to the pub's menu. Parameters are:
o name
The name of the meal. Will be capitalized in the menu.
If you give an array instead of a string, the first entry
in the array will show up in the menu; the other entries
may be used as aliases.
o heal
The amount of hit points which will be regained by the
player immediately after having bought the food.
o stuff
The amount of food which is used by eat_food() in player.c.
A rich meal (half a day's ration) should have about 70
stuffed units.
o value
The amount of money (in monetary units (MU); see documentation
to /std/money for an elaboration on this) the player will
have to pay for the food (which also will show up on the
menu). This amount should be calculated according to the
rules. If you give a value which is too low, it will be
replaced by one computed by the pub itself.
If you are unsure about the rules, give a value of 0 MU.
o eatmsg
This string is given to the player when he/she consumes
the meal. The parameter is optional; if not used, the
player will get the message "You eat a [name]".
SetDiscountFunc(string func_name)
This is the most complicated function, but you normally don't have
to use it. It allows you to manipulate the value of the drink for
a certain group of players (such as members of a certain guild or
race).
The parameters are:
o func_name
The name of a function which you have to define in your
pub file. This function gets the parameter value and gives
back a modified value, that is, it should be declared as:
int func_name(int value);
Within this function, you are able to modify the value of
your provisions as you like (provided you stay within the
rules). As a rule of thumb you may manipulate the original
value by 20% for a certain group of players. If you feel
unsure, ask on the newsboards for suggestions.
SetMenuStr(string menu_str)
If you want to add some lines to the menu (after the price list),
you can do it by using this function. Parameters are:
o menu_str
Contains the lines you want to add.
Payment is handled via the functions from the money library.
INHERITANCE TREE
pub
|----room
| `...
|
`----/lib/money
EXAMPLES
/d/archwiz/common/health/exroom2.c
/d/archwiz/common/health/exroom3.c
SEE ALSO
room(S)