Hengband  2.2.1
データ構造 | マクロ定義 | 型定義 | 関数 | 変数
store.h ファイル
被依存関係図:

[ソースコード]

データ構造

struct  owner_type
 
struct  store_type
 

マクロ定義

#define STORE_GENERAL   0
 店舗の種類: 雑貨屋 [詳解]
 
#define STORE_ARMOURY   1
 店舗の種類: 防具屋 [詳解]
 
#define STORE_WEAPON   2
 店舗の種類: 武器屋 [詳解]
 
#define STORE_TEMPLE   3
 店舗の種類: 寺院 [詳解]
 
#define STORE_ALCHEMIST   4
 店舗の種類: 錬金術の店 [詳解]
 
#define STORE_MAGIC   5
 店舗の種類: 魔道具屋 [詳解]
 
#define STORE_BLACK   6
 店舗の種類: ブラック・マーケット [詳解]
 
#define STORE_HOME   7
 店舗の種類: 我が家 [詳解]
 
#define STORE_BOOK   8
 店舗の種類: 書店 [詳解]
 
#define STORE_MUSEUM   9
 店舗の種類: 博物館 [詳解]
 
#define MAX_STORES   10
 store.c用の店舗の種類最大数 / Total number of stores (see "store.c", etc) [詳解]
 
#define MAX_OWNERS   32
 各店舗毎の店主定義最大数 / Total number of owners per store (see "store.c", etc) [詳解]
 
#define STORE_INVEN_MAX   24 /* Max number of discrete objs in inven */
 
#define STORE_CHOICES   48 /* Number of items to choose stock from */
 
#define STORE_OBJ_LEVEL   5 /* Magic Level for normal stores */
 
#define STORE_TURNOVER   9 /* Normal shop turnover, per day */
 
#define STORE_MIN_KEEP   6 /* Min slots to "always" keep full */
 
#define STORE_MAX_KEEP   18 /* Max slots to "always" keep full */
 
#define STORE_SHUFFLE   21 /* 1/Chance (per day) of an owner changing */
 
#define STORE_TICKS   1000 /* Number of ticks between turnovers */
 

型定義

typedef struct owner_type owner_type
 
typedef struct store_type store_type
 

関数

bool combine_and_reorder_home (int store_num)
 現在の町の指定された店舗のアイテムを整理する / Combine and reorder items in store. [詳解]
 
void do_cmd_store (void)
 店舗処理全体のメインルーチン / Enter a store, and interact with it. [詳解]
 
void store_shuffle (int which)
 現在の町の店主を交代させる / Shuffle one of the stores. [詳解]
 
void store_maint (int town_num, int store_num)
 店の品揃えを変化させる / Maintain the p_ptr->inventory_list at the stores. [詳解]
 
void store_init (int town_num, int store_num)
 店舗情報を初期化する / Initialize the stores [詳解]
 
void move_to_black_market (object_type *o_ptr)
 アイテムを町のブラックマーケットに移動させる / [詳解]
 

変数

const owner_type owners [MAX_STORES][MAX_OWNERS]
 闘技場のモンスターID及び報酬アイテムテーブル / Store owners (exactly four "possible" owners per store, chosen randomly) [詳解]
 
byte store_table [MAX_STORES][STORE_CHOICES][2]
 店舗で販売するオブジェクトを定義する / Hack – Objects sold in the stores – by tval/sval pair. [詳解]
 

マクロ定義詳解

◆ MAX_OWNERS

#define MAX_OWNERS   32

各店舗毎の店主定義最大数 / Total number of owners per store (see "store.c", etc)

◆ MAX_STORES

#define MAX_STORES   10

store.c用の店舗の種類最大数 / Total number of stores (see "store.c", etc)

◆ STORE_ALCHEMIST

#define STORE_ALCHEMIST   4

店舗の種類: 錬金術の店

◆ STORE_ARMOURY

#define STORE_ARMOURY   1

店舗の種類: 防具屋

◆ STORE_BLACK

#define STORE_BLACK   6

店舗の種類: ブラック・マーケット

◆ STORE_BOOK

#define STORE_BOOK   8

店舗の種類: 書店

◆ STORE_CHOICES

#define STORE_CHOICES   48 /* Number of items to choose stock from */

◆ STORE_GENERAL

#define STORE_GENERAL   0

店舗の種類: 雑貨屋

◆ STORE_HOME

#define STORE_HOME   7

店舗の種類: 我が家

◆ STORE_INVEN_MAX

#define STORE_INVEN_MAX   24 /* Max number of discrete objs in inven */

◆ STORE_MAGIC

#define STORE_MAGIC   5

店舗の種類: 魔道具屋

◆ STORE_MAX_KEEP

#define STORE_MAX_KEEP   18 /* Max slots to "always" keep full */

◆ STORE_MIN_KEEP

#define STORE_MIN_KEEP   6 /* Min slots to "always" keep full */

◆ STORE_MUSEUM

#define STORE_MUSEUM   9

店舗の種類: 博物館

◆ STORE_OBJ_LEVEL

#define STORE_OBJ_LEVEL   5 /* Magic Level for normal stores */

◆ STORE_SHUFFLE

#define STORE_SHUFFLE   21 /* 1/Chance (per day) of an owner changing */

◆ STORE_TEMPLE

#define STORE_TEMPLE   3

店舗の種類: 寺院

◆ STORE_TICKS

#define STORE_TICKS   1000 /* Number of ticks between turnovers */

◆ STORE_TURNOVER

#define STORE_TURNOVER   9 /* Normal shop turnover, per day */

◆ STORE_WEAPON

#define STORE_WEAPON   2

店舗の種類: 武器屋

型定義詳解

◆ owner_type

typedef struct owner_type owner_type

◆ store_type

typedef struct store_type store_type

関数詳解

◆ combine_and_reorder_home()

bool combine_and_reorder_home ( int  store_num)

現在の町の指定された店舗のアイテムを整理する / Combine and reorder items in store.

引数
store_num店舗ID
戻り値
実際に整理が行われたならばTRUEを返す。
呼び出し関係図:

◆ do_cmd_store()

void do_cmd_store ( void  )

店舗処理全体のメインルーチン / Enter a store, and interact with it.

  • 戻り値
    なし
    覚え書き
    Note that we use the standard "request_command()" function
    to get a command, allowing us to use "command_arg" and all
    command macros and other nifty stuff, but we use the special
    "shopping" argument, to force certain commands to be converted
    into other commands, normally, we convert "p" (pray) and "m"
    (cast magic) into "g" (get), and "s" (search) into "d" (drop).
    
呼び出し関係図:

◆ move_to_black_market()

void move_to_black_market ( object_type o_ptr)

アイテムを町のブラックマーケットに移動させる /

引数
o_ptr移動させたいオブジェクトの構造体参照ポインタ
戻り値
なし
呼び出し関係図:

◆ store_init()

void store_init ( int  town_num,
int  store_num 
)

店舗情報を初期化する / Initialize the stores

引数
town_num町のID
store_num店舗種類のID
戻り値
なし
呼び出し関係図:

◆ store_maint()

void store_maint ( int  town_num,
int  store_num 
)

店の品揃えを変化させる / Maintain the p_ptr->inventory_list at the stores.

引数
town_num町のID
store_num店舗種類のID
戻り値
なし
呼び出し関係図:

◆ store_shuffle()

void store_shuffle ( int  which)

現在の町の店主を交代させる / Shuffle one of the stores.

引数
which店舗種類のID
戻り値
なし
呼び出し関係図:

変数詳解

◆ owners

闘技場のモンスターID及び報酬アイテムテーブル / Store owners (exactly four "possible" owners per store, chosen randomly)

{ name, purse, max greed, min greed, haggle_per, tolerance, race, unused }
Lifted extra shopkeepers from CthAngband (don't you just love open source
development? ;-)). Since this gave less than 32 unique names for some
shops, those have their first x names copied to reach 32.
For the weapon and armour shops, several owners have a limit of 5k.
I want to do 50k owners, but the purse is currently s16b. Perhaps
we should just store 1/10th of the purse?

◆ store_table

byte store_table[MAX_STORES][STORE_CHOICES][2]

店舗で販売するオブジェクトを定義する / Hack – Objects sold in the stores – by tval/sval pair.