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

Function do_stinking_cloud

src/read.c:3081–3105  ·  view source on GitHub ↗

prompt the player to create a stinking cloud and then create it if they give a location */

Source from the content-addressed store, hash-verified

3079/* prompt the player to create a stinking cloud and then create it if they
3080 give a location */
3081staticfn void
3082do_stinking_cloud(struct obj *sobj, boolean mention_stinking)
3083{
3084 coord cc;
3085
3086 pline("Where do you want to center the %scloud?",
3087 mention_stinking ? "stinking " : "");
3088 cc.x = u.ux;
3089 cc.y = u.uy;
3090 getpos_sethilite(display_stinking_cloud_positions, can_center_cloud);
3091 if (getpos(&cc, TRUE, "the desired position") < 0) {
3092 pline1(Never_mind);
3093 return;
3094 } else if (!can_center_cloud(cc.x, cc.y)) {
3095 if (Hallucination)
3096 pline("Ugh... someone cut the cheese.");
3097 else
3098 pline("%s a whiff of rotten eggs.",
3099 sobj->oclass == SCROLL_CLASS ? "The scroll crumbles with"
3100 : "You smell");
3101 return;
3102 }
3103 (void) create_gas_cloud(cc.x, cc.y, 15 + 10 * bcsign(sobj),
3104 8 + 4 * bcsign(sobj));
3105}
3106
3107/* some creatures have special data structures that only make sense in their
3108 * normal locations -- if the player tries to create one elsewhere, or to

Callers 1

seffect_stinking_cloudFunction · 0.85

Calls 6

getpos_sethiliteFunction · 0.85
getposFunction · 0.85
can_center_cloudFunction · 0.85
create_gas_cloudFunction · 0.85
bcsignFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected