"UNPERM",
"TELEPORTABLE",
"CONVERT",
+ "GLASS",
};
"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) */
#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);
}
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;
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;
}
}
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 */