<ClCompile Include="..\..\src\mind\racial-samurai.c" />\r
<ClCompile Include="..\..\src\mind\samurai-slaying.c" />\r
<ClCompile Include="..\..\src\mind\surprise-attack.c" />\r
+ <ClCompile Include="..\..\src\monster\pet-fall-off.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-floor.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-particularity.c" />\r
<ClCompile Include="..\..\src\mspell\mspell-special.c" />\r
<ClInclude Include="..\..\src\mind\racial-samurai.h" />\r
<ClInclude Include="..\..\src\mind\samurai-slaying.h" />\r
<ClInclude Include="..\..\src\mind\surprise-attack.h" />\r
+ <ClInclude Include="..\..\src\monster\pet-fall-off.h" />\r
<ClInclude Include="..\..\src\mspell\assign-monster-spell.h" />\r
<ClInclude Include="..\..\src\mspell\mspell-floor.h" />\r
<ClInclude Include="..\..\src\mspell\mspell-particularity.h" />\r
<ClCompile Include="..\..\src\combat\aura-counterattack.c">
<Filter>combat</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\monster\pet-fall-off.c">
+ <Filter>monster</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-activate.h">
<ClInclude Include="..\..\src\combat\aura-counterattack.h">
<Filter>combat</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\monster\pet-fall-off.h">
+ <Filter>monster</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
monster/monster-status.c monster/monster-status.h \
monster/monster1.c monster/monster2.c \
monster/horror-descriptions.c monster/horror-descriptions.h \
+ monster/pet-fall-off.c monster/pet-fall-off.h \
\
mutation/mutation.c mutation/mutation.h \
mutation/mutation-processor.c mutation/mutation-processor.h \
#include "object/object-hook.h"
#include "monster/monster.h"
#include "monster/monster-status.h"
-#include "cmd-pet.h"
-#include "cmd-basic.h"
+#include "cmd/cmd-pet.h"
+#include "cmd/cmd-basic.h"
#include "view/display-main-window.h"
#include "io/targeting.h"
#include "world/world.h"
}
}
}
-
-
-/*!
-* @brief プレイヤーの落馬判定処理
-* @param dam 落馬判定を発した際に受けたダメージ量
-* @param force TRUEならば強制的に落馬する
-* @return 実際に落馬したらTRUEを返す
-*/
-bool process_fall_off_horse(player_type *creature_ptr, HIT_POINT dam, bool force)
-{
- DIRECTION i;
- POSITION y, x, oy, ox, sy = 0, sx = 0;
- int sn = 0;
- GAME_TEXT m_name[MAX_NLEN];
- monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
- bool fall_dam = FALSE;
-
- if (!creature_ptr->riding) return FALSE;
- if (creature_ptr->wild_mode) return FALSE;
-
- if (dam >= 0 || force)
- {
- if (!force)
- {
- int cur = creature_ptr->skill_exp[GINOU_RIDING];
- int max = s_info[creature_ptr->pclass].s_max[GINOU_RIDING];
- int ridinglevel = r_ptr->level;
-
- /* 落馬のしやすさ */
- int rakubalevel = r_ptr->level;
- if (creature_ptr->riding_ryoute) rakubalevel += 20;
-
- if ((cur < max) && (max > 1000) &&
- (dam / 2 + ridinglevel) > (cur / 30 + 10))
- {
- int inc = 0;
-
- if (ridinglevel > (cur / 100 + 15))
- inc += 1 + (ridinglevel - cur / 100 - 15);
- else
- inc += 1;
-
- creature_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
- }
-
- /* レベルの低い乗馬からは落馬しにくい */
- if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10)
- {
- if ((((creature_ptr->pclass == CLASS_BEASTMASTER) || (creature_ptr->pclass == CLASS_CAVALRY)) && !creature_ptr->riding_ryoute) || !one_in_(creature_ptr->lev*(creature_ptr->riding_ryoute ? 2 : 3) + 30))
- {
- return FALSE;
- }
- }
- }
-
- /* Check around the player */
- for (i = 0; i < 8; i++)
- {
- grid_type *g_ptr;
-
- y = creature_ptr->y + ddy_ddd[i];
- x = creature_ptr->x + ddx_ddd[i];
-
- g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
-
- if (g_ptr->m_idx) continue;
-
- /* Skip non-empty grids */
- if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !cave_have_flag_grid(g_ptr, FF_CAN_FLY))
- {
- if (!player_can_ride_aux(creature_ptr, g_ptr, FALSE)) continue;
- }
-
- if (cave_have_flag_grid(g_ptr, FF_PATTERN)) continue;
-
- /* Count "safe" grids */
- sn++;
-
- /* Randomize choice */
- if (randint0(sn) > 0) continue;
-
- /* Save the safe location */
- sy = y; sx = x;
- }
- if (!sn)
- {
- monster_desc(creature_ptr, m_name, m_ptr, 0);
- msg_format(_("%sから振り落とされそうになって、壁にぶつかった。", "You have nearly fallen from %s, but bumped into wall."), m_name);
- take_hit(creature_ptr, DAMAGE_NOESCAPE, r_ptr->level + 3, _("壁への衝突", "bumping into wall"), -1);
- return FALSE;
- }
-
- oy = creature_ptr->y;
- ox = creature_ptr->x;
-
- creature_ptr->y = sy;
- creature_ptr->x = sx;
-
- /* Redraw the old spot */
- lite_spot(creature_ptr, oy, ox);
-
- /* Redraw the new spot */
- lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
-
- /* Check for new panel */
- verify_panel(creature_ptr);
- }
-
- creature_ptr->riding = 0;
- creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
- creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
-
- creature_ptr->update |= (PU_BONUS | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
- handle_stuff(creature_ptr);
-
-
- creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
- creature_ptr->redraw |= (PR_EXTRA);
-
- /* Update health track of mount */
- creature_ptr->redraw |= (PR_UHEALTH);
-
- if (creature_ptr->levitation && !force)
- {
- monster_desc(creature_ptr, m_name, m_ptr, 0);
- msg_format(_("%sから落ちたが、空中でうまく体勢を立て直して着地した。", "You are thrown from %s, but make a good landing."), m_name);
- }
- else
- {
- take_hit(creature_ptr, DAMAGE_NOESCAPE, r_ptr->level + 3, _("落馬", "Falling from riding"), -1);
- fall_dam = TRUE;
- }
-
- if (sy && !creature_ptr->is_dead)
- (void)move_player_effect(creature_ptr, creature_ptr->y, creature_ptr->x, MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
-
- return fall_dam;
-}
extern void do_cmd_pet_dismiss(player_type *creature_pt);
extern void do_cmd_pet(player_type *creature_ptr);
extern bool player_can_ride_aux(player_type *creature_ptr, grid_type *g_ptr, bool now_riding);
-extern bool process_fall_off_horse(player_type *creature_ptr, HIT_POINT dam, bool force);
extern int total_friends;
*/
#include "combat/melee-postprocess.h"
-#include "cmd-pet.h"
#include "combat/monster-attack-types.h"
#include "grid/grid.h"
#include "main/sound-definitions-table.h"
#include "monster/monster-race-hook.h"
#include "monster/monster-status.h"
#include "monster/monster.h"
+#include "monster/pet-fall-off.h"
#include "mspell/monster-spell.h"
#include "player/player-class.h"
#include "player/player-move.h"
#include "main/sound-definitions-table.h"
#include "mind/racial-samurai.h"
#include "monster/monster-status.h"
+#include "monster/pet-fall-off.h"
#include "object/object-hook.h"
#include "player/player-damage.h"
#include "player/player-effects.h"
r_ptr->r_blows[monap_ptr->ap_cnt]++;
}
-/*!
- * @brief モンスターから直接攻撃を受けた時に落馬するかどうかを判定し、判定アウトならば落馬させる
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
- * @return なし
- */
-static void check_fall_off_horse(player_type *target_ptr, monap_type *monap_ptr)
-{
- if ((target_ptr->riding == 0) || (monap_ptr->damage == 0))
- return;
-
- char m_steed_name[MAX_NLEN];
- monster_desc(target_ptr, m_steed_name, &target_ptr->current_floor_ptr->m_list[target_ptr->riding], 0);
- if (process_fall_off_horse(target_ptr, (monap_ptr->damage > 200) ? 200 : monap_ptr->damage, FALSE))
- msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
-}
-
static bool process_monster_blows(player_type *target_ptr, monap_type *monap_ptr)
{
monster_race *r_ptr = &r_info[monap_ptr->m_ptr->r_idx];
-#include "system/angband.h"
-#include "effect/effect-monster-util.h"
-#include "effect/effect-monster-domination.h"
-#include "floor/floor.h"
-#include "player/player-effects.h"
-#include "spell/spells-diceroll.h"
-#include "monster/monster-status.h"
-#include "effect/spells-effect-util.h"
-#include "cmd/cmd-pet.h" // 暫定、後で消すかも.
+#include "effect/effect-monster-domination.h"
#include "dungeon/quest.h"
+#include "effect/spells-effect-util.h"
+#include "floor/floor.h"
#include "monster/monster-race-hook.h"
+#include "monster/monster-status.h"
+#include "monster/pet-fall-off.h"
#include "object/trc-types.h"
+#include "player/player-effects.h"
+#include "spell/spells-diceroll.h"
static void effect_monster_domination_corrupted_addition(player_type *caster_ptr, effect_monster_type *em_ptr)
{
#pragma once
+#include "system/angband.h"
+#include "effect/effect-monster-util.h"
+
gf_switch_result effect_monster_domination(player_type *caster_ptr, effect_monster_type *em_ptr);
gf_switch_result effect_monster_crusade(player_type *caster_ptr, effect_monster_type *em_ptr);
gf_switch_result effect_monster_capture(player_type *caster_ptr, effect_monster_type *em_ptr);
#include "io/write-diary.h"
#include "cmd/cmd-dump.h"
-#include "cmd/cmd-pet.h"
+#include "monster/pet-fall-off.h"
#include "monster/creature.h"
#include "combat/melee-postprocess.h"
#include "spell/spells-summon.h"
*/
#include "monster/monster-runaway.h"
-#include "player/player-move.h"
-#include "cmd/cmd-pet.h"
#include "dungeon/quest.h"
+#include "monster/pet-fall-off.h"
+#include "player/player-move.h"
/*!
* @brief HPが1/3未満になった有効的なユニークモンスターの逃走処理を行う
#include "io/write-diary.h"
#include "cmd/cmd-dump.h"
#include "cmd/cmd-building.h"
-#include "cmd-pet.h"
+#include "monster/pet-fall-off.h"
#include "effect/effect-characteristics.h"
#include "object/object-kind-hook.h"
#include "player/player-personalities-table.h"
#include "io/write-diary.h"
#include "cmd/cmd-dump.h"
-#include "cmd-pet.h"
+#include "monster/pet-fall-off.h"
#include "dungeon/dungeon.h"
#include "effect/effect-characteristics.h"
#include "object/object2.h"
--- /dev/null
+#include "monster/pet-fall-off.h"
+#include "cmd/cmd-pet.h" // 暫定、定数を見ているだけなのでutilへの分離を検討する.
+#include "floor/floor.h"
+#include "io/targeting.h"
+#include "player/player-damage.h"
+#include "player/player-move.h"
+#include "player/player-skill.h"
+
+/*!
+ * @brief モンスターから直接攻撃を受けた時に落馬するかどうかを判定し、判定アウトならば落馬させる
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param monap_ptr モンスターからプレーヤーへの直接攻撃構造体への参照ポインタ
+ * @return なし
+ */
+void check_fall_off_horse(player_type *target_ptr, monap_type *monap_ptr)
+{
+ if ((target_ptr->riding == 0) || (monap_ptr->damage == 0))
+ return;
+
+ char m_steed_name[MAX_NLEN];
+ monster_desc(target_ptr, m_steed_name, &target_ptr->current_floor_ptr->m_list[target_ptr->riding], 0);
+ if (process_fall_off_horse(target_ptr, (monap_ptr->damage > 200) ? 200 : monap_ptr->damage, FALSE))
+ msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
+}
+
+/*!
+ * @brief プレイヤーの落馬判定処理
+ * @param dam 落馬判定を発した際に受けたダメージ量
+ * @param force TRUEならば強制的に落馬する
+ * @return 実際に落馬したらTRUEを返す
+ */
+bool process_fall_off_horse(player_type *creature_ptr, HIT_POINT dam, bool force)
+{
+ DIRECTION i;
+ POSITION y, x, oy, ox, sy = 0, sx = 0;
+ int sn = 0;
+ GAME_TEXT m_name[MAX_NLEN];
+ monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ bool fall_dam = FALSE;
+
+ if (!creature_ptr->riding)
+ return FALSE;
+ if (creature_ptr->wild_mode)
+ return FALSE;
+
+ if (dam >= 0 || force) {
+ if (!force) {
+ int cur = creature_ptr->skill_exp[GINOU_RIDING];
+ int max = s_info[creature_ptr->pclass].s_max[GINOU_RIDING];
+ int ridinglevel = r_ptr->level;
+
+ /* 落馬のしやすさ */
+ int rakubalevel = r_ptr->level;
+ if (creature_ptr->riding_ryoute)
+ rakubalevel += 20;
+
+ if ((cur < max) && (max > 1000) && (dam / 2 + ridinglevel) > (cur / 30 + 10)) {
+ int inc = 0;
+
+ if (ridinglevel > (cur / 100 + 15))
+ inc += 1 + (ridinglevel - cur / 100 - 15);
+ else
+ inc += 1;
+
+ creature_ptr->skill_exp[GINOU_RIDING] = MIN(max, cur + inc);
+ }
+
+ /* レベルの低い乗馬からは落馬しにくい */
+ if (randint0(dam / 2 + rakubalevel * 2) < cur / 30 + 10) {
+ if ((((creature_ptr->pclass == CLASS_BEASTMASTER) || (creature_ptr->pclass == CLASS_CAVALRY)) && !creature_ptr->riding_ryoute)
+ || !one_in_(creature_ptr->lev * (creature_ptr->riding_ryoute ? 2 : 3) + 30)) {
+ return FALSE;
+ }
+ }
+ }
+
+ /* Check around the player */
+ for (i = 0; i < 8; i++) {
+ grid_type *g_ptr;
+
+ y = creature_ptr->y + ddy_ddd[i];
+ x = creature_ptr->x + ddx_ddd[i];
+
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
+
+ if (g_ptr->m_idx)
+ continue;
+
+ /* Skip non-empty grids */
+ if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !cave_have_flag_grid(g_ptr, FF_CAN_FLY)) {
+ if (!player_can_ride_aux(creature_ptr, g_ptr, FALSE))
+ continue;
+ }
+
+ if (cave_have_flag_grid(g_ptr, FF_PATTERN))
+ continue;
+
+ /* Count "safe" grids */
+ sn++;
+
+ /* Randomize choice */
+ if (randint0(sn) > 0)
+ continue;
+
+ /* Save the safe location */
+ sy = y;
+ sx = x;
+ }
+ if (!sn) {
+ monster_desc(creature_ptr, m_name, m_ptr, 0);
+ msg_format(_("%sから振り落とされそうになって、壁にぶつかった。", "You have nearly fallen from %s, but bumped into wall."), m_name);
+ take_hit(creature_ptr, DAMAGE_NOESCAPE, r_ptr->level + 3, _("壁への衝突", "bumping into wall"), -1);
+ return FALSE;
+ }
+
+ oy = creature_ptr->y;
+ ox = creature_ptr->x;
+
+ creature_ptr->y = sy;
+ creature_ptr->x = sx;
+
+ /* Redraw the old spot */
+ lite_spot(creature_ptr, oy, ox);
+
+ /* Redraw the new spot */
+ lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
+
+ /* Check for new panel */
+ verify_panel(creature_ptr);
+ }
+
+ creature_ptr->riding = 0;
+ creature_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
+ creature_ptr->riding_ryoute = creature_ptr->old_riding_ryoute = FALSE;
+
+ creature_ptr->update |= (PU_BONUS | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
+ handle_stuff(creature_ptr);
+
+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ creature_ptr->redraw |= (PR_EXTRA);
+
+ /* Update health track of mount */
+ creature_ptr->redraw |= (PR_UHEALTH);
+
+ if (creature_ptr->levitation && !force) {
+ monster_desc(creature_ptr, m_name, m_ptr, 0);
+ msg_format(_("%sから落ちたが、空中でうまく体勢を立て直して着地した。", "You are thrown from %s, but make a good landing."), m_name);
+ } else {
+ take_hit(creature_ptr, DAMAGE_NOESCAPE, r_ptr->level + 3, _("落馬", "Falling from riding"), -1);
+ fall_dam = TRUE;
+ }
+
+ if (sy && !creature_ptr->is_dead)
+ (void)move_player_effect(creature_ptr, creature_ptr->y, creature_ptr->x, MPE_DONT_PICKUP | MPE_DONT_SWAP_MON);
+
+ return fall_dam;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+#include "combat/monster-attack-util.h"
+
+void check_fall_off_horse(player_type *target_ptr, monap_type *monap_ptr);
+bool process_fall_off_horse(player_type *creature_ptr, HIT_POINT dam, bool force);
#include "effect/spells-effect-util.h"
#include "spell/process-effect.h"
#include "floor/floor.h"
-#include "cmd-pet.h" // 暫定、後で消すかも.
+#include "monster/pet-fall-off.h"
#include "core/stuff-handler.h"
#include "effect/effect-feature.h"
#include "effect/effect-item.h"
#include "object/artifact.h"
#include "io/write-diary.h"
#include "cmd/cmd-pet.h"
+#include "monster/pet-fall-off.h"
#include "cmd/cmd-dump.h"
#include "effect/effect-characteristics.h"
#include "grid/grid.h"