1 #include "racial/racial-android.h"
2 #include "inventory/inventory-slot-types.h"
3 #include "object-enchant/object-ego.h"
4 #include "object-enchant/trg-types.h"
5 #include "object-hook/hook-weapon.h"
6 #include "object/object-kind.h"
7 #include "object/object-value-calc.h"
8 #include "object/object-value.h"
9 #include "player-info/equipment-info.h"
10 #include "player/player-status.h"
11 #include "spell-kind/spells-launcher.h"
12 #include "effect/attribute-types.h"
13 #include "sv-definition/sv-armor-types.h"
14 #include "sv-definition/sv-protector-types.h"
15 #include "sv-definition/sv-weapon-types.h"
16 #include "system/artifact-type-definition.h"
17 #include "system/object-type-definition.h"
18 #include "system/player-type-definition.h"
19 #include "target/target-getter.h"
20 #include "view/display-messages.h"
22 bool android_inside_weapon(PlayerType *player_ptr)
25 if (!get_aim_dir(player_ptr, &dir))
28 if (player_ptr->lev < 10) {
29 msg_print(_("レイガンを発射した。", "You fire your ray gun."));
30 fire_bolt(player_ptr, AttributeType::MISSILE, dir, (player_ptr->lev + 1) / 2);
34 if (player_ptr->lev < 25) {
35 msg_print(_("ブラスターを発射した。", "You fire your blaster."));
36 fire_bolt(player_ptr, AttributeType::MISSILE, dir, player_ptr->lev);
40 if (player_ptr->lev < 35) {
41 msg_print(_("バズーカを発射した。", "You fire your bazooka."));
42 fire_ball(player_ptr, AttributeType::MISSILE, dir, player_ptr->lev * 2, 2);
46 if (player_ptr->lev < 45) {
47 msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
48 fire_beam(player_ptr, AttributeType::MISSILE, dir, player_ptr->lev * 2);
52 msg_print(_("ロケットを発射した。", "You fire a rocket."));
53 fire_rocket(player_ptr, AttributeType::ROCKET, dir, player_ptr->lev * 5, 2);
57 void calc_android_exp(PlayerType *player_ptr)
59 uint32_t total_exp = 0;
60 if (player_ptr->is_dead || (player_ptr->prace != PlayerRaceType::ANDROID))
63 for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
64 object_type *o_ptr = &player_ptr->inventory_list[i];
66 object_type *q_ptr = &forge;
68 DEPTH level = std::max(k_info[o_ptr->k_idx].level - 8, 1);
70 if ((i == INVEN_MAIN_RING) || (i == INVEN_SUB_RING) || (i == INVEN_NECK) || (i == INVEN_LITE))
76 q_ptr->copy_from(o_ptr);
78 q_ptr->curse_flags.clear();
80 if (o_ptr->is_fixed_artifact()) {
81 level = (level + std::max(a_info[o_ptr->name1].level - 8, 5)) / 2;
82 level += std::min(20, a_info[o_ptr->name1].rarity / (a_info[o_ptr->name1].gen_flags.has(ItemGenerationTraitType::INSTA_ART) ? 10 : 3));
83 } else if (o_ptr->is_ego()) {
84 level += std::max(3, (e_info[o_ptr->name2].rating - 5) / 2);
85 } else if (o_ptr->art_name) {
86 int32_t total_flags = flag_cost(o_ptr, o_ptr->pval);
89 if (!o_ptr->is_weapon_ammo()) {
90 if (total_flags < 15000)
92 else if (total_flags < 35000)
97 if (total_flags < 20000)
99 else if (total_flags < 45000)
105 level = std::max(level, (level + std::max(fake_level - 8, 5)) / 2 + 3);
108 value = object_value_real(q_ptr);
111 if ((o_ptr->tval == ItemKindType::SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (player_ptr->ppersonality != PERSONALITY_SEXY))
113 if (value > 5000000L)
115 if ((o_ptr->tval == ItemKindType::DRAG_ARMOR) || (o_ptr->tval == ItemKindType::CARD))
118 if (o_ptr->is_artifact() || o_ptr->is_ego() || (o_ptr->tval == ItemKindType::DRAG_ARMOR) || ((o_ptr->tval == ItemKindType::HELM) && (o_ptr->sval == SV_DRAGON_HELM))
119 || ((o_ptr->tval == ItemKindType::SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) || ((o_ptr->tval == ItemKindType::GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
120 || ((o_ptr->tval == ItemKindType::BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) || ((o_ptr->tval == ItemKindType::SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE))) {
122 level = 35 + (level - 65) / 5;
124 level = 25 + (level - 35) / 3;
126 level = 15 + (level - 15) / 2;
127 exp = std::min<uint>(100000, value) / 2 * level * level;
129 exp += (value - 100000L) / 8 * level * level;
131 exp = std::min<uint>(100000, value) * level;
133 exp += (value - 100000L) / 4 * level;
135 if ((((i == INVEN_MAIN_HAND) || (i == INVEN_SUB_HAND)) && (has_melee_weapon(player_ptr, i))) || (i == INVEN_BOW))
136 total_exp += exp / 48;
138 total_exp += exp / 16;
140 total_exp += exp / 32;
143 player_ptr->exp = player_ptr->max_exp = total_exp;
144 check_experience(player_ptr);