ident = true;
break;
case SV_POTION_POLYMORPH:
- if (this->player_ptr->muta.any() && one_in_(23)) {
- lose_all_mutations(this->player_ptr);
- break;
- }
-
- do {
- if (one_in_(2)) {
- if (gain_mutation(this->player_ptr, 0)) {
- ident = true;
- }
- } else if (lose_mutation(this->player_ptr, 0)) {
- ident = true;
- }
- } while (!ident || one_in_(2));
- break;
+ return this->polymorph();
}
return ident;
(void)bss.mod_cut(5000);
return true;
}
+
+/*!
+ * @brief 自己変容の薬
+ * @return 突然変異を得たか失ったらtrue、そのままならfalse
+ */
+bool QuaffEffects::polymorph()
+{
+ if (this->player_ptr->muta.any() && one_in_(23)) {
+ lose_all_mutations(this->player_ptr);
+ return false;
+ }
+
+ auto ident = false;
+ do {
+ if (one_in_(2)) {
+ if (gain_mutation(this->player_ptr, 0)) {
+ ident = true;
+ }
+ } else if (lose_mutation(this->player_ptr, 0)) {
+ ident = true;
+ }
+ } while (!ident || one_in_(2));
+ return ident;
+}