witch now tells you what potion it used

This commit is contained in:
a25liang
2024-07-20 15:29:28 -04:00
parent e76802b955
commit f6dbf6ee41

View File

@ -14,13 +14,15 @@ long_result witch::attack(character *ch) {
auto res = ch->get_hit(this, ATK, base_hit_rate); auto res = ch->get_hit(this, ATK, base_hit_rate);
if (res.res == HIT && rng->trial(POTION_RATE)) { if (res.res == HIT && rng->trial(POTION_RATE)) {
res.msg += "W's potion spilled onto PC. ";
potion_type type = potion_type type =
static_cast<potion_type>(rng->rand_under( static_cast<potion_type>(rng->rand_under(
(enabled_features & FEATURE_EXTRA_STUFF) ? (enabled_features & FEATURE_EXTRA_STUFF) ?
POTION_TYPE_CNT : POTION_TYPE_CNT :
DEFAULT_POTION_TYPE_CNT)); DEFAULT_POTION_TYPE_CNT));
ch->apply_effect(new_potion(type, {0, 0})); auto npotion = new_potion(type, {0, 0});
res.msg += std::string("Z's potion of ") +
npotion->get_name() + " spilled onto PC. ";
ch->apply_effect(std::move(npotion));
} }
return res; return res;