• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision02eee9a37bfa957d382fca8497ffc85d2446e0b3 (tree)
Time2019-07-08 12:45:49
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/player-damage.c
+++ b/src/player-damage.c
@@ -362,22 +362,22 @@ int inven_damage(inven_func typ, int perc)
362362 * Note that the "base armor" of an object never changes.
363363 * If any armor is damaged (or resists), the player takes less damage.
364364 */
365-static bool acid_minus_ac(void)
365+static bool acid_minus_ac(player_type *creature_ptr)
366366 {
367367 object_type *o_ptr = NULL;
368368 BIT_FLAGS flgs[TR_FLAG_SIZE];
369369 GAME_TEXT o_name[MAX_NLEN];
370370
371- /* Pick a (possibly empty) p_ptr->inventory_list slot */
371+ /* Pick a (possibly empty) creature_ptr->inventory_list slot */
372372 switch (randint1(7))
373373 {
374- case 1: o_ptr = &p_ptr->inventory_list[INVEN_RARM]; break;
375- case 2: o_ptr = &p_ptr->inventory_list[INVEN_LARM]; break;
376- case 3: o_ptr = &p_ptr->inventory_list[INVEN_BODY]; break;
377- case 4: o_ptr = &p_ptr->inventory_list[INVEN_OUTER]; break;
378- case 5: o_ptr = &p_ptr->inventory_list[INVEN_HANDS]; break;
379- case 6: o_ptr = &p_ptr->inventory_list[INVEN_HEAD]; break;
380- case 7: o_ptr = &p_ptr->inventory_list[INVEN_FEET]; break;
374+ case 1: o_ptr = &creature_ptr->inventory_list[INVEN_RARM]; break;
375+ case 2: o_ptr = &creature_ptr->inventory_list[INVEN_LARM]; break;
376+ case 3: o_ptr = &creature_ptr->inventory_list[INVEN_BODY]; break;
377+ case 4: o_ptr = &creature_ptr->inventory_list[INVEN_OUTER]; break;
378+ case 5: o_ptr = &creature_ptr->inventory_list[INVEN_HANDS]; break;
379+ case 6: o_ptr = &creature_ptr->inventory_list[INVEN_HEAD]; break;
380+ case 7: o_ptr = &creature_ptr->inventory_list[INVEN_FEET]; break;
381381 }
382382
383383 if (!o_ptr->k_idx) return (FALSE);
@@ -405,10 +405,10 @@ static bool acid_minus_ac(void)
405405 o_ptr->to_a--;
406406
407407 /* Calculate bonuses */
408- p_ptr->update |= (PU_BONUS);
409- p_ptr->window |= (PW_EQUIP | PW_PLAYER);
408+ creature_ptr->update |= (PU_BONUS);
409+ creature_ptr->window |= (PW_EQUIP | PW_PLAYER);
410410
411- calc_android_exp(p_ptr);
411+ calc_android_exp(creature_ptr);
412412
413413 /* Item was damaged */
414414 return (TRUE);
@@ -452,7 +452,7 @@ HIT_POINT acid_dam(HIT_POINT dam, concptr kb_str, int monspell, bool aura)
452452 (void)do_dec_stat(p_ptr, A_CHR);
453453
454454 /* If any armor gets hit, defend the player */
455- if (acid_minus_ac()) dam = (dam + 1) / 2;
455+ if (acid_minus_ac(p_ptr)) dam = (dam + 1) / 2;
456456 }
457457
458458 get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
Show on old repository browser