*/
#include "angband.h"
+#include "world.h"
+#include "monster.h"
+#include "realm-hex.h"
+#include "player-status.h"
/*!
* @brief 地形生成確率を決める要素100の配列を確率テーブルから作成する
* @param depth_max 深みの最大値
* @return なし
*/
-static void perturb_point_mid(int x1, int x2, int x3, int x4,
- int xmid, int ymid, int rough, int depth_max)
+static void perturb_point_mid(FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, FEAT_IDX x4, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
{
/*
* Average the four corners & perturb it a bit.
* tmp is a random int +/- rough
*/
- int tmp2 = rough*2 + 1;
- int tmp = randint1(tmp2) - (rough + 1);
+ FEAT_IDX tmp2 = rough*2 + 1;
+ FEAT_IDX tmp = randint1(tmp2) - (rough + 1);
- int avg = ((x1 + x2 + x3 + x4) / 4) + tmp;
+ FEAT_IDX avg = ((x1 + x2 + x3 + x4) / 4) + tmp;
/* Division always rounds down, so we round up again */
if (((x1 + x2 + x3 + x4) % 4) > 1)
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- cave[ymid][xmid].feat = (s16b)avg;
+ cave[ymid][xmid].feat = (FEAT_IDX)avg;
}
* @param depth_max 深みの最大値
* @return なし
*/
-static void perturb_point_end(int x1, int x2, int x3,
- int xmid, int ymid, int rough, int depth_max)
+static void perturb_point_end(FEAT_IDX x1, FEAT_IDX x2, FEAT_IDX x3, POSITION xmid, POSITION ymid, FEAT_IDX rough, FEAT_IDX depth_max)
{
/*
* Average the three corners & perturb it a bit.
* tmp is a random int +/- rough
*/
- int tmp2 = rough * 2 + 1;
- int tmp = randint0(tmp2) - rough;
+ FEAT_IDX tmp2 = rough * 2 + 1;
+ FEAT_IDX tmp = randint0(tmp2) - rough;
- int avg = ((x1 + x2 + x3) / 3) + tmp;
+ FEAT_IDX avg = ((x1 + x2 + x3) / 3) + tmp;
/* Division always rounds down, so we round up again */
if ((x1 + x2 + x3) % 3) avg++;
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- cave[ymid][xmid].feat = (s16b)avg;
+ cave[ymid][xmid].feat = (FEAT_IDX)avg;
}
* need to be converted to features.
* </pre>
*/
-static void plasma_recursive(int x1, int y1, int x2, int y2,
- int depth_max, int rough)
+static void plasma_recursive(POSITION x1, POSITION y1, POSITION x2, POSITION y2, FEAT_IDX depth_max, FEAT_IDX rough)
{
/* Find middle */
- int xmid = (x2 - x1) / 2 + x1;
- int ymid = (y2 - y1) / 2 + y1;
+ POSITION xmid = (x2 - x1) / 2 + x1;
+ POSITION ymid = (y2 - y1) / 2 + y1;
/* Are we done? */
if (x1 + 1 == x2) return;
*/
static void generate_wilderness_area(int terrain, u32b seed, bool border, bool corner)
{
- int x1, y1;
+ POSITION x1, y1;
int table_size = sizeof(terrain_table[0]) / sizeof(s16b);
- int roughness = 1; /* The roughness of the level. */
+ FEAT_IDX roughness = 1; /* The roughness of the level. */
u32b state_backup[4];
/* Unused */
* If corner is set then only the corners of the area are needed.
* </pre>
*/
-static void generate_area(int y, int x, bool border, bool corner)
+static void generate_area(POSITION y, POSITION x, bool border, bool corner)
{
- int x1, y1;
+ POSITION x1, y1;
/* Number of the town (if any) */
p_ptr->town_num = (s16b)wilderness[y][x].town;
x = p_ptr->wilderness_x;
y = p_ptr->wilderness_y;
-
- /* Prepare allocation table */
get_mon_num_prep(get_monster_hook(), NULL);
/* North border */
*/
void seed_wilderness(void)
{
- int x, y;
+ POSITION x, y;
/* Init wilderness seeds */
for (x = 0; x < max_wild_x; x++)
* @param fmt 地勢内の地形数を参照するための独自フォーマット
* @return なし
*/
-static void init_terrain_table(int terrain, s16b feat_global, cptr fmt, ...)
+static void init_terrain_table(int terrain, s16b feat_global, concptr fmt, ...)
{
va_list vp;
- cptr p;
+ concptr p;
int cur = 0;
char check = 'a';
- s16b feat;
+ FEAT_IDX feat;
int num;
/* Begin the varargs stuff */
#else
msg_print("You cannot enter global map, since there is some monsters nearby!");
#endif
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
if (have_pet)
{
#ifdef JP
- cptr msg = "ペットを置いて広域マップに入りますか?";
+ concptr msg = "ペットを置いて広域マップに入りますか?";
#else
- cptr msg = "Do you leave your pets behind? ";
+ concptr msg = "Do you leave your pets behind? ";
#endif
if (!get_check_strict(msg, CHECK_OKAY_CANCEL))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
}