店の処理 / Store commands [詳細]
#include "angband.h"
マクロ定義 | |
#define | MIN_STOCK 12 |
#define | RUMOR_CHANCE 8 |
#define | MAX_COMMENT_1 6 |
#define | MAX_COMMENT_2A 2 |
#define | MAX_COMMENT_2B 12 |
#define | MAX_COMMENT_3A 2 |
#define | MAX_COMMENT_3B 12 |
#define | MAX_COMMENT_4A 4 |
#define | MAX_COMMENT_4B 4 |
#define | MAX_COMMENT_5 8 |
#define | MAX_COMMENT_6 4 |
#define | MAX_COMMENT_7A 4 |
#define | MAX_COMMENT_7B 4 |
#define | MAX_COMMENT_7C 4 |
#define | MAX_COMMENT_7D 4 |
関数 | |
static void | say_comment_1 (void) |
取引成功時の店主のメッセージ処理 / Successful haggle. [詳細] | |
static void | say_comment_2 (s32b value, int annoyed) |
プレイヤーがアイテムを買う時の価格代案メッセージ処理 / Continue haggling (player is buying) [詳細] | |
static void | say_comment_3 (s32b value, int annoyed) |
プレイヤーがアイテムを売る時の価格代案メッセージ処理 / Continue haggling (player is selling) [詳細] | |
static void | say_comment_4 (void) |
店主がプレイヤーを追い出す時のメッセージ処理 / Kick 'da bum out. [詳細] | |
static void | say_comment_5 (void) |
店主がプレイヤーに取り合わない時のメッセージ処理 / You are insulting me [詳細] | |
static void | say_comment_6 (void) |
店主がプレイヤーの提示を理解できなかった時のメッセージ処理 / That makes no sense. [詳細] | |
static void | purchase_analyze (s32b price, s32b value, s32b guess) |
店主が交渉を終えた際の反応を返す処理 / Let a shop-keeper React to a purchase [詳細] | |
static s32b | price_item (object_type *o_ptr, int greed, bool flip) |
店舗価格を決定する / Determine the price of an item (qty one) in a store. [詳細] | |
static void | mass_produce (object_type *o_ptr) |
安価な消耗品の販売数を増やし、低確率で割引にする / Certain "cheap" objects should be created in "piles" [詳細] | |
static bool | store_object_similar (object_type *o_ptr, object_type *j_ptr) |
店舗に並べた品を同一品であるかどうか判定する / Determine if a store item can "absorb" another item [詳細] | |
static void | store_object_absorb (object_type *o_ptr, object_type *j_ptr) |
店舗に並べた品を重ね合わせできるかどうか判定する / Allow a store item to absorb another item [詳細] | |
static int | store_check_num (object_type *o_ptr) |
店舗に品を置くスペースがあるかどうかの判定を返す / Check to see if the shop will be carrying too many objects -RAK- [詳細] | |
static bool | is_blessed (object_type *o_ptr) |
オブジェクトが祝福されているかの判定を返す / [詳細] | |
static bool | store_will_buy (object_type *o_ptr) |
オブジェクトが所定の店舗で引き取れるかどうかを返す / Determine if the current store will purchase the given item [詳細] | |
bool | combine_and_reorder_home (int store_num) |
現在の町の指定された店舗のアイテムを整理する / Combine and reorder items in store. [詳細] | |
static int | home_carry (object_type *o_ptr) |
我が家にオブジェクトを加える / Add the item "o_ptr" to the inventory of the "Home" [詳細] | |
static int | store_carry (object_type *o_ptr) |
店舗にオブジェクトを加える / Add the item "o_ptr" to a real stores inventory. [詳細] | |
static void | store_item_increase (int item, int num) |
店舗のオブジェクト数を増やす / Add the item "o_ptr" to a real stores inventory. [詳細] | |
static void | store_item_optimize (int item) |
店舗のオブジェクト数を削除する / Remove a slot if it is empty [詳細] | |
static bool | black_market_crap (object_type *o_ptr) |
ブラックマーケット用の無価値品の排除判定 / This function will keep 'crap' out of the black market. [詳細] | |
static void | store_delete (void) |
店舗の品揃え変化のためにアイテムを削除する / Attempt to delete (some of) a random item from the store [詳細] | |
static void | store_create (void) |
店舗の品揃え変化のためにアイテムを追加する / Creates a random item and gives it to a store [詳細] | |
static bool | noneedtobargain (s32b minprice) |
店舗の割引対象外にするかどうかを判定 / Eliminate need to bargain if player has haggled well in the past [詳細] | |
static void | updatebargain (s32b price, s32b minprice, int num) |
店主の持つプレイヤーに対する売買の良し悪し経験を記憶する / Update the bargain info [詳細] | |
static void | display_entry (int pos) |
店の商品リストを再表示する / Re-displays a single store entry [詳細] | |
static void | display_inventory (void) |
店の商品リストを表示する / Displays a store's inventory -RAK- [詳細] | |
static void | store_prt_gold (void) |
プレイヤーの所持金を表示する / Displays players gold -RAK- [詳細] | |
static void | display_store (void) |
店舗情報全体を表示するメインルーチン / Displays store (after clearing screen) -RAK- [詳細] | |
static int | get_stock (int *com_val, cptr pmt, int i, int j) |
店舗からアイテムを選択する / Get the ID of a store item and return its value -RAK- [詳細] | |
static int | increase_insults (void) |
店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う / Increase the insult counter and get angry if too many -RAK- [詳細] | |
static void | decrease_insults (void) |
店主の不満度を減らす / Decrease insults -RAK- [詳細] | |
static int | haggle_insults (void) |
店主の不満度が増えた場合のみのメッセージを表示する / Have insulted while haggling -RAK- [詳細] | |
static int | get_haggle (cptr pmt, s32b *poffer, s32b price, int final) |
交渉価格を確認と認証の是非を行う / Get a haggle [詳細] | |
static bool | receive_offer (cptr pmt, s32b *poffer, s32b last_offer, int factor, s32b price, int final) |
店主がプレイヤーからの交渉価格を判断する / Receive an offer (from the player) [詳細] | |
static bool | purchase_haggle (object_type *o_ptr, s32b *price) |
プレイヤーが購入する時の値切り処理メインルーチン / Haggling routine -RAK- [詳細] | |
static bool | sell_haggle (object_type *o_ptr, s32b *price) |
プレイヤーが売却する時の値切り処理メインルーチン / Haggling routine -RAK- [詳細] | |
static void | store_purchase (void) |
店からの購入処理のメインルーチン / Buy an item from a store -RAK- [詳細] | |
static void | store_sell (void) |
店からの売却処理のメインルーチン / Sell an item to the store (or home) [詳細] | |
static void | store_examine (void) |
店のアイテムを調べるコマンドのメインルーチン / Examine an item in a store -JDL- [詳細] | |
static void | museum_remove_object (void) |
博物館のアイテムを除去するコマンドのメインルーチン / Remove an item from museum (Originally from TOband) [詳細] | |
static void | store_process_command (void) |
店舗処理コマンド選択のメインルーチン / Process a command in a 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 inventory at the stores. [詳細] | |
void | store_init (int town_num, int store_num) |
店舗情報を初期化する / Initialize the stores [詳細] | |
void | move_to_black_market (object_type *o_ptr) |
アイテムを町のブラックマーケットに移動させる / [詳細] | |
変数 | |
static int | cur_store_num = 0 |
static int | store_top = 0 |
static int | store_bottom = 0 |
static int | xtra_stock = 0 |
static store_type * | st_ptr = NULL |
static const owner_type * | ot_ptr = NULL |
static s16b | old_town_num = 0 |
static s16b | inner_town_num = 0 |
static cptr | comment_1 [MAX_COMMENT_1] |
static cptr | comment_2a [MAX_COMMENT_2A] |
static cptr | comment_2b [MAX_COMMENT_2B] |
static cptr | comment_3a [MAX_COMMENT_3A] |
static cptr | comment_3b [MAX_COMMENT_3B] |
static cptr | comment_4a [MAX_COMMENT_4A] |
static cptr | comment_4b [MAX_COMMENT_4B] |
static cptr | comment_5 [MAX_COMMENT_5] |
static cptr | comment_6 [MAX_COMMENT_6] |
static cptr | comment_7a [MAX_COMMENT_7A] |
static cptr | comment_7b [MAX_COMMENT_7B] |
static cptr | comment_7c [MAX_COMMENT_7C] |
static cptr | comment_7d [MAX_COMMENT_7D] |
static int | cur_store_feat |
static byte | rgold_adj [MAX_RACES][MAX_RACES] |
static bool | allow_inc = FALSE |
static s32b | last_inc = 0L |
static bool | leave_store = FALSE |
店の処理 / Store commands
#define MAX_COMMENT_1 6 |
#define MAX_COMMENT_2A 2 |
#define MAX_COMMENT_2B 12 |
#define MAX_COMMENT_3A 2 |
#define MAX_COMMENT_3B 12 |
#define MAX_COMMENT_4A 4 |
#define MAX_COMMENT_4B 4 |
#define MAX_COMMENT_5 8 |
#define MAX_COMMENT_6 4 |
#define MAX_COMMENT_7A 4 |
#define MAX_COMMENT_7B 4 |
#define MAX_COMMENT_7C 4 |
#define MAX_COMMENT_7D 4 |
#define MIN_STOCK 12 |
#define RUMOR_CHANCE 8 |
|
static |
ブラックマーケット用の無価値品の排除判定 / This function will keep 'crap' out of the black market.
o_ptr | 判定したいオブジェクトの構造体参照ポインタ |
Crap is defined as any item that is "available" elsewhere Based on a suggestion by "Lee Vogt" lvogt @cig .mcel .mot .com
bool combine_and_reorder_home | ( | int | store_num | ) |
現在の町の指定された店舗のアイテムを整理する / Combine and reorder items in store.
store_num | 店舗ID |
|
static |
店主の不満度を減らす / Decrease insults -RAK-
|
static |
店の商品リストを再表示する / Re-displays a single store entry
pos | 表示行 |
|
static |
店の商品リストを表示する / Displays a store's inventory -RAK-
All prices are listed as "per individual object". -BEN-
|
static |
店舗情報全体を表示するメインルーチン / Displays store (after clearing screen) -RAK-
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).
交渉価格を確認と認証の是非を行う / Get a haggle
pmt | メッセージ |
poffer | 別途価格提示をした場合の値を返す参照ポインタ |
price | 現在の交渉価格 |
final | 最終確定価格ならばTRUE |
|
static |
店舗からアイテムを選択する / Get the ID of a store item and return its value -RAK-
com_val | 選択IDを返す参照ポインタ |
pmt | メッセージキャプション |
i | 選択範囲の最小値 |
j | 選択範囲の最大値 |
|
static |
店主の不満度が増えた場合のみのメッセージを表示する / Have insulted while haggling -RAK-
|
static |
我が家にオブジェクトを加える / Add the item "o_ptr" to the inventory of the "Home"
o_ptr | 加えたいオブジェクトの構造体参照ポインタ |
In all cases, return the slot (or -1) where the object was placed Note that this is a hacked up version of "inven_carry()". Also note that it may not correctly "adapt" to "knowledge" bacoming known, the player may have to pick stuff up and drop it again.
|
static |
店主の不満度を増やし、プレイヤーを締め出す判定と処理を行う / Increase the insult counter and get angry if too many -RAK-
|
static |
オブジェクトが祝福されているかの判定を返す /
o_ptr | 判定したいオブジェクト構造体の参照ポインタ |
|
static |
安価な消耗品の販売数を増やし、低確率で割引にする / Certain "cheap" objects should be created in "piles"
o_ptr | 店舗に並べるオブジェクト構造体の参照ポインタ |
Some objects can be sold at a "discount" (in small piles)
void move_to_black_market | ( | object_type * | o_ptr | ) |
アイテムを町のブラックマーケットに移動させる /
o_ptr | 移動させたいオブジェクトの構造体参照ポインタ |
|
static |
博物館のアイテムを除去するコマンドのメインルーチン / Remove an item from museum (Originally from TOband)
店舗の割引対象外にするかどうかを判定 / Eliminate need to bargain if player has haggled well in the past
minprice | アイテムの最低販売価格 |
|
static |
店舗価格を決定する / Determine the price of an item (qty one) in a store.
o_ptr | 店舗に並べるオブジェクト構造体の参照ポインタ |
greed | 店主の強欲度 |
flip | TRUEならば店主にとっての買取価格、FALSEなら売出価格を計算 |
This function takes into account the player's charisma, and the shop-keepers friendliness, and the shop-keeper's base greed, but never lets a shop-keeper lose money in a transaction. The "greed" value should exceed 100 when the player is "buying" the item, and should be less than 100 when the player is "selling" it. Hack – the black market always charges twice as much as it should. Charisma adjustment runs from 80 to 130 Racial adjustment runs from 95 to 130 Since greed/charisma/racial adjustments are centered at 100, we need to adjust (by 200) to extract a usable multiplier. Note that the "greed" value is always something (?).
店主が交渉を終えた際の反応を返す処理 / Let a shop-keeper React to a purchase
price | アイテムの取引額 |
value | アイテムの実際価値 |
guess | 店主が当初予想していた価値 |
We paid "price", it was worth "value", and we thought it was worth "guess"
|
static |
プレイヤーが購入する時の値切り処理メインルーチン / Haggling routine -RAK-
o_ptr | オブジェクトの構造体参照ポインタ |
price | 最終価格を返す参照ポインタ |
|
static |
店主がプレイヤーからの交渉価格を判断する / Receive an offer (from the player)
pmt | メッセージ |
poffer | 店主からの交渉価格を返す参照ポインタ |
last_offer | 現在の交渉価格 |
factor | 店主の価格基準倍率 |
price | アイテムの実価値 |
final | 最終価格確定ならばTRUE |
|
static |
取引成功時の店主のメッセージ処理 / Successful haggle.
|
static |
プレイヤーがアイテムを買う時の価格代案メッセージ処理 / Continue haggling (player is buying)
value | 店主の提示価格 |
annoyed | 店主のいらつき度 |
|
static |
プレイヤーがアイテムを売る時の価格代案メッセージ処理 / Continue haggling (player is selling)
value | 店主の提示価格 |
annoyed | 店主のいらつき度 |
|
static |
店主がプレイヤーを追い出す時のメッセージ処理 / Kick 'da bum out.
-RAK-
|
static |
店主がプレイヤーに取り合わない時のメッセージ処理 / You are insulting me
|
static |
店主がプレイヤーの提示を理解できなかった時のメッセージ処理 / That makes no sense.
|
static |
プレイヤーが売却する時の値切り処理メインルーチン / Haggling routine -RAK-
o_ptr | オブジェクトの構造体参照ポインタ |
price | 最終価格を返す参照ポインタ |
|
static |
店舗にオブジェクトを加える / Add the item "o_ptr" to a real stores inventory.
o_ptr | 加えたいオブジェクトの構造体参照ポインタ |
In all cases, return the slot (or -1) where the object was placed Note that this is a hacked up version of "inven_carry()". Also note that it may not correctly "adapt" to "knowledge" bacoming known, the player may have to pick stuff up and drop it again.
|
static |
店舗に品を置くスペースがあるかどうかの判定を返す / Check to see if the shop will be carrying too many objects -RAK-
o_ptr | 店舗に置きたいオブジェクト構造体の参照ポインタ |
Note that the shop, just like a player, will not accept things it cannot hold. Before, one could "nuke" potions this way. Return value is now int: 0 : No space -1 : Can be combined to existing slot. 1 : Cannot be combined but there are empty spaces.
|
static |
店舗の品揃え変化のためにアイテムを追加する / Creates a random item and gives it to a store
This algorithm needs to be rethought. A lot. Currently, "normal" stores use a pre-built array. Note – the "level" given to "obj_get_num()" is a "favored" level, that is, there is a much higher chance of getting items with a level approaching that of the given level... Should we check for "permission" to have the given item?
|
static |
店舗の品揃え変化のためにアイテムを削除する / Attempt to delete (some of) a random item from the store
Hack – we attempt to "maintain" piles of items when possible.
|
static |
店のアイテムを調べるコマンドのメインルーチン / Examine an item in a store -JDL-
void store_init | ( | int | town_num, |
int | store_num | ||
) |
店舗情報を初期化する / Initialize the stores
town_num | 町のID |
store_num | 店舗種類のID |
|
static |
店舗のオブジェクト数を増やす / Add the item "o_ptr" to a real stores inventory.
item | 増やしたいアイテムのID |
num | 増やしたい数 |
Increase, by a given amount, the number of a certain item in a certain store. This can result in zero items.
|
static |
店舗のオブジェクト数を削除する / Remove a slot if it is empty
item | 削除したいアイテムのID |
void store_maint | ( | int | town_num, |
int | store_num | ||
) |
店の品揃えを変化させる / Maintain the inventory at the stores.
town_num | 町のID |
store_num | 店舗種類のID |
|
static |
店舗に並べた品を重ね合わせできるかどうか判定する / Allow a store item to absorb another item
o_ptr | 判定するオブジェクト構造体の参照ポインタ1 |
j_ptr | 判定するオブジェクト構造体の参照ポインタ2 |
See "object_similar()" for the same function for the "player"
|
static |
店舗に並べた品を同一品であるかどうか判定する / Determine if a store item can "absorb" another item
o_ptr | 判定するオブジェクト構造体の参照ポインタ1 |
j_ptr | 判定するオブジェクト構造体の参照ポインタ2 |
See "object_similar()" for the same function for the "player"
|
static |
店舗処理コマンド選択のメインルーチン / Process a command in a store
Note that we must allow the use of a few "special" commands in the stores which are not allowed in the dungeon, and we must disable some commands which are allowed in the dungeon but not in the stores, to prevent chaos.
|
static |
プレイヤーの所持金を表示する / Displays players gold -RAK-
|
static |
店からの購入処理のメインルーチン / Buy an item from a store -RAK-
|
static |
店からの売却処理のメインルーチン / Sell an item to the store (or home)
void store_shuffle | ( | int | which | ) |
現在の町の店主を交代させる / Shuffle one of the stores.
which | 店舗種類のID |
|
static |
オブジェクトが所定の店舗で引き取れるかどうかを返す / Determine if the current store will purchase the given item
o_ptr | 判定したいオブジェクト構造体の参照ポインタ |
店主の持つプレイヤーに対する売買の良し悪し経験を記憶する / Update the bargain info
price | 実際の取引価格 |
minprice | 店主の提示した価格 |
num | 売買数 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |