#include "angband.h"
#include "trap.h"
+#include "monster.h"
+#include "artifact.h"
+#include "cmd-activate.h"
* モンスターの打撃手段トークンの定義 /
* Monster Blow Methods
*/
-static cptr r_info_blow_method[] =
+static concptr r_info_blow_method[] =
{
"",
"HIT",
* モンスターの打撃属性トークンの定義 /
* Monster Blow Effects
*/
-static cptr r_info_blow_effect[] =
+static concptr r_info_blow_effect[] =
{
"",
"HURT",
* 地形属性トークンの定義 /
* Feature info flags
*/
-static cptr f_info_flags[] =
+static concptr f_info_flags[] =
{
"LOS",
"PROJECT",
* モンスター特性トークンの定義1 /
* Monster race flags
*/
-static cptr r_info_flags1[] =
+static concptr r_info_flags1[] =
{
"UNIQUE",
"QUESTOR",
* モンスター特性トークンの定義2 /
* Monster race flags
*/
-static cptr r_info_flags2[] =
+static concptr r_info_flags2[] =
{
"STUPID",
"SMART",
* モンスター特性トークンの定義3 /
* Monster race flags
*/
-static cptr r_info_flags3[] =
+static concptr r_info_flags3[] =
{
"ORC",
"TROLL",
* モンスター特性トークンの定義4 /
* Monster race flags
*/
-static cptr r_info_flags4[] =
+static concptr r_info_flags4[] =
{
"SHRIEK",
"XXX1",
* モンスター特性トークン(発動型能力1) /
* Monster race flags
*/
-static cptr r_a_ability_flags1[] =
+static concptr r_a_ability_flags1[] =
{
"BA_ACID",
"BA_ELEC",
* モンスター特性トークン(発動型能力2) /
* Monster race flags
*/
-static cptr r_a_ability_flags2[] =
+static concptr r_a_ability_flags2[] =
{
"HASTE",
"HAND_DOOM",
* モンスター特性トークン(発動型能力3) /
* Monster race flags
*/
-static cptr r_a_ability_flags3[] =
+static concptr r_a_ability_flags3[] =
{
"XXXA3X00",
"XXXA3X01",
* モンスター特性トークン(発動型能力4) /
* Monster race flags
*/
-static cptr r_a_ability_flags4[] =
+static concptr r_a_ability_flags4[] =
{
"XXXA4X00",
"XXXA4X01",
* モンスター特性トークンの定義7 /
* Monster race flags
*/
-static cptr r_info_flags7[] =
+static concptr r_info_flags7[] =
{
"AQUATIC",
"CAN_SWIM",
* モンスター特性トークンの定義8 /
* Monster race flags
*/
-static cptr r_info_flags8[] =
+static concptr r_info_flags8[] =
{
"WILD_ONLY",
"WILD_TOWN",
* モンスター特性トークンの定義9 /
* Monster race flags
*/
-static cptr r_info_flags9[] =
+static concptr r_info_flags9[] =
{
"DROP_CORPSE",
"DROP_SKELETON",
* モンスター特性トークンの定義R(耐性) /
* Monster race flags
*/
-static cptr r_info_flagsr[] =
+static concptr r_info_flagsr[] =
{
"IM_ACID",
"IM_ELEC",
* オブジェクト基本特性トークンの定義 /
* Object flags
*/
-static cptr k_info_flags[] =
+static concptr k_info_flags[] =
{
"STR",
"INT",
* オブジェクト生成特性トークンの定義 /
* Object flags
*/
-static cptr k_info_gen_flags[] =
+static concptr k_info_gen_flags[] =
{
"INSTA_ART",
"QUESTITEM",
* ダンジョン特性トークンの定義 /
* Dungeon flags
*/
-static cptr d_info_flags1[] =
+static concptr d_info_flags1[] =
{
"WINNER",
"MAZE",
"CAVE",
"CAVERN",
"ARCADE",
- "XXX",
- "XXX",
+ "LAKE_ACID",
+ "LAKE_POISONOUS",
"XXX",
"FORGET",
"LAKE_WATER",
"NO_MELEE",
"CHAMELEON",
"DARKNESS",
- "XXX",
- "XXX"
+ "ACID_RIVER",
+ "POISONOUS_RIVER"
};
* Returns FALSE when there isn't enough space available to store
* the text.
*/
-static bool add_text(u32b *offset, header *head, cptr buf, bool normal_text)
+static bool add_text(u32b *offset, header *head, concptr buf, bool normal_text)
{
/* Hack -- Verify space */
if (head->text_size + strlen(buf) + 8 > FAKE_TEXT_SIZE)
* Returns FALSE when there isn't enough space available to store
* the text.
*/
-static bool add_name(u32b *offset, header *head, cptr buf)
+static bool add_name(u32b *offset, header *head, concptr buf)
{
/* Hack -- Verify space */
if (head->name_size + strlen(buf) + 8 > FAKE_NAME_SIZE)
* Returns FALSE when there isn't enough space available to store
* the text.
*/
-static bool add_tag(STR_OFFSET *offset, header *head, cptr buf)
+static bool add_tag(STR_OFFSET *offset, header *head, concptr buf)
{
u32b i;
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_flag(u32b *flags, cptr names[], cptr what)
+static errr grab_one_flag(u32b *flags, concptr names[], concptr what)
{
int i;
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_feat_flag(feature_type *f_ptr, cptr what)
+static errr grab_one_feat_flag(feature_type *f_ptr, concptr what)
{
int i;
* @param count ステートの保存先ID
* @return エラーコード
*/
-static errr grab_one_feat_action(feature_type *f_ptr, cptr what, int count)
+static errr grab_one_feat_action(feature_type *f_ptr, concptr what, int count)
{
FF_FLAGS_IDX i;
/* Start at next entry */
s = t;
- /* Continue */
continue;
}
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
* @param str タグ文字列
* @return 地形ID
*/
-s16b f_tag_to_index(cptr str)
+s16b f_tag_to_index(concptr str)
{
u16b i;
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_kind_flag(object_kind *k_ptr, cptr what)
+static errr grab_one_kind_flag(object_kind *k_ptr, concptr what)
{
int i;
* @param what 参照元の文字列ポインタ
* @return 発動能力ID
*/
-static byte grab_one_activation_flag(cptr what)
+static byte grab_one_activation_flag(concptr what)
{
int i;
* @param what 参照元の文字列ポインタ
* @return エラーがあった場合1、エラーがない場合0を返す
*/
-static errr grab_one_artifact_flag(artifact_type *a_ptr, cptr what)
+static errr grab_one_artifact_flag(artifact_type *a_ptr, concptr what)
{
int i;
* @param what 参照元の文字列ポインタ
* @return エラーがあった場合1、エラーがない場合0を返す
*/
-static bool grab_one_ego_item_flag(ego_item_type *e_ptr, cptr what)
+static bool grab_one_ego_item_flag(ego_item_type *e_ptr, concptr what)
{
int i;
errr parse_e_info(char *buf, header *head)
{
int i;
-
char *s, *t;
/* Current entry */
static ego_item_type *e_ptr = NULL;
-
/* Just before the first record */
error_idx = -1;
/* Just before the first line */
error_line = -1;
-
/* Process 'N' for "New/Number/Name" */
if (buf[0] == 'N')
{
/* Find the colon before the name */
s = my_strchr(buf+2, ':');
- /* Verify that colon */
+ /* Verify that colon */
if (!s) return (1);
/* Nuke the colon, advance to the name */
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_basic_flag(monster_race *r_ptr, cptr what)
+static errr grab_one_basic_flag(monster_race *r_ptr, concptr what)
{
if (grab_one_flag(&r_ptr->flags1, r_info_flags1, what) == 0)
return 0;
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_spell_flag(monster_race *r_ptr, cptr what)
+static errr grab_one_spell_flag(monster_race *r_ptr, concptr what)
{
if (grab_one_flag(&r_ptr->flags4, r_info_flags4, what) == 0)
return 0;
errr parse_r_info(char *buf, header *head)
{
int i;
-
char *s, *t;
/* Current entry */
{
int id, ds, dd;
/* Find the next empty blow slot (if any) */
- for (i = 0; i < 6; i++) if (r_ptr->reinforce_id[i] == 0) break;
+ for (i = 0; i < A_MAX; i++) if (r_ptr->reinforce_id[i] == 0) break;
/* Oops, no more slots */
if (i == 6) return (1);
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_dungeon_flag(dungeon_info_type *d_ptr, cptr what)
+static errr grab_one_dungeon_flag(dungeon_info_type *d_ptr, concptr what)
{
if (grab_one_flag(&d_ptr->flags1, d_info_flags1, what) == 0)
return 0;
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_basic_monster_flag(dungeon_info_type *d_ptr, cptr what)
+static errr grab_one_basic_monster_flag(dungeon_info_type *d_ptr, concptr what)
{
if (grab_one_flag(&d_ptr->mflags1, r_info_flags1, what) == 0)
return 0;
* @param what 参照元の文字列ポインタ
* @return エラーコード
*/
-static errr grab_one_spell_monster_flag(dungeon_info_type *d_ptr, cptr what)
+static errr grab_one_spell_monster_flag(dungeon_info_type *d_ptr, concptr what)
{
if (grab_one_flag(&d_ptr->mflags4, r_info_flags4, what) == 0)
return 0;
errr parse_d_info(char *buf, header *head)
{
int i;
-
char *s, *t;
/* Current entry */
static dungeon_info_type *d_ptr = NULL;
-
/* Process 'N' for "New/Number/Name" */
if (buf[0] == 'N')
{
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
{
/* Start at next entry */
s = t;
-
- /* Continue */
continue;
}
IDX trap; /* Trap */
BIT_FLAGS cave_info; /* Flags for CAVE_MARK, CAVE_GLOW, CAVE_ICKY, CAVE_ROOM */
s16b special; /* Reserved for special terrain info */
- int random; /* Number of the random effect */
+ int random; /* Number of the random effect */
};
int num;
char *zz[9];
-
if (init_flags & INIT_ONLY_BUILDINGS) return (0);
/* Tokenize the line */
static errr parse_line_building(char *buf)
{
int i;
- char *zz[37];
+ char *zz[1000];
int index;
char *s;
/* Building Classes */
case 'C':
{
- if (tokenize(s + 2, MAX_CLASS, zz, 0) == MAX_CLASS)
- {
- for (i = 0; i < MAX_CLASS; i++)
- {
- building[index].member_class[i] = (CLASS_IDX)atoi(zz[i]);
- }
-
- break;
+ int n;
+ n = tokenize(s + 2, MAX_CLASS, zz, 0);
+ for (i = 0; i < MAX_CLASS; i++)
+ {
+ building[index].member_class[i] = ((i < n) ? (CLASS_IDX)atoi(zz[i]) : 1);
}
-
- return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+ break;
}
/* Building Races */
case 'R':
{
- if (tokenize(s+2, MAX_RACES, zz, 0) == MAX_RACES)
+ int n;
+ n = tokenize(s + 2, MAX_RACES, zz, 0);
+ for (i = 0; i < MAX_RACES; i++)
{
- for (i = 0; i < MAX_RACES; i++)
- {
- building[index].member_race[i] = (RACE_IDX)atoi(zz[i]);
- }
-
- break;
+ building[index].member_race[i] = ((i < n) ? (RACE_IDX)atoi(zz[i]) : 1);
}
-
- return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+ break;
}
/* Building Realms */
case 'M':
{
- if (tokenize(s+2, MAX_MAGIC, zz, 0) == MAX_MAGIC)
+ int n;
+ n = tokenize(s + 2, MAX_MAGIC, zz, 0);
+ for (i = 0; i < MAX_MAGIC; i++)
{
- for (i = 0; i < MAX_MAGIC; i++)
- {
- building[index].member_realm[i+1] = (REALM_IDX)atoi(zz[i]);
- }
-
- break;
+ building[index].member_realm[i+1] = ((i < n) ? (REALM_IDX)atoi(zz[i]) : 1);
}
-
- return (PARSE_ERROR_TOO_FEW_ARGUMENTS);
+ break;
}
case 'Z':
cave_type *c_ptr = &cave[y][x];
object_type *o_ptr;
- /* Get new object */
OBJECT_IDX o_idx = o_pop();
/* Access new object */
/* Structure copy */
object_copy(o_ptr, j_ptr);
-
/* Locate */
o_ptr->iy = y;
o_ptr->ix = x;
for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
{
- /* Access the grid */
cave_type *c_ptr = &cave[*y][*x];
int idx = s[0];
- IDX object_index = letter[idx].object;
- IDX monster_index = letter[idx].monster;
+ OBJECT_IDX object_index = letter[idx].object;
+ MONSTER_IDX monster_index = letter[idx].monster;
int random = letter[idx].random;
- IDX artifact_index = letter[idx].artifact;
+ ARTIFACT_IDX artifact_index = letter[idx].artifact;
/* Lay down a floor */
c_ptr->feat = conv_dungeon_feat(letter[idx].feature);
}
else if (object_index)
{
- /* Get local object */
object_type *o_ptr = &object_type_body;
-
- /* Create the item */
object_prep(o_ptr, object_index);
if (o_ptr->tval == TV_GOLD)
object_type *q_ptr = &forge;
object_prep(q_ptr, k_idx);
-
- /* Drop it in the dungeon */
drop_here(q_ptr, *y, *x);
}
else
/* Place player in a quest level */
if (p_ptr->inside_quest)
{
- int py, px;
+ POSITION py, px;
/* Delete the monster (if any) */
delete_monster(p_ptr->y, p_ptr->x);
static char tmp[8];
-static cptr variant = "ZANGBAND";
+static concptr variant = "ZANGBAND";
/*!
* @param fp
* @return エラーコード
*/
-static cptr process_dungeon_file_expr(char **sp, char *fp)
+static concptr process_dungeon_file_expr(char **sp, char *fp)
{
- cptr v;
+ concptr v;
char *b;
char *s;
/* Analyze */
if (*s == b1)
{
- const char *p;
- const char *t;
+ concptr p;
+ concptr t;
/* Skip b1 */
s++;
/* Save */
(*fp) = f;
-
- /* Save */
(*sp) = s;
return (v);
}
* @param xmax 詳細不明
* @return エラーコード
*/
-errr process_dungeon_file(cptr name, int ymin, int xmin, int ymax, int xmax)
+errr process_dungeon_file(concptr name, int ymin, int xmin, int ymax, int xmax)
{
FILE *fp;
char buf[1024];
if ((buf[0] == '?') && (buf[1] == ':'))
{
char f;
- cptr v;
+ concptr v;
char *s;
/* Start */
/* Set flag */
bypass = (streq(v, "0") ? TRUE : FALSE);
-
- /* Continue */
continue;
}
/* Errors */
if (err)
{
- cptr oops;
+ concptr oops;
/* Error string */
oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "unknown");
msg_print(NULL);
}
-
- /* Close the file */
my_fclose(fp);
return (err);
}
int i, j, z, fc, bc;
int dlen;
- cptr flags[32 * 10];
+ concptr flags[32 * 10];
u32b f_ptr[10];
- cptr *n_ptr[10];
+ concptr *n_ptr[10];
monster_race *r_ptr;
FILE *fff = fopen("output.txt", "wt");
- cptr desc;
+ concptr desc;
BIT_FLAGS mode = -1;
r_info_blow_effect[b_ptr->effect],
b_ptr->d_dice, b_ptr->d_side);
}
-
- /* Extract the flags */
for (fc = 0, j = 0; j < 32 * 3; j++)
{
/* Check this flag */