{
switch (randint0(10))
{
- case 0: add_flag(o_ptr->art_flags, TR_FEATHER); break;
+ case 0: add_flag(o_ptr->art_flags, TR_LEVITATION); break;
case 1: add_flag(o_ptr->art_flags, TR_LITE); break;
case 2: add_flag(o_ptr->art_flags, TR_SEE_INVIS); break;
case 3: add_flag(o_ptr->art_flags, TR_WARNING); break;
static void random_plus(object_type * o_ptr)
{
- int this_type = (o_ptr->tval <= TV_WEAPON_END ? 23 : 19);
+ int this_type = (object_is_weapon_ammo(o_ptr) ? 23 : 19);
switch (artifact_bias)
{
break;
case 12:
case 13:
- add_flag(o_ptr->art_flags, TR_FEATHER);
+ add_flag(o_ptr->art_flags, TR_LEVITATION);
break;
case 15:
case 16:
case 24:
case 25:
case 26:
- if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END)
+ if (object_is_armour(o_ptr))
random_misc(o_ptr);
else
{
char new_name[1024];
int has_pval = 0;
int powers = randint1(5) + 1;
- int max_type = (o_ptr->tval <= TV_WEAPON_END ? 7 : 5);
+ int max_type = (object_is_weapon_ammo(o_ptr) ? 7 : 5);
int power_level;
s32b total_flags;
bool a_cursed = FALSE;
if (!a_scroll && one_in_(A_CURSED))
a_cursed = TRUE;
- if (((o_ptr->tval == TV_AMULET) || (o_ptr->tval == TV_RING)) && cursed_p(o_ptr))
+ if (((o_ptr->tval == TV_AMULET) || (o_ptr->tval == TV_RING)) && object_is_cursed(o_ptr))
a_cursed = TRUE;
while (one_in_(powers) || one_in_(7) || one_in_(10))
has_pval = TRUE;
break;
case 3: case 4:
- if (one_in_(2) && (o_ptr->tval <= TV_WEAPON_END) && (o_ptr->tval != TV_BOW))
+ if (one_in_(2) && object_is_weapon_ammo(o_ptr) && (o_ptr->tval != TV_BOW))
{
if (a_cursed && !one_in_(13)) break;
if (one_in_(13))
}
/* give it some plusses... */
- if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END)
+ if (object_is_armour(o_ptr))
o_ptr->to_a += randint1(o_ptr->to_a > 19 ? 1 : 20 - o_ptr->to_a);
- else if (o_ptr->tval <= TV_SWORD)
+ else if (object_is_weapon_ammo(o_ptr))
{
o_ptr->to_h += randint1(o_ptr->to_h > 19 ? 1 : 20 - o_ptr->to_h);
o_ptr->to_d += randint1(o_ptr->to_d > 19 ? 1 : 20 - o_ptr->to_d);
if (a_cursed) curse_artifact(o_ptr);
if (!a_cursed &&
- (randint1((o_ptr->tval >= TV_ARMOR_BEGIN)
- ? ACTIVATION_CHANCE * 2 : ACTIVATION_CHANCE) == 1))
+ one_in_(object_is_armour(o_ptr) ? ACTIVATION_CHANCE * 2 : ACTIVATION_CHANCE))
{
o_ptr->xtra2 = 0;
give_activation_power(o_ptr);
}
- if (TV_ARMOR_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_ARMOR_END)
+ if (object_is_armour(o_ptr))
{
while ((o_ptr->to_d+o_ptr->to_h) > 20)
{
remove_flag(o_ptr->art_flags, TR_BRAND_COLD);
}
- if (o_ptr->tval >= TV_ARMOR_BEGIN)
+ if (!object_is_weapon_ammo(o_ptr))
{
/* For armors */
if (a_cursed) power_level = 0;
if (a_scroll)
{
- char dummy_name[80];
+ char dummy_name[80] = "";
+#ifdef JP
+ cptr ask_msg = "¤³¤Î¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ò²¿¤È̾ÉÕ¤±¤Þ¤¹¤«¡©";
+#else
+ cptr ask_msg = "What do you want to call the artifact? ";
+#endif
+
/* Identify it fully */
object_aware(o_ptr);
object_known(o_ptr);
/* Mark the item as fully known */
o_ptr->ident |= (IDENT_MENTAL);
- strcpy(dummy_name, "");
(void)screen_object(o_ptr, TRUE);
-#ifdef JP
- if (!(get_string("¤³¤Î¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤ò²¿¤È̾ÉÕ¤±¤Þ¤¹¤«¡©", dummy_name, 80)))
-#else
- if (!(get_string("What do you want to call the artifact? ", dummy_name, 80)))
-#endif
-
+ if (!get_string(ask_msg, dummy_name, sizeof dummy_name)
+ || !dummy_name[0])
{
- get_random_name(new_name, (bool)(o_ptr->tval >= TV_ARMOR_BEGIN), power_level);
- }
- else
- {
-#ifdef JP
- strcpy(new_name, "¡Ô");
-#else
- strcpy(new_name, "'");
+ /* Cancelled */
+#if 0
+ if (one_in_(2))
+ {
+ get_table_sindarin(dummy_name);
+ }
+ else
#endif
+ {
+ get_table_name_aux(dummy_name);
+ }
+ }
- strcat(new_name, dummy_name);
#ifdef JP
- strcat(new_name, "¡Õ¤È¤¤¤¦Ì¾¤Î");
+ sprintf(new_name, "¡Ô%s¡Õ", dummy_name);
#else
- strcat(new_name, "'");
+ sprintf(new_name, "'%s'", dummy_name);
#endif
- }
-
chg_virtue(V_INDIVIDUALISM, 2);
chg_virtue(V_ENCHANT, 5);
-
}
else
{
- get_random_name(new_name, (bool)(o_ptr->tval >= TV_ARMOR_BEGIN), power_level);
+ get_random_name(new_name, object_is_armour(o_ptr), power_level);
}
if (cheat_xtra)
{
- if (artifact_bias)
#ifdef JP
-msg_format("±¿¤ÎÊФä¿¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È: %d¡£", artifact_bias);
+ if (artifact_bias) msg_format("±¿¤ÎÊФä¿¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È: %d¡£", artifact_bias);
+ else msg_print("¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Ë±¿¤ÎÊФê¤Ê¤·¡£");
#else
- msg_format("Biased artifact: %d.", artifact_bias);
+ if (artifact_bias) msg_format("Biased artifact: %d.", artifact_bias);
+ else msg_print("No bias in artifact.");
#endif
-
- else
-#ifdef JP
-msg_print("¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È¤Ë±¿¤ÎÊФê¤Ê¤·¡£");
-#else
- msg_print("No bias in artifact.");
-#endif
-
}
/* Save the inscription */
m_ptr = &m_list[c_ptr->m_idx];
/* Hack -- attack monsters */
- if (c_ptr->m_idx && (m_ptr->ml || have_flag(f_flags_bold(y, x), FF_PROJECT)))
+ if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
py_attack(y, x, 0);
}
}