1 #include "racial/racial-android.h"
2 #include "inventory/inventory-slot-types.h"
3 #include "io/targeting.h"
4 #include "object-enchant/object-ego.h"
5 #include "object-enchant/trg-types.h"
6 #include "object-hook/hook-enchant.h"
7 #include "object-hook/hook-weapon.h"
8 #include "object/object-generator.h"
9 #include "object/object-kind.h"
10 #include "object/object-value-calc.h"
11 #include "object/object-value.h"
12 #include "spell-kind/spells-launcher.h"
13 #include "spell/spell-types.h"
14 #include "sv-definition/sv-armor-types.h"
15 #include "sv-definition/sv-protector-types.h"
16 #include "sv-definition/sv-weapon-types.h"
17 #include "system/artifact-type-definition.h"
18 #include "system/object-type-definition.h"
19 #include "view/display-messages.h"
21 bool android_inside_weapon(player_type *creature_ptr)
24 if (!get_aim_dir(creature_ptr, &dir))
27 if (creature_ptr->lev < 10) {
28 msg_print(_("レイガンを発射した。", "You fire your ray gun."));
29 fire_bolt(creature_ptr, GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
33 if (creature_ptr->lev < 25) {
34 msg_print(_("ブラスターを発射した。", "You fire your blaster."));
35 fire_bolt(creature_ptr, GF_MISSILE, dir, creature_ptr->lev);
39 if (creature_ptr->lev < 35) {
40 msg_print(_("バズーカを発射した。", "You fire your bazooka."));
41 fire_ball(creature_ptr, GF_MISSILE, dir, creature_ptr->lev * 2, 2);
45 if (creature_ptr->lev < 45) {
46 msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
47 fire_beam(creature_ptr, GF_MISSILE, dir, creature_ptr->lev * 2);
51 msg_print(_("ロケットを発射した。", "You fire a rocket."));
52 fire_rocket(creature_ptr, GF_ROCKET, dir, creature_ptr->lev * 5, 2);
56 void calc_android_exp(player_type *creature_ptr)
59 if (creature_ptr->is_dead || (creature_ptr->prace != RACE_ANDROID))
62 for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) {
63 object_type *o_ptr = &creature_ptr->inventory_list[i];
65 object_type *q_ptr = &forge;
67 DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
69 if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE))
75 object_copy(q_ptr, o_ptr);
77 q_ptr->curse_flags = 0L;
79 if (object_is_fixed_artifact(o_ptr)) {
80 level = (level + MAX(a_info[o_ptr->name1].level - 8, 5)) / 2;
81 level += MIN(20, a_info[o_ptr->name1].rarity / (a_info[o_ptr->name1].gen_flags & TRG_INSTA_ART ? 10 : 3));
82 } else if (object_is_ego(o_ptr)) {
83 level += MAX(3, (e_info[o_ptr->name2].rating - 5) / 2);
84 } else if (o_ptr->art_name) {
85 s32b total_flags = flag_cost(creature_ptr, o_ptr, o_ptr->pval);
88 if (!object_is_weapon_ammo(o_ptr)) {
89 if (total_flags < 15000)
91 else if (total_flags < 35000)
96 if (total_flags < 20000)
98 else if (total_flags < 45000)
104 level = MAX(level, (level + MAX(fake_level - 8, 5)) / 2 + 3);
107 value = object_value_real(creature_ptr, q_ptr);
110 if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (creature_ptr->pseikaku != PERSONALITY_SEXY))
112 if (value > 5000000L)
114 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD))
117 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr) || (o_ptr->tval == TV_DRAG_ARMOR) || ((o_ptr->tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
118 || ((o_ptr->tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) || ((o_ptr->tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
119 || ((o_ptr->tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) || ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DIAMOND_EDGE))) {
121 level = 35 + (level - 65) / 5;
123 level = 25 + (level - 35) / 3;
125 level = 15 + (level - 15) / 2;
126 exp = MIN(100000L, value) / 2 * level * level;
128 exp += (value - 100000L) / 8 * level * level;
130 exp = MIN(100000L, value) * level;
132 exp += (value - 100000L) / 4 * level;
134 if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW))
135 total_exp += exp / 48;
137 total_exp += exp / 16;
139 total_exp += exp / 32;
142 creature_ptr->exp = creature_ptr->max_exp = total_exp;
143 check_experience(creature_ptr);