static boolean learnscrolltyp(short);
static void cap_spe(struct obj *);
static char *erode_obj_text(struct obj *, char *);
+static char *hawaiian_design(struct obj *, char *);
static int read_ok(struct obj *);
static void stripspe(struct obj *);
static void p_glow1(struct obj *);
return erode_obj_text(tshirt, buf);
}
+char *
+hawaiian_motif(struct obj *shirt, char *buf)
+{
+ static const char *hawaiian_motifs[] = {
+ /* birds */
+ "flamingo",
+ "parrot",
+ "toucan",
+ "bird of paradise", /* could be a bird or a flower */
+ /* sea creatures */
+ "sea turtle",
+ "tropical fish",
+ "jellyfish",
+ "giant eel",
+ "water nymph",
+ /* plants */
+ "plumeria",
+ "orchid",
+ "hibiscus flower",
+ "palm tree",
+ /* other */
+ "hula dancer",
+ "sailboat",
+ "ukulele",
+ };
+
+ /* a tourist's starting shirt always has the same o_id; we need some
+ additional randomness or else its design will never differ */
+ unsigned motif = shirt->o_id ^ (unsigned) ubirthday;
+
+ Strcpy(buf, hawaiian_motifs[motif % SIZE(hawaiian_motifs)]);
+ return buf;
+}
+
+static char *
+hawaiian_design(struct obj *shirt, char *buf)
+{
+ static const char *hawaiian_bgs[] = {
+ /* solid colors */
+ "purple",
+ "yellow",
+ "red",
+ "blue",
+ "orange",
+ "black",
+ "green",
+ /* adjectives */
+ "abstract",
+ "geometric",
+ "patterned",
+ "naturalistic",
+ };
+
+ /* This hash method is slightly different than the one in hawaiian_motif;
+ using the same formula in both cases may lead to some shirt combos
+ never appearing, if the sizes of the two lists have common factors. */
+ unsigned bg = shirt->o_id ^ (unsigned) ~ubirthday;
+
+ Sprintf(buf, "%s on %s background",
+ makeplural(hawaiian_motif(shirt, buf)),
+ an(hawaiian_bgs[bg % SIZE(hawaiian_bgs)]));
+ return buf;
+}
+
char *
apron_text(struct obj* apron, char* buf)
{
u.uconduct.literate++;
useup(scroll);
return 1;
- } else if (otyp == T_SHIRT || otyp == ALCHEMY_SMOCK) {
+ } else if (otyp == T_SHIRT || otyp == ALCHEMY_SMOCK
+ || otyp == HAWAIIAN_SHIRT) {
char buf[BUFSZ], *mesg;
const char *endpunct;
return 0;
}
/* can't read shirt worn under suit (under cloak is ok though) */
- if (otyp == T_SHIRT && uarm && scroll == uarmu) {
+ if ((otyp == T_SHIRT || otyp == HAWAIIAN_SHIRT) && uarm
+ && scroll == uarmu) {
pline("%s shirt is obscured by %s%s.",
scroll->unpaid ? "That" : "Your", shk_your(buf, uarm),
suit_simple_name(uarm));
return 0;
}
+ if (otyp == HAWAIIAN_SHIRT) {
+ pline("%s features %s.", flags.verbose ? "The design" : "It",
+ hawaiian_design(scroll, buf));
+ return 1;
+ }
u.uconduct.literate++;
/* populate 'buf[]' */
mesg = (otyp == T_SHIRT) ? tshirt_text(scroll, buf)