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

Function shopdig

src/shk.c:5018–5110  ·  view source on GitHub ↗

You are digging in the shop. */

Source from the content-addressed store, hash-verified

5016
5017/* You are digging in the shop. */
5018void
5019shopdig(int fall)
5020{
5021 struct monst *shkp = shop_keeper(*u.ushops);
5022 int lang;
5023 const char *grabs = "grabs";
5024
5025 if (!shkp)
5026 return;
5027 if (!inhishop(shkp)) {
5028 if (Role_if(PM_KNIGHT)) {
5029 You_feel("like a common thief.");
5030 adjalign(-sgn(u.ualign.type));
5031 }
5032 return;
5033 }
5034 /* 0 == can't speak, 1 == makes animal noises, 2 == speaks */
5035 lang = 0;
5036 if (helpless(shkp) || is_silent(shkp->data))
5037 ; /* lang stays 0 */
5038 else if (shkp->data->msound <= MS_ANIMAL)
5039 lang = 1;
5040 else if (shkp->data->msound >= MS_HUMANOID)
5041 lang = 2;
5042
5043 if (!fall) {
5044 if (lang == 2) {
5045 if (!Deaf && !muteshk(shkp)) {
5046 SetVoice(shkp, 0, 80, 0);
5047 if (u.utraptype == TT_PIT) {
5048 verbalize(
5049 "Be careful, %s, or you might fall through the floor.",
5050 flags.female ? "madam" : "sir");
5051 } else {
5052 verbalize("%s, do not damage the floor here!",
5053 flags.female ? "Madam" : "Sir");
5054 }
5055 }
5056 }
5057 if (Role_if(PM_KNIGHT)) {
5058 You_feel("like a common thief.");
5059 adjalign(-sgn(u.ualign.type));
5060 }
5061 } else if (!um_dist(shkp->mx, shkp->my, 5)
5062 && !helpless(shkp)
5063 && (ESHK(shkp)->billct || ESHK(shkp)->debit)) {
5064 struct obj *obj, *obj2;
5065
5066 if (nolimbs(shkp->data)) {
5067 grabs = "knocks off";
5068#if 0
5069 /* This is what should happen, but for balance
5070 * reasons, it isn't currently.
5071 */
5072 if (lang == 2)
5073 pline("%s curses %s inability to grab your backpack!",
5074 Shknam(shkp), noit_mhim(shkp));
5075 rile_shk(shkp);

Callers 3

digactualholeFunction · 0.85
use_pick_axe2Function · 0.85
fall_throughFunction · 0.85

Calls 15

shop_keeperFunction · 0.85
inhishopFunction · 0.85
You_feelFunction · 0.85
adjalignFunction · 0.85
sgnFunction · 0.85
verbalizeFunction · 0.85
um_distFunction · 0.85
ShknamFunction · 0.85
rile_shkFunction · 0.85
mnextoFunction · 0.85
growlFunction · 0.85
makepluralFunction · 0.85

Tested by

no test coverage detected