• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision4f2517f7aeb132230c542c91ba2850b634dfd779 (tree)
Time2019-08-11 00:25:24
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 exe_aim_wand() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -1523,7 +1523,7 @@ void do_cmd_use(void)
15231523 break;
15241524
15251525 case TV_WAND:
1526- exe_aim_wand(item);
1526+ exe_aim_wand(p_ptr, item);
15271527 break;
15281528
15291529 case TV_STAFF:
--- a/src/cmd-magiceat.c
+++ b/src/cmd-magiceat.c
@@ -590,5 +590,5 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
590590 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
591591 else p_ptr->magic_num1[item] -= EATER_CHARGE;
592592
593- return TRUE;
593+ return TRUE;
594594 }
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -326,7 +326,7 @@ bool wand_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION
326326 * as the basic "ball" rods.
327327 * </pre>
328328 */
329-void exe_aim_wand(INVENTORY_IDX item)
329+void exe_aim_wand(player_type *creature_ptr, INVENTORY_IDX item)
330330 {
331331 DEPTH lev;
332332 int ident, chance;
@@ -334,7 +334,7 @@ void exe_aim_wand(INVENTORY_IDX item)
334334 object_type *o_ptr;
335335 bool old_target_pet = target_pet;
336336
337- o_ptr = REF_ITEM(p_ptr, current_floor_ptr, item);
337+ o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
338338
339339 /* Mega-Hack -- refuse to aim a pile from the ground */
340340 if ((item < 0) && (o_ptr->number > 1))
@@ -355,17 +355,17 @@ void exe_aim_wand(INVENTORY_IDX item)
355355 }
356356 target_pet = old_target_pet;
357357
358- take_turn(p_ptr, 100);
358+ take_turn(creature_ptr, 100);
359359
360360 /* Get the level */
361361 lev = k_info[o_ptr->k_idx].level;
362362 if (lev > 50) lev = 50 + (lev - 50) / 2;
363363
364364 /* Base chance of success */
365- chance = p_ptr->skill_dev;
365+ chance = creature_ptr->skill_dev;
366366
367367 /* Confusion hurts skill */
368- if (p_ptr->confused) chance = chance / 2;
368+ if (creature_ptr->confused) chance = chance / 2;
369369
370370 /* Hight level objects are harder */
371371 chance = chance - lev;
@@ -376,10 +376,10 @@ void exe_aim_wand(INVENTORY_IDX item)
376376 chance = USE_DEVICE;
377377 }
378378
379- if (cmd_limit_time_walk(p_ptr)) return;
379+ if (cmd_limit_time_walk(creature_ptr)) return;
380380
381381 /* Roll for usage */
382- if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
382+ if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (creature_ptr->pclass == CLASS_BERSERKER))
383383 {
384384 if (flush_failure) flush();
385385 msg_print(_("魔法棒をうまく使えなかった。", "You failed to use the wand properly."));
@@ -393,22 +393,22 @@ void exe_aim_wand(INVENTORY_IDX item)
393393 if (flush_failure) flush();
394394 msg_print(_("この魔法棒にはもう魔力が残っていない。", "The wand has no charges left."));
395395 o_ptr->ident |= (IDENT_EMPTY);
396- p_ptr->update |= (PU_COMBINE | PU_REORDER);
397- p_ptr->window |= (PW_INVEN);
396+ creature_ptr->update |= (PU_COMBINE | PU_REORDER);
397+ creature_ptr->window |= (PW_INVEN);
398398
399399 return;
400400 }
401401
402402 sound(SOUND_ZAP);
403403
404- ident = wand_effect(p_ptr, o_ptr->sval, dir, FALSE, FALSE);
405- p_ptr->update |= (PU_COMBINE | PU_REORDER);
404+ ident = wand_effect(creature_ptr, o_ptr->sval, dir, FALSE, FALSE);
405+ creature_ptr->update |= (PU_COMBINE | PU_REORDER);
406406
407407 if (!(object_is_aware(o_ptr)))
408408 {
409- chg_virtue(p_ptr, V_PATIENCE, -1);
410- chg_virtue(p_ptr, V_CHANCE, 1);
411- chg_virtue(p_ptr, V_KNOWLEDGE, -1);
409+ chg_virtue(creature_ptr, V_PATIENCE, -1);
410+ chg_virtue(creature_ptr, V_CHANCE, 1);
411+ chg_virtue(creature_ptr, V_KNOWLEDGE, -1);
412412 }
413413
414414 /* Mark it as tried */
@@ -418,10 +418,10 @@ void exe_aim_wand(INVENTORY_IDX item)
418418 if (ident && !object_is_aware(o_ptr))
419419 {
420420 object_aware(o_ptr);
421- gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
421+ gain_exp(creature_ptr, (lev + (creature_ptr->lev >> 1)) / creature_ptr->lev);
422422 }
423423
424- p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
424+ creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
425425
426426
427427 /* Use a single charge */
@@ -460,5 +460,5 @@ void do_cmd_aim_wand(void)
460460 s = _("使える魔法棒がない。", "You have no wand to aim.");
461461 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
462462
463- exe_aim_wand(item);
463+ exe_aim_wand(p_ptr, item);
464464 }
--- a/src/cmd-zapwand.h
+++ b/src/cmd-zapwand.h
@@ -1,3 +1,3 @@
11 extern bool wand_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool powerful, bool magic);
2-extern void exe_aim_wand(INVENTORY_IDX item);
2+extern void exe_aim_wand(player_type *creature_ptr, INVENTORY_IDX item);
33 extern void do_cmd_aim_wand(void);
Show on old repository browser