#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"
/*
* The artifact arrays
char *a_name;
char *a_text;
+/*
+ * Maximum number of artifacts in a_info.txt
+ */
+ARTIFACT_IDX max_a_idx;
+
static bool has_extreme_damage_rate(object_type *o_ptr);
static bool weakening_artifact(object_type *o_ptr);
* @param a_scroll アーティファクト生成の巻物上の処理。呪いのアーティファクトが生成対象外となる。
* @return 常にTRUE(1)を返す
*/
-bool create_artifact(object_type *o_ptr, bool a_scroll)
+bool become_random_artifact(object_type *o_ptr, bool a_scroll)
{
GAME_TEXT new_name[1024];
PARAMETER_VALUE has_pval = 0;
random_slay(o_ptr);
break;
default:
- if (p_ptr->wizard) msg_print("Switch error in create_artifact!");
+ if (current_world_ptr->wizard) msg_print("Switch error in become_random_artifact!");
powers++;
}
};
}
}
sprintf(new_name, _("《%s》", "'%s'"), dummy_name);
- chg_virtue(V_INDIVIDUALISM, 2);
- chg_virtue(V_ENCHANT, 5);
+ chg_virtue(p_ptr, V_INDIVIDUALISM, 2);
+ chg_virtue(p_ptr, V_ENCHANT, 5);
}
else
{
/*!
* @brief フロアの指定された位置に固定アーティファクトを生成する。 / Create the artifact of the specified number
* @details 固定アーティファクト構造体から基本ステータスをコピーした後、所定の座標でdrop_item()で落とす。
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param a_idx 生成する固定アーティファクト構造体のID
* @param y アイテムを落とす地点のy座標
* @param x アイテムを落とす地点のx座標
* 仮に2個以上存在可能かつ装備品以外の固定アーティファクトが作成されれば
* drop_near()関数の返り値は信用できなくなる.
*/
-bool create_named_art(ARTIFACT_IDX a_idx, POSITION y, POSITION x)
+bool create_named_art(player_type *player_ptr, ARTIFACT_IDX a_idx, POSITION y, POSITION x)
{
object_type forge;
object_type *q_ptr;
random_artifact_resistance(q_ptr, a_ptr);
/* Drop the artifact from heaven */
- return drop_near(q_ptr, -1, y, x) ? TRUE : FALSE;
+ return drop_near(player_ptr, q_ptr, -1, y, x) ? TRUE : FALSE;
}
/*対邪平均ダメージの計算処理*/
ARTIFACT_IDX i;
/* No artifacts in the town */
- if (!current_floor_ptr->dun_level) return (FALSE);
+ if (!p_ptr->current_floor_ptr->dun_level) return (FALSE);
/* Paranoia -- no "plural" artifacts */
if (o_ptr->number != 1) return (FALSE);
if (a_ptr->sval != o_ptr->sval) continue;
/* XXX XXX Enforce minimum "depth" (loosely) */
- if (a_ptr->level > current_floor_ptr->dun_level)
+ if (a_ptr->level > p_ptr->current_floor_ptr->dun_level)
{
/* Acquire the "out-of-depth factor" */
- int d = (a_ptr->level - current_floor_ptr->dun_level) * 2;
+ int d = (a_ptr->level - p_ptr->current_floor_ptr->dun_level) * 2;
/* Roll for out-of-depth creation */
if (!one_in_(d)) continue;
KIND_OBJECT_IDX k_idx = 0;
/*! @note 地上ではキャンセルする / No artifacts in the town */
- if (!current_floor_ptr->dun_level) return (FALSE);
+ if (!p_ptr->current_floor_ptr->dun_level) return (FALSE);
/*! @note get_obj_num_hookによる指定がある場合は生成をキャンセルする / Themed object */
if (get_obj_num_hook) return (FALSE);
/*! @note アーティファクト生成階が現在に対して足りない場合は高確率で1/(不足階層*2)を満たさないと生成リストに加えられない /
* XXX XXX Enforce minimum "depth" (loosely) */
- if (a_ptr->level > current_floor_ptr->object_level)
+ if (a_ptr->level > p_ptr->current_floor_ptr->object_level)
{
/* @note / Acquire the "out-of-depth factor". Roll for out-of-depth creation. */
- int d = (a_ptr->level - current_floor_ptr->object_level) * 2;
+ int d = (a_ptr->level - p_ptr->current_floor_ptr->object_level) * 2;
if (!one_in_(d)) continue;
}
/*! @note 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. */
k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
- if (k_info[k_idx].level > current_floor_ptr->object_level)
+ if (k_info[k_idx].level > p_ptr->current_floor_ptr->object_level)
{
- int d = (k_info[k_idx].level - current_floor_ptr->object_level) * 5;
+ int d = (k_info[k_idx].level - p_ptr->current_floor_ptr->object_level) * 5;
if (!one_in_(d)) continue;
}