Hengband  2.2.1
関数 | 変数
artifact.c ファイル

アーティファクトの生成と管理 / Artifact code [詳解]

#include "angband.h"
#include "util.h"
#include "artifact.h"
#include "cmd-smith.h"
#include "avatar.h"
#include "floor.h"
#include "cmd-activate.h"
#include "object.h"
#include "objectkind.h"
#include "object-boost.h"
#include "object-curse.h"
#include "object-ego.h"
#include "object-flavor.h"
#include "object-hook.h"
#include "spells-object.h"
#include "files.h"
#include "grid.h"
#include "monster.h"
#include "view-mainwindow.h"
#include "player-class.h"
#include "player-personality.h"
#include "world.h"
artifact.c の依存先関係図:

関数

static bool has_extreme_damage_rate (object_type *o_ptr)
 
static bool weakening_artifact (object_type *o_ptr)
 
static void curse_artifact (object_type *o_ptr)
 ランダムアーティファクト生成中、対象のオブジェクトを呪いのアーティファクトにする経過処理。/ generation process of cursed artifact. [詳解]
 
static void random_plus (object_type *o_ptr)
 ランダムアーティファクト生成中、対象のオブジェクトにpval能力を付加する。/ Add one pval on generation of randam artifact. [詳解]
 
static void random_resistance (object_type *o_ptr)
 ランダムアーティファクト生成中、対象のオブジェクトに耐性を付加する。/ Add one resistance on generation of randam artifact. [詳解]
 
static void random_misc (object_type *o_ptr)
 ランダムアーティファクト生成中、対象のオブジェクトにその他特性を付加する。/ Add one misc flag on generation of randam artifact. [詳解]
 
static void random_slay (object_type *o_ptr)
 ランダムアーティファクト生成中、対象のオブジェクトにスレイ効果を付加する。/ Add one slaying on generation of randam artifact. [詳解]
 
static void give_activation_power (object_type *o_ptr)
 ランダムアーティファクト生成中、対象のオブジェクトにバイアスに依存した発動を与える。/ Add one activaton of randam artifact depend on bias. [詳解]
 
static void get_random_name (object_type *o_ptr, char *return_name, bool armour, int power)
 ランダムアーティファクト生成中、対象のオブジェクトに名前を与える。/ Set name of randomartifact. [詳解]
 
bool become_random_artifact (object_type *o_ptr, bool a_scroll)
 ランダムアーティファクト生成のメインルーチン [詳解]
 
int activation_index (object_type *o_ptr)
 オブジェクトから能力発動IDを取得する。 [詳解]
 
const activation_type * find_activation_info (object_type *o_ptr)
 オブジェクトから発動効果構造体のポインタを取得する。 [詳解]
 
void random_artifact_resistance (object_type *o_ptr, artifact_type *a_ptr)
 固定アーティファクト生成時の特別なハードコーディング処理を行う。. [詳解]
 
bool create_named_art (ARTIFACT_IDX a_idx, POSITION y, POSITION x)
 フロアの指定された位置に固定アーティファクトを生成する。 / Create the artifact of the specified number [詳解]
 
HIT_POINT calc_arm_avgdamage (object_type *o_ptr)
 
bool make_artifact (object_type *o_ptr)
 非INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects" [詳解]
 
bool make_artifact_special (object_type *o_ptr)
 INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects" [詳解]
 

変数

artifact_typea_info
 
char * a_name
 
char * a_text
 
ARTIFACT_IDX max_a_idx
 
const concptr artifact_bias_name [MAX_BIAS]
 

詳解

アーティファクトの生成と管理 / Artifact code

日付
2013/12/11
著者
Copyright (c) 1989 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.
2013 Deskull rearranged comment for Doxygen.

関数詳解

◆ activation_index()

int activation_index ( object_type o_ptr)

オブジェクトから能力発動IDを取得する。

いくつかのケースで定義されている発動効果から、 鍛冶師による付与>固定アーティファクト>エゴ>ランダムアーティファクト>ベースアイテムの優先順位で走査していく。

引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
発動効果のIDを返す
呼び出し関係図:

◆ become_random_artifact()

bool become_random_artifact ( object_type o_ptr,
bool  a_scroll 
)

ランダムアーティファクト生成のメインルーチン

既に生成が済んでいるオブジェクトの構造体を、アーティファクトとして強化する。

引数
o_ptr対象のオブジェクト構造体ポインタ
a_scrollアーティファクト生成の巻物上の処理。呪いのアーティファクトが生成対象外となる。
戻り値
常にTRUE(1)を返す
呼び出し関係図:

◆ calc_arm_avgdamage()

HIT_POINT calc_arm_avgdamage ( object_type o_ptr)
呼び出し関係図:
被呼び出し関係図:

◆ create_named_art()

bool create_named_art ( ARTIFACT_IDX  a_idx,
POSITION  y,
POSITION  x 
)

フロアの指定された位置に固定アーティファクトを生成する。 / Create the artifact of the specified number

固定アーティファクト構造体から基本ステータスをコピーした後、所定の座標でdrop_item()で落とす。

引数
a_idx生成する固定アーティファクト構造体のID
yアイテムを落とす地点のy座標
xアイテムを落とす地点のx座標
戻り値
生成が成功したか否か、失敗はIDの不全、ベースアイテムの不全、drop_item()の失敗時に起こる。
注意
この処理はdrop_near()内で普通の固定アーティファクトが重ならない性質に依存する. 仮に2個以上存在可能かつ装備品以外の固定アーティファクトが作成されれば drop_near()関数の返り値は信用できなくなる.
呼び出し関係図:

◆ curse_artifact()

static void curse_artifact ( object_type o_ptr)
static

ランダムアーティファクト生成中、対象のオブジェクトを呪いのアーティファクトにする経過処理。/ generation process of cursed artifact.

pval、AC、命中、ダメージが正の場合、符号反転の上1d4だけ悪化させ、重い呪い、呪いフラグを必ず付加。 祝福を無効。確率に応じて、永遠の呪い、太古の怨念、経験値吸収、弱い呪いの継続的付加、強い呪いの継続的付加、HP吸収の呪い、 MP吸収の呪い、乱テレポート、反テレポート、反魔法をつける。

注意
プレイヤーの職業依存処理あり。
引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
なし
被呼び出し関係図:

◆ find_activation_info()

const activation_type* find_activation_info ( object_type o_ptr)

オブジェクトから発動効果構造体のポインタを取得する。

activation_index() 関数の結果から参照する。

引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
発動効果構造体のポインタを返す
呼び出し関係図:

◆ get_random_name()

static void get_random_name ( object_type o_ptr,
char *  return_name,
bool  armour,
int  power 
)
static

ランダムアーティファクト生成中、対象のオブジェクトに名前を与える。/ Set name of randomartifact.

確率によって、シンダリン銘、漢字銘、固定名のいずれか一つが与えられる。

引数
o_ptr処理中のアイテム参照ポインタ
return_name名前を返すための文字列参照ポインタ
armour対象のオブジェクトが防具が否か
power銘の基準となるオブジェクトの価値レベル(0=呪い、1=低位、2=中位、3以上=高位)
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ give_activation_power()

static void give_activation_power ( object_type o_ptr)
static

ランダムアーティファクト生成中、対象のオブジェクトにバイアスに依存した発動を与える。/ Add one activaton of randam artifact depend on bias.

バイアスが無い場合、一部のバイアスの確率によっては one_ability() に処理が移行する。

引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ has_extreme_damage_rate()

static bool has_extreme_damage_rate ( object_type o_ptr)
static
呼び出し関係図:
被呼び出し関係図:

◆ make_artifact()

bool make_artifact ( object_type o_ptr)

非INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects"

引数
o_ptr生成に割り当てたいオブジェクトの構造体参照ポインタ
戻り値
生成に成功したらTRUEを返す。

Attempt to change an object into an artifact
This routine should only be called by "apply_magic()"
Note – see "make_artifact_special()" and "apply_magic()"

呼び出し関係図:

◆ make_artifact_special()

bool make_artifact_special ( object_type o_ptr)

INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects"

引数
o_ptr生成に割り当てたいオブジェクトの構造体参照ポインタ
戻り値
生成に成功したらTRUEを返す。

We are only called from "make_object()", and we assume that
"apply_magic()" is called immediately after we return.

Note – see "make_artifact()" and "apply_magic()"

覚え書き
地上ではキャンセルする / No artifacts in the town
get_obj_num_hookによる指定がある場合は生成をキャンセルする / Themed object
全固定アーティファクト中からIDの若い順に生成対象とその確率を走査する / Check the artifact list (just the "specials")
アーティファクト名が空の不正なデータは除外する / Skip "empty" artifacts
既に生成回数がカウントされたアーティファクト、QUESTITEMと非INSTA_ARTは除外 / Cannot make an artifact twice
アーティファクト生成階が現在に対して足りない場合は高確率で1/(不足階層*2)を満たさないと生成リストに加えられない / XXX XXX Enforce minimum "depth" (loosely)
1/(レア度)の確率を満たさないと除外される / Artifact "rarity roll"
INSTA_ART型固定アーティファクトのベースアイテムもチェック対象とする。ベースアイテムの生成階層が足りない場合1/(不足階層*5) を満たさないと除外される。 / Find the base object. XXX XXX Enforce minimum "object" level (loosely). Acquire the "out-of-depth factor". Roll for out-of-depth creation.
前述の条件を満たしたら、後のIDのアーティファクトはチェックせずすぐ確定し生成処理に移す / Assign the template. Mega-Hack – mark the item as an artifact. Hack: Some artifacts get random extra powers. Success.
全INSTA_ART固定アーティファクトを試行しても決まらなかった場合 FALSEを返す / Failure
呼び出し関係図:

◆ random_artifact_resistance()

void random_artifact_resistance ( object_type o_ptr,
artifact_type a_ptr 
)

固定アーティファクト生成時の特別なハードコーディング処理を行う。.

random_artifact_resistance()とあるが実際は固定アーティファクトである。 対象は恐怖の仮面、村正、ロビントンのハープ、龍争虎鬪、ブラッディムーン、羽衣、天女の羽衣、ミリム、 その他追加耐性、特性追加処理。

注意
プレイヤーの各種ステータスに依存した処理がある。
todo:
折を見て関数名を変更すること。
引数
o_ptr対象のオブジェクト構造体ポインタ
a_ptr生成する固定アーティファクト構造体ポインタ
戻り値
なし
呼び出し関係図:

◆ random_misc()

static void random_misc ( object_type o_ptr)
static

ランダムアーティファクト生成中、対象のオブジェクトにその他特性を付加する。/ Add one misc flag on generation of randam artifact.

優先的に付加される耐性がランダムアーティファクトバイアスに依存して存在する。 原則的候補は各種能力維持、永久光源+1、麻痺知らず、経験値維持、浮遊、透明視、急回復、遅消化、 乱テレポート、反魔法、反テレポート、警告、テレパシー、各種ESP、一部装備に殺戮修正。

注意
オブジェクトのtval、svalに依存したハードコーディング処理がある。
引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ random_plus()

static void random_plus ( object_type o_ptr)
static

ランダムアーティファクト生成中、対象のオブジェクトにpval能力を付加する。/ Add one pval on generation of randam artifact.

優先的に付加されるpvalがランダムアーティファクトバイアスに依存して存在する。 原則的候補は腕力、知力、賢さ、器用さ、耐久、魅力、探索、隠密、赤外線視力、加速。武器のみ採掘、追加攻撃も候補に入る。

注意
オブジェクトのtval、svalに依存したハードコーディング処理がある。
引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ random_resistance()

static void random_resistance ( object_type o_ptr)
static

ランダムアーティファクト生成中、対象のオブジェクトに耐性を付加する。/ Add one resistance on generation of randam artifact.

優先的に付加される耐性がランダムアーティファクトバイアスに依存して存在する。 原則的候補は火炎、冷気、電撃、酸(以上免疫の可能性もあり)、 毒、閃光、暗黒、破片、轟音、盲目、混乱、地獄、カオス、劣化、恐怖、火オーラ、冷気オーラ、電撃オーラ、反射。 戦士系バイアスのみ反魔もつく。

注意
オブジェクトのtval、svalに依存したハードコーディング処理がある。
引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
なし
被呼び出し関係図:

◆ random_slay()

static void random_slay ( object_type o_ptr)
static

ランダムアーティファクト生成中、対象のオブジェクトにスレイ効果を付加する。/ Add one slaying on generation of randam artifact.

優先的に付加される耐性がランダムアーティファクトバイアスに依存して存在する。 原則的候補は強力射、高速射、混沌効果、吸血効果、祝福、投擲しやすい、焼棄、凍結、電撃、溶解、毒殺、 動物スレイ、邪悪スレイ、悪魔スレイ、不死スレイ、オークスレイ、トロルスレイ、巨人スレイ、ドラゴンスレイ、 *ドラゴンスレイ*、人間スレイ、切れ味、地震、理力。

注意
オブジェクトのtval、svalに依存したハードコーディング処理がある。
引数
o_ptr対象のオブジェクト構造体ポインタ
戻り値
なし
被呼び出し関係図:

◆ weakening_artifact()

static bool weakening_artifact ( object_type o_ptr)
static
呼び出し関係図:
被呼び出し関係図:

変数詳解

◆ a_info

artifact_type* a_info

◆ a_name

char* a_name

◆ a_text

char* a_text

◆ artifact_bias_name

const concptr artifact_bias_name[MAX_BIAS]
初期値:
=
{
"None",
"Elec",
"Poison",
"Fire",
"Cold",
"Acid",
"STR",
"INT",
"WIS",
"DEX",
"CON",
"CHA",
"Chaos",
"Pristly",
"Necromantic",
"Law",
"Rogue",
"Mage",
"Warrior",
"Ranger",
}

◆ max_a_idx

ARTIFACT_IDX max_a_idx