OBJECT
/room/smithy
SYNOPSIS
inherit "/room/smithy";
#include <properties.h>
LAST UPDATE
Analena, 03-Jan-97
DESCRIPTION
The smithy is an extension of the standard shop that allows
players to get their weapons and armours fixed and resized.
Warriors may also repair their stuff themselves. Besides the
regular shop commands list, sell, show, buy and list, the
smithy defines the commands fix and repair and redefines the
command appraise.
The smithy offers the following special commands:
'fix <what>' will fix an item, that is adding an amount
defined by the property P_MAX_REPAIR (or the
difference between the current quality and
P_MAX_QUALITY, if that is smaller than
P_MAX_REPAIR) to the items quality. Items with
a quality of 0 or below can't be fixed.
'resize <what> <small/large>' will resize an item to be
smaller or larger. Items of
the size PSIZE_GENERIC can't
be resized.
'appraise <what>' will tell the player what (s)he will get for
the item, how much it will cost to fix it
and/or how much it will cost to resize it.
Note: The resize-function has been disabled since OSB
doesn't support size differences between equipment
and players. All functions concerned by this have
been 'commented out'.
The functions of the smithy:
int P_NO_SHOP "NoShop"
If set, the smithy doesn't offer the 'shop actions'
buy, sell, list, show, and the Store Exit is removed.
int P_REPAIR_FACTOR "RepairFactor"
Percentage of the total value you need to pay to have
an item fixed. Default is 150.
/*
int P_RESIZE_FACTOR "ResizeFactor"
Percentage of the value of the item you need to pay to
have the item resized. Default is 33.
*/
int P_MAX_REPAIR "MaxRepair"
Percentage of the items Quality that may be fixed in one
turn. Default is 100.
item P_MAX_QUALITY "MaxQuality"
Maximum Quality that the smith can fix the item to. If
P_MAX_QUALITY is set to 0, items can be fixed up to their
P_RESET_QUALITY.
int P_WEAPON_DECAY "WeaponDecay"
The amount that the P_WP_PER_QP-property of a weapon is
raised when that weapon is fixed. Default is 0.
int P_ARMOUR_DECAY "ArmourDecay"
The amount that the P_AP_PER_QP-property of an armour is
raised when that armour is fixed. Default is 0.
Both P_WEAPON_DECAY and P_ARMOUR_DECAY may be used to
simulate the effect that a fixed weapon/armour will easier
degrade in Quality than the original item. Note that you
need to set them to a negative value since the item
degrades easier with a lower P_.._PER_QP.
int P_SMITHY "Smithy"
If set, players may repair their own weapons and armours in
this room. This also sets a Detail ({"hammer","anvil"})
since they are mentioned in the notify_fail-messages.
int IsSmithy()
int cmd_repair(string str)
These functions handle the 'SK_REPAIR'-Skill that allows
players to repair their own weapons and armours. If P_SMITHY
is set to 0, both IsSmithy() and cmd_repair() will return 0.
varargs int GetRepairPrice(object ob, int force)
// varargs int GetResizePrice(object ob, int force)
Returns the price for fixing/resizing the object ob. These
functions are used by the do_fix, do_resize and do_appraise
functions and call ModifyPrice with the verbs "fix" and
"resize" respectively.
int do_fix(string str)
The 'fix'-command.
/*
int do_resize(string str)
The 'resize'-command.
*/
Functions from /std/shop that have been modified by the smithy:
int do_appraise(string str)
The 'appraise'-command will offer prices for the sell-, fix-
and/or resize-actions (if available).
int CheckTrade(object ob)
Per Default, the smithy only trades with items that define
either a weapon type or an armour type.
string format_sign(string cmd, string desc, string help)
The spacing is slightly different from /std/shop to allow
enough room for the resize-command.
string detail_sign()
The default sign offers a different appraise-command as well
as help for the fix- and resize-commands. 'the shopkeeper'
has been replaced with 'the smith' in all descriptions,
and the examples given talk of weapons and armours instead
of other items.
string detail_shopkeeper()
If the shopkeeper is forbidden, this will return 'This is
the smith.\n' instead of 'This is the shopkeeper.\n'.
string QueryIntLong(string arg)
The smithy will append 'There is a sign hanging on the
wall.\n' to the IntLong of the room (instead of 'a sign
placed on the counter').
void SetShopkeeper(string file, mapping properties)
A slightly different set of properties describes the
default-smith.
void create()
Makes some default settings and adjusts the details added
by the /std/shop to the smithy.
void init()
Adds the fix- and resize-actions.
INHERITANCE TREE
/room/smithy
`-/std/shop
|-std/room
|-std/shop/articles
|-std/shop/comm
`-std/shop/trading
`-/lib/money
SEE ALSO
shop(S)