MCPcopy Index your code
hub / github.com/NetHack/NetHack / cad

Function cad

src/shk.c:5907–5941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5905}
5906
5907staticfn const char *
5908cad(
5909 boolean altusage) /* used as a verbalized exclamation: \"Cad! ...\" */
5910{
5911 const char *res = 0;
5912
5913 switch (is_demon(gy.youmonst.data) ? 3 : poly_gender()) {
5914 case 0:
5915 res = "cad";
5916 break;
5917 case 1:
5918 res = "minx";
5919 break;
5920 case 2:
5921 res = "beast";
5922 break;
5923 case 3:
5924 res = "fiend";
5925 break;
5926 default:
5927 impossible("cad: unknown gender");
5928 res = "thing";
5929 break;
5930 }
5931 if (altusage) {
5932 char *cadbuf = mon_nam(&gy.youmonst); /* snag an output buffer */
5933
5934 /* alternate usage adds a leading double quote and trailing
5935 exclamation point plus sentence separating spaces */
5936 Sprintf(cadbuf, "\"%s! ", res);
5937 cadbuf[1] = highc(cadbuf[1]);
5938 res = cadbuf;
5939 }
5940 return res;
5941}
5942
5943#ifdef __SASC
5944void

Callers 3

pick_pickFunction · 0.85
pay_for_damageFunction · 0.85
check_unpaid_usageFunction · 0.85

Calls 4

poly_genderFunction · 0.85
mon_namFunction · 0.85
highcFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected