MCPcopy Create free account
hub / github.com/NetHack/NetHack / hawaiian_design

Function hawaiian_design

src/read.c:223–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223staticfn char *
224hawaiian_design(struct obj *shirt, char *buf)
225{
226 static const char *const hawaiian_bgs[] = {
227 /* solid colors */
228 "purple",
229 "yellow",
230 "red",
231 "blue",
232 "orange",
233 "black",
234 "green",
235 /* adjectives */
236 "abstract",
237 "geometric",
238 "patterned",
239 "naturalistic",
240 };
241
242 /* This hash method is slightly different than the one in hawaiian_motif;
243 using the same formula in both cases may lead to some shirt combos
244 never appearing, if the sizes of the two lists have common factors. */
245 unsigned bg = shirt->o_id ^ (unsigned) ~ubirthday;
246
247 Sprintf(buf, "%s on %s background",
248 makeplural(hawaiian_motif(shirt, buf)),
249 an(hawaiian_bgs[bg % SIZE(hawaiian_bgs)]));
250 return buf;
251}
252
253char *
254apron_text(struct obj *apron, char *buf)

Callers 1

doreadFunction · 0.85

Calls 3

makepluralFunction · 0.85
hawaiian_motifFunction · 0.85
anFunction · 0.85

Tested by

no test coverage detected