if (!cave_empty_bold(y, x)) continue;\r
\r
/* Place the object there. */\r
- drop_near(q_ptr, -1, y, x);\r
+ (void)drop_near(q_ptr, -1, y, x);\r
\r
/* Done. */\r
break;\r
}\r
}\r
/* Normally, drop object near the chest. */\r
- else drop_near(q_ptr, -1, y, x);\r
+ else (void)drop_near(q_ptr, -1, y, x);\r
}\r
\r
/* Reset the object level */\r
* @details
* Note that artifacts never break, see the "drop_near()" function.
*/
-static int breakage_chance(object_type *o_ptr)
+static PERCENTAGE breakage_chance(object_type *o_ptr)
{
- int archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (p_ptr->lev-1)/7 + 4: 0);
+ PERCENTAGE archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (PERCENTAGE)(p_ptr->lev-1)/7 + 4: 0);
/* Examine the snipe type */
if (snipe_type)
void do_cmd_fire_aux(int item, object_type *j_ptr)
{
int dir;
- int i, j, y, x, ny, nx, ty, tx, prev_y, prev_x;
+ int i, y, x, ny, nx, ty, tx, prev_y, prev_x;
int tdam_base, tdis, thits, tmul;
int bonus, chance;
int cur_dis, visible;
+ PERCENTAGE j;
object_type forge;
object_type *q_ptr;
{
DIRECTION dir;
OBJECT_IDX item;
- int i, j, y, x, ty, tx, prev_y, prev_x;
+ int i, y, x, ty, tx, prev_y, prev_x;
int ny[19], nx[19];
int chance, tdam, tdis;
int mul, div, dd, ds;
int cur_dis, visible;
+ PERCENTAGE j;
object_type forge;
object_type *q_ptr;
extern void place_object(POSITION y, POSITION x, BIT_FLAGS mode);
extern bool make_gold(object_type *j_ptr);
extern void place_gold(POSITION y, POSITION x);
-extern s16b drop_near(object_type *o_ptr, int chance, int y, int x);
+extern OBJECT_IDX drop_near(object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
extern void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known);
extern void amusement(POSITION y1, POSITION x1, int num, bool known);
extern void inven_item_charges(int item);
}
- if (dummy >= SAFE_MAX_ATTEMPTS)
+ if (dummy >= SAFE_MAX_ATTEMPTS && cheat_room)
{
- if (cheat_room)
- {
-#ifdef JP
-msg_print("警告!地下室のアイテムを配置できません!");
-#else
- msg_print("Warning! Could not place vault object!");
-#endif
-
- }
+ msg_print(_("警告!地下室のアイテムを配置できません!", "Warning! Could not place vault object!"));
}
bool make_gold(object_type *j_ptr)
{
int i;
-
s32b base;
-
/* Hack -- Pick a Treasure variety */
i = ((randint1(object_level + 2) + 2) / 2) - 1;
object_prep(j_ptr, OBJ_GOLD_LIST + i);
/* Hack -- Base coin cost */
- base = k_info[OBJ_GOLD_LIST+i].cost;
+ base = k_info[OBJ_GOLD_LIST + i].cost;
/* Determine how much the treasure is "worth" */
j_ptr->pval = (base + (8L * randint1(base)) + randint1(8));
*/
void place_gold(POSITION y, POSITION x)
{
- s16b o_idx;
+ OBJECT_IDX o_idx;
/* Acquire grid */
cave_type *c_ptr = &cave[y][x];
-
object_type forge;
object_type *q_ptr;
/* Make some gold */
if (!make_gold(q_ptr)) return;
-
/* Make an object */
o_idx = o_pop();
* @param chance ドロップの成功率(%)
* @param y 配置したいフロアのY座標
* @param x 配置したいフロアのX座標
- * @return 生成に成功したらTRUEを返す。
+ * @return 生成に成功したらオブジェクトのIDを返す。
* @details
* The initial location is assumed to be "in_bounds()".\n
*\n
* the object can combine, stack, or be placed. Artifacts will try very\n
* hard to be placed, including "teleporting" to a useful grid if needed.\n
*/
-s16b drop_near(object_type *j_ptr, int chance, int y, int x)
+OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x)
{
int i, k, d, s;
int bs, bn;
- int by, bx;
- int dy, dx;
- int ty, tx = 0;
+ POSITION by, bx;
+ POSITION dy, dx;
+ POSITION ty, tx = 0;
- s16b o_idx = 0;
-
- s16b this_o_idx, next_o_idx = 0;
+ OBJECT_IDX o_idx = 0;
+ OBJECT_IDX this_o_idx, next_o_idx = 0;
cave_type *c_ptr;
#ifdef JP
msg_format("%sは消えた。", o_name);
#else
- msg_format("The %s disappear%s.",
- o_name, (plural ? "" : "s"));
+ msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
#endif
-
-
/* Debug */
if (p_ptr->wizard) msg_print(_("(破損)", "(breakage)"));
object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));\r
\r
/* Drop the object from heaven */\r
- drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);\r
+ (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);\r
}\r
}\r
break;\r