From e07154089a29fb40784acdfb5399e07b9b187a74 Mon Sep 17 00:00:00 2001 From: Hourier Date: Mon, 27 Apr 2020 21:18:28 +0900 Subject: [PATCH] [Refactor] Renamed project_o() to affect_item() --- src/Makefile.am | 3 +++ src/effect/effect-item.c | 2 +- src/effect/effect-item.h | 2 +- src/spells1.c | 10 +++++----- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 16ff3076c..53c284dfe 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -158,6 +158,9 @@ hengband_SOURCES = \ \ rumor.h rumor.c \ \ + effect/effect-feature.c effect/effect-feature.h \ + effect/effect-item.c effect/effect-item.h \ + \ spells.h \ spells1.c spells2.c spells3.c \ spells-diceroll.c spells-diceroll.h \ diff --git a/src/effect/effect-item.c b/src/effect/effect-item.c index 9b4ca4231..d50307ea1 100644 --- a/src/effect/effect-item.c +++ b/src/effect/effect-item.c @@ -33,7 +33,7 @@ * We return "TRUE" if the effect of the projection is "obvious". * */ -bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ) +bool affect_item(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ) { grid_type *g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x]; diff --git a/src/effect/effect-item.h b/src/effect/effect-item.h index b4d58b42d..580230468 100644 --- a/src/effect/effect-item.h +++ b/src/effect/effect-item.h @@ -1,3 +1,3 @@ #pragma once -bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ); +bool affect_item(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ); diff --git a/src/spells1.c b/src/spells1.c index 3b9516392..27c831969 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -4308,7 +4308,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y, } } - if (project_o(caster_ptr, 0, 0, y, x, dam, GF_SEEKER))notice = TRUE; + if (affect_item(caster_ptr, 0, 0, y, x, dam, GF_SEEKER))notice = TRUE; if (!is_mirror_grid(&caster_ptr->current_floor_ptr->grid_array[y][x])) continue; @@ -4412,7 +4412,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y, } } - if (project_o(caster_ptr, 0, 0, y, x, dam, GF_SUPER_RAY))notice = TRUE; + if (affect_item(caster_ptr, 0, 0, y, x, dam, GF_SUPER_RAY))notice = TRUE; if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)) { if (second_step)continue; @@ -4691,11 +4691,11 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y, if (breath) { int d = dist_to_line(y, x, y1, x1, by, bx); - if (project_o(caster_ptr, who, d, y, x, dam, typ)) notice = TRUE; + if (affect_item(caster_ptr, who, d, y, x, dam, typ)) notice = TRUE; } else { - if (project_o(caster_ptr, who, dist, y, x, dam, typ)) notice = TRUE; + if (affect_item(caster_ptr, who, dist, y, x, dam, typ)) notice = TRUE; } } } @@ -5069,7 +5069,7 @@ bool binding_field(player_type *caster_ptr, HIT_POINT dam) { if (player_has_los_bold(caster_ptr, y, x) && projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)) { - (void)project_o(caster_ptr, 0, 0, y, x, dam, GF_MANA); + (void)affect_item(caster_ptr, 0, 0, y, x, dam, GF_MANA); } } } -- 2.11.0