1 #include "birth/birth-body-spec.h"
2 #include "player-info/race-info.h"
3 #include "player-info/race-types.h"
4 #include "player/player-personality-types.h"
5 #include "player/player-sex.h"
6 #include "system/player-type-definition.h"
9 * @brief プレイヤーの身長体重を決める / Get character's height and weight
11 void get_height_weight(player_type *player_ptr)
14 switch (player_ptr->psex) {
16 player_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
17 deviation = (int)(player_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
18 player_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * deviation / 100, (int)(rp_ptr->m_m_wt) * deviation / 300);
21 player_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
22 deviation = (int)(player_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
23 player_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * deviation / 100, (int)(rp_ptr->f_m_wt) * deviation / 300);
30 * @brief プレイヤーの年齢を決める。 / Computes character's age, height, and weight by henkma
31 * @details 内部でget_height_weight()も呼び出している。
33 void get_ahw(player_type *player_ptr)
35 player_ptr->age = rp_ptr->b_age + randint1(rp_ptr->m_age);
36 get_height_weight(player_ptr);
40 * @brief プレイヤーの初期所持金を決める。 / Get the player's starting money
41 * @param player_ptr プレイヤーへの参照ポインタ
43 void get_money(player_type *player_ptr)
45 int gold = (player_ptr->sc * 6) + randint1(100) + 300;
46 if (player_ptr->pclass == PlayerClassType::TOURIST)
49 for (int i = 0; i < A_MAX; i++) {
50 if (player_ptr->stat_max[i] >= 18 + 50)
52 else if (player_ptr->stat_max[i] >= 18 + 20)
54 else if (player_ptr->stat_max[i] > 18)
57 gold -= (player_ptr->stat_max[i] - 8) * 10;
60 const int minimum_deposit = 100;
61 if (gold < minimum_deposit)
62 gold = minimum_deposit;
64 if (player_ptr->ppersonality == PERSONALITY_LAZY)
66 else if (player_ptr->ppersonality == PERSONALITY_MUNCHKIN)
68 if (player_ptr->prace == PlayerRaceType::ANDROID)
71 player_ptr->au = gold;