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

Function Sting_effects

src/artifact.c:2465–2502  ·  view source on GitHub ↗

use for warning "glow" for Sting, Orcrist, and Grimtooth */

Source from the content-addressed store, hash-verified

2463
2464/* use for warning "glow" for Sting, Orcrist, and Grimtooth */
2465void
2466Sting_effects(
2467 int orc_count) /* new count (warn_obj_cnt is old count);
2468 * -1 is a flag value */
2469{
2470 if (u_wield_art(ART_STING)
2471 || u_wield_art(ART_ORCRIST)
2472 || u_wield_art(ART_GRIMTOOTH)) {
2473 int oldstr = glow_strength(gw.warn_obj_cnt),
2474 newstr = glow_strength(orc_count);
2475
2476 if (orc_count == -1 && gw.warn_obj_cnt > 0) {
2477 /* -1 means that blindness has just been toggled; give a
2478 'continue' message that eventual 'stop' message will match */
2479 pline("%s is %s.", bare_artifactname(uwep),
2480 glow_verb(Blind ? 0 : gw.warn_obj_cnt, TRUE));
2481 } else if (newstr > 0 && newstr != oldstr) {
2482 /* goto_level() -> docrt() -> see_monsters() -> Sting_effects();
2483 if "you materialize on a different level" is pending, give
2484 it now so that start-glowing message comes after it */
2485 maybe_lvltport_feedback(); /* usually called by goto_level() */
2486
2487 /* 'start' message */
2488 if (!Blind)
2489 pline("%s %s %s%c", bare_artifactname(uwep),
2490 otense(uwep, glow_verb(orc_count, FALSE)),
2491 glow_color(uwep->oartifact),
2492 (newstr > oldstr) ? '!' : '.');
2493 else if (oldstr == 0) /* quivers */
2494 pline("%s %s slightly.", bare_artifactname(uwep),
2495 otense(uwep, glow_verb(0, FALSE)));
2496 } else if (orc_count == 0 && gw.warn_obj_cnt > 0) {
2497 /* 'stop' message */
2498 pline("%s stops %s.", bare_artifactname(uwep),
2499 glow_verb(Blind ? 0 : gw.warn_obj_cnt, TRUE));
2500 }
2501 }
2502}
2503
2504/* called when hero is wielding/applying/invoking a carried item, or
2505 after undergoing a transformation (alignment change, lycanthropy,

Callers 2

toggle_blindnessFunction · 0.85
see_monstersFunction · 0.85

Calls 7

glow_strengthFunction · 0.85
bare_artifactnameFunction · 0.85
glow_verbFunction · 0.85
maybe_lvltport_feedbackFunction · 0.85
otenseFunction · 0.85
glow_colorFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected