Hengband  2.1.4
 全て データ構造 ファイル 関数 変数 型定義 マクロ定義 ページ
関数
cmd6.c

プレイヤーのアイテムに関するコマンドの実装2 / Spell/Prayer commands [詳細]

#include "angband.h"
cmd6.cのインクルード依存関係図

関数

static void do_cmd_eat_food_aux (int item)
 食料を食べるコマンドのサブルーチン [詳細]
 
static bool item_tester_hook_eatable (object_type *o_ptr)
 オブジェクトをプレイヤーが食べることができるかを判定する / Hook to determine if an object is eatable [詳細]
 
void do_cmd_eat_food (void)
 食料を食べるコマンドのメインルーチン / Eat some food (from the pack or floor) [詳細]
 
static void do_cmd_quaff_potion_aux (int item)
 薬を飲むコマンドのサブルーチン / Quaff a potion (from the pack or the floor) [詳細]
 
static bool item_tester_hook_quaff (object_type *o_ptr)
 オブジェクトをプレイヤーが飲むことができるかを判定する / Hook to determine if an object can be quaffed [詳細]
 
void do_cmd_quaff_potion (void)
 薬を飲むコマンドのメインルーチン / Quaff some potion (from the pack or floor) [詳細]
 
static void do_cmd_read_scroll_aux (int item, bool known)
 巻物を読むコマンドのサブルーチン Read a scroll (from the pack or floor). [詳細]
 
static bool item_tester_hook_readable (object_type *o_ptr)
 オブジェクトをプレイヤーが読むことができるかを判定する / Hook to determine if an object is readable [詳細]
 
void do_cmd_read_scroll (void)
 読むコマンドのメインルーチン / Eat some food (from the pack or floor) [詳細]
 
static int staff_effect (int sval, bool *use_charge, bool powerful, bool magic, bool known)
 杖の効果を発動する [詳細]
 
static void do_cmd_use_staff_aux (int item)
 杖を使うコマンドのサブルーチン / Use a staff. [詳細]
 
void do_cmd_use_staff (void)
 杖を使うコマンドのメインルーチン / [詳細]
 
static int wand_effect (int sval, int dir, bool powerful, bool magic)
 魔法棒の効果を発動する [詳細]
 
static void do_cmd_aim_wand_aux (int item)
 魔法棒を使うコマンドのサブルーチン / Aim a wand (from the pack or floor). [詳細]
 
void do_cmd_aim_wand (void)
 魔法棒を使うコマンドのメインルーチン / [詳細]
 
static int rod_effect (int sval, int dir, bool *use_charge, bool powerful, bool magic)
 ロッドの効果を発動する [詳細]
 
static void do_cmd_zap_rod_aux (int item)
 魔法棒を使うコマンドのサブルーチン / Activate (zap) a Rod [詳細]
 
void do_cmd_zap_rod (void)
 ロッドを使うコマンドのメインルーチン / [詳細]
 
static bool item_tester_hook_activate (object_type *o_ptr)
 オブジェクトをプレイヤーが魔道具として発動できるかを判定する / Hook to determine if an object is activatable [詳細]
 
void ring_of_power (int dir)
 『一つの指輪』の効果処理 / Hack – activate the ring of power [詳細]
 
static bool ang_sort_comp_pet (vptr u, vptr v, int a, int b)
 ペット入りモンスターボールをソートするための比較関数 [詳細]
 
static void do_cmd_activate_aux (int item)
 装備を発動するコマンドのサブルーチン / Activate a wielded object. [詳細]
 
void do_cmd_activate (void)
 装備を発動するコマンドのメインルーチン / [詳細]
 
static bool item_tester_hook_use (object_type *o_ptr)
 オブジェクトをプレイヤーが簡易使用コマンドで利用できるかを判定する / Hook to determine if an object is useable [詳細]
 
void do_cmd_use (void)
 アイテムを汎用的に「使う」コマンドのメインルーチン / Use an item [詳細]
 
static int select_magic_eater (bool only_browse)
 魔道具術師の取り込んだ魔力一覧から選択/閲覧する / [詳細]
 
bool do_cmd_magic_eater (bool only_browse, bool powerful)
 取り込んだ魔力を利用するコマンドのメインルーチン / Use eaten rod, wand or staff [詳細]
 

説明

プレイヤーのアイテムに関するコマンドの実装2 / Spell/Prayer commands

日付
2014/01/27
作者
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
This software may be copied and distributed for educational, research,
and not for profit purposes provided that this copyright and statement
are included in all such copies.  Other copyrights may also apply.
2014 Deskull rearranged comment for Doxygen.
This file includes code for eating food, drinking potions,
reading scrolls, aiming wands, using staffs, zapping rods,
and activating artifacts.
In all cases, if the player becomes "aware" of the item's use
by testing it, mark it as "aware" and reward some experience
based on the object's level, always rounding up.  If the player
remains "unaware", mark that object "kind" as "tried".
This code now correctly handles the unstacking of wands, staffs,
and rods.  Note the overly paranoid warning about potential pack
overflow, which allows the player to use and drop a stacked item.
In all "unstacking" scenarios, the "used" object is "carried" as if
the player had just picked it up.  In particular, this means that if
the use of an item induces pack overflow, that item will be dropped.
For simplicity, these routines induce a full "pack reorganization"
which not only combines similar items, but also reorganizes various
items to obey the current "sorting" method.  This may require about
400 item comparisons, but only occasionally.
There may be a BIG problem with any "effect" that can cause "changes"
to the inventory.  For example, a "scroll of recharging" can cause
a wand/staff to "disappear", moving the inventory up.  Luckily, the
scrolls all appear BEFORE the staffs/wands, so this is not a problem.
But, for example, a "staff of recharging" could cause MAJOR problems.
In such a case, it will be best to either (1) "postpone" the effect
until the end of the function, or (2) "change" the effect, say, into
giving a staff "negative" charges, or "turning a staff into a stick".
It seems as though a "rod of recharging" might in fact cause problems.
The basic problem is that the act of recharging (and destroying) an
item causes the inducer of that action to "move", causing "o_ptr" to
no longer point at the correct item, with horrifying results.
Note that food/potions/scrolls no longer use bit-flags for effects,
but instead use the "sval" (which is also used to sort the objects).

関数

static bool ang_sort_comp_pet ( vptr  u,
vptr  v,
int  a,
int  b 
)
static

ペット入りモンスターボールをソートするための比較関数

引数
u所持品配列の参照ポインタ
v未使用
a所持品ID1
b所持品ID2
戻り値
1の方が大であればTRUE

呼出しグラフ:

void do_cmd_activate ( void  )

装備を発動するコマンドのメインルーチン /

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_activate_aux ( int  item)
static

装備を発動するコマンドのサブルーチン / Activate a wielded object.

Wielded objects never stack. And even if they did, activatable objects never stack.

引数
item発動するオブジェクトの所持品ID
戻り値
なし
Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
But one could, for example, easily make an activatable "Ring of Plasma".
Note that it always takes a turn to activate an artifact, even if
the user hits "escape" at the "direction" prompt.

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_aim_wand ( void  )

魔法棒を使うコマンドのメインルーチン /

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_aim_wand_aux ( int  item)
static

魔法棒を使うコマンドのサブルーチン / Aim a wand (from the pack or floor).

引数
item使うオブジェクトの所持品ID
戻り値
なし
Use a single charge from a single item.
Handle "unstacking" in a logical manner.
For simplicity, you cannot use a stack of items from the
ground.  This would require too much nasty code.
There are no wands which can "destroy" themselves, in the inventory
or on the ground, so we can ignore this possibility.  Note that this
required giving "wand of wonder" the ability to ignore destruction
by electric balls.
All wands can be "cancelled" at the "Direction?" prompt for free.
Note that the basic "bolt" wands do slightly less damage than the
basic "bolt" rods, but the basic "ball" wands do the same damage
as the basic "ball" rods.

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_eat_food ( void  )

食料を食べるコマンドのメインルーチン / Eat some food (from the pack or floor)

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_eat_food_aux ( int  item)
static

食料を食べるコマンドのサブルーチン

引数
item食べるオブジェクトの所持品ID
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

bool do_cmd_magic_eater ( bool  only_browse,
bool  powerful 
)

取り込んだ魔力を利用するコマンドのメインルーチン / Use eaten rod, wand or staff

引数
only_browse閲覧するだけならばTRUE
powerful強力発動中の処理ならばTRUE
戻り値
実際にコマンドを実行したならばTRUEを返す。

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_quaff_potion ( void  )

薬を飲むコマンドのメインルーチン / Quaff some potion (from the pack or floor)

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_quaff_potion_aux ( int  item)
static

薬を飲むコマンドのサブルーチン / Quaff a potion (from the pack or the floor)

引数
item飲む薬オブジェクトの所持品ID
戻り値
なし

呼出しグラフ:

void do_cmd_read_scroll ( void  )

読むコマンドのメインルーチン / Eat some food (from the pack or floor)

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_read_scroll_aux ( int  item,
bool  known 
)
static

巻物を読むコマンドのサブルーチン Read a scroll (from the pack or floor).

引数
item読むオブジェクトの所持品ID
known判明済ならばTRUE
戻り値
なし
Certain scrolls can be "aborted" without losing the scroll.  These
include scrolls with no effects but recharge or identify, which are
cancelled before use.  XXX Reading them still takes a turn, though.

呼出しグラフ:

void do_cmd_use ( void  )

アイテムを汎用的に「使う」コマンドのメインルーチン / Use an item

戻り値
なし

XXX - Add actions for other item types

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_use_staff ( void  )

杖を使うコマンドのメインルーチン /

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_use_staff_aux ( int  item)
static

杖を使うコマンドのサブルーチン / Use a staff.

        -RAK-
引数
item使うオブジェクトの所持品ID
戻り値
なし

One charge of one staff disappears. Hack – staffs of identify can be "cancelled".

関数の呼び出しグラフ:

呼出しグラフ:

void do_cmd_zap_rod ( void  )

ロッドを使うコマンドのメインルーチン /

戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static void do_cmd_zap_rod_aux ( int  item)
static

魔法棒を使うコマンドのサブルーチン / Activate (zap) a Rod

引数
item使うオブジェクトの所持品ID
戻り値
なし
Unstack fully charged rods as needed.
Hack – rods of perception/genocide can be "cancelled"
All rods can be cancelled at the "Direction?" prompt
pvals are defined for each rod in k_info. -LM-

関数の呼び出しグラフ:

呼出しグラフ:

static bool item_tester_hook_activate ( object_type o_ptr)
static

オブジェクトをプレイヤーが魔道具として発動できるかを判定する / Hook to determine if an object is activatable

引数
o_ptr判定したいオブジェクトの構造体参照ポインタ
戻り値
魔道具として発動可能ならばTRUEを返す

関数の呼び出しグラフ:

呼出しグラフ:

static bool item_tester_hook_eatable ( object_type o_ptr)
static

オブジェクトをプレイヤーが食べることができるかを判定する / Hook to determine if an object is eatable

引数
o_ptr判定したいオブジェクトの構造体参照ポインタ
戻り値
食べることが可能ならばTRUEを返す

関数の呼び出しグラフ:

呼出しグラフ:

static bool item_tester_hook_quaff ( object_type o_ptr)
static

オブジェクトをプレイヤーが飲むことができるかを判定する / Hook to determine if an object can be quaffed

引数
o_ptr判定したいオブジェクトの構造体参照ポインタ
戻り値
飲むことが可能ならばTRUEを返す

呼出しグラフ:

static bool item_tester_hook_readable ( object_type o_ptr)
static

オブジェクトをプレイヤーが読むことができるかを判定する / Hook to determine if an object is readable

引数
o_ptr判定したいオブジェクトの構造体参照ポインタ
戻り値
読むことが可能ならばTRUEを返す

呼出しグラフ:

static bool item_tester_hook_use ( object_type o_ptr)
static

オブジェクトをプレイヤーが簡易使用コマンドで利用できるかを判定する / Hook to determine if an object is useable

引数
o_ptr判定したいオブジェクトの構造体参照ポインタ
戻り値
利用可能ならばTRUEを返す

関数の呼び出しグラフ:

呼出しグラフ:

void ring_of_power ( int  dir)

『一つの指輪』の効果処理 / Hack – activate the ring of power

引数
dir発動の方向ID
戻り値
なし

関数の呼び出しグラフ:

呼出しグラフ:

static int rod_effect ( int  sval,
int  dir,
bool use_charge,
bool  powerful,
bool  magic 
)
static

ロッドの効果を発動する

引数
svalオブジェクトのsval
dir発動目標の方向ID
use_chargeチャージを消費したかどうかを返す参照ポインタ
powerful強力発動上の処理ならばTRUE
magic魔道具術上の処理ならばTRUE
戻り値
発動により効果内容が確定したならばTRUEを返す

関数の呼び出しグラフ:

呼出しグラフ:

static int select_magic_eater ( bool  only_browse)
static

魔道具術師の取り込んだ魔力一覧から選択/閲覧する /

引数
only_browse閲覧するだけならばTRUE
戻り値
選択した魔力のID、キャンセルならば-1を返す

関数の呼び出しグラフ:

呼出しグラフ:

static int staff_effect ( int  sval,
bool use_charge,
bool  powerful,
bool  magic,
bool  known 
)
static

杖の効果を発動する

引数
svalオブジェクトのsval
use_charge使用回数を消費したかどうかを返す参照ポインタ
powerful強力発動上の処理ならばTRUE
magic魔道具術上の処理ならばTRUE
known判明済ならばTRUE
戻り値
発動により効果内容が確定したならばTRUEを返す

関数の呼び出しグラフ:

呼出しグラフ:

static int wand_effect ( int  sval,
int  dir,
bool  powerful,
bool  magic 
)
static

魔法棒の効果を発動する

引数
svalオブジェクトのsval
dir発動の方向ID
powerful強力発動上の処理ならばTRUE
magic魔道具術上の処理ならばTRUE
戻り値
発動により効果内容が確定したならばTRUEを返す

関数の呼び出しグラフ:

呼出しグラフ: