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

Function vampire_mesmerism_check

crawl-ref/source/transform.cc:2610–2636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2608}
2609
2610bool vampire_mesmerism_check(monster& mon)
2611{
2612 if (you.form == transformation::vampire && you.can_see(mon) && mon.can_see(you)
2613 && (mon.holiness() & (MH_NATURAL | MH_DEMONIC | MH_HOLY))
2614 && !one_chance_in(4))
2615 {
2616 if (mon.check_willpower(&you, get_form()->get_effect_chance()) <= 0)
2617 {
2618 mprf("%s loses %s in your eye%s.",
2619 mon.name(DESC_THE).c_str(),
2620 mon.pronoun(PRONOUN_REFLEXIVE).c_str(),
2621 you.has_mutation(MUT_MISSING_EYE) ? "" : "s");
2622 mon.daze(random_range(3, 5));
2623 }
2624 else
2625 {
2626 mprf("%s is briefly mesmerised by your gaze.", mon.name(DESC_THE).c_str());
2627 // This works even if called during the stealth check, whereas a 1-turn daze
2628 // would wear off with no effect and produce extra messages on top of that.
2629 mon.speed_increment -= 10;
2630 }
2631
2632 return true;
2633 }
2634
2635 return false;
2636}

Callers 2

seen_monsters_reactFunction · 0.85
behaviour_eventFunction · 0.85

Calls 12

one_chance_inFunction · 0.85
get_formFunction · 0.85
mprfFunction · 0.85
random_rangeFunction · 0.85
can_seeMethod · 0.80
check_willpowerMethod · 0.80
has_mutationMethod · 0.80
holinessMethod · 0.45
get_effect_chanceMethod · 0.45
nameMethod · 0.45
pronounMethod · 0.45
dazeMethod · 0.45

Tested by

no test coverage detected