skylib_fluffos_v3/
skylib_fluffos_v3/bin/
skylib_fluffos_v3/bin/db/
skylib_fluffos_v3/fluffos-2.9-ds2.04/
skylib_fluffos_v3/fluffos-2.9-ds2.04/ChangeLog.old/
skylib_fluffos_v3/fluffos-2.9-ds2.04/Win32/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/simuls/
skylib_fluffos_v3/fluffos-2.9-ds2.04/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/clone/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/command/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/data/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/etc/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/master/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/log/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/compiler/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/efuns/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/operators/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/u/
skylib_fluffos_v3/fluffos-2.9-ds2.04/tmp/
skylib_fluffos_v3/fluffos-2.9-ds2.04/windows/
skylib_fluffos_v3/mudlib/
skylib_fluffos_v3/mudlib/cmds/
skylib_fluffos_v3/mudlib/cmds/admin/
skylib_fluffos_v3/mudlib/cmds/guild-race/
skylib_fluffos_v3/mudlib/cmds/living/broken/
skylib_fluffos_v3/mudlib/cmds/player/group_cmds/
skylib_fluffos_v3/mudlib/cmds/playtester/
skylib_fluffos_v3/mudlib/d/admin/
skylib_fluffos_v3/mudlib/d/admin/room/
skylib_fluffos_v3/mudlib/d/admin/room/we_care/
skylib_fluffos_v3/mudlib/d/admin/save/
skylib_fluffos_v3/mudlib/d/admin/text/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/buildings/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/map/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/roads/
skylib_fluffos_v3/mudlib/d/learning/chars/
skylib_fluffos_v3/mudlib/d/learning/functions/
skylib_fluffos_v3/mudlib/d/learning/handlers/
skylib_fluffos_v3/mudlib/d/learning/help_topics/
skylib_fluffos_v3/mudlib/d/learning/help_topics/npcs/
skylib_fluffos_v3/mudlib/d/learning/help_topics/objects/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/RCS/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/crowd/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/situations/
skylib_fluffos_v3/mudlib/d/learning/save/
skylib_fluffos_v3/mudlib/d/learning/school/
skylib_fluffos_v3/mudlib/d/learning/school/add_sc/
skylib_fluffos_v3/mudlib/d/learning/school/characters/
skylib_fluffos_v3/mudlib/d/learning/school/general/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/basic_commands/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/edtutor/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/unix_tutor/
skylib_fluffos_v3/mudlib/d/learning/school/items/
skylib_fluffos_v3/mudlib/d/learning/school/npc_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/room_basic/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/situations/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/terrain_tutor/
skylib_fluffos_v3/mudlib/d/learning/text/
skylib_fluffos_v3/mudlib/d/liaison/
skylib_fluffos_v3/mudlib/d/mudlib/
skylib_fluffos_v3/mudlib/d/mudlib/changes/
skylib_fluffos_v3/mudlib/d/playtesters/
skylib_fluffos_v3/mudlib/d/playtesters/effects/
skylib_fluffos_v3/mudlib/d/playtesters/handlers/
skylib_fluffos_v3/mudlib/d/playtesters/items/
skylib_fluffos_v3/mudlib/d/sage/
skylib_fluffos_v3/mudlib/doc/
skylib_fluffos_v3/mudlib/doc/creator/
skylib_fluffos_v3/mudlib/doc/driver/
skylib_fluffos_v3/mudlib/doc/driver/efuns/arrays/
skylib_fluffos_v3/mudlib/doc/driver/efuns/buffers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/calls/
skylib_fluffos_v3/mudlib/doc/driver/efuns/compile/
skylib_fluffos_v3/mudlib/doc/driver/efuns/filesystem/
skylib_fluffos_v3/mudlib/doc/driver/efuns/floats/
skylib_fluffos_v3/mudlib/doc/driver/efuns/functions/
skylib_fluffos_v3/mudlib/doc/driver/efuns/general/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mappings/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mixed/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mudlib/
skylib_fluffos_v3/mudlib/doc/driver/efuns/numbers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/parsing/
skylib_fluffos_v3/mudlib/doc/login/
skylib_fluffos_v3/mudlib/doc/lpc/basic_manual/
skylib_fluffos_v3/mudlib/doc/lpc/intermediate/
skylib_fluffos_v3/mudlib/doc/new/add_command/
skylib_fluffos_v3/mudlib/doc/new/events/
skylib_fluffos_v3/mudlib/doc/new/handlers/
skylib_fluffos_v3/mudlib/doc/new/living/race/
skylib_fluffos_v3/mudlib/doc/new/living/spells/
skylib_fluffos_v3/mudlib/doc/new/object/
skylib_fluffos_v3/mudlib/doc/new/player/
skylib_fluffos_v3/mudlib/doc/new/room/guild/
skylib_fluffos_v3/mudlib/doc/new/room/outside/
skylib_fluffos_v3/mudlib/doc/new/room/storeroom/
skylib_fluffos_v3/mudlib/doc/object/
skylib_fluffos_v3/mudlib/doc/playtesters/
skylib_fluffos_v3/mudlib/doc/policy/
skylib_fluffos_v3/mudlib/doc/weapons/
skylib_fluffos_v3/mudlib/global/
skylib_fluffos_v3/mudlib/global/creator/
skylib_fluffos_v3/mudlib/handlers/
skylib_fluffos_v3/mudlib/include/casino/
skylib_fluffos_v3/mudlib/include/cmds/
skylib_fluffos_v3/mudlib/include/effects/
skylib_fluffos_v3/mudlib/include/npc/
skylib_fluffos_v3/mudlib/include/room/
skylib_fluffos_v3/mudlib/include/shops/
skylib_fluffos_v3/mudlib/net/daemon/
skylib_fluffos_v3/mudlib/net/daemon/chars/
skylib_fluffos_v3/mudlib/net/inherit/
skylib_fluffos_v3/mudlib/net/obj/
skylib_fluffos_v3/mudlib/net/obj/BACKUPS/
skylib_fluffos_v3/mudlib/obj/amulets/
skylib_fluffos_v3/mudlib/obj/armours/plate/
skylib_fluffos_v3/mudlib/obj/b_day/
skylib_fluffos_v3/mudlib/obj/clothes/transport/horse/
skylib_fluffos_v3/mudlib/obj/faith/symbols/
skylib_fluffos_v3/mudlib/obj/fungi/
skylib_fluffos_v3/mudlib/obj/gatherables/
skylib_fluffos_v3/mudlib/obj/instruments/
skylib_fluffos_v3/mudlib/obj/media/
skylib_fluffos_v3/mudlib/obj/misc/player_shop/
skylib_fluffos_v3/mudlib/obj/monster/godmother/
skylib_fluffos_v3/mudlib/obj/monster/transport/
skylib_fluffos_v3/mudlib/obj/rings/
skylib_fluffos_v3/mudlib/obj/scabbards/
skylib_fluffos_v3/mudlib/obj/spells/
skylib_fluffos_v3/mudlib/obj/stationery/
skylib_fluffos_v3/mudlib/obj/stationery/envelopes/
skylib_fluffos_v3/mudlib/obj/toys/
skylib_fluffos_v3/mudlib/obj/vessels/
skylib_fluffos_v3/mudlib/obj/weapons/axes/
skylib_fluffos_v3/mudlib/obj/weapons/chains/
skylib_fluffos_v3/mudlib/obj/weapons/maces/BACKUPS/
skylib_fluffos_v3/mudlib/save/autodoc/
skylib_fluffos_v3/mudlib/save/book_handler/
skylib_fluffos_v3/mudlib/save/books/history/calarien/
skylib_fluffos_v3/mudlib/save/mail/
skylib_fluffos_v3/mudlib/save/new_soul/data/
skylib_fluffos_v3/mudlib/save/parcels/
skylib_fluffos_v3/mudlib/save/playerinfo/
skylib_fluffos_v3/mudlib/save/players/d/
skylib_fluffos_v3/mudlib/save/players/s/
skylib_fluffos_v3/mudlib/save/random_names/
skylib_fluffos_v3/mudlib/save/random_names/data/
skylib_fluffos_v3/mudlib/save/terrains/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_desert/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_grassy_field/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_mountain/
skylib_fluffos_v3/mudlib/save/todo_lists/
skylib_fluffos_v3/mudlib/secure/
skylib_fluffos_v3/mudlib/secure/cmds/admin/
skylib_fluffos_v3/mudlib/secure/cmds/lord/
skylib_fluffos_v3/mudlib/secure/config/
skylib_fluffos_v3/mudlib/secure/handlers/autodoc/
skylib_fluffos_v3/mudlib/secure/handlers/intermud/
skylib_fluffos_v3/mudlib/secure/include/global/
skylib_fluffos_v3/mudlib/secure/save/
skylib_fluffos_v3/mudlib/secure/save/handlers/
skylib_fluffos_v3/mudlib/secure/std/
skylib_fluffos_v3/mudlib/secure/std/classes/
skylib_fluffos_v3/mudlib/secure/std/modules/
skylib_fluffos_v3/mudlib/std/creator/
skylib_fluffos_v3/mudlib/std/dom/
skylib_fluffos_v3/mudlib/std/effects/
skylib_fluffos_v3/mudlib/std/effects/external/
skylib_fluffos_v3/mudlib/std/effects/fighting/
skylib_fluffos_v3/mudlib/std/effects/magic/
skylib_fluffos_v3/mudlib/std/effects/magic/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/other/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/priest/
skylib_fluffos_v3/mudlib/std/effects/room/
skylib_fluffos_v3/mudlib/std/environ/
skylib_fluffos_v3/mudlib/std/guilds/
skylib_fluffos_v3/mudlib/std/guilds/old/
skylib_fluffos_v3/mudlib/std/languages/
skylib_fluffos_v3/mudlib/std/liquids/
skylib_fluffos_v3/mudlib/std/npc/
skylib_fluffos_v3/mudlib/std/npc/goals/
skylib_fluffos_v3/mudlib/std/npc/goals/basic/
skylib_fluffos_v3/mudlib/std/npc/goals/misc/
skylib_fluffos_v3/mudlib/std/npc/plans/
skylib_fluffos_v3/mudlib/std/npc/plans/basic/
skylib_fluffos_v3/mudlib/std/npc/types/
skylib_fluffos_v3/mudlib/std/npc/types/helper/
skylib_fluffos_v3/mudlib/std/npcs/
skylib_fluffos_v3/mudlib/std/outsides/
skylib_fluffos_v3/mudlib/std/races/shadows/
skylib_fluffos_v3/mudlib/std/room/basic/BACKUPS/
skylib_fluffos_v3/mudlib/std/room/basic/topography/
skylib_fluffos_v3/mudlib/std/room/controller/
skylib_fluffos_v3/mudlib/std/room/inherit/topography/
skylib_fluffos_v3/mudlib/std/room/topography/area/
skylib_fluffos_v3/mudlib/std/room/topography/iroom/
skylib_fluffos_v3/mudlib/std/room/topography/milestone/
skylib_fluffos_v3/mudlib/std/shadows/curses/
skylib_fluffos_v3/mudlib/std/shadows/disease/
skylib_fluffos_v3/mudlib/std/shadows/fighting/
skylib_fluffos_v3/mudlib/std/shadows/healing/
skylib_fluffos_v3/mudlib/std/shadows/magic/
skylib_fluffos_v3/mudlib/std/shadows/poison/
skylib_fluffos_v3/mudlib/std/shadows/room/
skylib_fluffos_v3/mudlib/std/shops/controllers/
skylib_fluffos_v3/mudlib/std/shops/objs/
skylib_fluffos_v3/mudlib/std/shops/player_shop/
skylib_fluffos_v3/mudlib/std/socket/
skylib_fluffos_v3/mudlib/std/soul/d/
skylib_fluffos_v3/mudlib/std/soul/e/
skylib_fluffos_v3/mudlib/std/soul/i/
skylib_fluffos_v3/mudlib/std/soul/j/
skylib_fluffos_v3/mudlib/std/soul/k/
skylib_fluffos_v3/mudlib/std/soul/l/
skylib_fluffos_v3/mudlib/std/soul/n/
skylib_fluffos_v3/mudlib/std/soul/o/
skylib_fluffos_v3/mudlib/std/soul/q/
skylib_fluffos_v3/mudlib/std/soul/r/
skylib_fluffos_v3/mudlib/std/soul/u/
skylib_fluffos_v3/mudlib/std/soul/v/
skylib_fluffos_v3/mudlib/std/soul/y/
skylib_fluffos_v3/mudlib/std/soul/z/
skylib_fluffos_v3/mudlib/std/stationery/
skylib_fluffos_v3/mudlib/w/
skylib_fluffos_v3/mudlib/w/default/
skylib_fluffos_v3/mudlib/w/default/armour/
skylib_fluffos_v3/mudlib/w/default/clothes/
skylib_fluffos_v3/mudlib/w/default/item/
skylib_fluffos_v3/mudlib/w/default/npc/
skylib_fluffos_v3/mudlib/w/default/room/
skylib_fluffos_v3/mudlib/w/default/weapon/
skylib_fluffos_v3/mudlib/www/
skylib_fluffos_v3/mudlib/www/java/
skylib_fluffos_v3/mudlib/www/secure/
skylib_fluffos_v3/mudlib/www/secure/lpc/advanced/
skylib_fluffos_v3/mudlib/www/secure/lpc/intermediate/
skylib_fluffos_v3/win32/
/**
 * The header file for player-run shops.
 * The aim of the player-run shop is to provide an environment
 * where players can interact with each other, and the shop, with
 * no interference from creators.  Ideally, once the shop is set
 * up, and with the exception of the implementation of new features
 * or code maintenance, no further input should be required.  All
 * administration tasks can be performed by players.  These tasks
 * typically include:
 * <LI>adding and removing stock</LI>
 * <LI>personnel decisions (hiring/firing/disciplinary)</LI>
 * <LI>deciding what to stock & for how much it is bought/sold</LI>
 * <LI>increasing/decreasing stock capacity (for a price)</LI>
 * <LI>setting pay & bonus levels</LI>
 * <BR>
 * The only involvement needed by a creator after setup is the 
 * initial role of manager until employees have been promoted to
 * take this position.<BR>
 * <BR>
 * I will describe the workings of the shop in five sections.  These
 * will be from the point of view of a customer, employee, supervisor,
 * manager, and general.  This last section will discuss in greater
 * detail the way things work.<BR>
 * <BR>
 * Customers
 * From a customers' point of view, the shop should appear to function
 * similarly to a normal shop, with the obvious addition of players
 * acting as shopkeepers.  In the absence of players, there is an npc
 * shopkeeper to serve customers.  The npc has two customer interfaces.
 * Firstly, it will recognise the standard "buy", "sell", "list", "browse"
 * commands, and it will also recognise certain patterns of speech to
 * perform the same function.  The npc will then react to the customer's
 * request, performing the same actions as a player would.  A bell is
 * provided on the counter to alert any employees logged onto DW in the
 * event that the npc is not available.  Employees that are clocked in
 * are listed in the description of the shop front.  It is here that a
 * customer may make a complaint, suggestion, or apply for employment with
 * the shop.  These applications are mailed to each manager.  Confirmations
 * of employment, or cancellations of application are also made here.<BR>
 * <BR>
 * Employees
 * Once an application has been accepted, confirmed, and subject to any
 * vacancies, the applicant is hired and becomes an employee of the shop.
 * Employees are able to move past the counter into the room beyond.  From
 * here, it should be possible to access the office, storeroom and managers'
 * office.  Employees are responsible for replenishing stock and serving
 * customers.  Each is given a staff handbook and a special badge which
 * acts as a talker, allowing employees to keep in touch on a dedicated
 * channel.  This channel is also used by the shop bell to alert employees
 * to a customer in the shop.<BR>
 * Before undertaking any actions in the shop, it is important that the
 * employee clocks on in the office.  Also in the office is the shop's
 * chart, listing the lines of stock carried.  This chart displays the
 * buying and selling price, as well as the number of items currently
 * in stock.  The stock itself is held in the stockroom, in one or more
 * stock cabinets.  Each item is allocated a cabinet and the employee can
 * either place items in a specific cabinet, or let the stockroom work out
 * where they should go.  Similarly, an employee can specify which cabinet
 * to remove stock from, or let the stockroom determine that.  Listing stock
 * is an artform in itself - stock can be listed by item, cabinet, item in
 * cabinet, or all stock.  Creators have access to most commands - try it
 * for yourself.<BR>
 * When buying or selling items, the employee will need to handle money.
 * This is kept in the register behind the counter.  Along with the stock,
 * all changes made are logged and viewable by supervisors and managers.
 * The logbook behind the counter is for employees to record for themselves
 * what they have done and why.<BR>
 * Of course, a big incentive to do this work is to be paid for it.  Employees
 * are paid every DW month, direct into their bank account.  They also receive
 * a profit-related bonus each month, which they claim from the office.  Along
 * with the pay, they accumulate points towards promotion.  Promotion is now
 * not mandatory, and employees can deselect themselves if they wish not to be
 * promoted.  Any player with the "no score" property is automatically de-
 * selected.  Promotion is the only personnel issue that managers have no 
 * control over.  It is done automatically to minimise favouritism.  Once an
 * employee has achieved sufficient points, and subject to vacancies, they are
 * promoted to Supervisor.<BR>
 * <BR>
 * Supervisors
 * Supervisors receive a higher wage packet than employees - 1.5 times the
 * value, to be exact.  Their duties include those of the employees, with 
 * several additions.  They are responsible for deciding what items should
 * be bought and sold, and at what price.  Along with this, they assign
 * items to cabinets.  To assist them, they are able to view the general
 * and chart logs.  These logs indicate what is being bought/sold, and what
 * updates have been made to the chart.  Again, supervisors accumulate points
 * towards promotion, and will eventually be promoted to Manager.<BR>
 * <BR>
 * Managers
 * Managers receive double the wage of employees.  Their duties, however,
 * are quite involved.  They include setting staffing levels, pay rates,
 * renting new storage space, hiring/firing/disciplinary issues, and setting
 * the shop's policies.  This is in addition to the duties performed by
 * supervisors and employees.  Delegation would seem to play a part.<BR>
 * Managers cannot be promoted, and so have nothing to "work towards".
 * Experience has shown, however, that players in this position gain their
 * enthusiasm from the role itself, along with that pay packet.  This view
 * is reinforced by the fact that most managers will prefer to retire than
 * resign.  A retired manager has no active role in the shop, other than
 * voting on policy suggestions, and receives no pay.  Those employed by
 * Tarnach's have been shown to be happy acting as 'mentors'.<BR>
 * The main advantage of being a retired manager is the lack of commitment
 * needed - a manager must be very active in the shop, otherwise risking
 * demotion.  This demotion follows a warning, recorded on an employee's
 * record.  The same procedure applies to supervisors, within a longer 
 * timescale.  Employees have even longer, but risk being fired rather than
 * demoted.  These firings and demotions are automatic, and are one method
 * of staff turnover to help ensure a fair system to allow new employees
 * and promotions.  If an employee has a valid reason to be away, they can
 * notify a manager who can place them on leave.  This ensures they are
 * not fired or demoted if they are genuinely on holiday etc.<BR>
 * The code also includes a hook to the refresh handler.  The office is
 * registered automatically, and appropriate action taken when an employee
 * refreshes.  If the character is deleted, the employee data is also
 * deleted.  If an applicant refreshes, their application is terminated.
 * If a retired manager refreshes, their employment is terminated.  If any
 * other employee refreshes totally, their employment is terminated, but
 * if they only partially refresh, they revert to being a "new employee".
 * <BR>
 * General
 * This object is the nerve centre of the shop.  Most of the data structures
 * are defined and maintained from here, and virtually all of the managerial
 * functions are forwarded here.  It is this object that passes the common
 * variables across to other files as they call for them.  This minimises
 * the complexity of setting up each object - as long as they point to this
 * object, and this object is correctly set up, the objects will know which
 * shop they belong to, who the employees are, who the proprietor is etc.<BR>
 * Most of the functions defined in the office are not needed by creators.
 * Those that are needed are shown in the examples.  The other documented
 * functions are not necessary, but may be useful.<BR>
 * The data itself is saved into several files.  The data is arranged into
 * these files to minimise the amount of disk activity when changes are made.
 * For example, employee data changes every time an employee does something.
 * The list of applicants, however, changes only when an application status
 * changes.  They are, therefore, saved into seperate objects.  Also, each
 * save call is subject to a callout, and will limit the amount of disk
 * writing actually done. The only data not stored by this file is the stock
 * data, which is saved by each cabinet individually.  All data is saved to 
 * a secure directory under the shop name.<BR>
 * Logfiles are saved to a specified directory with the general log being
 * handled internally, all other logs handled by log_file().<BR>
 * The shop supports notice boards, posting all hirings, promotions, bonus
 * amounts in addition to any posts requested in the inheriting object.
 * In the absence of a board, all posts are mailed to each employee and
 * each employee will have access to an additional "memo" command in the
 * office.<BR>
 * Applications are handled automatically, with managers voting whether to
 * accept or reject an application.  On gaining positive votes from at least
 * 50% of the managers, an applicant is hired.  If they receive more than
 * 50% negative votes, they are rejected.  If there are insufficient votes
 * to settle the decision, it will be made based on votes cast after a 
 * period of time.  Policy suggestions are handled in a similar way.<BR>
 * <BR>
 * The shop's two main administration routines are run on a regular basis.
 * The first of these is run every day and is responsible for checking that
 * employees are still valid players (not deleted chars or creators).  It 
 * conducts automatic promotions, and handles demotions for inactive employees.
 * It also updates the lists of declined applicants and banned people and 
 * removes that status if applicable.  Finally, it calls the check_hire_list
 * function to see if we can hire any new employees.<BR>
 * The second is run every Discworld month.  This review involves paying
 * employees directly into their nominated bank account, and awarding bonuses
 * based on the current value of the bonus fund.<BR>
 *
 * @see /std/shops/player_shop/office.c
 * @see /std/shops/player_shop/mgr_office.c
 * @see /std/shops/player_shop/counter.c
 * @see /std/shops/player_shop/storerooom.c
 * @see /std/shops/player_shop/shop_front.c
 * @see /std/shops/player_shop/shopkeeper.c
 * @author Ringo
 * @started 1st August 1999
 */

#ifndef _PLAYER_SHOP_H
#define _PLAYER_SHOP_H

#define DEBUG
#undef TESTING

/**
 * Default maintainer of player shops.
 */
#define CREATOR "shiannar"

/**
 * The path to save data to
 */
#define SAVE_DIR "/save/player_shops/"
/**
 * Path to the shop cabinet object
 */
#define CABINET "/obj/misc/player_shop/shop_cabinet"
/**
 * Path to the shop badge object
 */
#define BADGE "/obj/misc/player_shop/shop_badge"
/**
 * Path to staff handbook
 */
#define STAFF_BOOK "/obj/misc/player_shop/staff_book"
/**
 * Path to the manager's handbook
 */
#define MGR_BOOK "/obj/misc/player_shop/mgr_book"
/**
 * Path to the shopping bag
 */
#define SHOP_BAG "/obj/misc/player_shop/shopping_bag"
/**
 * Path to the chart
 */
#define SHOP_CHART "/obj/misc/player_shop/shop_chart"
/**
 * Path to the policy notice
 */
#define SHOP_NOTICE "/obj/misc/player_shop/shop_notice"

/**
 * True value (1)
 */
#define TRUE 1
/**
 * False value (0)
 */
#define FALSE 0

/**
 * Employee mapping - points
 */
#define EMP_POINTS 0
/**
 * Employee mapping - last action time
 */
#define EMP_TIME 1
/**
 * Employee mapping - bank
 */
#define EMP_BANK 2
/**
 * Employee mapping - this month's pay
 */
#define EMP_PAY 3
/**
 * Employee mapping - inactivity flag
 */
#define EMP_INACTIVE 4
/**
 * Employee mapping - suspended bonus
 */
#define EMP_NOBONUS 5
/**
 * Employee mapping - Skip promotion.
 * This is done either at employee's request, or automatically
 * if the "no score" property is set.<br>
 * Set at -1 for "no score", or TRUE for employee request
 */
#define EMP_NOPROMOTE 6

/**
 * Employee bit - employee exists.
 */
#define EMPLOYEE 1
/**
 * Employee bit - employee is the npc shopkeeper.
 */
#define NPC 2
/**
 * Employee bit - employee is supervisor.
 */
#define SUPERVISOR 4
/**
 * Employee bit - employee is manager.
 */
#define MANAGER 8
/**
 * Employee bit - player is clocked in.
 */
#define CLOCKED_IN 16

/**
 * Number of points to become a manager.
 */
#define MANAGER_POINTS 1000
/**
 * Number of points to become a supervisor.
 */
#define SUPER_POINTS 500

/**
 * Banned people mapping - reason
 */
#define BAD_REASON 0
/**
 * Banned people mapping - banner 
 */
#define BAD_BANNER 1
/**
 * Banned people mapping - time of ban
 */
#define BAD_TIME 2

/**
 * Applications mapping - type of applicant
 */
#define APP_TYPE 0
/**
 * Applications mapping - time of application
 */
#define APP_TIME 1
/**
 * Applications mapping - votes for
 */
#define APP_FOR 2
/**
 * Applications mapping - votes against
 */
#define APP_AGAINST 3
/**
 * Applications mapping - abstentions
 */
#define APP_ABSTAIN 4

/**
 * Applicant types - Just applied
 */
#define APPLIED 1
/**
 * Applicant types - Voted in
 */
#define HIRED 2
/**
 * Applicant types - Awaiting a vacancy
 */
#define AWAITING 3

/**
 * Vote for an applicant
 */
#define VFOR      1
/**
 * Vote against an applicant
 */
#define VAGAINST  0
/**
 * Abstain on applicant
 */
#define VABSTAIN -1

/**
 * Minimum number of cabinets per storeroom
 */
#define MIN_CABINETS 5
/**
 * Maximum number of cabinets per storeroom
 */
#define MAX_CABINETS 20
/**
 * Maximum number of items per cabinet
 */
#define STOCK_PER_CABINET 50
/**
 * Maximum number of items in stock
 */
#define MAX_STOCK MAX_CABINETS * STOCK_PER_CABINET
/**
 * Price of cabinets
 */
#define CABINET_COST 400000

/**
 * Log entries - manual entry
 */
#define LOG_ENTRY 1
/**
 * Log entries - items purchased by shop.
 * Items added to stock, cash removed from till
 */
#define PURCHASE 2
/**
 * Log entries - items sold by shop.
 * Items removed from stock, cash added to till
 */
#define SALE 3
/**
 * Log entries - personnel issues (hire, fire, promote, demote,
 * warnings, retire, resign, on leave etc)
 */
#define PERSONNEL 4
/**
 * Log entries - accounts (pay/bonus/profit)
 */
#define ACCOUNTS 5
/** 
 * Log entries - general entries
 */
#define GENERAL 6
/**
 * Log entries - chart changes
 */
#define CHARTLOG 7

/**
 * Chart mapping - maximum stock
 */
#define CHART_MAX 0
/**
 * Chart mapping - average stock
 */
#define CHART_AVE 1
/**
 * Chart mapping - buy price
 */
#define CHART_BUY 2
/**
 * Chart mapping - sell price
 */
#define CHART_SELL 3
/**
 * Chart mapping - stock cabinet(s) used by this item
 */
#define CHART_CAB 4
/**
 * Chart mapping - average daily sales
 */
#define CHART_AVESALE 5
/**
 * Chart mapping - daily sales
 */
#define CHART_SOLD 6
/**
 * Chart mapping - daily purchases
 */
#define CHART_BOUGHT 7

/**
 * Path to the history handler used for chats through the badge
 */
#define HISTORY "/handlers/hist_handler"
/**
 * Path to the bank handler
 */
#define BANK "/handlers/bank_handler"
/**
 * Path to the refresh handler
 */
#define REFRESH "/handlers/refresh"

/**
 * List of banks.
 * The list is formatted as ({ ({ "Description", "Name" }) })<br>
 * Any new banks must be added to the end of this list to avoid 
 * upsetting existing employees ;-)
 */
#define BANKS ({ ({ "XXXXXX", "XXXXXX", }), \
              })

/**
 * How long to prevent someone ringing the shop bell again (seconds)
 */
#define BELL_TIMEOUT 120

/**
 * Minimum number of employees per shop
 */
#define MIN_EMP 10
/**
 * Maximum number of employees per shop
 */
#define MAX_EMP 40
/**
 * Percentage of employees that can be managers
 */
#define PERCENT_M 10
/**
 * Percentage of employees that can be supervisors
 */
#define PERCENT_S 20


/**
 * Default pay amount
 */
#define START_PAY 20

/** 
 * Maximum number of consecutive days an employee can be on leave
 */
#define MAX_LEAVE 14
/**
 * Length of ban from shop in days
 */
#define BAN_LENGTH 28
/**
 * Length of time (days) before an applicant can re-apply
 */
#define DECLINE_LENGTH 14
/**
 * Time (days) before managers demoted for inactivity
 */
#define MGR_DEMOTE 14
/**
 * Time (days) before managers warned for inactivity
 */
#define MGR_WARN 7
/**
 * Time (days) before supervisors demoted for inactivity
 */
#define SPR_DEMOTE 28
/**
 * Time (days) before supervisors warned for inactivity
 */
#define SPR_WARN 14
/**
 * Time (days) before employees fired for inactivity
 */
#define EMP_FIRE 62
/**
 * Time (days) before employees warned for inactivity
 */
#define EMP_WARN 14



/**
 * Length of time (days) to keep shop's logs
 */
#define LOG_DAYS 14

/**
 * Length of time (seconds) for hired applicants to confirm
 * their employment.
 */
#define HIRE_TIMEOUT 60*60*24*14

/**
 * Length of time (seconds) for a player's history to expire if
 * there has been no update.
 */
#define HIST_TIMEOUT 60*60*24*91

/**
 * Shopkeeper's movement & command delay
 */
#define NPC_DELAY 2 + random( 3 )
/**
 * Shopkeeper's reload delay (seconds)
 */
#define NPC_RELOAD 60*60

/**
 * Call-out delay for saving employee & shop data
 */
#define SAVE_DELAY 1
/**
 * Call-out delay for saving personnel data
 */
#define PERS_DELAY

/**
 * Prompt shown to player making a complaint
 */
#define COMPLAINT_TEXT "Please fully state your complaint below.  " \
                       "Include as much detail as you can and any " \
                       "evidence/witnesses to support your complaint."

/**
 * Prompt shown to player making a suggestion
 */
#define SUGGEST_TEXT "Please detail your suggestion below."

/**
 * Questions to ask an applicant for a job
 */
#define APP_QUESTIONS ({ "Why do you want to work for "+ \
                     _office->query_shop_name()+ "?", \
                     "What is your character's age?", \
                     "What relevant experience do you have of collecting " \
                      " and/or recognising our stock?", \
                     "How much time (hours/week) do you think you can " \
                     "commit to the shop?  Please also tell us at what " \
                     "time you will usually be on.", \
                     "Do you already know anyone who is an employee " \
                     "here, who could recommend you?  If so, who?", \
                     "Have you previously held a position at this shop?  " \
                     "If so, why did you leave?", \
                     "Do you currently work at any other shop?", \
                     "Have you applied for employment here before?  " \
                     "If so, what was the outcome?", \
                     "Do you have anything else you'd like to tell us in " \
                     "support of your application?  Please expand on above " \
                     "points if necessary.  What you say here will influence " \
                     "whether or not you are hired." \
                })
#endif