"EXP_VAMP",
"DR_MANA",
"SUPERHURT",
+ "INERTIA",
+ "STUN",
NULL
};
"UNPERM",
"TELEPORTABLE",
"CONVERT",
+ "GLASS",
};
"RANDOM_CURSE0",
"RANDOM_CURSE1",
"RANDOM_CURSE2",
- "XXX",
+ "XTRA_DICE",
"XXX",
"XXX",
"XXX",
"XXX",
};
-
/*
* Dungeon flags
*/
"NO_DOORS",
"WATER_RIVER",
"LAVA_RIVER",
- "XXX",
- "XXX",
+ "CURTAIN",
+ "GLASS_DOOR",
"CAVE",
"CAVERN",
"XXX",
"NO_VAULT",
"ARENA",
"DESTROY",
- "XXX",
+ "GLASS_ROOM",
"NO_CAVE",
"NO_MAGIC",
"NO_MELEE",
* Returns FALSE when there isn't enough space available to store
* the text.
*/
-static bool add_text(u32b *offset, header *head, cptr buf)
+static bool add_text(u32b *offset, header *head, cptr buf, bool normal_text)
{
/* Hack -- Verify space */
if (head->text_size + strlen(buf) + 8 > FAKE_TEXT_SIZE)
if (*offset == 0)
{
/* Advance and save the text index */
- *offset = ++head->text_size;
+ *offset = ++head->text_size;
}
/* Additional text */
- else
+ else if (normal_text)
{
/*
* If neither the end of the last line nor
/* Prepare the "fake" stuff */
head->name_size = 0;
head->text_size = 0;
- head->tag_size = 1;
+ head->tag_size = 0;
/* Parse */
while (0 == my_fgets(fp, buf, 1024))
s = buf+2;
/* Store the text */
- if (!add_text(&v_ptr->text, head, s)) return (7);
+ if (!add_text(&v_ptr->text, head, s, FALSE)) return (7);
}
/* Process 'X' for "Extra info" (one line only) */
while (*t == ' ' || *t == '|') t++;
}
+ /* XXX XXX XXX Hack -- Read feature subtype */
+ if (1 == sscanf(s, "SUBTYPE_%d", &i))
+ {
+ /* Extract a "subtype" */
+ f_ptr->subtype = i;
+
+ /* Start at next entry */
+ s = t;
+
+ /* Continue */
+ continue;
+ }
+
/* XXX XXX XXX Hack -- Read feature power */
if (1 == sscanf(s, "POWER_%d", &i))
{
#endif
/* Store the text */
- if (!add_text(&k_ptr->text, head, s)) return (7);
+ if (!add_text(&k_ptr->text, head, s, TRUE)) return (7);
}
/* Process 'G' for "Graphics" (one line only) */
return (1);
}
+/*
+ * Grab one activation index flag
+ */
+static byte grab_one_activation_flag(cptr what)
+{
+ int i;
+
+ for (i = 0; ; i++)
+ {
+ if (activation_info[i].flag == NULL) break;
+
+ if (streq(what, activation_info[i].flag))
+ {
+ return activation_info[i].index;
+ }
+ }
+ i = atoi(what);
+ if (i > 0)
+ {
+ return ((byte) i);
+ }
+
+ /* Oops */
+#ifdef JP
+ msg_format("̤ÃΤÎȯư¡¦¥Õ¥é¥° '%s'¡£", what);
+#else
+ msg_format("Unknown activation flag '%s'.", what);
+#endif
+
+ /* Error */
+ return (0);
+}
/*
#endif
/* Store the text */
- if (!add_text(&a_ptr->text, head, s)) return (7);
+ if (!add_text(&a_ptr->text, head, s, TRUE)) return (7);
}
a_ptr->to_a = ta;
}
+ /* Hack -- Process 'U' for activation index */
+ else if (buf[0] == 'U')
+ {
+ byte n;
+ n = grab_one_activation_flag(buf + 2);
+ if (n > 0)
+ {
+ a_ptr->act_idx = n;
+ }
+ else
+ {
+ return (5);
+ }
+ }
+
/* Hack -- Process 'F' for flags */
else if (buf[0] == 'F')
{
s = buf+2;
/* Store the text */
- if (!add_text(&e_ptr->text, head, s)) return (7);
+ if (!add_text(&e_ptr->text, head, s, TRUE)) return (7);
}
#endif
#endif
/* Store the text */
- if (!add_text(&r_ptr->text, head, s)) return (7);
+ if (!add_text(&r_ptr->text, head, s, TRUE)) return (7);
}
/* Process 'G' for "Graphics" (one line only) */
/* Save the values */
r_ptr->speed = spd;
- r_ptr->hdice = hp1;
- r_ptr->hside = hp2;
+ r_ptr->hdice = MAX(hp1, 1);
+ r_ptr->hside = MAX(hp2, 1);
r_ptr->aaf = aaf;
r_ptr->ac = ac;
r_ptr->sleep = slp;
#endif
/* Store the text */
- if (!add_text(&d_ptr->text, head, s)) return (7);
+ if (!add_text(&d_ptr->text, head, s, TRUE)) return (7);
}
/* Process 'W' for "More Info" (one line only) */
int index = zz[0][0];
/* Reset the info for the letter */
- letter[index].feature = FEAT_NONE;
+ letter[index].feature = feat_none;
letter[index].monster = 0;
letter[index].object = 0;
letter[index].ego = 0;
letter[index].artifact = 0;
- letter[index].trap = FEAT_NONE;
+ letter[index].trap = feat_none;
letter[index].cave_info = 0;
letter[index].special = 0;
letter[index].random = RANDOM_NONE;
letter[index].random |= RANDOM_ARTIFACT;
if (zz[6][1]) letter[index].artifact = atoi(zz[6] + 1);
}
+ else if (zz[6][0] == '!')
+ {
+ if (p_ptr->inside_quest)
+ {
+ letter[index].artifact = quest[p_ptr->inside_quest].k_idx;
+ }
+ }
else
{
letter[index].artifact = atoi(zz[6]);
letter[index].random |= RANDOM_OBJECT;
if (zz[4][1]) letter[index].object = atoi(zz[4] + 1);
}
+ else if (zz[4][0] == '!')
+ {
+ if (p_ptr->inside_quest)
+ {
+ int a_idx = quest[p_ptr->inside_quest].k_idx;
+ if (a_idx)
+ {
+ artifact_type *a_ptr = &a_info[a_idx];
+ if (!(a_ptr->gen_flags & TRG_INSTA_ART))
+ {
+ letter[index].object = lookup_kind(a_ptr->tval, a_ptr->sval);
+ }
+ }
+ }
+ }
else
{
letter[index].object = atoi(zz[4]);
else
{
/* Create the artifact */
- create_named_art(artifact_index, *y, *x);
-
- a_info[artifact_index].cur_num = 1;
+ if (create_named_art(artifact_index, *y, *x))
+ a_info[artifact_index].cur_num = 1;
}
}
return (0);
}
+ else if (zz[1][0] == 'R')
+ {
+ if (init_flags & INIT_ASSIGN)
+ {
+ int idx, count = 0;
+ int reward_idx = 0;
+
+ for (idx = 2; idx < num; idx++)
+ {
+ int a_idx = atoi(zz[idx]);
+ if (a_idx < 1) continue;
+ if (a_info[a_idx].cur_num > 0) continue;
+ count++;
+ if (one_in_(count)) reward_idx = a_idx;
+ }
+
+ if (reward_idx)
+ {
+ /* Set quest's rewarding artifact */
+ q_ptr->k_idx = reward_idx;
+ a_info[reward_idx].gen_flags |= TRG_QUESTITEM;
+ }
+ else
+ {
+ /* Change a quest type to KILL_ALL when all artifact of reward list are got */
+ q_ptr->type = QUEST_TYPE_KILL_ALL;
+ }
+ }
+
+ return (0);
+ }
+
/* Process "Q:<q_index>:N:<name>" -- quest name */
else if (zz[1][0] == 'N')
{
- if (init_flags & (INIT_ASSIGN | INIT_SHOW_TEXT))
+ if (init_flags & (INIT_ASSIGN | INIT_SHOW_TEXT | INIT_NAME_ONLY))
{
strcpy(q_ptr->name, zz[2]);
}
else
{
/* Accept all printables except spaces and brackets */
+#ifdef JP
+ while (iskanji(*s) || (isprint(*s) && !my_strchr(" []", *s)))
+ {
+ if (iskanji(*s)) s++;
+ s++;
+ }
+#else
while (isprint(*s) && !my_strchr(" []", *s)) ++s;
+#endif
/* Extract final and Terminate */
if ((f = *s) != '\0') *s++ = '\0';
/* Player name */
else if (streq(b+1, "PLAYER"))
{
- v = player_base;
+ static char tmp_player_name[32];
+ char *pn, *tpn;
+ for (pn = player_name, tpn = tmp_player_name; *pn; pn++, tpn++)
+ {
+#ifdef JP
+ if (iskanji(*pn))
+ {
+ *(tpn++) = *(pn++);
+ *tpn = *pn;
+ continue;
+ }
+#endif
+ *tpn = my_strchr(" []", *pn) ? '_' : *pn;
+ }
+ *tpn = '\0';
+ v = tmp_player_name;
}
/* Town */
v = tmp;
}
+ /* Quest type */
+ else if (prefix(b+1, "QUEST_TYPE"))
+ {
+ /* "QUEST_TYPE" uses a special parameter to determine the type of the quest */
+ sprintf(tmp, "%d", quest[atoi(b+11)].type);
+ v = tmp;
+ }
+
/* Quest status */
else if (prefix(b+1, "QUEST"))
{