[Package Index | Mudlib Index | Effect Index]

File /std/npc/surface_decorator.c

This is a inheritable for playerhousing surface decorating npcs. With this you can add carpets, wood panelling, beams or anything your little heart desires to npcs that will then go out and make the world a prettier place. If you want to add a surface to an npc that he will be able to decorate, use eg: add_allowed_surface( "floor" ); If you want to add a type of decoration that the npc can install, use eg: add_fitted_surface( "plush blue carpet", "covered with plush " "blue carpet", ); @September 3rd, 2002 @authors Una and Dasquian

Inherits

This class inherits the following classes /obj/monster.c

Includes

This class includes the following files /include/money.h and /include/shops/bank.h

Method index

Public Functions

These are functions that everyone can access.

add_allowed_domain
void add_allowed_domain(string domain)

Adds a string to the list of domains to be checked by the npc when it moves to see if it's allowed to be in that room, eg. "/d/guilds" or "Bes_Pelargic"

Parameters:
domain - the name of the domain to be added


add_allowed_surface
void add_allowed_surface(string surface)

Allows the npc to work on a specific surface in a room, eg. floor, ceiling If the argument passed is "wall", they will be able to work on all walls, eg. north wall, east wall, south wall, etc.

Parameters:
surface - the name of the surface to be added


add_fitted_surface
void add_fitted_surface(string short,
                        string long,
                        int cost)

Adds a new decoration that the npc can use to his stock list

Parameters:
short - the short description used in the stock list and for ordering
long - the long description actually used for the new decoration in the room
cost - the cost of installing this decoration


check_domain
void check_domain()

Called every time the npc moves. This function checks that the file name of its new environment contains at least one of the allowed domains. If it does, it will store the current room as being its last good location. Otherwise, it will move it to its last good location.

See also:
go_back .c


do_ask
int do_ask(string surface,
           string decor)

Does all the necessary checks to see if he can decorate the requested surface with the requested decor, handles payment and starts the work.

Parameters:
surface - the surface to be decorated
decor - the short name of the decor to be used, eg. green carpet

See also:
finish_work .c


do_hire
int do_hire()

Sets him to follow the player and marks that player as his current employer
do_list
int do_list()

Causes the surface decorator to give a list of the surfaces he decorates and what he can decorate them with, or says that he has no stock.
finish_work
void finish_work(string surface,
                 string long,
                 object where)

Called by do_ask(), this finishes decorating the surface

Parameters:
surface - the surface to be decorated
long - the long description of the decorated surface, eg. carpeted with plush green carpet

See also:
do_ask .c


query_allowed_domains
string * query_allowed_domains()
query_allowed_surfaces
string * query_allowed_surfaces()
query_employer
object query_employer()
query_fitted_surfaces
mapping query_fitted_surfaces()
query_responses
string * query_responses()
query_under_construction_mess
string query_under_construction_mess()
query_work_time
int query_work_time()
remove_all_fitted_surfaces
void remove_all_fitted_surfaces()

Removes all decorations from the npc's stock list
remove_fitted_surface
void remove_fitted_surface(string short)

Removes a decoration whose short matches the argument given

Parameters:
short - the short description of the surface to remove


set_employer
void set_employer(object player)

Sets the current player employer

Parameters:
player - the player object currently using the npc


set_responses
void set_responses(string * the_responses)

Sets custom responses. The array size must match the existing one or the call will be disregarded.

Parameters:
the_responses - the array of responses to be used


set_under_construction_mess
void set_under_construction_mess(string mess)

Sets what a surface looks like while the npc is working on it.

Parameters:
mess - the description to replace the surface's appearance in the room while it is being worked on


set_work_time
void set_work_time(int time)

Sets the time it takes to finish the work.

Parameters:
time - the time (in seconds) taken to complete the work