• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

変愚蛮怒のメインリポジトリです


Commit MetaInfo

修订版c00ecf37b219c5093ad562edcdf90712bcf3539e (tree)
时间2020-02-01 22:18:02
作者Hourier <hourier@user...>
CommiterHourier

Log Message

[Refactor] #37353 spells3.c において、1行ごとに挟まれていたコメントを削除 / Removed many comments per 1 line in spells3.c

更改概述

差异

--- a/src/spells3.c
+++ b/src/spells3.c
@@ -98,14 +98,10 @@ bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT
9898 while (look)
9999 {
100100 tries++;
101-
102- /* Verify max distance */
103101 if (dis > 200) dis = 200;
104102
105- /* Try several locations */
106103 for (int i = 0; i < 500; i++)
107104 {
108- /* Pick a (possibly illegal) location */
109105 while (TRUE)
110106 {
111107 ny = rand_spread(oy, dis);
@@ -114,12 +110,8 @@ bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT
114110 if ((d >= min) && (d <= dis)) break;
115111 }
116112
117- /* Ignore illegal locations */
118113 if (!in_bounds(caster_ptr->current_floor_ptr, ny, nx)) continue;
119-
120114 if (!cave_monster_teleportable_bold(caster_ptr, m_idx, ny, nx, mode)) continue;
121-
122- /* No teleporting into vaults and such */
123115 if (!(caster_ptr->current_floor_ptr->inside_quest || caster_ptr->current_floor_ptr->inside_arena))
124116 if (caster_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
125117
@@ -127,28 +119,19 @@ bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT
127119 break;
128120 }
129121
130- /* Increase the maximum distance */
131122 dis = dis * 2;
132-
133123 min = min / 2;
134124 if (tries > MAX_TRIES) return FALSE;
135125 }
136126
137127 sound(SOUND_TPOTHER);
138-
139- /* Update the old location */
140128 caster_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
141-
142- /* Update the new location */
143129 caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
144130
145- /* Move the monster */
146131 m_ptr->fy = ny;
147132 m_ptr->fx = nx;
148133
149- /* Forget the counter target */
150134 reset_target(m_ptr);
151-
152135 update_monster(caster_ptr, m_idx, TRUE);
153136 lite_spot(caster_ptr, oy, ox);
154137 lite_spot(caster_ptr, ny, nx);
@@ -175,8 +158,6 @@ void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty
175158 {
176159 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
177160 if(!m_ptr->r_idx) return;
178-
179- /* "Skill" test */
180161 if(randint1(100) > power) return;
181162
182163 POSITION ny = m_ptr->fy;
@@ -190,13 +171,10 @@ void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty
190171 bool look = TRUE;
191172 while (look && --attempts)
192173 {
193- /* Verify max distance */
194174 if (dis > 200) dis = 200;
195175
196- /* Try several locations */
197176 for (int i = 0; i < 500; i++)
198177 {
199- /* Pick a (possibly illegal) location */
200178 while (TRUE)
201179 {
202180 ny = rand_spread(ty, dis);
@@ -205,33 +183,23 @@ void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty
205183 if ((d >= min) && (d <= dis)) break;
206184 }
207185
208- /* Ignore illegal locations */
209186 if (!in_bounds(caster_ptr->current_floor_ptr, ny, nx)) continue;
210-
211187 if (!cave_monster_teleportable_bold(caster_ptr, m_idx, ny, nx, mode)) continue;
212188
213189 look = FALSE;
214190 break;
215191 }
216192
217- /* Increase the maximum distance */
218193 dis = dis * 2;
219-
220- /* Decrease the minimum distance */
221194 min = min / 2;
222195 }
223196
224197 if (attempts < 1) return;
225198
226199 sound(SOUND_TPOTHER);
227-
228- /* Update the old location */
229200 caster_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
230-
231- /* Update the new location */
232201 caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
233202
234- /* Move the monster */
235203 m_ptr->fy = ny;
236204 m_ptr->fx = nx;
237205
@@ -280,10 +248,8 @@ bool teleport_player_aux(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode
280248 for (int i = 0; i <= MAX_TELEPORT_DISTANCE; i++)
281249 candidates_at[i] = 0;
282250
283- /* Limit the distance */
284251 if (dis > MAX_TELEPORT_DISTANCE) dis = MAX_TELEPORT_DISTANCE;
285252
286- /* Search valid locations */
287253 int left = MAX(1, creature_ptr->x - dis);
288254 int right = MIN(creature_ptr->current_floor_ptr->width - 2, creature_ptr->x + dis);
289255 int top = MAX(1, creature_ptr->y - dis);
@@ -293,38 +259,26 @@ bool teleport_player_aux(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode
293259 {
294260 for (POSITION x = left; x <= right; x++)
295261 {
296- /* Skip illegal locations */
297262 if (!cave_player_teleportable_bold(creature_ptr, y, x, mode)) continue;
298263
299- /* Calculate distance */
300264 int d = distance(creature_ptr->y, creature_ptr->x, y, x);
301-
302- /* Skip too far locations */
303265 if (d > dis) continue;
304266
305- /* Count the total number of candidates */
306267 total_candidates++;
307-
308- /* Count the number of candidates in this circumference */
309268 candidates_at[d]++;
310269 }
311270 }
312271
313- /* No valid location! */
314272 if (0 == total_candidates) return FALSE;
315273
316- /* Fix the minimum distance */
317274 int cur_candidates;
318275 int min = dis;
319276 for (cur_candidates = 0; min >= 0; min--)
320277 {
321278 cur_candidates += candidates_at[min];
322-
323- /* 50% of all candidates will have an equal chance to be choosen. */
324279 if (cur_candidates && (cur_candidates >= total_candidates / 2)) break;
325280 }
326281
327- /* Pick up a single location randomly */
328282 int pick = randint1(cur_candidates);
329283
330284 /* Search again the choosen location */
@@ -333,40 +287,31 @@ bool teleport_player_aux(player_type *creature_ptr, POSITION dis, BIT_FLAGS mode
333287 {
334288 for (xx = left; xx <= right; xx++)
335289 {
336- /* Skip illegal locations */
337290 if (!cave_player_teleportable_bold(creature_ptr, yy, xx, mode)) continue;
338291
339- /* Calculate distance */
340292 int d = distance(creature_ptr->y, creature_ptr->x, yy, xx);
341-
342- /* Skip too far locations */
343293 if (d > dis) continue;
344-
345- /* Skip too close locations */
346294 if (d < min) continue;
347295
348- /* This grid was picked up? */
349296 pick--;
350297 if (!pick) break;
351298 }
352299
353- /* Exit the loop */
354300 if (!pick) break;
355301 }
356302
357303 if (player_bold(creature_ptr, yy, xx)) return FALSE;
358304
359305 sound(SOUND_TELEPORT);
360-
361306 #ifdef JP
362307 if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
363308 msg_format("『こっちだぁ、%s』", creature_ptr->name);
364309 #endif
365-
366310 (void)move_player_effect(creature_ptr, yy, xx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
367311 return TRUE;
368312 }
369313
314+
370315 /*!
371316 * @brief プレイヤーのテレポート処理メインルーチン
372317 * @param creature_ptr プレーヤーへの参照ポインタ
@@ -475,7 +420,6 @@ void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
475420 POSITION dis = 0, ctr = 0;
476421 while (TRUE)
477422 {
478- /* Pick a nearby legal location */
479423 while (TRUE)
480424 {
481425 y = (POSITION)rand_spread(ny, dis);
@@ -483,13 +427,14 @@ void teleport_player_to(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
483427 if (in_bounds(creature_ptr->current_floor_ptr, y, x)) break;
484428 }
485429
486- /* Accept any grid when wizard mode */
487- if (current_world_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!creature_ptr->current_floor_ptr->grid_array[y][x].m_idx || (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx == creature_ptr->riding))) break;
430+ bool is_anywhere = current_world_ptr->wizard;
431+ is_anywhere &= !(mode & TELEPORT_PASSIVE);
432+ is_anywhere &= (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0) ||
433+ creature_ptr->current_floor_ptr->grid_array[y][x].m_idx == creature_ptr->riding;
434+ if (is_anywhere) break;
488435
489- /* Accept teleportable floor grids */
490436 if (cave_player_teleportable_bold(creature_ptr, y, x, mode)) break;
491437
492- /* Occasionally advance the distance */
493438 if (++ctr > (4 * dis * dis + 4 * dis + 1))
494439 {
495440 ctr = 0;
@@ -601,34 +546,29 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
601546 {
602547 GAME_TEXT m_name[160];
603548 bool see_m = TRUE;
604- if (m_idx <= 0) /* To player */
549+ if (m_idx <= 0)
605550 {
606551 strcpy(m_name, _("あなた", "you"));
607552 }
608- else /* To monster */
553+ else
609554 {
610555 monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
611-
612- /* Get the monster name (or "it") */
613556 monster_desc(creature_ptr, m_name, m_ptr, 0);
614-
615557 see_m = is_seen(m_ptr);
616558 }
617559
618- /* No effect in some case */
619560 if (is_teleport_level_ineffective(creature_ptr, m_idx))
620561 {
621562 if (see_m) msg_print(_("効果がなかった。", "There is no effect."));
622563 return;
623564 }
624565
625- if ((m_idx <= 0) && creature_ptr->anti_tele) /* To player */
566+ if ((m_idx <= 0) && creature_ptr->anti_tele)
626567 {
627568 msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
628569 return;
629570 }
630571
631- /* Choose up or down */
632572 bool go_up;
633573 if (randint0(100) < 50) go_up = TRUE;
634574 else go_up = FALSE;
@@ -639,7 +579,6 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
639579 else if (get_check("Force to go down? ")) go_up = FALSE;
640580 }
641581
642- /* Down only */
643582 if ((ironman_downward && (m_idx <= 0)) || (creature_ptr->current_floor_ptr->dun_level <= d_info[creature_ptr->dungeon_idx].mindepth))
644583 {
645584 #ifdef JP
@@ -647,7 +586,7 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
647586 #else
648587 if (see_m) msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
649588 #endif
650- if (m_idx <= 0) /* To player */
589+ if (m_idx <= 0)
651590 {
652591 if (!creature_ptr->current_floor_ptr->dun_level)
653592 {
@@ -673,8 +612,6 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
673612 creature_ptr->leaving = TRUE;
674613 }
675614 }
676-
677- /* Up only */
678615 else if (quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level) || (creature_ptr->current_floor_ptr->dun_level >= d_info[creature_ptr->dungeon_idx].maxdepth))
679616 {
680617 #ifdef JP
@@ -683,8 +620,7 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
683620 if (see_m) msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
684621 #endif
685622
686-
687- if (m_idx <= 0) /* To player */
623+ if (m_idx <= 0)
688624 {
689625 if (record_stair) exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, -1, NULL);
690626
@@ -705,8 +641,7 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
705641 if (see_m) msg_format("%^s rise%s up through the ceiling.", m_name, (m_idx <= 0) ? "" : "s");
706642 #endif
707643
708-
709- if (m_idx <= 0) /* To player */
644+ if (m_idx <= 0)
710645 {
711646 if (record_stair) exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, -1, NULL);
712647
@@ -724,10 +659,8 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
724659 if (see_m) msg_format("%^s sink%s through the floor.", m_name, (m_idx <= 0) ? "" : "s");
725660 #endif
726661
727- if (m_idx <= 0) /* To player */
662+ if (m_idx <= 0)
728663 {
729- /* Never reach this code on the surface */
730- /* if (!creature_ptr->current_floor_ptr->dun_level) creature_ptr->dungeon_idx = creature_ptr->recall_dungeon; */
731664 if (record_stair) exe_write_diary(creature_ptr, DIARY_TELEPORT_LEVEL, 1, NULL);
732665 if (autosave_l) do_cmd_save_game(creature_ptr, TRUE);
733666
@@ -736,7 +669,6 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx)
736669 }
737670 }
738671
739- /* Monster level teleportation is simple deleting now */
740672 if (m_idx <= 0)
741673 {
742674 sound(SOUND_TPLEVEL);
@@ -771,8 +703,6 @@ bool recall_player(player_type *creature_ptr, TIME_EFFECT turns)
771703 * TODO: Recall the player to the last
772704 * visited town when in the wilderness
773705 */
774-
775- /* Ironman option */
776706 if (creature_ptr->current_floor_ptr->inside_arena || ironman_downward)
777707 {
778708 msg_print(_("何も起こらなかった。", "Nothing happens."));
@@ -820,12 +750,9 @@ bool recall_player(player_type *creature_ptr, TIME_EFFECT turns)
820750 bool free_level_recall(player_type *creature_ptr)
821751 {
822752 DUNGEON_IDX select_dungeon = choose_dungeon(_("にテレポート", "teleport"), 4, 0);
823-
824753 if (!select_dungeon) return FALSE;
825754
826755 DEPTH max_depth = d_info[select_dungeon].maxdepth;
827-
828- /* Limit depth in Angband */
829756 if (select_dungeon == DUNGEON_ANGBAND)
830757 {
831758 if (quest[QUEST_OBERON].status != QUEST_STATUS_FINISHED) max_depth = 98;
@@ -834,7 +761,6 @@ bool free_level_recall(player_type *creature_ptr)
834761
835762 QUANTITY amt = get_quantity(format(_("%sの何階にテレポートしますか?", "Teleport to which level of %s? "),
836763 d_name + d_info[select_dungeon].name), (QUANTITY)max_depth);
837-
838764 if (amt <= 0)
839765 {
840766 return FALSE;
@@ -865,8 +791,6 @@ bool reset_recall(player_type *caster_ptr)
865791 char tmp_val[160];
866792
867793 select_dungeon = choose_dungeon(_("をセット", "reset"), 2, 14);
868-
869- /* Ironman option */
870794 if (ironman_downward)
871795 {
872796 msg_print(_("何も起こらなかった。", "Nothing happens."));
@@ -874,20 +798,15 @@ bool reset_recall(player_type *caster_ptr)
874798 }
875799
876800 if (!select_dungeon) return FALSE;
877- /* Prompt */
878801 sprintf(ppp, _("何階にセットしますか (%d-%d):", "Reset to which level (%d-%d): "),
879802 (int)d_info[select_dungeon].mindepth, (int)max_dlv[select_dungeon]);
880-
881- /* Default */
882803 sprintf(tmp_val, "%d", (int)MAX(caster_ptr->current_floor_ptr->dun_level, 1));
883804
884- /* Ask for a level */
885805 if (!get_string(ppp, tmp_val, 10))
886806 {
887807 return FALSE;
888808 }
889809
890- /* Extract request */
891810 dummy = atoi(tmp_val);
892811 if (dummy < 1) dummy = 1;
893812 if (dummy > max_dlv[select_dungeon]) dummy = max_dlv[select_dungeon];
@@ -897,7 +816,6 @@ bool reset_recall(player_type *caster_ptr)
897816
898817 if (record_maxdepth)
899818 exe_write_diary(caster_ptr, DIARY_TRUMP, select_dungeon, _("フロア・リセットで", "using a scroll of reset recall"));
900- /* Accept request */
901819 #ifdef JP
902820 msg_format("%sの帰還レベルを %d 階にセット。", d_name + d_info[select_dungeon].name, dummy, dummy * 50);
903821 #else
@@ -932,15 +850,11 @@ bool apply_disenchant(player_type *target_ptr, BIT_FLAGS mode)
932850
933851 object_type *o_ptr;
934852 o_ptr = &target_ptr->inventory_list[t];
935-
936- /* No item, nothing happens */
937853 if (!o_ptr->k_idx) return FALSE;
938854
939- /* Disenchant equipments only -- No disenchant on monster ball */
940855 if (!object_is_weapon_armour_ammo(o_ptr))
941856 return FALSE;
942857
943- /* Nothing to disenchant */
944858 if ((o_ptr->to_h <= 0) && (o_ptr->to_d <= 0) && (o_ptr->to_a <= 0) && (o_ptr->pval <= 1))
945859 {
946860 return FALSE;
@@ -948,8 +862,6 @@ bool apply_disenchant(player_type *target_ptr, BIT_FLAGS mode)
948862
949863 GAME_TEXT o_name[MAX_NLEN];
950864 object_desc(target_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
951-
952- /* Artifacts have 71% chance to resist */
953865 if (object_is_artifact(o_ptr) && (randint0(100) < 71))
954866 {
955867 #ifdef JP
@@ -961,26 +873,20 @@ bool apply_disenchant(player_type *target_ptr, BIT_FLAGS mode)
961873 return TRUE;
962874 }
963875
964- /* Memorize old value */
965876 int to_h = o_ptr->to_h;
966877 int to_d = o_ptr->to_d;
967878 int to_a = o_ptr->to_a;
968879 int pval = o_ptr->pval;
969880
970- /* Disenchant tohit */
971881 if (o_ptr->to_h > 0) o_ptr->to_h--;
972882 if ((o_ptr->to_h > 5) && (randint0(100) < 20)) o_ptr->to_h--;
973883
974- /* Disenchant todam */
975884 if (o_ptr->to_d > 0) o_ptr->to_d--;
976885 if ((o_ptr->to_d > 5) && (randint0(100) < 20)) o_ptr->to_d--;
977886
978- /* Disenchant toac */
979887 if (o_ptr->to_a > 0) o_ptr->to_a--;
980888 if ((o_ptr->to_a > 5) && (randint0(100) < 20)) o_ptr->to_a--;
981889
982- /* Disenchant pval (occasionally) */
983- /* Unless called from wild_magic() */
984890 if ((o_ptr->pval > 1) && one_in_(13) && !(mode & 0x01)) o_ptr->pval--;
985891
986892 bool is_actually_disenchanted = to_h != o_ptr->to_h;
@@ -995,7 +901,6 @@ bool apply_disenchant(player_type *target_ptr, BIT_FLAGS mode)
995901 msg_format("Your %s (%c) %s disenchanted!", o_name, index_to_label(t),
996902 ((o_ptr->number != 1) ? "were" : "was"));
997903 #endif
998-
999904 chg_virtue(target_ptr, V_HARMONY, 1);
1000905 chg_virtue(target_ptr, V_ENCHANT, -2);
1001906 target_ptr->update |= (PU_BONUS);
@@ -1019,7 +924,6 @@ bool vanish_dungeon(player_type *caster_ptr)
1019924 is_special_floor |= !caster_ptr->current_floor_ptr->dun_level;
1020925 if (is_special_floor) return FALSE;
1021926
1022- /* Scan all normal grids */
1023927 grid_type *g_ptr;
1024928 feature_type *f_ptr;
1025929 monster_type *m_ptr;
@@ -1030,20 +934,12 @@ bool vanish_dungeon(player_type *caster_ptr)
1030934 {
1031935 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
1032936
1033- /* Seeing true feature code (ignore mimic) */
1034937 f_ptr = &f_info[g_ptr->feat];
1035-
1036- /* Lose room and vault */
1037938 g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
1038-
1039939 m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
1040-
1041- /* Awake monster */
1042940 if (g_ptr->m_idx && MON_CSLEEP(m_ptr))
1043941 {
1044942 (void)set_monster_csleep(caster_ptr, g_ptr->m_idx, 0);
1045-
1046- /* Notice the "waking up" */
1047943 if (m_ptr->ml)
1048944 {
1049945 monster_desc(caster_ptr, m_name, m_ptr, 0);
@@ -1051,41 +947,29 @@ bool vanish_dungeon(player_type *caster_ptr)
1051947 }
1052948 }
1053949
1054- /* Process all walls, doors and patterns */
1055950 if (have_flag(f_ptr->flags, FF_HURT_DISI)) cave_alter_feat(caster_ptr, y, x, FF_HURT_DISI);
1056951 }
1057952 }
1058953
1059- /* Special boundary walls -- Top and bottom */
1060954 for (POSITION x = 0; x < caster_ptr->current_floor_ptr->width; x++)
1061955 {
1062956 g_ptr = &caster_ptr->current_floor_ptr->grid_array[0][x];
1063957 f_ptr = &f_info[g_ptr->mimic];
1064-
1065- /* Lose room and vault */
1066958 g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
1067959
1068- /* Set boundary mimic if needed */
1069960 if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
1070961 {
1071962 g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
1072-
1073- /* Check for change to boring grid */
1074963 if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
1075964 }
1076965
1077966 g_ptr = &caster_ptr->current_floor_ptr->grid_array[caster_ptr->current_floor_ptr->height - 1][x];
1078967 f_ptr = &f_info[g_ptr->mimic];
1079-
1080- /* Lose room and vault */
1081968 g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
1082969
1083- /* Set boundary mimic if needed */
1084970 if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
1085971 {
1086972 g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
1087-
1088- /* Check for change to boring grid */
1089973 if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
1090974 }
1091975 }
@@ -1095,43 +979,32 @@ bool vanish_dungeon(player_type *caster_ptr)
1095979 {
1096980 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][0];
1097981 f_ptr = &f_info[g_ptr->mimic];
1098-
1099- /* Lose room and vault */
1100982 g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
1101983
1102- /* Set boundary mimic if needed */
1103984 if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
1104985 {
1105986 g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
1106-
1107- /* Check for change to boring grid */
1108987 if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
1109988 }
1110989
1111990 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][caster_ptr->current_floor_ptr->width - 1];
1112991 f_ptr = &f_info[g_ptr->mimic];
1113-
1114- /* Lose room and vault */
1115992 g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
1116993
1117- /* Set boundary mimic if needed */
1118994 if (g_ptr->mimic && have_flag(f_ptr->flags, FF_HURT_DISI))
1119995 {
1120996 g_ptr->mimic = feat_state(caster_ptr, g_ptr->mimic, FF_HURT_DISI);
1121-
1122- /* Check for change to boring grid */
1123997 if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
1124998 }
1125999 }
11261000
1127- /* Mega-Hack -- Forget the view and lite */
11281001 caster_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
11291002 caster_ptr->redraw |= (PR_MAP);
11301003 caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1131-
11321004 return TRUE;
11331005 }
11341006
1007+
11351008 /*!
11361009 * @brief 虚無招来処理 /
11371010 * @param caster_ptr プレーヤーへの参照ポインタ
@@ -1178,7 +1051,6 @@ void call_the_void(player_type *caster_ptr)
11781051 return;
11791052 }
11801053
1181- /* Prevent destruction of quest levels and town */
11821054 bool is_special_fllor = caster_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->current_floor_ptr->inside_quest);
11831055 is_special_fllor |= !caster_ptr->current_floor_ptr->dun_level;
11841056 if (is_special_fllor)
@@ -1227,7 +1099,6 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
12271099 object_type *o_ptr;
12281100 GAME_TEXT o_name[MAX_NLEN];
12291101
1230- /* Check to see if an object is already there */
12311102 if (caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].o_idx)
12321103 {
12331104 msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
@@ -1247,22 +1118,18 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
12471118 }
12481119
12491120 g_ptr = &caster_ptr->current_floor_ptr->grid_array[ty][tx];
1250-
1251- /* We need an item to fetch */
12521121 if (!g_ptr->o_idx)
12531122 {
12541123 msg_print(_("そこには何もありません。", "There is no object at this place."));
12551124 return;
12561125 }
12571126
1258- /* No fetching from vault */
12591127 if (g_ptr->info & CAVE_ICKY)
12601128 {
12611129 msg_print(_("アイテムがコントロールを外れて落ちた。", "The item slips from your control."));
12621130 return;
12631131 }
12641132
1265- /* We need to see the item */
12661133 if (require_los)
12671134 {
12681135 if (!player_has_los_bold(caster_ptr, ty, tx))
@@ -1296,10 +1163,8 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
12961163 }
12971164
12981165 o_ptr = &caster_ptr->current_floor_ptr->o_list[g_ptr->o_idx];
1299-
13001166 if (o_ptr->weight > wgt)
13011167 {
1302- /* Too heavy to 'fetch' */
13031168 msg_print(_("そのアイテムは重過ぎます。", "The object is too heavy."));
13041169 return;
13051170 }
@@ -1327,7 +1192,6 @@ void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los)
13271192 */
13281193 void reserve_alter_reality(player_type *caster_ptr)
13291194 {
1330- /* Ironman option */
13311195 if (caster_ptr->current_floor_ptr->inside_arena || ironman_downward)
13321196 {
13331197 msg_print(_("何も起こらなかった。", "Nothing happens."));
@@ -1358,17 +1222,12 @@ void reserve_alter_reality(player_type *caster_ptr)
13581222 */
13591223 void identify_pack(player_type *target_ptr)
13601224 {
1361- INVENTORY_IDX i;
1362-
1363- /* Simply identify and know every item */
1364- for (i = 0; i < INVEN_TOTAL; i++)
1225+ for (INVENTORY_IDX i = 0; i < INVEN_TOTAL; i++)
13651226 {
13661227 object_type *o_ptr = &target_ptr->inventory_list[i];
13671228 if (!o_ptr->k_idx) continue;
13681229
13691230 identify_item(target_ptr, o_ptr);
1370-
1371- /* Auto-inscription */
13721231 autopick_alter_item(target_ptr, i, FALSE);
13731232 }
13741233 }
@@ -1397,14 +1256,8 @@ static int remove_curse_aux(player_type *creature_ptr, int all)
13971256 {
13981257 object_type *o_ptr = &creature_ptr->inventory_list[i];
13991258 if (!o_ptr->k_idx) continue;
1400-
1401- /* Uncursed already */
14021259 if (!object_is_cursed(o_ptr)) continue;
1403-
1404- /* Heavily Cursed Items need a special spell */
14051260 if (!all && (o_ptr->curse_flags & TRC_HEAVY_CURSE)) continue;
1406-
1407- /* Perma-Cursed Items can NEVER be uncursed */
14081261 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
14091262 {
14101263 o_ptr->curse_flags &= (TRC_CURSED | TRC_HEAVY_CURSE | TRC_PERMA_CURSE);
@@ -1417,15 +1270,11 @@ static int remove_curse_aux(player_type *creature_ptr, int all)
14171270
14181271 creature_ptr->update |= (PU_BONUS);
14191272 creature_ptr->window |= (PW_EQUIP);
1420-
1421- /* Count the uncursings */
14221273 cnt++;
14231274 }
14241275
14251276 if (cnt)
1426- {
14271277 msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
1428- }
14291278
14301279 return cnt;
14311280 }
@@ -1472,13 +1321,10 @@ bool alchemy(player_type *caster_ptr)
14721321 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
14731322 if (!o_ptr) return FALSE;
14741323
1475- /* See how many items */
14761324 int amt = 1;
14771325 if (o_ptr->number > 1)
14781326 {
14791327 amt = get_quantity(NULL, o_ptr->number);
1480-
1481- /* Allow user abort */
14821328 if (amt <= 0) return FALSE;
14831329 }
14841330
@@ -1488,19 +1334,16 @@ bool alchemy(player_type *caster_ptr)
14881334 object_desc(caster_ptr, o_name, o_ptr, 0);
14891335 o_ptr->number = old_number;
14901336
1491- /* Verify unless quantity given */
14921337 if (!force)
14931338 {
14941339 if (confirm_destroy || (object_value(o_ptr) > 0))
14951340 {
1496- /* Make a verification */
14971341 char out_val[MAX_NLEN + 40];
14981342 sprintf(out_val, _("本当に%sを金に変えますか?", "Really current_world_ptr->game_turn %s to gold? "), o_name);
14991343 if (!get_check(out_val)) return FALSE;
15001344 }
15011345 }
15021346
1503- /* Artifacts cannot be destroyed */
15041347 if (!can_player_destroy_object(o_ptr))
15051348 {
15061349 msg_format(_("%sを金に変えることに失敗した。", "You fail to current_world_ptr->game_turn %s to gold!"), o_name);
@@ -1541,7 +1384,6 @@ bool artifact_scroll(player_type *caster_ptr)
15411384
15421385 concptr q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
15431386 concptr s = _("強化できるアイテムがない。", "You have nothing to enchant.");
1544-
15451387 object_type *o_ptr;
15461388 OBJECT_IDX item;
15471389 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
@@ -1565,7 +1407,6 @@ bool artifact_scroll(player_type *caster_ptr)
15651407 #endif
15661408 okay = FALSE;
15671409 }
1568-
15691410 else if (object_is_ego(o_ptr))
15701411 {
15711412 #ifdef JP
@@ -1577,7 +1418,6 @@ bool artifact_scroll(player_type *caster_ptr)
15771418 #endif
15781419 okay = FALSE;
15791420 }
1580-
15811421 else if (o_ptr->xtra3)
15821422 {
15831423 #ifdef JP
@@ -1587,7 +1427,6 @@ bool artifact_scroll(player_type *caster_ptr)
15871427 ((o_ptr->number > 1) ? "customized items" : "a customized item"));
15881428 #endif
15891429 }
1590-
15911430 else
15921431 {
15931432 if (o_ptr->number > 1)
@@ -1709,7 +1548,6 @@ bool ident_spell(player_type *caster_ptr, bool only_equip)
17091548 }
17101549
17111550 concptr s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
1712-
17131551 OBJECT_IDX item;
17141552 object_type *o_ptr;
17151553 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
@@ -1783,6 +1621,7 @@ bool mundane_spell(player_type *owner_ptr, bool only_equip)
17831621 return TRUE;
17841622 }
17851623
1624+
17861625 /*!
17871626 * @brief アイテム*鑑定*のメインルーチン処理 /
17881627 * Identify an object in the inventory (or on the floor)
@@ -1824,7 +1663,6 @@ bool identify_fully(player_type *caster_ptr, bool only_equip)
18241663
18251664 bool old_known = identify_item(caster_ptr, o_ptr);
18261665
1827- /* Mark the item as fully known */
18281666 o_ptr->ident |= (IDENT_MENTAL);
18291667 handle_stuff(caster_ptr);
18301668
@@ -1890,58 +1728,35 @@ bool recharge(player_type *caster_ptr, int power)
18901728 bool is_recharge_successful = TRUE;
18911729 if (o_ptr->tval == TV_ROD)
18921730 {
1893- /* Extract a recharge strength by comparing object level to power. */
18941731 recharge_strength = ((power > lev / 2) ? (power - lev / 2) : 0) / 5;
1895-
1896-
1897- /* Back-fire */
18981732 if (one_in_(recharge_strength))
18991733 {
1900- /* Activate the failure code. */
19011734 is_recharge_successful = FALSE;
19021735 }
1903-
1904- /* Recharge */
19051736 else
19061737 {
1907- /* Recharge amount */
19081738 recharge_amount = (power * damroll(3, 2));
1909-
1910- /* Recharge by that amount */
19111739 if (o_ptr->timeout > recharge_amount)
19121740 o_ptr->timeout -= recharge_amount;
19131741 else
19141742 o_ptr->timeout = 0;
19151743 }
19161744 }
1917-
1918- /* Recharge wand/staff */
19191745 else
19201746 {
1921- /* Extract a recharge strength by comparing object level to power.
1922- * Divide up a stack of wands' charges to calculate charge penalty.
1923- */
19241747 if ((o_ptr->tval == TV_WAND) && (o_ptr->number > 1))
19251748 recharge_strength = (100 + power - lev - (8 * o_ptr->pval / o_ptr->number)) / 15;
1926-
1927- /* All staffs, unstacked wands. */
19281749 else recharge_strength = (100 + power - lev - (8 * o_ptr->pval)) / 15;
1750+
19291751 if (recharge_strength < 0) recharge_strength = 0;
19301752
1931- /* Back-fire */
19321753 if (one_in_(recharge_strength))
19331754 {
1934- /* Activate the failure code. */
19351755 is_recharge_successful = FALSE;
19361756 }
1937-
1938- /* If the spell didn't backfire, recharge the wand or staff. */
19391757 else
19401758 {
1941- /* Recharge based on the standard number of charges. */
19421759 recharge_amount = randint1(1 + k_ptr->pval / 2);
1943-
1944- /* Multiple wands in a stack increase recharging somewhat. */
19451760 if ((o_ptr->tval == TV_WAND) && (o_ptr->number > 1))
19461761 {
19471762 recharge_amount +=
@@ -1950,23 +1765,14 @@ bool recharge(player_type *caster_ptr, int power)
19501765 if (recharge_amount > 12) recharge_amount = 12;
19511766 }
19521767
1953- /* But each staff in a stack gets fewer additional charges,
1954- * although always at least one.
1955- */
19561768 if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
19571769 {
19581770 recharge_amount /= (TIME_EFFECT)o_ptr->number;
19591771 if (recharge_amount < 1) recharge_amount = 1;
19601772 }
19611773
1962- /* Recharge the wand or staff. */
19631774 o_ptr->pval += recharge_amount;
1964-
1965-
1966- /* Hack -- we no longer "know" the item */
19671775 o_ptr->ident &= ~(IDENT_KNOWN);
1968-
1969- /* Hack -- we no longer think the item is empty */
19701776 o_ptr->ident &= ~(IDENT_EMPTY);
19711777 }
19721778 }
@@ -1982,12 +1788,8 @@ bool recharge(player_type *caster_ptr, int power)
19821788 {
19831789 object_desc(caster_ptr, o_name, o_ptr, OD_NAME_ONLY);
19841790 msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), o_name);
1985-
1986- /* Artifact rods. */
19871791 if ((o_ptr->tval == TV_ROD) && (o_ptr->timeout < 10000))
19881792 o_ptr->timeout = (o_ptr->timeout + 100) * 2;
1989-
1990- /* Artifact wands and staffs. */
19911793 else if ((o_ptr->tval == TV_WAND) || (o_ptr->tval == TV_STAFF))
19921794 o_ptr->pval = 0;
19931795 return update_player(caster_ptr);
@@ -2099,17 +1901,14 @@ void display_spell_list(player_type *caster_ptr)
20991901
21001902 clear_from(0);
21011903
2102- /* They have too many spells to list */
21031904 if (caster_ptr->pclass == CLASS_SORCERER) return;
21041905 if (caster_ptr->pclass == CLASS_RED_MAGE) return;
2105-
21061906 if (caster_ptr->pclass == CLASS_SNIPER)
21071907 {
21081908 display_snipe_list(caster_ptr);
21091909 return;
21101910 }
21111911
2112- /* mind.c type classes */
21131912 if ((caster_ptr->pclass == CLASS_MINDCRAFTER) ||
21141913 (caster_ptr->pclass == CLASS_BERSERKER) ||
21151914 (caster_ptr->pclass == CLASS_NINJA) ||
@@ -2119,16 +1918,15 @@ void display_spell_list(player_type *caster_ptr)
21191918 PERCENTAGE minfail = 0;
21201919 PLAYER_LEVEL plev = caster_ptr->lev;
21211920 PERCENTAGE chance = 0;
2122- mind_type spell;
2123- char comment[80];
2124- char psi_desc[80];
2125- int use_mind;
1921+ mind_type spell;
1922+ char comment[80];
1923+ char psi_desc[80];
1924+ int use_mind;
21261925 bool use_hp = FALSE;
21271926
21281927 y = 1;
21291928 x = 1;
21301929
2131- /* Display a list of spells */
21321930 prt("", y, x);
21331931 put_str(_("名前", "Name"), y, x + 5);
21341932 put_str(_("Lv MP 失率 効果", "Lv Mana Fail Info"), y, x + 35);
@@ -2143,28 +1941,17 @@ void display_spell_list(player_type *caster_ptr)
21431941 default: use_mind = 0;break;
21441942 }
21451943
2146- /* Dump the spells */
2147- int i;
2148- for (i = 0; i < MAX_MIND_POWERS; i++)
1944+ for (int i = 0; i < MAX_MIND_POWERS; i++)
21491945 {
21501946 byte a = TERM_WHITE;
2151-
2152- /* Access the available spell */
21531947 spell = mind_powers[use_mind].info[i];
21541948 if (spell.min_lev > plev) break;
21551949
2156- /* Get the failure rate */
21571950 chance = spell.fail;
2158-
2159- /* Reduce failure rate by "effective" level adjustment */
21601951 chance -= 3 * (caster_ptr->lev - spell.min_lev);
2161-
2162- /* Reduce failure rate by INT/WIS adjustment */
21631952 chance -= 3 * (adj_mag_stat[caster_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
2164-
21651953 if (!use_hp)
21661954 {
2167- /* Not enough mana to cast */
21681955 if (spell.mana_cost > caster_ptr->csp)
21691956 {
21701957 chance += 5 * (spell.mana_cost - caster_ptr->csp);
@@ -2173,7 +1960,6 @@ void display_spell_list(player_type *caster_ptr)
21731960 }
21741961 else
21751962 {
2176- /* Not enough hp to cast */
21771963 if (spell.mana_cost > caster_ptr->chp)
21781964 {
21791965 chance += 100;
@@ -2181,23 +1967,15 @@ void display_spell_list(player_type *caster_ptr)
21811967 }
21821968 }
21831969
2184- /* Extract the minimum failure rate */
21851970 minfail = adj_mag_fail[caster_ptr->stat_ind[mp_ptr->spell_stat]];
2186-
2187- /* Minimum failure rate */
21881971 if (chance < minfail) chance = minfail;
21891972
2190- /* Stunning makes spells harder */
21911973 if (caster_ptr->stun > 50) chance += 25;
21921974 else if (caster_ptr->stun) chance += 15;
21931975
2194- /* Always a 5 percent chance of working */
21951976 if (chance > 95) chance = 95;
21961977
2197- /* Get info */
21981978 mindcraft_info(caster_ptr, comment, use_mind, i);
2199-
2200- /* Dump the spell */
22011979 sprintf(psi_desc, " %c) %-30s%2d %4d %3d%%%s",
22021980 I2A(i), spell.name,
22031981 spell.min_lev, spell.mana_cost, chance, comment);
@@ -2208,30 +1986,18 @@ void display_spell_list(player_type *caster_ptr)
22081986 return;
22091987 }
22101988
2211- /* Cannot read spellbooks */
22121989 if (REALM_NONE == caster_ptr->realm1) return;
22131990
2214- /* Normal spellcaster with books */
2215-
2216- /* Scan books */
22171991 for (int j = 0; j < ((caster_ptr->realm2 > REALM_NONE) ? 2 : 1); j++)
22181992 {
2219- /* Reset vertical */
22201993 m[j] = 0;
2221-
2222- /* Vertical location */
22231994 y = (j < 3) ? 0 : (m[j - 3] + 2);
2224-
2225- /* Horizontal location */
22261995 x = 27 * (j % 3);
2227-
2228- /* Scan spells */
22291996 int n = 0;
22301997 for (int i = 0; i < 32; i++)
22311998 {
22321999 byte a = TERM_WHITE;
22332000
2234- /* Access the spell */
22352001 if (!is_magic((j < 1) ? caster_ptr->realm1 : caster_ptr->realm2))
22362002 {
22372003 s_ptr = &technic_info[((j < 1) ? caster_ptr->realm1 : caster_ptr->realm2) - MIN_TECHNIC][i % 32];
@@ -2243,48 +2009,33 @@ void display_spell_list(player_type *caster_ptr)
22432009
22442010 strcpy(name, exe_spell(caster_ptr, (j < 1) ? caster_ptr->realm1 : caster_ptr->realm2, i % 32, SPELL_NAME));
22452011
2246- /* Illegible */
22472012 if (s_ptr->slevel >= 99)
22482013 {
2249- /* Illegible */
22502014 strcpy(name, _("(判読不能)", "(illegible)"));
2251-
2252- /* Unusable */
22532015 a = TERM_L_DARK;
22542016 }
2255-
2256- /* Forgotten */
22572017 else if ((j < 1) ?
22582018 ((caster_ptr->spell_forgotten1 & (1L << i))) :
22592019 ((caster_ptr->spell_forgotten2 & (1L << (i % 32)))))
22602020 {
2261- /* Forgotten */
22622021 a = TERM_ORANGE;
22632022 }
2264-
2265- /* Unknown */
22662023 else if (!((j < 1) ?
22672024 (caster_ptr->spell_learned1 & (1L << i)) :
22682025 (caster_ptr->spell_learned2 & (1L << (i % 32)))))
22692026 {
2270- /* Unknown */
22712027 a = TERM_RED;
22722028 }
2273-
2274- /* Untried */
22752029 else if (!((j < 1) ?
22762030 (caster_ptr->spell_worked1 & (1L << i)) :
22772031 (caster_ptr->spell_worked2 & (1L << (i % 32)))))
22782032 {
2279- /* Untried */
22802033 a = TERM_YELLOW;
22812034 }
22822035
2283- /* Dump the spell --(-- */
22842036 sprintf(out_val, "%c/%c) %-20.20s",
22852037 I2A(n / 8), I2A(n % 8), name);
22862038
2287- /* Track maximum */
22882039 m[j] = y + n;
22892040 Term_putstr(x, m[j], -1, a, out_val);
22902041 n++;
@@ -2325,21 +2076,13 @@ MANA_POINT mod_need_mana(player_type *caster_ptr, MANA_POINT need_mana, SPELL_ID
23252076 #define MANA_CONST 2400
23262077 #define MANA_DIV 4
23272078 #define DEC_MANA_DIV 3
2328-
2329- /* Realm magic */
23302079 if ((realm > REALM_NONE) && (realm <= MAX_REALM))
23312080 {
2332- /*
2333- * need_mana defaults if spell exp equals SPELL_EXP_EXPERT and !caster_ptr->dec_mana.
2334- * MANA_CONST is used to calculate need_mana effected from spell proficiency.
2335- */
23362081 need_mana = need_mana * (MANA_CONST + SPELL_EXP_EXPERT - experience_of_spell(caster_ptr, spell, realm)) + (MANA_CONST - 1);
23372082 need_mana *= caster_ptr->dec_mana ? DEC_MANA_DIV : MANA_DIV;
23382083 need_mana /= MANA_CONST * MANA_DIV;
23392084 if (need_mana < 1) need_mana = 1;
23402085 }
2341-
2342- /* Non-realm magic */
23432086 else
23442087 {
23452088 if (caster_ptr->dec_mana) need_mana = (need_mana + 1) * DEC_MANA_DIV / MANA_DIV;
@@ -2406,12 +2149,9 @@ PERCENTAGE mod_spell_chance_2(player_type *caster_ptr, PERCENTAGE chance)
24062149 */
24072150 PERCENTAGE spell_chance(player_type *caster_ptr, SPELL_IDX spell, REALM_IDX use_realm)
24082151 {
2409- /* Paranoia -- must be literate */
24102152 if (!mp_ptr->spell_book) return 100;
2411-
24122153 if (use_realm == REALM_HISSATSU) return 0;
24132154
2414- /* Access the spell */
24152155 const magic_type *s_ptr;
24162156 if (!is_magic(use_realm))
24172157 {
@@ -2422,22 +2162,13 @@ PERCENTAGE spell_chance(player_type *caster_ptr, SPELL_IDX spell, REALM_IDX use_
24222162 s_ptr = &mp_ptr->info[use_realm - 1][spell];
24232163 }
24242164
2425- /* Extract the base spell failure rate */
24262165 PERCENTAGE chance = s_ptr->sfail;
2427-
2428- /* Reduce failure rate by "effective" level adjustment */
24292166 chance -= 3 * (caster_ptr->lev - s_ptr->slevel);
2430-
2431- /* Reduce failure rate by INT/WIS adjustment */
24322167 chance -= 3 * (adj_mag_stat[caster_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
2433-
24342168 if (caster_ptr->riding)
24352169 chance += (MAX(r_info[caster_ptr->current_floor_ptr->m_list[caster_ptr->riding].r_idx].level - caster_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
24362170
2437- /* Extract mana consumption rate */
24382171 MANA_POINT need_mana = mod_need_mana(caster_ptr, s_ptr->smana, spell, use_realm);
2439-
2440- /* Not enough mana to cast */
24412172 if (need_mana > caster_ptr->csp)
24422173 {
24432174 chance += 5 * (need_mana - caster_ptr->csp);
@@ -2445,25 +2176,16 @@ PERCENTAGE spell_chance(player_type *caster_ptr, SPELL_IDX spell, REALM_IDX use_
24452176
24462177 if ((use_realm != caster_ptr->realm1) && ((caster_ptr->pclass == CLASS_MAGE) || (caster_ptr->pclass == CLASS_PRIEST))) chance += 5;
24472178
2448- /* Extract the minimum failure rate */
24492179 PERCENTAGE minfail = adj_mag_fail[caster_ptr->stat_ind[mp_ptr->spell_stat]];
2450-
2451- /*
2452- * Non mage/priest characters never get too good
2453- * (added high mage, mindcrafter)
2454- */
24552180 if (mp_ptr->spell_xtra & MAGIC_FAIL_5PERCENT)
24562181 {
24572182 if (minfail < 5) minfail = 5;
24582183 }
24592184
2460- /* Hack -- Priest prayer penalty for "edged" weapons -DGK */
24612185 if (((caster_ptr->pclass == CLASS_PRIEST) || (caster_ptr->pclass == CLASS_SORCERER)) && caster_ptr->icky_wield[0]) chance += 25;
24622186 if (((caster_ptr->pclass == CLASS_PRIEST) || (caster_ptr->pclass == CLASS_SORCERER)) && caster_ptr->icky_wield[1]) chance += 25;
24632187
24642188 chance = mod_spell_chance_1(caster_ptr, chance);
2465-
2466- /* Goodness or evilness gives a penalty to failure rate */
24672189 PERCENTAGE penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
24682190 switch (use_realm)
24692191 {
@@ -2483,7 +2205,6 @@ PERCENTAGE spell_chance(player_type *caster_ptr, SPELL_IDX spell, REALM_IDX use_
24832205 if (caster_ptr->stun > 50) chance += 25;
24842206 else if (caster_ptr->stun) chance += 15;
24852207
2486- /* Always a 5 percent chance of working */
24872208 if (chance > 95) chance = 95;
24882209
24892210 if ((use_realm == caster_ptr->realm1) || (use_realm == caster_ptr->realm2)
@@ -2515,7 +2236,6 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
25152236 if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && current_world_ptr->wizard)
25162237 msg_print(_("警告! print_spell が領域なしに呼ばれた", "Warning! print_spells called with null realm"));
25172238
2518- /* Title the list */
25192239 prt("", y, x);
25202240 char buf[256];
25212241 if (use_realm == REALM_HISSATSU)
@@ -2533,7 +2253,6 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
25332253
25342254 int i;
25352255 int exp_level;
2536- SPELL_IDX spell;
25372256 const magic_type *s_ptr;
25382257 char info[80];
25392258 char out_val[160];
@@ -2541,7 +2260,7 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
25412260 bool max = FALSE;
25422261 for (i = 0; i < num; i++)
25432262 {
2544- spell = spells[i];
2263+ SPELL_IDX spell = spells[i];
25452264
25462265 if (!is_magic(use_realm))
25472266 {
@@ -2558,10 +2277,7 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
25582277 else
25592278 {
25602279 EXP exp = experience_of_spell(caster_ptr, spell, use_realm);
2561-
2562- /* Extract mana consumption rate */
25632280 need_mana = mod_need_mana(caster_ptr, s_ptr->smana, spell, use_realm);
2564-
25652281 if ((increment == 64) || (s_ptr->slevel >= 99)) exp_level = EXP_LEVEL_UNSKILLED;
25662282 else exp_level = spell_exp_level(exp);
25672283
@@ -2584,7 +2300,7 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
25842300 strcpy(out_val, " ");
25852301 }
25862302 else sprintf(out_val, " %c) ", I2A(i));
2587- /* Skip illegible spells */
2303+
25882304 if (s_ptr->slevel >= 99)
25892305 {
25902306 strcat(out_val, format("%-30s", _("(判読不能)", "(illegible)")));
@@ -2592,18 +2308,9 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
25922308 continue;
25932309 }
25942310
2595- /* XXX XXX Could label spells above the players level */
2596-
2597- /* Get extra info */
25982311 strcpy(info, exe_spell(caster_ptr, use_realm, spell, SPELL_INFO));
2599-
2600- /* Use that info */
26012312 concptr comment = info;
2602-
2603- /* Assume spell is known and tried */
26042313 byte line_attr = TERM_WHITE;
2605-
2606- /* Analyze the spell */
26072314 if ((caster_ptr->pclass == CLASS_SORCERER) || (caster_ptr->pclass == CLASS_RED_MAGE))
26082315 {
26092316 if (s_ptr->slevel > caster_ptr->max_plv)
@@ -2644,18 +2351,15 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
26442351 line_attr = TERM_L_GREEN;
26452352 }
26462353
2647- /* Dump the spell --(-- */
26482354 if (use_realm == REALM_HISSATSU)
26492355 {
26502356 strcat(out_val, format("%-25s %2d %4d",
2651- exe_spell(caster_ptr, use_realm, spell, SPELL_NAME), /* realm, spell */
2652- s_ptr->slevel, need_mana));
2357+ exe_spell(caster_ptr, use_realm, spell, SPELL_NAME), s_ptr->slevel, need_mana));
26532358 }
26542359 else
26552360 {
26562361 strcat(out_val, format("%-25s%c%-4s %2d %4d %3d%% %s",
2657- exe_spell(caster_ptr, use_realm, spell, SPELL_NAME), /* realm, spell */
2658- (max ? '!' : ' '), ryakuji,
2362+ exe_spell(caster_ptr, use_realm, spell, SPELL_NAME), (max ? '!' : ' '), ryakuji,
26592363 s_ptr->slevel, need_mana, spell_chance(caster_ptr, spell, use_realm), comment));
26602364 }
26612365
@@ -2677,36 +2381,23 @@ void print_spells(player_type* caster_ptr, SPELL_IDX target_spell, SPELL_IDX *sp
26772381 */
26782382 static MONRACE_IDX poly_r_idx(player_type *caster_ptr, MONRACE_IDX r_idx)
26792383 {
2680- /* Hack -- Uniques/Questors never polymorph */
26812384 monster_race *r_ptr = &r_info[r_idx];
26822385 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags1 & RF1_QUESTOR))
26832386 return (r_idx);
26842387
2685- /* Allowable range of "levels" for resulting monster */
26862388 DEPTH lev1 = r_ptr->level - ((randint1(20) / randint1(9)) + 1);
26872389 DEPTH lev2 = r_ptr->level + ((randint1(20) / randint1(9)) + 1);
2688-
2689- /* Pick a (possibly new) non-unique race */
26902390 MONRACE_IDX r;
26912391 for (int i = 0; i < 1000; i++)
26922392 {
2693- /* Pick a new race, using a level calculation */
26942393 r = get_mon_num(caster_ptr, (caster_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5);
2695-
2696- /* Handle failure */
26972394 if (!r) break;
26982395
26992396 r_ptr = &r_info[r];
2700-
2701- /* Ignore unique monsters */
27022397 if (r_ptr->flags1 & RF1_UNIQUE) continue;
2703-
2704- /* Ignore monsters with incompatible levels */
27052398 if ((r_ptr->level < lev1) || (r_ptr->level > lev2)) continue;
27062399
2707- /* Use that index */
27082400 r_idx = r;
2709-
27102401 break;
27112402 }
27122403
@@ -2735,67 +2426,48 @@ bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
27352426 if (floor_ptr->inside_arena || caster_ptr->phase_out) return FALSE;
27362427 if ((caster_ptr->riding == g_ptr->m_idx) || (m_ptr->mflag2 & MFLAG2_KAGE)) return FALSE;
27372428
2738- /* Memorize the monster before polymorphing */
27392429 monster_type back_m = *m_ptr;
2740-
2741- /* Pick a "new" monster race */
27422430 new_r_idx = poly_r_idx(caster_ptr, old_r_idx);
2743-
2744- /* Handle polymorph */
27452431 if (new_r_idx == old_r_idx) return FALSE;
27462432
27472433 bool preserve_hold_objects = back_m.hold_o_idx ? TRUE : FALSE;
27482434 OBJECT_IDX this_o_idx, next_o_idx = 0;
27492435
2750- /* Get the monsters attitude */
27512436 BIT_FLAGS mode = 0L;
27522437 if (is_friendly(m_ptr)) mode |= PM_FORCE_FRIENDLY;
27532438 if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
27542439 if (m_ptr->mflag2 & MFLAG2_NOPET) mode |= PM_NO_PET;
27552440
2756- /* Mega-hack -- ignore held objects */
27572441 m_ptr->hold_o_idx = 0;
2758-
2759- /* "Kill" the "old" monster */
27602442 delete_monster_idx(caster_ptr, g_ptr->m_idx);
2761-
2762- /* Create a new monster (no groups) */
27632443 bool polymorphed = FALSE;
27642444 if (place_monster_aux(caster_ptr, 0, y, x, new_r_idx, mode))
27652445 {
27662446 floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
27672447 floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
27682448 floor_ptr->m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
2769-
2770- /* Success */
27712449 polymorphed = TRUE;
27722450 }
27732451 else
27742452 {
2775- /* Placing the new monster failed */
27762453 if (place_monster_aux(caster_ptr, 0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
27772454 {
27782455 floor_ptr->m_list[hack_m_idx_ii] = back_m;
2779-
2780- /* Re-initialize monster process */
27812456 mproc_init(floor_ptr);
27822457 }
27832458 else preserve_hold_objects = FALSE;
27842459 }
27852460
2786- /* Mega-hack -- preserve held objects */
27872461 if (preserve_hold_objects)
27882462 {
27892463 for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
27902464 {
27912465 object_type *o_ptr = &floor_ptr->o_list[this_o_idx];
27922466 next_o_idx = o_ptr->next_o_idx;
2793-
2794- /* Held by new monster */
27952467 o_ptr->held_m_idx = hack_m_idx_ii;
27962468 }
27972469 }
2798- else if (back_m.hold_o_idx) /* Failed (paranoia) */
2470+ else if (back_m.hold_o_idx)
27992471 {
28002472 for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
28012473 {
@@ -2809,6 +2481,7 @@ bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
28092481 return polymorphed;
28102482 }
28112483
2484+
28122485 /*!
28132486 * @brief 次元の扉処理 /
28142487 * Dimension Door
@@ -2846,7 +2519,6 @@ static bool dimension_door_aux(player_type *caster_ptr, POSITION x, POSITION y)
28462519 bool dimension_door(player_type *caster_ptr)
28472520 {
28482521 DEPTH x = 0, y = 0;
2849-
28502522 if (!tgt_pt(caster_ptr, &x, &y)) return FALSE;
28512523 if (dimension_door_aux(caster_ptr, x, y)) return TRUE;
28522524
@@ -2881,14 +2553,12 @@ bool mirror_tunnel(player_type *caster_ptr)
28812553 bool eat_magic(player_type *caster_ptr, int power)
28822554 {
28832555 byte fail_type = 1;
2884-
2885- concptr q, s;
28862556 GAME_TEXT o_name[MAX_NLEN];
28872557
28882558 item_tester_hook = item_tester_hook_recharge;
28892559
2890- q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
2891- s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
2560+ concptr q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
2561+ concptr s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
28922562
28932563 object_type *o_ptr;
28942564 OBJECT_IDX item;
@@ -2904,11 +2574,8 @@ bool eat_magic(player_type *caster_ptr, int power)
29042574 if (o_ptr->tval == TV_ROD)
29052575 {
29062576 recharge_strength = ((power > lev/2) ? (power - lev/2) : 0) / 5;
2907-
2908- /* Back-fire */
29092577 if (one_in_(recharge_strength))
29102578 {
2911- /* Activate the failure code. */
29122579 is_eating_successful = FALSE;
29132580 }
29142581 else
@@ -2926,11 +2593,9 @@ bool eat_magic(player_type *caster_ptr, int power)
29262593 }
29272594 else
29282595 {
2929- /* All staffs, wands. */
29302596 recharge_strength = (100 + power - lev) / 15;
29312597 if (recharge_strength < 0) recharge_strength = 0;
29322598
2933- /* Back-fire */
29342599 if (one_in_(recharge_strength))
29352600 {
29362601 is_eating_successful = FALSE;
@@ -2942,7 +2607,6 @@ bool eat_magic(player_type *caster_ptr, int power)
29422607 caster_ptr->csp += lev / 2;
29432608 o_ptr->pval --;
29442609
2945- /* XXX Hack -- unstack if necessary */
29462610 if ((o_ptr->tval == TV_STAFF) && (item >= 0) && (o_ptr->number > 1))
29472611 {
29482612 object_type forge;
@@ -2950,13 +2614,8 @@ bool eat_magic(player_type *caster_ptr, int power)
29502614 q_ptr = &forge;
29512615 object_copy(q_ptr, o_ptr);
29522616
2953- /* Modify quantity */
29542617 q_ptr->number = 1;
2955-
2956- /* Restore the charges */
29572618 o_ptr->pval++;
2958-
2959- /* Unstack the used item */
29602619 o_ptr->number--;
29612620 caster_ptr->total_weight -= q_ptr->weight;
29622621 item = inven_carry(caster_ptr, q_ptr);
@@ -2978,27 +2637,20 @@ bool eat_magic(player_type *caster_ptr, int power)
29782637 return redraw_player(caster_ptr);
29792638 }
29802639
2981- /* Artifacts are never destroyed. */
29822640 if (object_is_fixed_artifact(o_ptr))
29832641 {
29842642 object_desc(caster_ptr, o_name, o_ptr, OD_NAME_ONLY);
29852643 msg_format(_("魔力が逆流した!%sは完全に魔力を失った。", "The recharging backfires - %s is completely drained!"), o_name);
2986-
2987- /* Artifact rods. */
29882644 if (o_ptr->tval == TV_ROD)
29892645 o_ptr->timeout = k_ptr->pval * o_ptr->number;
2990-
2991- /* Artifact wands and staffs. */
29922646 else if ((o_ptr->tval == TV_WAND) || (o_ptr->tval == TV_STAFF))
29932647 o_ptr->pval = 0;
2648+
29942649 return redraw_player(caster_ptr);
29952650 }
29962651
2997- /* Get the object description */
29982652 object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
29992653
3000- /*** Determine Seriousness of Failure ***/
3001-
30022654 /* Mages recharge objects more safely. */
30032655 if (IS_WIZARD_CLASS(caster_ptr))
30042656 {
@@ -3044,9 +2696,6 @@ bool eat_magic(player_type *caster_ptr, int power)
30442696 }
30452697 }
30462698
3047- /*** Apply draining and destruction. ***/
3048-
3049- /* Drain object or stack of objects. */
30502699 if (fail_type == 1)
30512700 {
30522701 if (o_ptr->tval == TV_ROD)
@@ -3062,7 +2711,6 @@ bool eat_magic(player_type *caster_ptr, int power)
30622711 }
30632712 }
30642713
3065- /* Destroy an object or one in a stack of objects. */
30662714 if (fail_type == 2)
30672715 {
30682716 if (o_ptr->number > 1)
@@ -3080,7 +2728,6 @@ bool eat_magic(player_type *caster_ptr, int power)
30802728 vary_item(caster_ptr, item, -1);
30812729 }
30822730
3083- /* Destroy all members of a stack of objects. */
30842731 if (fail_type == 3)
30852732 {
30862733 if (o_ptr->number > 1)
@@ -3102,17 +2749,14 @@ bool eat_magic(player_type *caster_ptr, int power)
31022749 */
31032750 void massacre(player_type *caster_ptr)
31042751 {
3105- POSITION x, y;
31062752 grid_type *g_ptr;
31072753 monster_type *m_ptr;
31082754 for (DIRECTION dir = 0; dir < 8; dir++)
31092755 {
3110- y = caster_ptr->y + ddy_ddd[dir];
3111- x = caster_ptr->x + ddx_ddd[dir];
2756+ POSITION y = caster_ptr->y + ddy_ddd[dir];
2757+ POSITION x = caster_ptr->x + ddx_ddd[dir];
31122758 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
31132759 m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
3114-
3115- /* Hack -- attack monsters */
31162760 if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)))
31172761 py_attack(caster_ptr, y, x, 0);
31182762 }
@@ -3137,7 +2781,6 @@ bool eat_rock(player_type *caster_ptr)
31372781 mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
31382782
31392783 stop_mouth(caster_ptr);
3140-
31412784 if (!have_flag(mimic_f_ptr->flags, FF_HURT_ROCK))
31422785 {
31432786 msg_print(_("この地形は食べられない。", "You cannot eat this feature."));
@@ -3220,7 +2863,10 @@ bool shock_power(player_type *caster_ptr)
32202863 ty = y;
32212864 tx = x;
32222865 }
3223- else break;
2866+ else
2867+ {
2868+ break;
2869+ }
32242870 }
32252871
32262872 bool is_shock_successful = ty != oy;
@@ -3391,11 +3037,8 @@ bool fire_crimson(player_type *shooter_ptr)
33913037 DIRECTION dir;
33923038 if (!get_aim_dir(shooter_ptr, &dir)) return FALSE;
33933039
3394- /* Use the given direction */
33953040 POSITION tx = shooter_ptr->x + 99 * ddx[dir];
33963041 POSITION ty = shooter_ptr->y + 99 * ddy[dir];
3397-
3398- /* Hack -- Use an actual "target" */
33993042 if ((dir == 5) && target_okay(shooter_ptr))
34003043 {
34013044 tx = target_col;
@@ -3405,13 +3048,8 @@ bool fire_crimson(player_type *shooter_ptr)
34053048 int num = 1;
34063049 if (shooter_ptr->pclass == CLASS_ARCHER)
34073050 {
3408- /* Extra shot at level 10 */
34093051 if (shooter_ptr->lev >= 10) num++;
3410-
3411- /* Extra shot at level 30 */
34123052 if (shooter_ptr->lev >= 30) num++;
3413-
3414- /* Extra shot at level 45 */
34153053 if (shooter_ptr->lev >= 45) num++;
34163054 }
34173055
@@ -3458,7 +3096,7 @@ bool tele_town(player_type *caster_ptr)
34583096 num++;
34593097 }
34603098
3461- if (!num)
3099+ if (num == 0)
34623100 {
34633101 msg_print(_("まだ行けるところがない。", "You have not yet visited any town."));
34643102 msg_print(NULL);