OSDN Git Service

c47a8ebb3d0263f338d35d754f8561f5efb19191
[hengband/hengband.git] / src / store.h
1 #pragma once
2
3 #include "angband.h"
4 #include "market/store-owners.h"
5
6 /*
7  * A store, with an owner, various state flags, a current stock
8  * of items, and a table of items that are often purchased.
9  */
10 typedef struct store_type store_type;
11
12 struct store_type
13 {
14         byte type;                              /* Store type */
15
16         byte owner;                             /* Owner index */
17         byte extra;                             /* Unused for now */
18
19         s16b insult_cur;                /* Insult counter */
20
21         s16b good_buy;                  /* Number of "good" buys */
22         s16b bad_buy;                   /* Number of "bad" buys */
23
24         s32b store_open;                /* Closed until this turn */
25
26         s32b last_visit;                /* Last visited on this turn */
27
28         s16b table_num;                 /* Table -- Number of entries */
29         s16b table_size;                /* Table -- Total Size of Array */
30         s16b *table;                    /* Table -- Legal item kinds */
31
32         s16b stock_num;                 /* Stock -- Number of entries */
33         s16b stock_size;                /* Stock -- Total Size of Array */
34         object_type *stock;             /* Stock -- Actual stock items */
35 };
36
37  /*
38   * Store constants
39   */
40 #define STORE_INVEN_MAX 24              /* Max number of discrete objs in inven */
41 #define STORE_OBJ_LEVEL 5               /* Magic Level for normal stores */
42 #define STORE_TURNOVER  9               /* Normal shop turnover, per day */
43 #define STORE_MIN_KEEP  6               /* Min slots to "always" keep full */
44 #define STORE_MAX_KEEP  18              /* Max slots to "always" keep full */
45 #define STORE_SHUFFLE   21              /* 1/Chance (per day) of an owner changing */
46 #define STORE_TICKS     1000            /* Number of ticks between turnovers */
47
48 /* store.c */
49 extern bool combine_and_reorder_home(int store_num);
50 extern void do_cmd_store(player_type *player_ptr);
51 extern void store_shuffle(player_type *player_ptr, int which);
52 extern void store_maint(player_type *player_ptr, int town_num, int store_num);
53 extern void store_init(int town_num, int store_num);