Hengband  2.2.1
関数 | 変数
trap.c ファイル
#include "angband.h"
#include "util.h"
#include "cmd-dump.h"
#include "trap.h"
#include "player-damage.h"
#include "player-move.h"
#include "player-effects.h"
#include "player-class.h"
#include "player-personality.h"
#include "spells-summon.h"
#include "quest.h"
#include "artifact.h"
#include "feature.h"
#include "player-status.h"
#include "grid.h"
#include "spells.h"
#include "floor.h"
#include "floor-save.h"
#include "init.h"
#include "files.h"
#include "dungeon.h"
#include "world.h"
#include "realm-song.h"
trap.c の依存先関係図:

関数

void init_normal_traps (void)
 タグに従って、基本トラップテーブルを初期化する / Initialize arrays for normal traps [詳解]
 
FEAT_IDX choose_random_trap (void)
 基本トラップをランダムに選択する / Get random trap [詳解]
 
void disclose_grid (POSITION y, POSITION x)
 マスに存在する隠しトラップを公開する / Disclose an invisible trap [詳解]
 
void place_trap (floor_type *floor_ptr, POSITION y, POSITION x)
 マスをトラップを配置する / The location must be a legal, naked, floor grid. [詳解]
 
static int check_hit (int power)
 プレイヤーへのトラップ命中判定 / Determine if a trap affects the player. [詳解]
 
static void hit_trap_pit (int trap_feat_type)
 落とし穴系トラップの判定とプレイヤーの被害処理 [詳解]
 
static bool hit_trap_dart (void)
 ダーツ系トラップ(通常ダメージ)の判定とプレイヤーの被害処理 [詳解]
 
static void hit_trap_lose_stat (int stat)
 ダーツ系トラップ(通常ダメージ+能力値減少)の判定とプレイヤーの被害処理 [詳解]
 
static void hit_trap_slow (void)
 ダーツ系トラップ(通常ダメージ+減速)の判定とプレイヤーの被害処理 [詳解]
 
static void hit_trap_set_abnormal_status (concptr trap_message, bool resist, bool(*set_status)(IDX), IDX turn_aux)
 ダーツ系トラップ(通常ダメージ+状態異常)の判定とプレイヤーの被害処理 [詳解]
 
static void hit_trap_set_abnormal_status_p (concptr trap_message, bool resist, bool(*set_status)(player_type *, IDX), IDX turn_aux)
 
void hit_trap (player_type *trapped_ptr, bool break_trap)
 プレイヤーへのトラップ作動処理メインルーチン / Handle player hitting a real trap [詳解]
 

変数

static s16b normal_traps [MAX_NORMAL_TRAPS]
 
const int chest_traps [64]
 箱のトラップテーブル [詳解]
 

関数詳解

◆ check_hit()

static int check_hit ( int  power)
static

プレイヤーへのトラップ命中判定 / Determine if a trap affects the player.

引数
power基本回避難度
戻り値
トラップが命中した場合TRUEを返す。

Always miss 5% of the time, Always hit 5% of the time. Otherwise, match trap power against player armor.

被呼び出し関係図:

◆ choose_random_trap()

FEAT_IDX choose_random_trap ( void  )

基本トラップをランダムに選択する / Get random trap

戻り値
選択したトラップのID

This routine should be redone to reflect trap "level".
That is, it does not make sense to have spiked pits at 50 feet.
Actually, it is not this routine, but the "trap instantiation"
code, which should also check for "trap doors" on quest levels.

呼び出し関係図:

◆ disclose_grid()

void disclose_grid ( POSITION  y,
POSITION  x 
)

マスに存在する隠しトラップを公開する / Disclose an invisible trap

引数
y秘匿したいマスのY座標
x秘匿したいマスのX座標
戻り値
なし
呼び出し関係図:

◆ hit_trap()

void hit_trap ( player_type trapped_ptr,
bool  break_trap 
)

プレイヤーへのトラップ作動処理メインルーチン / Handle player hitting a real trap

引数
break_trap作動後のトラップ破壊が確定しているならばTRUE
戻り値
なし
呼び出し関係図:

◆ hit_trap_dart()

static bool hit_trap_dart ( void  )
static

ダーツ系トラップ(通常ダメージ)の判定とプレイヤーの被害処理

戻り値
ダーツが命中した場合TRUEを返す
呼び出し関係図:
被呼び出し関係図:

◆ hit_trap_lose_stat()

static void hit_trap_lose_stat ( int  stat)
static

ダーツ系トラップ(通常ダメージ+能力値減少)の判定とプレイヤーの被害処理

引数
stat低下する能力値ID
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ hit_trap_pit()

static void hit_trap_pit ( int  trap_feat_type)
static

落とし穴系トラップの判定とプレイヤーの被害処理

引数
trap_feat_typeトラップの種別ID
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ hit_trap_set_abnormal_status()

static void hit_trap_set_abnormal_status ( concptr  trap_message,
bool  resist,
bool(*)(IDX set_status,
IDX  turn_aux 
)
static

ダーツ系トラップ(通常ダメージ+状態異常)の判定とプレイヤーの被害処理

引数
trap_messageメッセージの補完文字列
resist状態異常に抵抗する判定が出たならTRUE
set_status状態異常を指定する関数ポインタ
turn_aux状態異常の追加ターン量
戻り値
なし
呼び出し関係図:

◆ hit_trap_set_abnormal_status_p()

static void hit_trap_set_abnormal_status_p ( concptr  trap_message,
bool  resist,
bool(*)(player_type *, IDX set_status,
IDX  turn_aux 
)
static
呼び出し関係図:
被呼び出し関係図:

◆ hit_trap_slow()

static void hit_trap_slow ( void  )
static

ダーツ系トラップ(通常ダメージ+減速)の判定とプレイヤーの被害処理

戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ init_normal_traps()

void init_normal_traps ( void  )

タグに従って、基本トラップテーブルを初期化する / Initialize arrays for normal traps

戻り値
なし
呼び出し関係図:

◆ place_trap()

void place_trap ( floor_type floor_ptr,
POSITION  y,
POSITION  x 
)

マスをトラップを配置する / The location must be a legal, naked, floor grid.

引数
y配置したいマスのY座標
x配置したいマスのX座標
戻り値
Note that all traps start out as "invisible" and "untyped", and then
when they are "discovered" (by detecting them or setting them off),
the trap is "instantiated" as a visible, "typed", trap.
呼び出し関係図:

変数詳解

◆ chest_traps

const int chest_traps[64]

箱のトラップテーブル

Each chest has a certain set of traps, determined by pval
Each chest has a "pval" from 1 to the chest level (max 55)
If the "pval" is negative then the trap has been disarmed
The "pval" of a chest determines the quality of its treasure
Note that disarming a trap on a chest also removes the lock.

◆ normal_traps

s16b normal_traps[MAX_NORMAL_TRAPS]
static