Hengband  2.2.1
store.h
[詳解]
1 #pragma once
2 
3 /*
4  * A store owner
5  */
6 typedef struct owner_type owner_type;
7 
8 struct owner_type
9 {
10  concptr owner_name; /* Name */
11  PRICE max_cost; /* Purse limit */
12  byte max_inflate; /* Inflation (max) */
13  byte min_inflate; /* Inflation (min) */
14  byte haggle_per; /* Haggle unit */
15  byte insult_max; /* Insult limit */
16  byte owner_race; /* Owner race */
17 };
18 
19 
20 /*
21  * A store, with an owner, various state flags, a current stock
22  * of items, and a table of items that are often purchased.
23  */
24 typedef struct store_type store_type;
25 
26 struct store_type
27 {
28  byte type; /* Store type */
29 
30  byte owner; /* Owner index */
31  byte extra; /* Unused for now */
32 
33  s16b insult_cur; /* Insult counter */
34 
35  s16b good_buy; /* Number of "good" buys */
36  s16b bad_buy; /* Number of "bad" buys */
37 
38  s32b store_open; /* Closed until this turn */
39 
40  s32b last_visit; /* Last visited on this turn */
41 
42  s16b table_num; /* Table -- Number of entries */
43  s16b table_size; /* Table -- Total Size of Array */
44  s16b *table; /* Table -- Legal item kinds */
45 
46  s16b stock_num; /* Stock -- Number of entries */
47  s16b stock_size; /* Stock -- Total Size of Array */
48  object_type *stock; /* Stock -- Actual stock items */
49 };
50 
51 /*
52  * Store types
53  */
54 #define STORE_GENERAL 0 /*!< 店舗の種類: 雑貨屋 */
55 #define STORE_ARMOURY 1 /*!< 店舗の種類: 防具屋 */
56 #define STORE_WEAPON 2 /*!< 店舗の種類: 武器屋 */
57 #define STORE_TEMPLE 3 /*!< 店舗の種類: 寺院 */
58 #define STORE_ALCHEMIST 4 /*!< 店舗の種類: 錬金術の店 */
59 #define STORE_MAGIC 5 /*!< 店舗の種類: 魔道具屋 */
60 #define STORE_BLACK 6 /*!< 店舗の種類: ブラック・マーケット */
61 #define STORE_HOME 7 /*!< 店舗の種類: 我が家 */
62 #define STORE_BOOK 8 /*!< 店舗の種類: 書店 */
63 #define STORE_MUSEUM 9 /*!< 店舗の種類: 博物館 */
64 #define MAX_STORES 10 /*!< store.c用の店舗の種類最大数 / Total number of stores (see "store.c", etc) */
65 
66 #define MAX_OWNERS 32 /*!< 各店舗毎の店主定義最大数 / Total number of owners per store (see "store.c", etc) */
67 
68  /*
69  * Store constants
70  */
71 #define STORE_INVEN_MAX 24 /* Max number of discrete objs in inven */
72 #define STORE_CHOICES 48 /* Number of items to choose stock from */
73 #define STORE_OBJ_LEVEL 5 /* Magic Level for normal stores */
74 #define STORE_TURNOVER 9 /* Normal shop turnover, per day */
75 #define STORE_MIN_KEEP 6 /* Min slots to "always" keep full */
76 #define STORE_MAX_KEEP 18 /* Max slots to "always" keep full */
77 #define STORE_SHUFFLE 21 /* 1/Chance (per day) of an owner changing */
78 #define STORE_TICKS 1000 /* Number of ticks between turnovers */
79 
80 /* store.c */
81 extern bool combine_and_reorder_home(int store_num);
82 extern void do_cmd_store(void);
83 extern void store_shuffle(int which);
84 extern void store_maint(int town_num, int store_num);
85 extern void store_init(int town_num, int store_num);
86 extern void move_to_black_market(object_type * o_ptr);
87 
88 extern const owner_type owners[MAX_STORES][MAX_OWNERS];
89 
90 extern byte store_table[MAX_STORES][STORE_CHOICES][2];
91 
92 
93 
byte extra
Definition: store.h:31
void store_maint(int town_num, int store_num)
店の品揃えを変化させる / Maintain the p_ptr->inventory_list at the stores.
Definition: store.c:6053
const char * concptr
文字列定数用ポインタ定義 / A simple pointer (to unmodifiable strings)
Definition: h-type.h:47
PRICE max_cost
Definition: store.h:11
byte store_table[MAX_STORES][STORE_CHOICES][2]
店舗で販売するオブジェクトを定義する / Hack – Objects sold in the stores – by tval/sval pair.
Definition: store.c:1081
s16b bad_buy
Definition: store.h:36
Definition: object.h:189
s32b last_visit
Definition: store.h:40
s16b stock_num
Definition: store.h:46
#define STORE_CHOICES
Definition: store.h:72
byte min_inflate
Definition: store.h:13
byte max_inflate
Definition: store.h:12
const owner_type owners[MAX_STORES][MAX_OWNERS]
闘技場のモンスターID及び報酬アイテムテーブル / Store owners (exactly four "possible" owners per store, chosen randomly)
Definition: store.c:68
Definition: store.h:8
void store_shuffle(int which)
現在の町の店主を交代させる / Shuffle one of the stores.
Definition: store.c:5983
s32b store_open
Definition: store.h:38
Definition: store.h:26
signed long s32b
Definition: h-type.h:107
s16b insult_cur
Definition: store.h:33
#define MAX_STORES
store.c用の店舗の種類最大数 / Total number of stores (see "store.c", etc)
Definition: store.h:64
s16b * table
Definition: store.h:44
s16b table_num
Definition: store.h:42
concptr owner_name
Definition: store.h:10
bool combine_and_reorder_home(int store_num)
現在の町の指定された店舗のアイテムを整理する / Combine and reorder items in store.
Definition: store.c:2867
byte owner_race
Definition: store.h:16
s16b table_size
Definition: store.h:43
byte haggle_per
Definition: store.h:14
object_type * stock
Definition: store.h:48
void store_init(int town_num, int store_num)
店舗情報を初期化する / Initialize the stores
Definition: store.c:6137
byte type
Definition: store.h:28
void move_to_black_market(object_type *o_ptr)
アイテムを町のブラックマーケットに移動させる /
Definition: store.c:6192
s16b stock_size
Definition: store.h:47
s32b PRICE
ゲーム中の金額価値の型定義
Definition: h-type.h:209
signed short s16b
Definition: h-type.h:98
byte insult_max
Definition: store.h:15
byte owner
Definition: store.h:30
#define MAX_OWNERS
各店舗毎の店主定義最大数 / Total number of owners per store (see "store.c", etc)
Definition: store.h:66
s16b good_buy
Definition: store.h:35
void do_cmd_store(void)
店舗処理全体のメインルーチン / Enter a store, and interact with it.
Definition: store.c:5706