MCPcopy Create free account
hub / github.com/crawl/crawl / effect

Method effect

crawl-ref/source/potion.cc:469–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467 }
468
469 bool effect(bool=true, int pow = 40, bool is_potion = true) const override
470 {
471 if (you.backlit())
472 {
473 vector<const char *> afflictions;
474 if (you.haloed() && !you.umbraed())
475 afflictions.push_back("halo");
476 if (player_harmful_contamination())
477 afflictions.push_back("magical contamination");
478 if (you.duration[DUR_CORONA])
479 afflictions.push_back("corona");
480 if (you.duration[DUR_STICKY_FLAME])
481 afflictions.push_back("liquid flames");
482 if (you.duration[DUR_QUAD_DAMAGE])
483 afflictions.push_back("!!!QUAD DAMAGE!!!");
484 if (you.form == transformation::flux)
485 afflictions.push_back("form");
486 mprf(MSGCH_DURATION,
487 "You become %stransparent, but the glow from %s "
488 "%s prevents you from becoming completely invisible.",
489 you.duration[DUR_INVIS] ? "more " : "",
490 you.haloed() && you.halo_radius() == -1 ? "the" : "your",
491 comma_separated_line(afflictions.begin(),
492 afflictions.end()).c_str());
493 }
494 else
495 {
496 mprf(MSGCH_DURATION, !you.duration[DUR_INVIS]
497 ? "You fade into invisibility!"
498 : "You fade further into invisibility.");
499 }
500
501 const int dur = _scale_pot_duration(15 + random2(pow), is_potion);
502 you.increase_duration(DUR_INVIS, dur, 100);
503 return true;
504 }
505
506 bool check_known_quaff() const override
507 {

Callers

nothing calls this directly

Calls 13

mprfFunction · 0.85
comma_separated_lineFunction · 0.85
_scale_pot_durationFunction · 0.85
random2Function · 0.85
haloedMethod · 0.80
umbraedMethod · 0.80
halo_radiusMethod · 0.80
increase_durationMethod · 0.80
backlitMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected