#include "angband.h"
-#include "kajitips.h"
+static cptr const kaji_tips[5] =
+{
+#ifdef JP
+ "現在持っているエッセンスの一覧を表示する。",
+ "アイテムからエッセンスを取り出す。エッセンスを取られたアイテムは全く魔法がかかっていない初期状態に戻る。",
+ "既にエッセンスが付加されたアイテムからエッセンスのみ消し去る。エッセンスは手に入らない。",
+ "アイテムにエッセンスを付加する。既にエッセンスが付加されたアイテムやアーティファクトには付加できない。",
+ "武器や防具を強化したり、攻撃で傷つかないようにしたりする。エッセンスが付加されたアイテムやアーティファクトに対しても使用できる。",
+#else
+ "Display essences you have.",
+ "Extract essences from an item. The item become non magical.",
+ "Remove added essences from an equipment which was improved before. The removed essence will be ruined.",
+ "Add essences to an item. The improved items or artifacts cannot be reimprove.",
+ "Enchant an equipment or make an equiment element-proofed. The improved items and artifacts can be enchanted too.",
+#endif
+};
/*!
* @brief 床上、モンスター所持でスタックされたアイテムを削除しスタックを補完する / Excise a dungeon object from any stacks
* @param i2 整理したい配列の終点
* @return なし
*/
-static void compact_objects_aux(int i1, int i2)
+static void compact_objects_aux(IDX i1, IDX i2)
{
- int i;
-
+ IDX i;
cave_type *c_ptr;
-
object_type *o_ptr;
-
/* Do nothing */
if (i1 == i2) return;
*/
void compact_objects(int size)
{
- int i, y, x, num, cnt;
+ IDX i;
+ int y, x, num, cnt;
int cur_lev, cur_dis, chance;
object_type *o_ptr;
}
/* Nearby objects start out "immune" */
- if ((cur_dis > 0) && (distance(py, px, y, x) < cur_dis)) continue;
+ if ((cur_dis > 0) && (distance(p_ptr->y, p_ptr->x, y, x) < cur_dis)) continue;
/* Saving throw */
chance = 90;
* This routine should almost never fail, but in case it does,
* we must be sure to handle "failure" of this routine.
*/
-s16b o_pop(void)
+IDX o_pop(void)
{
- int i;
+ IDX i;
/* Initial allocation */
* @param sval 検索したいベースアイテムのsval
* @return なし
*/
-s16b lookup_kind(int tval, int sval)
+IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval)
{
- int k;
+ IDX k;
int num = 0;
- int bk = 0;
+ IDX bk = 0;
/* Look for it */
for (k = 1; k < max_k_idx; k++)
* @param k_idx 新たに作成したいベースアイテム情報のID
* @return なし
*/
-void object_prep(object_type *o_ptr, int k_idx)
+void object_prep(object_type *o_ptr, IDX k_idx)
{
object_kind *k_ptr = &k_info[k_idx];
{
char o_name[MAX_NLEN];
- /*!
- * @note アイテム名取得後アイテムの価値に応じたデバッグメッセージを出力する。
- * Get Describe and view, Artifact, Random Artifact, Ego-item, and Normal item.
- */
- object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
+ object_aware(o_ptr);
+ object_known(o_ptr);
- if (object_is_fixed_artifact(o_ptr))
- {
- msg_format(_("伝説のアイテム (%s)", "Artifact (%s)"), o_name);
- }
- else if (o_ptr->art_name)
- {
- msg_print(_("ランダム・アーティファクト", "Random artifact"));
- }
- else if (object_is_ego(o_ptr))
- {
- msg_format(_("名のあるアイテム (%s)", "Ego-item (%s)"), o_name);
- }
- else
- {
- msg_format(_("アイテム (%s)", "Object (%s)"), o_name);
- }
+ /* Mark the item as fully known */
+ o_ptr->ident |= (IDENT_MENTAL);
+
+ /* Description */
+ object_desc(o_name, o_ptr, 0);
+ msg_format_wizard(CHEAT_OBJECT, _("%sを生成しました。", "%s was generated."), o_name);
}
/*!
*/
static bool make_artifact_special(object_type *o_ptr)
{
- int i;
- int k_idx = 0;
+ IDX i;
+ IDX k_idx = 0;
/*! @note 地上ではキャンセルする / No artifacts in the town */
if (!dun_level) return (FALSE);
*/
static bool make_artifact(object_type *o_ptr)
{
- int i;
+ IDX i;
/* No artifacts in the town */
*/
static void a_m_aux_1(object_type *o_ptr, int level, int power)
{
- int tohit1 = randint1(5) + m_bonus(5, level);
- int todam1 = randint1(5) + m_bonus(5, level);
+ HIT_PROB tohit1 = randint1(5) + m_bonus(5, level);
+ HIT_POINT todam1 = randint1(5) + m_bonus(5, level);
- int tohit2 = m_bonus(10, level);
- int todam2 = m_bonus(10, level);
+ HIT_PROB tohit2 = m_bonus(10, level);
+ HIT_POINT todam2 = m_bonus(10, level);
if ((o_ptr->tval == TV_BOLT) || (o_ptr->tval == TV_ARROW) || (o_ptr->tval == TV_SHOT))
{
*/
static void a_m_aux_2(object_type *o_ptr, int level, int power)
{
- int toac1 = randint1(5) + m_bonus(5, level);
-
- int toac2 = m_bonus(10, level);
+ ARMOUR_CLASS toac1 = randint1(5) + m_bonus(5, level);
+ ARMOUR_CLASS toac2 = m_bonus(10, level);
/* Good */
if (power > 0)
{
if (one_in_(50) || (power > 2)) /* power > 2 is debug only */
create_artifact(o_ptr, FALSE);
-
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
-
break;
}
switch (o_ptr->name2)
{
- case EGO_DWARVEN:
- if (o_ptr->tval != TV_HARD_ARMOR)
- {
- okay_flag = FALSE;
- break;
- }
- case EGO_DRUID:
- if (o_ptr->tval != TV_SOFT_ARMOR)
- {
- okay_flag = FALSE;
- break;
- }
- default:
+ case EGO_DWARVEN:
+ if (o_ptr->tval != TV_HARD_ARMOR)
+ {
+ okay_flag = FALSE;
+ }
+ break;
+ case EGO_DRUID:
+ if (o_ptr->tval != TV_SOFT_ARMOR)
+ {
+ okay_flag = FALSE;
+ }
+ break;
+ default:
break;
}
- if (okay_flag)
- break;
+ if (okay_flag) break;
}
switch (o_ptr->name2)
{
if (o_ptr->sval == SV_DRAGON_SHIELD)
{
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
if (!one_in_(3)) break;
}
{
if (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)
{
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
if (!one_in_(3)) break;
}
{
if (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)
{
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
if (!one_in_(3)) break;
}
{
if (o_ptr->sval == SV_DRAGON_HELM)
{
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
dragon_resist(o_ptr);
if (!one_in_(3)) break;
}
break;
}
}
+
}
break;
}
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
-
break;
}
/* gain one low ESP */
add_esp_weak(o_ptr, FALSE);
- /* Mention the item */
- if (cheat_peek) object_mention(o_ptr);
-
break;
}
case TV_FIGURINE:
{
- int i = 1;
+ PARAMETER_VALUE i = 1;
int check;
monster_race *r_ptr;
/* Some figurines are cursed */
if (one_in_(6)) o_ptr->curse_flags |= TRC_CURSED;
- if (cheat_peek)
- {
- msg_format(_("%sの人形, 深さ +%d%s", "Figurine of %s, depth +%d%s"),
- r_name + r_ptr->name, check - 1,
- !object_is_cursed(o_ptr) ? "" : " {cursed}");
- }
-
break;
}
case TV_CORPSE:
{
- int i = 1;
+ PARAMETER_VALUE i = 1;
int check;
u32b match = 0;
o_ptr->pval = i;
- if (cheat_peek)
- {
- msg_format(_("%sの死体, 深さ +%d", "Corpse of %s, depth +%d"),
- r_name + r_ptr->name, check - 1);
- }
object_aware(o_ptr);
object_known(o_ptr);
case TV_STATUE:
{
- int i = 1;
+ PARAMETER_VALUE i = 1;
monster_race *r_ptr;
if (a_ptr->gen_flags & (TRG_RANDOM_CURSE1)) o_ptr->curse_flags |= get_curse(1, o_ptr);
if (a_ptr->gen_flags & (TRG_RANDOM_CURSE2)) o_ptr->curse_flags |= get_curse(2, o_ptr);
-
- /* Cheat -- peek at the item */
- if (cheat_peek) object_mention(o_ptr);
-
/* Done */
return;
}
if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_HAYABUSA) && (o_ptr->pval > 2) && (o_ptr->name2 != EGO_ATTACKS))
o_ptr->pval = 2;
}
-
- /* Cheat -- describe the item */
- if (cheat_peek) object_mention(o_ptr);
/* Done */
return;
if (k_ptr->gen_flags & (TRG_RANDOM_CURSE1)) o_ptr->curse_flags |= get_curse(1, o_ptr);
if (k_ptr->gen_flags & (TRG_RANDOM_CURSE2)) o_ptr->curse_flags |= get_curse(2, o_ptr);
}
+
+
}
/* Generate a special object, or a normal object */
if (!one_in_(prob) || !make_artifact_special(j_ptr))
{
- int k_idx;
+ IDX k_idx;
/* Good objects */
if ((mode & AM_GOOD) && !get_obj_num_hook)
obj_level = k_info[j_ptr->k_idx].level;
if (object_is_fixed_artifact(j_ptr)) obj_level = a_info[j_ptr->name1].level;
- /* Notice "okay" out-of-depth objects */
- if (!object_is_cursed(j_ptr) && !object_is_broken(j_ptr) &&
- (obj_level > dun_level))
- {
- /* Cheat -- peek at items */
- if (cheat_peek) object_mention(j_ptr);
- }
+ if (cheat_peek) object_mention(j_ptr);
/* Success */
return (TRUE);
* This routine uses "object_level" for the "generation level".\n
* This routine requires a clean floor grid destination.\n
*/
-void place_object(int y, int x, u32b mode)
+void place_object(POSITION y, POSITION x, u32b mode)
{
- s16b o_idx;
+ IDX o_idx;
/* Acquire grid */
cave_type *c_ptr = &cave[y][x];
* @details
* The location must be a legal, clean, floor grid.
*/
-void place_gold(int y, int x)
+void place_gold(POSITION y, POSITION x)
{
s16b o_idx;
typedef struct
{
- int tval;
- int sval;
+ OBJECT_TYPE_VALUE tval;
+ OBJECT_SUBTYPE_VALUE sval;
int prob;
byte flag;
} amuse_type;
/* Acquirement */
while (num)
{
- int i, k_idx, a_idx = 0;
+ int i;
+ IDX k_idx, a_idx = 0;
int r = randint0(t);
bool insta_art, fixed_art;
else if (num < 0) num = 0;
/* Un-apply */
- num -= o_ptr->number;
+ num -= (ITEM_NUMBER)o_ptr->number;
/* Change the number and weight */
if (num)
else if (num < 0) num = 0;
/* Un-apply */
- num -= o_ptr->number;
+ num -= (int)o_ptr->number;
/* Change the number */
- o_ptr->number += num;
+ o_ptr->number += (ITEM_NUMBER)num;
}
msg_format(_("%s(%c)を落とした。", "You drop %s (%c)."), o_name, index_to_label(item));
/* Drop it near the player */
- (void)drop_near(q_ptr, 0, py, px);
+ (void)drop_near(q_ptr, 0, p_ptr->y, p_ptr->x);
/* Modify, Describe, Optimize */
inven_item_increase(item, -amt);
* @details
* Include list of usable spells for readible books
*/
-void display_koff(int k_idx)
+void display_koff(IDX k_idx)
{
int y;
if (projectable(my, mx, yy, xx))
{
u32b f4 = r_ptr->flags4;
- u32b f5 = r_ptr->flags5;
- u32b f6 = r_ptr->flags6;
+ u32b f5 = r_ptr->a_ability_flags1;
+ u32b f6 = r_ptr->a_ability_flags2;
if (!(d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
{
if (f4 & RF4_BR_DISE) spell_damcalc_by_spellnum(MS_BR_DISEN, GF_DISENCHANT, c_ptr->m_idx, &dam_max0);
if (f4 & RF4_BR_NEXU) spell_damcalc_by_spellnum(MS_BR_NEXUS, GF_NEXUS, c_ptr->m_idx, &dam_max0);
if (f4 & RF4_BR_TIME) spell_damcalc_by_spellnum(MS_BR_TIME, GF_TIME, c_ptr->m_idx, &dam_max0);
- if (f4 & RF4_BR_INER) spell_damcalc_by_spellnum(MS_BR_INERTIA, GF_INERTIA, c_ptr->m_idx, &dam_max0);
+ if (f4 & RF4_BR_INER) spell_damcalc_by_spellnum(MS_BR_INERTIA, GF_INERTIAL, c_ptr->m_idx, &dam_max0);
if (f4 & RF4_BR_GRAV) spell_damcalc_by_spellnum(MS_BR_GRAVITY, GF_GRAVITY, c_ptr->m_idx, &dam_max0);
if (f4 & RF4_BR_SHAR) spell_damcalc_by_spellnum(MS_BR_SHARDS, GF_SHARDS, c_ptr->m_idx, &dam_max0);
if (f4 & RF4_BR_PLAS) spell_damcalc_by_spellnum(MS_BR_PLASMA, GF_PLASMA, c_ptr->m_idx, &dam_max0);
int i, item;
int dec = 4;
bool observe = FALSE;
- int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2, old_timeout;
+ int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2;
+ TIME_EFFECT old_timeout;
u32b old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
object_type *o_ptr;
- cptr q, s;
- byte iy, ix, marked, number;
+ cptr q, s;
+ POSITION iy, ix;
+ byte_hack marked;
+ ITEM_NUMBER number;
s16b next_o_idx, weight;
for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
for (i = 0; essence_info[i].add_name; i++)
{
essence_type *es_ptr = &essence_info[i];
- int pval = 0;
+ PARAMETER_VALUE pval = 0;
if (es_ptr->add < TR_FLAG_MAX && is_pval_flag(es_ptr->add) && old_pval)
pval = (have_flag(new_flgs, es_ptr->add)) ? old_pval - o_ptr->pval : old_pval;
{
char tmp[80];
char tmp_val[160];
- int pval;
- int limit = MIN(5, p_ptr->magic_num1[es_ptr->essence]/es_ptr->value);
+ PARAMETER_VALUE pval;
+ PARAMETER_VALUE limit = MIN(5, p_ptr->magic_num1[es_ptr->essence]/es_ptr->value);
sprintf(tmp, _("いくつ付加しますか? (1-%d): ", "Enchant how many? (1-%d): "), limit);
strcpy(tmp_val, "1");
if (!get_string(tmp, tmp_val, 1)) return;
- pval = atoi(tmp_val);
+ pval = (PARAMETER_VALUE)atoi(tmp_val);
if (pval > limit) pval = limit;
else if (pval < 1) pval = 1;
o_ptr->pval += pval;
{
char tmp_val[160];
int val;
- int get_to_h, get_to_d;
+ HIT_PROB get_to_h;
+ HIT_POINT get_to_d;
strcpy(tmp_val, "1");
if (!get_string(format(_("いくつ付加しますか? (1-%d):", "Enchant how many? (1-%d):"), p_ptr->lev/7+3), tmp_val, 2)) return;