CONCEPT
Houses for players
AUTHOR
Sique, Mar 18 1993
DESCRIPTION
Houses are properties of players. They can configure them at their own
taste. Houses were bought at a estate agency. For every customizing
the playes have to pay a specific amount of cash.
Objects we need to use the houses:
/d/avalon/common/std/room.c
This is the basic room of a house. The owner can change the short and
long description of the room. He can add new rooms with the commands
'dig <direction>' and 'build <direction>'. The commands both have the
same function.
The filename of a room contains the coordinates of the room. Every
coordinate can range from 0 to 2, which means that a house can have a
maximum of 27 rooms. The price for a new room ist #defined in
/d/avalon/common/std/prices.h as ROOM_PRICE. If the player can't pay
the whole price immediately, he gets a credit.
If the player has already a credit, he can't expand his house.
/d/avalon/common/std/home.c
This is the entrance room of the house. It checks for every person who
wants to enter the house, if the person is either the owner of the
house, or if the owner has allowed to the person to enter the house.
If the person is the owner himself, it checks for his credit, and if
he can pay a part of it back, the home.c force him to do that.
/d/avalon/common/std/road.c
This room contains two functions, AddHome() and DeleteHome().
int AddHome(string exit, string path, string owner)
This function adds a new exit to the room leading into the <path>.
And it adds a line similar to "To the <exit> you can go into the home
of <owner>." to the long description. If you want to overwrite the
function QueryIntLong() please be careful, maybe you mess the new
exits.
int DeleteHome(string owner)
This function deletes the exit to the home of <owner> again.
All rooms who should contain exits to player properties need to have
these functions.
/d/avalon/common/std/cert_dummy.c
This is the certificate the player can buy for to own a property.
If the player "buy" it, it makes a new sub directory of the directory
set by SetHomedir(). Then it writes 9 files into that new subdirectory,
garden1.c .. garden8.c and buildplace.c. Then it tries to connect the
new property in direction defined by SetExitverb() to the file set by
SetExitpath(). If successed it removes itself and clones a new object,
the /d/avalon/common/obj/certificate.
/d/avalon/common/std/buildplace.c
This file allows to the owner to build a house here. The price for the
house is defined in /d/avalon/common/std/prices.h as HOUSE_PRICE.
If the player can't pay the the whole price immediately he will get a
credit.
/d/avalon/common/std/agency.c
This is the estate agency where the property certificates can be bought.
The estate agent only sells the certificates. He don't buy anything.
/d/avalon/common/std/proppool.c
In this room the sellable properties are stored. You can add
a new property via
#include "/d/avalon/common/std/def.h"
..
POOLFILE->AddProperty(string homedir, string exit, string path,
int price, string location, string cert_file)
where the arguments have the following meaning:
homedir ......... Here we add a subdir, where the files of the house of the
stored.
exit ............ In this direction the player can leave his property.
path ............ This is the room connected to the property.
price ........... This is the price of the property.
location ........ This is a short description, where the property are
Example: "Lorinia", or "England"...
cert_file ....... This defines which file should be used for to clone
a certificate. You should use a file that inherits
/d/avalon/common/std/cert_dummy.
For uid reasons you can't use the cert_dummy outside
of /d/avalon