From 746d8a14c325d1c087720ad5030feee39e08c6b9 Mon Sep 17 00:00:00 2001 From: Deskull Date: Mon, 17 Sep 2018 16:14:06 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20#33232=20scatter()=E4=BB=AE=E6=8B=A1?= =?utf8?q?=E5=BC=B5=20/=20Add=20feature=20to=20scatter()=20temporarily.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cave.c | 14 +++++++++----- src/cmd-usestaff.c | 4 +--- src/mane.c | 35 +++++++++++++++++++++-------------- src/spells1.c | 4 ++-- 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/cave.c b/src/cave.c index d8c615a92..8640ddc33 100644 --- a/src/cave.c +++ b/src/cave.c @@ -4938,9 +4938,6 @@ void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT { POSITION nx, ny; - /* Unused */ - mode = mode; - /* Pick a location */ while (TRUE) { @@ -4954,8 +4951,15 @@ void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT /* Ignore "excessively distant" locations */ if ((d > 1) && (distance(y, x, ny, nx) > d)) continue; - /* Require "line of projection" */ - if (projectable(y, x, ny, nx)) break; + if (mode & PROJECT_LOS) + { + if(los(y, x, ny, nx)) break; + } + else + { + if(projectable(y, x, ny, nx)) break; + } + } /* Save the location */ diff --git a/src/cmd-usestaff.c b/src/cmd-usestaff.c index 738066ffb..2903cdcbc 100644 --- a/src/cmd-usestaff.c +++ b/src/cmd-usestaff.c @@ -110,10 +110,8 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo while (attempts--) { - scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0); - + scatter(&y, &x, p_ptr->y, p_ptr->x, 4, PROJECT_LOS); if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue; - if (!player_bold(y, x)) break; } diff --git a/src/mane.c b/src/mane.c index b73ee34a1..ad997e296 100644 --- a/src/mane.c +++ b/src/mane.c @@ -287,12 +287,15 @@ static bool use_mane(int spell) /* spell code */ switch (spell) { + case MS_SHRIEK: msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek.")); aggravate_monsters(0); break; + case MS_XXX1: break; + case MS_DISPEL: { MONSTER_IDX m_idx; @@ -305,96 +308,100 @@ static bool use_mane(int spell) dispel_monster_status(m_idx); break; } + case MS_ROCKET: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("ロケットを発射した。", "You fire a rocket.")); - fire_rocket(GF_ROCKET, dir, damage, 2); break; + case MS_SHOOT: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("矢を放った。", "You fire an arrow.")); - fire_bolt(GF_ARROW, dir, damage); break; + case MS_XXX2: break; + case MS_XXX3: break; + case MS_XXX4: break; + case MS_BR_ACID: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("酸のブレスを吐いた。", "You breathe acid.")); - fire_breath(GF_ACID, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_ELEC: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning.")); - fire_breath(GF_ELEC, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_FIRE: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("火炎のブレスを吐いた。", "You breathe fire.")); - fire_breath(GF_FIRE, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_COLD: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("冷気のブレスを吐いた。", "You breathe frost.")); - fire_breath(GF_COLD, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_POIS: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("ガスのブレスを吐いた。", "You breathe gas.")); - fire_breath(GF_POIS, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_NETHER: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("地獄のブレスを吐いた。", "You breathe nether.")); - fire_breath(GF_NETHER, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_LITE: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("閃光のブレスを吐いた。", "You breathe light.")); - fire_breath(GF_LITE, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_DARK: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness.")); - fire_breath(GF_DARK, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_CONF: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("混乱のブレスを吐いた。", "You breathe confusion.")); - fire_breath(GF_CONFUSION, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_SOUND: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("轟音のブレスを吐いた。", "You breathe sound.")); - fire_breath(GF_SOUND, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_CHAOS: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("カオスのブレスを吐いた。", "You breathe chaos.")); - fire_breath(GF_CHAOS, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_DISEN: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment.")); - fire_breath(GF_DISENCHANT, dir, damage, (plev > 35 ? 3 : 2)); break; + case MS_BR_NEXUS: if (!get_aim_dir(&dir)) return FALSE; else msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus.")); diff --git a/src/spells1.c b/src/spells1.c index e5c039691..deae24334 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -6826,8 +6826,8 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da rakubadam_m = 0; /* Default target of monsterspell is player */ - monster_target_y=p_ptr->y; - monster_target_x=p_ptr->x; + monster_target_y = p_ptr->y; + monster_target_x = p_ptr->x; /* Hack -- Jump to target */ if (flg & (PROJECT_JUMP)) -- 2.11.0