<ClCompile Include="..\..\src\monster-status.c" />\r
<ClCompile Include="..\..\src\monsterrace-hook.c" />\r
<ClCompile Include="..\..\src\monsterrace.c" />\r
+ <ClCompile Include="..\..\src\monster\quantum-effect.c" />\r
<ClCompile Include="..\..\src\object-boost.c" />\r
<ClCompile Include="..\..\src\object-curse.c" />\r
<ClCompile Include="..\..\src\object-ego.c" />\r
<ClInclude Include="..\..\src\io\read-pref-file.h" />\r
<ClInclude Include="..\..\src\io\tokenizer.h" />\r
<ClInclude Include="..\..\src\monster-dist-offsets.h" />\r
+ <ClInclude Include="..\..\src\monster\quantum-effect.h" />\r
<ClInclude Include="..\..\src\object-flavor.h" />\r
<ClInclude Include="..\..\src\player-inventory.h" />\r
<ClInclude Include="..\..\src\player\permanent-resistances.h" />\r
<ClCompile Include="..\..\src\io\interpret-pref-file.c">
<Filter>io</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\monster\quantum-effect.c">
+ <Filter>monster</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\gamevalue.h" />
<ClInclude Include="..\..\src\io\interpret-pref-file.h">
<Filter>io</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\monster\quantum-effect.h">
+ <Filter>monster</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
mind.c mind.h \
\
monster.h monsterrace.c monsterrace.h \
+ monster/quantum-effect.c monster/quantum-effect.c \
monsterrace-hook.c monsterrace-hook.h \
monster-dist-offsets.c monster-dist-offsets.h \
monster-process.c monster-process.h \
#include "angband.h"
#include "util.h"
+#include "monster/quantum-effect.h"
#include "cmd-dump.h"
#include "cmd-pet.h"
bool vanish_summoned_children(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);
void awake_monster(player_type *target_ptr, MONSTER_IDX m_idx);
void process_angar(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);
-bool process_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);
-void vanish_nonunique(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);
-void produce_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);
bool explode_monster(player_type *target_ptr, MONSTER_IDX m_idx);
bool decide_monster_multiplication(player_type *target_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox);
bool decide_monster_movement_direction(player_type *target_ptr, DIRECTION *mm, MONSTER_IDX m_idx, bool aware);
/*!
- * @brief 量子生物の量子的効果を実行する
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param m_idx モンスターID
- * @param see_m モンスターが視界内にいたらTRUE
- * @return モンスターが量子的効果により消滅したらTRUE
- */
-bool process_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m)
-{
- monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if ((r_ptr->flags2 & RF2_QUANTUM) == 0) return FALSE;
- if (!randint0(2)) return FALSE;
- if (randint0((m_idx % 100) + 10)) return FALSE;
-
- bool can_disappear = (r_ptr->flags1 & RF1_UNIQUE) == 0;
- can_disappear &= (r_ptr->flags1 & RF1_QUESTOR) == 0;
- if (can_disappear)
- {
- vanish_nonunique(target_ptr, m_idx, see_m);
- return TRUE;
- }
-
- produce_quantum_effect(target_ptr, m_idx, see_m);
- return FALSE;
-}
-
-
-/*!
- * @brief ユニークでない量子生物を消滅させる
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param m_idx モンスターID
- * @param see_m モンスターが視界内にいたらTRUE
- * @return なし
- */
-void vanish_nonunique(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m)
-{
- monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
- if (see_m)
- {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(target_ptr, m_name, m_ptr, 0);
- msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
- }
-
- monster_death(target_ptr, m_idx, FALSE);
- delete_monster_idx(target_ptr, m_idx);
- if (is_pet(m_ptr) && !(m_ptr->ml))
- {
- msg_print(_("少しの間悲しい気分になった。", "You feel sad for a moment."));
- }
-}
-
-
-/*!
- * @brief 量子生物ユニークの量子的効果 (ショート・テレポートまたは距離10のテレポート・アウェイ)を実行する
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param m_idx モンスターID
- * @param see_m モンスターが視界内にいたらTRUE
- * @return なし
- * @details
- * プレーヤーが量子生物を観測しているか、量子生物がプレーヤーを観測している場合、互いの相対的な位置を確定させる
- * 波動関数の収縮はテレポートではないので反テレポート無効
- * todo パターンは収縮どころか拡散しているが、この際気にしてはいけない
- */
-void produce_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m)
-{
- monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
- bool coherent = los(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x);
- if (!see_m && !coherent) return;
-
- if (see_m)
- {
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(target_ptr, m_name, m_ptr, 0);
- msg_format(_("%sは量子的効果を起こした!", "%^s produced a decoherence!"), m_name);
- }
- else
- {
- msg_print(_("量子的効果が起こった!", "A decoherence was produced!"));
- }
-
- bool target = one_in_(2);
- const int blink = 32 * 5 + 4;
- if (target)
- {
- (void)monspell_to_monster(target_ptr, blink, m_ptr->fy, m_ptr->fx, m_idx, m_idx);
- }
- else
- {
- teleport_player_away(m_idx, target_ptr, 10, TRUE);
- }
-}
-
-
-/*!
* @brief モンスターの爆発処理
* @param target_ptr プレーヤーへの参照ポインタ
* @param m_idx モンスターID
--- /dev/null
+#include "angband.h"
+#include "quantum-effect.h"
+#include "monster-spell.h"
+
+/*!
+ * @brief ユニークでない量子生物を消滅させる
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param m_idx モンスターID
+ * @param see_m モンスターが視界内にいたらTRUE
+ * @return なし
+ */
+static void vanish_nonunique(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m)
+{
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
+ if (see_m)
+ {
+ GAME_TEXT m_name[MAX_NLEN];
+ monster_desc(target_ptr, m_name, m_ptr, 0);
+ msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
+ }
+
+ monster_death(target_ptr, m_idx, FALSE);
+ delete_monster_idx(target_ptr, m_idx);
+ if (is_pet(m_ptr) && !(m_ptr->ml))
+ {
+ msg_print(_("少しの間悲しい気分になった。", "You feel sad for a moment."));
+ }
+}
+
+
+/*!
+ * todo ユニークとプレーヤーとの間でしか効果が発生しない。ユニークとその他のモンスター間では何もしなくてよい?
+ * @brief 量子生物ユニークの量子的効果 (ショート・テレポートまたは距離10のテレポート・アウェイ)を実行する
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param m_idx モンスターID
+ * @param see_m モンスターが視界内にいたらTRUE
+ * @return なし
+ * @details
+ * プレーヤーが量子生物を観測しているか、量子生物がプレーヤーを観測している場合、互いの相対的な位置を確定させる
+ * 波動関数の収縮はテレポートではないので反テレポート無効
+ * @notes
+ * パターンは収縮どころか拡散しているが、この際気にしてはいけない
+ */
+static void produce_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m)
+{
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
+ bool coherent = los(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x);
+ if (!see_m && !coherent) return;
+
+ if (see_m)
+ {
+ GAME_TEXT m_name[MAX_NLEN];
+ monster_desc(target_ptr, m_name, m_ptr, 0);
+ msg_format(_("%sは量子的効果を起こした!", "%^s produced a decoherence!"), m_name);
+ }
+ else
+ {
+ msg_print(_("量子的効果が起こった!", "A decoherence was produced!"));
+ }
+
+ bool target = one_in_(2);
+ const int blink = 32 * 5 + 4;
+ if (target)
+ {
+ (void)monspell_to_monster(target_ptr, blink, m_ptr->fy, m_ptr->fx, m_idx, m_idx);
+ }
+ else
+ {
+ teleport_player_away(m_idx, target_ptr, 10, TRUE);
+ }
+}
+
+
+/*!
+ * @brief 量子生物の量子的効果を実行する
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param m_idx モンスターID
+ * @param see_m モンスターが視界内にいたらTRUE
+ * @return モンスターが量子的効果により消滅したらTRUE
+ */
+bool process_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m)
+{
+ monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ if ((r_ptr->flags2 & RF2_QUANTUM) == 0) return FALSE;
+ if (!randint0(2)) return FALSE;
+ if (randint0((m_idx % 100) + 10)) return FALSE;
+
+ bool can_disappear = (r_ptr->flags1 & RF1_UNIQUE) == 0;
+ can_disappear &= (r_ptr->flags1 & RF1_QUESTOR) == 0;
+ if (can_disappear)
+ {
+ vanish_nonunique(target_ptr, m_idx, see_m);
+ return TRUE;
+ }
+
+ produce_quantum_effect(target_ptr, m_idx, see_m);
+ return FALSE;
+}
--- /dev/null
+#pragma once
+
+bool process_quantum_effect(player_type *target_ptr, MONSTER_IDX m_idx, bool see_m);