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

Function pick_pick

src/shk.c:920–947  ·  view source on GitHub ↗

called when removing a pick-axe or mattock from a container */

Source from the content-addressed store, hash-verified

918
919/* called when removing a pick-axe or mattock from a container */
920void
921pick_pick(struct obj *obj)
922{
923 struct monst *shkp;
924
925 if (obj->unpaid || !is_pick(obj))
926 return;
927 shkp = shop_keeper(*u.ushops);
928 if (shkp && inhishop(shkp)) {
929 static NEARDATA long pickmovetime = 0L;
930
931 /* if you bring a sack of N picks into a shop to sell,
932 don't repeat this N times when they're taken out */
933 if (svm.moves != pickmovetime) {
934 if (!Deaf && !muteshk(shkp)) {
935 SetVoice(shkp, 0, 80, 0);
936 verbalize("You sneaky %s! Get out of here with that pick!",
937 cad(FALSE));
938 } else {
939 pline("%s %s your pick!",
940 Shknam(shkp),
941 haseyes(shkp->data) ? "glares at"
942 : "is dismayed because of");
943 }
944 }
945 pickmovetime = svm.moves;
946 }
947}
948
949/*
950 Decide whether two unpaid items are mergeable; caller is responsible for

Callers 1

out_containerFunction · 0.85

Calls 6

shop_keeperFunction · 0.85
inhishopFunction · 0.85
verbalizeFunction · 0.85
cadFunction · 0.85
ShknamFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected