• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision65fd06872bf97d142b917049d220cd64e27f182b (tree)
Time2019-06-17 00:27:25
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 do_cmd_go_up() に player_type * 引数を対象として追加.

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -183,17 +183,17 @@ bool cmd_limit_time_walk(player_type *creature_ptr)
183183 * @brief 階段を使って階層を昇る処理 / Go up one level
184184 * @return なし
185185 */
186-void do_cmd_go_up(void)
186+void do_cmd_go_up(player_type *creature_ptr)
187187 {
188188 bool go_up = FALSE;
189189
190190 /* Player grid */
191- grid_type *g_ptr = &current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
191+ grid_type *g_ptr = &current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
192192 feature_type *f_ptr = &f_info[g_ptr->feat];
193193
194194 int up_num = 0;
195195
196- if (p_ptr->special_defense & KATA_MUSOU)
196+ if (creature_ptr->special_defense & KATA_MUSOU)
197197 {
198198 set_action(ACTION_NONE);
199199 }
@@ -209,41 +209,41 @@ void do_cmd_go_up(void)
209209 if (have_flag(f_ptr->flags, FF_QUEST))
210210 {
211211 /* Cancel the command */
212- if (!confirm_leave_level(p_ptr, FALSE)) return;
212+ if (!confirm_leave_level(creature_ptr, FALSE)) return;
213213
214214
215215 /* Success */
216- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
216+ if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
217217 msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
218218 else
219219 msg_print(_("上の階に登った。", "You enter the up staircase."));
220220
221221 leave_quest_check();
222222
223- p_ptr->inside_quest = g_ptr->special;
223+ creature_ptr->inside_quest = g_ptr->special;
224224
225225 /* Activate the quest */
226- if (!quest[p_ptr->inside_quest].status)
226+ if (!quest[creature_ptr->inside_quest].status)
227227 {
228- if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
228+ if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
229229 {
230230 init_flags = INIT_ASSIGN;
231231 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
232232 }
233- quest[p_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
233+ quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
234234 }
235235
236236 /* Leaving a quest */
237- if (!p_ptr->inside_quest)
237+ if (!creature_ptr->inside_quest)
238238 {
239239 current_floor_ptr->dun_level = 0;
240240 }
241- p_ptr->leaving = TRUE;
241+ creature_ptr->leaving = TRUE;
242242
243- p_ptr->oldpx = 0;
244- p_ptr->oldpy = 0;
243+ creature_ptr->oldpx = 0;
244+ creature_ptr->oldpy = 0;
245245
246- take_turn(p_ptr, 100);
246+ take_turn(creature_ptr, 100);
247247
248248 /* End the command */
249249 return;
@@ -255,32 +255,32 @@ void do_cmd_go_up(void)
255255 }
256256 else
257257 {
258- go_up = confirm_leave_level(p_ptr, FALSE);
258+ go_up = confirm_leave_level(creature_ptr, FALSE);
259259 }
260260
261261 /* Cancel the command */
262262 if (!go_up) return;
263263
264- take_turn(p_ptr, 100);
264+ take_turn(creature_ptr, 100);
265265
266266 if (autosave_l) do_cmd_save_game(TRUE);
267267
268268 /* For a random quest */
269- if (p_ptr->inside_quest &&
270- quest[p_ptr->inside_quest].type == QUEST_TYPE_RANDOM)
269+ if (creature_ptr->inside_quest &&
270+ quest[creature_ptr->inside_quest].type == QUEST_TYPE_RANDOM)
271271 {
272272 leave_quest_check();
273273
274- p_ptr->inside_quest = 0;
274+ creature_ptr->inside_quest = 0;
275275 }
276276
277277 /* For a fixed quest */
278- if (p_ptr->inside_quest &&
279- quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
278+ if (creature_ptr->inside_quest &&
279+ quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
280280 {
281281 leave_quest_check();
282282
283- p_ptr->inside_quest = g_ptr->special;
283+ creature_ptr->inside_quest = g_ptr->special;
284284 current_floor_ptr->dun_level = 0;
285285 up_num = 0;
286286 }
@@ -305,19 +305,19 @@ void do_cmd_go_up(void)
305305 }
306306
307307 /* Get out from current dungeon */
308- if (current_floor_ptr->dun_level - up_num < d_info[p_ptr->dungeon_idx].mindepth)
308+ if (current_floor_ptr->dun_level - up_num < d_info[creature_ptr->dungeon_idx].mindepth)
309309 up_num = current_floor_ptr->dun_level;
310310 }
311311 if (record_stair) do_cmd_write_nikki(NIKKI_STAIR, 0-up_num, _("階段を上った", "climbed up the stairs to"));
312312
313313 /* Success */
314- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
314+ if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
315315 msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
316316 else if (up_num == current_floor_ptr->dun_level)
317317 msg_print(_("地上に戻った。", "You go back to the surface."));
318318 else
319319 msg_print(_("階段を上って新たなる迷宮へと足を踏み入れた。", "You enter a maze of up staircases."));
320- p_ptr->leaving = TRUE;
320+ creature_ptr->leaving = TRUE;
321321 }
322322
323323
--- a/src/cmd-basic.h
+++ b/src/cmd-basic.h
@@ -9,7 +9,7 @@ extern bool cmd_limit_confused(player_type *creature_ptr);
99 extern bool cmd_limit_image(player_type *creature_ptr);
1010 extern bool cmd_limit_stun(player_type *creature_ptr);
1111 extern void forget_travel_flow(void);
12-extern void do_cmd_go_up(void);
12+extern void do_cmd_go_up(player_type *creature_ptr);
1313 extern void do_cmd_go_down(void);
1414 extern void do_cmd_search(void);
1515 extern void do_cmd_open(void);
--- a/src/core.c
+++ b/src/core.c
@@ -3789,7 +3789,7 @@ static void process_command(void)
37893789 change_wild_mode(FALSE);
37903790 }
37913791 else
3792- do_cmd_go_up();
3792+ do_cmd_go_up(p_ptr);
37933793 break;
37943794 }
37953795
Show on old repository browser