2 * @brief 突然変異の各種計算 / Calculations for mutation
5 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7 * This software may be copied and distributed for educational, research,
8 * and not for profit purposes provided that this copyright and statement
9 * are included in all such copies. Other copyrights may also apply
10 * 2014 Deskull rearranged comment for Doxygen
11 * 2020 Hourier rearranged for dividing processes.
14 #include "mutation/mutation-calculator.h"
15 #include "mutation/mutation-flag-types.h"
16 #include "player-base/player-race.h"
17 #include "system/player-type-definition.h"
20 * @brief 現在プレイヤー得ている突然変異の数を返す。
21 * @return 現在得ている突然変異の数
23 static int count_mutations(PlayerType *player_ptr)
25 return player_ptr->muta.count();
29 * @brief 突然変異による自然回復ペナルティをパーセント値で返す /
30 * Return the modifier to the regeneration rate (in percent)
33 * Beastman get 10 "free" mutations and only 5% decrease per additional mutation.
34 * Max 90% decrease in regeneration speed.
36 int calc_mutant_regenerate_mod(PlayerType *player_ptr)
40 int count = count_mutations(player_ptr);
41 if (player_ptr->ppersonality == PERSONALITY_LUCKY) {
45 if (PlayerRace(player_ptr).equals(PlayerRaceType::BEASTMAN)) {
54 regen = 100 - count * mod;