* the user hits "escape" at the "direction" prompt.
* </pre>
*/
-void exe_activate(PlayerType *player_ptr, INVENTORY_IDX item, CapturedMonsterType *cap_mon_ptr)
+void exe_activate(PlayerType *player_ptr, INVENTORY_IDX item)
{
PlayerEnergy(player_ptr).set_player_turn_energy(100);
ae_type tmp_ae;
if (activate_whistle(player_ptr, ae_ptr))
return;
- if (exe_monster_capture(player_ptr, ae_ptr, cap_mon_ptr))
+ if (exe_monster_capture(player_ptr, ae_ptr))
return;
msg_print(_("おっと、このアイテムは始動できない。", "Oops. That object cannot be activated."));
#include "system/angband.h"
-class CapturedMonsterType;
class PlayerType;
-void exe_activate(PlayerType *player_ptr, INVENTORY_IDX item, CapturedMonsterType *cap_mon_ptr);
+void exe_activate(PlayerType *player_ptr, INVENTORY_IDX item);
* @param command 発動するレイシャルのID
* @return 処理を実際に実行した場合はTRUE、キャンセルした場合FALSEを返す。
*/
-bool exe_racial_power(PlayerType *player_ptr, const int32_t command, CapturedMonsterType *cap_mon_ptr)
+bool exe_racial_power(PlayerType *player_ptr, const int32_t command)
{
if (command <= -3)
- return switch_class_racial_execution(player_ptr, command, cap_mon_ptr);
+ return switch_class_racial_execution(player_ptr, command);
if (player_ptr->mimic_form)
return switch_mimic_racial_execution(player_ptr);
};
struct rpi_type;
-class CapturedMonsterType;
class PlayerType;
PERCENTAGE racial_chance(PlayerType *player_ptr, rpi_type *rpi_ptr);
racial_level_check_result check_racial_level(PlayerType *player_ptr, rpi_type *rpi_ptr);
-bool exe_racial_power(PlayerType *player_ptr, const int32_t command, CapturedMonsterType *cap_mon_ptr);
+bool exe_racial_power(PlayerType *player_ptr, const int32_t command);
check_mind_mirror_master(player_ptr, cm_ptr);
}
-static bool switch_mind_class(PlayerType *player_ptr, cm_type *cm_ptr, CapturedMonsterType *cap_mon_ptr)
+static bool switch_mind_class(PlayerType *player_ptr, cm_type *cm_ptr)
{
switch (cm_ptr->use_mind) {
case MindKindType::MINDCRAFTER:
if (player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x].is_mirror())
cm_ptr->on_mirror = true;
- cm_ptr->cast = cast_mirror_spell(player_ptr, i2enum<mind_mirror_master_type>(cm_ptr->n), cap_mon_ptr);
+ cm_ptr->cast = cast_mirror_spell(player_ptr, i2enum<mind_mirror_master_type>(cm_ptr->n));
return true;
case MindKindType::NINJUTSU:
cm_ptr->cast = cast_ninja_spell(player_ptr, i2enum<mind_ninja_type>(cm_ptr->n));
energy.set_player_turn_energy(100);
}
-static bool judge_mind_chance(PlayerType *player_ptr, cm_type *cm_ptr, CapturedMonsterType *cap_mon_ptr)
+static bool judge_mind_chance(PlayerType *player_ptr, cm_type *cm_ptr)
{
if (randint0(100) >= cm_ptr->chance) {
sound(SOUND_ZAP);
- return switch_mind_class(player_ptr, cm_ptr, cap_mon_ptr) && cm_ptr->cast;
+ return switch_mind_class(player_ptr, cm_ptr) && cm_ptr->cast;
}
if (flush_failure)
/*!
* @brief 特殊技能コマンドのメインルーチン /
*/
-void do_cmd_mind(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void do_cmd_mind(PlayerType *player_ptr)
{
cm_type tmp_cm;
cm_type *cm_ptr = initialize_cm_type(player_ptr, &tmp_cm);
if (cm_ptr->chance > 95)
cm_ptr->chance = 95;
- if (!judge_mind_chance(player_ptr, cm_ptr, cap_mon_ptr))
+ if (!judge_mind_chance(player_ptr, cm_ptr))
return;
mind_turn_passing(player_ptr, cm_ptr);
#pragma once
-class CapturedMonsterType;
class PlayerType;
-void do_cmd_mind(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+void do_cmd_mind(PlayerType *player_ptr);
void do_cmd_mind_browse(PlayerType *player_ptr);
void do_cmd_mind_browse(PlayerType *player_ptr);
* @details
* 戻り値の代わりにrc_ptr->castに使用の有無を入れる。
*/
-static void racial_power_cast_power(PlayerType *player_ptr, rc_type *rc_ptr, CapturedMonsterType *cap_mon_ptr)
+static void racial_power_cast_power(PlayerType *player_ptr, rc_type *rc_ptr)
{
auto *rpi_ptr = &rc_ptr->power_desc[rc_ptr->command_code];
switch (check_racial_level(player_ptr, rpi_ptr)) {
case RACIAL_SUCCESS:
if (rpi_ptr->number < 0)
- rc_ptr->cast = exe_racial_power(player_ptr, rpi_ptr->number, cap_mon_ptr);
+ rc_ptr->cast = exe_racial_power(player_ptr, rpi_ptr->number);
else
rc_ptr->cast = exe_mutation_power(player_ptr, i2enum<PlayerMutationType>(rpi_ptr->number));
break;
* @brief レイシャル・パワーコマンドのメインルーチン / Allow user to choose a power (racial / mutation) to activate
* @param player_ptr プレイヤーへの参照ポインタ
*/
-void do_cmd_racial_power(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void do_cmd_racial_power(PlayerType *player_ptr)
{
if (player_ptr->wild_mode)
return;
racial_power_make_prompt(rc_ptr);
if (racial_power_select_power(player_ptr, rc_ptr) == RC_CONTINUE)
- racial_power_cast_power(player_ptr, rc_ptr, cap_mon_ptr);
+ racial_power_cast_power(player_ptr, rc_ptr);
if (!rc_ptr->cast) {
energy.reset_player_turn();
#pragma once
-class CapturedMonsterType;
class PlayerType;
-void do_cmd_racial_power(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+void do_cmd_racial_power(PlayerType *player_ptr);
* @param browse_only 魔法と技能の閲覧を行うならばTRUE
* @return 魔道書を一冊も持っていないならTRUEを返す
*/
-static void confirm_use_force(PlayerType *player_ptr, bool browse_only, CapturedMonsterType *cap_mon_ptr)
+static void confirm_use_force(PlayerType *player_ptr, bool browse_only)
{
char which;
COMMAND_CODE code;
/* Get the item index */
if (repeat_pull(&code) && (code == INVEN_FORCE)) {
- browse_only ? do_cmd_mind_browse(player_ptr) : do_cmd_mind(player_ptr, cap_mon_ptr);
+ browse_only ? do_cmd_mind_browse(player_ptr) : do_cmd_mind(player_ptr);
return;
}
prt("", 0, 0);
if (which == 'w') {
- browse_only ? do_cmd_mind_browse(player_ptr) : do_cmd_mind(player_ptr, cap_mon_ptr);
+ browse_only ? do_cmd_mind_browse(player_ptr) : do_cmd_mind(player_ptr);
}
}
* and in the dark, primarily to allow browsing in stores.
* </pre>
*/
-void do_cmd_browse(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void do_cmd_browse(PlayerType *player_ptr)
{
OBJECT_IDX item;
OBJECT_SUBTYPE_VALUE sval;
if (pc.equals(PlayerClassType::FORCETRAINER)) {
if (player_has_no_spellbooks(player_ptr)) {
- confirm_use_force(player_ptr, true, cap_mon_ptr);
+ confirm_use_force(player_ptr, true);
return;
}
}
* @param player_ptr プレイヤーへの参照ポインタ
* @return 詠唱したらtrue
*/
-bool do_cmd_cast(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+bool do_cmd_cast(PlayerType *player_ptr)
{
OBJECT_IDX item;
OBJECT_SUBTYPE_VALUE sval;
if (player_ptr->blind || no_lite(player_ptr)) {
if (pc.equals(PlayerClassType::FORCETRAINER))
- confirm_use_force(player_ptr, false, cap_mon_ptr);
+ confirm_use_force(player_ptr, false);
else {
msg_print(_("目が見えない!", "You cannot see!"));
flush();
if (pc.equals(PlayerClassType::FORCETRAINER)) {
if (player_has_no_spellbooks(player_ptr)) {
- confirm_use_force(player_ptr, false, cap_mon_ptr);
+ confirm_use_force(player_ptr, false);
return true; //!< 錬気キャンセル時の処理がない
}
}
if (!o_ptr) {
if (item == INVEN_FORCE) /* the_force */
{
- do_cmd_mind(player_ptr, cap_mon_ptr);
+ do_cmd_mind(player_ptr);
return true; //!< 錬気キャンセル時の処理がない
}
return false;
concptr info_radius(POSITION rad);
concptr info_weight(WEIGHT weight);
-class CapturedMonsterType;
class PlayerType;
-void do_cmd_browse(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+void do_cmd_browse(PlayerType *player_ptr);
void do_cmd_study(PlayerType *player_ptr);
-bool do_cmd_cast(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+bool do_cmd_cast(PlayerType *player_ptr);
* @details
* XXX - Add actions for other item types
*/
-void do_cmd_use(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void do_cmd_use(PlayerType *player_ptr)
{
OBJECT_IDX item;
ObjectType *o_ptr;
exe_fire(player_ptr, item, &player_ptr->inventory_list[INVEN_BOW], SP_NONE);
break;
default:
- exe_activate(player_ptr, item, cap_mon_ptr);
+ exe_activate(player_ptr, item);
break;
}
}
* @brief 装備を発動するコマンドのメインルーチン /
* @param player_ptr プレイヤーへの参照ポインタ
*/
-void do_cmd_activate(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void do_cmd_activate(PlayerType *player_ptr)
{
OBJECT_IDX item;
if (player_ptr->wild_mode || cmd_limit_arena(player_ptr))
if (!choose_object(player_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), FuncItemTester(&ObjectType::is_activatable)))
return;
- exe_activate(player_ptr, item, cap_mon_ptr);
+ exe_activate(player_ptr, item);
}
#pragma once
-class CapturedMonsterType;
class PlayerType;
void do_cmd_inven(PlayerType *player_ptr);
void do_cmd_drop(PlayerType *player_ptr);
void do_cmd_observe(PlayerType *player_ptr);
void do_cmd_uninscribe(PlayerType *player_ptr);
void do_cmd_inscribe(PlayerType *player_ptr);
-void do_cmd_use(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
-void do_cmd_activate(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+void do_cmd_use(PlayerType *player_ptr);
+void do_cmd_activate(PlayerType *player_ptr);
* @param player_ptr プレイヤー情報への参照ポインタ
* @param em_ptr 効果情報への参照ポインタ
*/
-static void effect_monster_captured(PlayerType *player_ptr, effect_monster_type *em_ptr, CapturedMonsterType *cap_mon_ptr)
+static void effect_monster_captured(PlayerType *player_ptr, effect_monster_type *em_ptr, std::optional<CapturedMonsterType *> tmp_cap_mon_ptr)
{
if (em_ptr->m_ptr->mflag2.has(MonsterConstantFlagType::CHAMELEON))
choose_new_monster(player_ptr, em_ptr->g_ptr->m_idx, false, MON_CHAMELEON);
msg_format(_("%sを捕えた!", "You capture %^s!"), em_ptr->m_name);
+ auto cap_mon_ptr = tmp_cap_mon_ptr.value();
cap_mon_ptr->r_idx = em_ptr->m_ptr->r_idx;
cap_mon_ptr->speed = em_ptr->m_ptr->mspeed;
cap_mon_ptr->current_hp = static_cast<short>(em_ptr->m_ptr->hp);
* @param em_ptr 効果情報への参照ポインタ
* @return 効果発動結果
*/
-process_result effect_monster_capture(PlayerType *player_ptr, effect_monster_type *em_ptr, CapturedMonsterType *cap_mon_ptr)
+process_result effect_monster_capture(PlayerType *player_ptr, effect_monster_type *em_ptr, std::optional<CapturedMonsterType *> cap_mon_ptr)
{
auto *floor_ptr = player_ptr->current_floor_ptr;
#pragma once
#include "system/angband.h"
+#include <optional>
enum process_result;
struct effect_monster_type;
process_result effect_monster_charm_living(PlayerType *player_ptr, effect_monster_type *em_ptr);
process_result effect_monster_domination(PlayerType *player_ptr, effect_monster_type *em_ptr);
process_result effect_monster_crusade(PlayerType *player_ptr, effect_monster_type *em_ptr);
-process_result effect_monster_capture(PlayerType *player_ptr, effect_monster_type *em_ptr, CapturedMonsterType *cap_mon_ptr);
+process_result effect_monster_capture(PlayerType *player_ptr, effect_monster_type *em_ptr, std::optional<CapturedMonsterType *> cap_mon_ptr);
* @param em_ptr モンスター効果構造体への参照ポインタ
* @return ここのスイッチングで終るならTRUEかFALSE、後続処理を実行するならCONTINUE
*/
-process_result switch_effects_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, CapturedMonsterType *cap_mon_ptr)
+process_result switch_effects_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, std::optional<CapturedMonsterType *> cap_mon_ptr)
{
switch (em_ptr->attribute) {
case AttributeType::PSY_SPEAR:
#pragma once
#include "system/angband.h"
+#include <optional>
struct effect_monster_type;
class CapturedMonsterType;
class PlayerType;
-process_result switch_effects_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, CapturedMonsterType *cap_mon_ptr);
+process_result switch_effects_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
* 完全な耐性を持っていたら、一部属性を除いて影響は及ぼさない
* デバッグ属性、モンスター打撃、モンスター射撃であれば貫通する
*/
-static process_result exe_affect_monster_by_effect(PlayerType *player_ptr, effect_monster_type *em_ptr, CapturedMonsterType *cap_mon_ptr)
+static process_result exe_affect_monster_by_effect(PlayerType *player_ptr, effect_monster_type *em_ptr, std::optional<CapturedMonsterType *> cap_mon_ptr)
{
const std::vector<AttributeType> effect_arrtibute = {
AttributeType::OLD_CLONE,
ignore_res_all |= (em_ptr->attribute == AttributeType::MONSTER_SHOOT);
if (any_bits(em_ptr->r_ptr->flagsr, RFR_RES_ALL) && ignore_res_all)
- return switch_effects_monster(player_ptr, em_ptr, cap_mon_ptr);
+ return switch_effects_monster(player_ptr, em_ptr);
em_ptr->note = _("には完全な耐性がある!", " is immune.");
em_ptr->dam = 0;
* 3.ペット及び撮影による事後効果
*/
bool affect_monster(
- PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg, CapturedMonsterType *cap_mon_ptr)
+ PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg, std::optional<CapturedMonsterType *> cap_mon_ptr)
{
effect_monster_type tmp_effect;
effect_monster_type *em_ptr = initialize_effect_monster(player_ptr, &tmp_effect, who, r, y, x, dam, attribute, flag, see_s_msg);
#include "system/angband.h"
#include "effect/attribute-types.h"
+#include <optional>
class CapturedMonsterType;
class PlayerType;
-bool affect_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg, CapturedMonsterType *cap_mon_ptr);
+bool affect_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
t_x = player_ptr->x - 1 + randint1(3);
}
- (*project)(player_ptr, 0, 0, t_y, t_x, ep_ptr->dam, ep_ptr->attribute, (PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE));
+ (*project)(player_ptr, 0, 0, t_y, t_x, ep_ptr->dam, ep_ptr->attribute, (PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE), std::nullopt);
disturb(player_ptr, true, true);
return true;
}
GAME_TEXT m_name_self[MAX_MONSTER_NAME];
monster_desc(player_ptr, m_name_self, ep_ptr->m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), ep_ptr->m_name, m_name_self);
- (*project)(player_ptr, 0, 0, ep_ptr->m_ptr->fy, ep_ptr->m_ptr->fx, ep_ptr->get_damage, AttributeType::MISSILE, PROJECT_KILL);
+ (*project)(player_ptr, 0, 0, ep_ptr->m_ptr->fy, ep_ptr->m_ptr->fx, ep_ptr->get_damage, AttributeType::MISSILE, PROJECT_KILL, std::nullopt);
if (player_ptr->tim_eyeeye) {
set_tim_eyeeye(player_ptr, player_ptr->tim_eyeeye - 5, true);
}
#pragma once
-#include "system/angband.h"
#include "effect/attribute-types.h"
+#include "system/angband.h"
+#include <optional>
struct monster_type;
class EffectPlayerType {
AttributeType attribute;
BIT_FLAGS flag;
EffectPlayerType(MONSTER_IDX who, int dam, AttributeType attribute, BIT_FLAGS flag);
-
};
-
struct ProjectResult;
-
+class CapturedMonsterType;
class PlayerType;
using project_func = ProjectResult (*)(
- PlayerType *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag);
+ PlayerType *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr);
bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag,
project_func project);
* @todo 引数にそのまま再代入していてカオスすぎる。直すのは簡単ではない
*/
ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const int dam,
- const AttributeType typ, BIT_FLAGS flag)
+ const AttributeType typ, BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr)
{
int dist;
POSITION y1;
path_n = projection_path(player_ptr, path_g, (project_length ? project_length : get_max_range(player_ptr)), y1, x1, y2, x2, flag);
handle_stuff(player_ptr);
- auto *cap_mon_ptr = g_cap_mon_ptr.get();
if (typ == AttributeType::SEEKER) {
int j;
int last_i = 0;
ProjectResult() = default;
};
+class CapturedMonsterType;
class EffectPlayerType;
class PlayerType;
ProjectResult project(
PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const int dam, const AttributeType typ,
- BIT_FLAGS flag);
+ BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
int project_length = 0;
-std::shared_ptr<CapturedMonsterType> g_cap_mon_ptr = std::make_shared<CapturedMonsterType>();
-
int project_m_n;
POSITION project_m_x;
POSITION project_m_y;
#pragma once
#include "system/angband.h"
-#include <memory>
extern int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
extern int rakubadam_p; /*!< 落馬した際のダメージ量 */
int nickname;
};
-extern std::shared_ptr<CapturedMonsterType> g_cap_mon_ptr;
-
extern bool sukekaku;
extern int project_length; /*!< 投射の射程距離 */
sniper_data->reset_concent = true;
}
- auto *cap_mon_ptr = g_cap_mon_ptr.get();
auto *floor_ptr = player_ptr->current_floor_ptr;
switch (command_cmd) {
case ESCAPE:
break;
}
case SPECIAL_KEY_STORE: {
- do_cmd_store(player_ptr, cap_mon_ptr);
+ do_cmd_store(player_ptr);
break;
}
case SPECIAL_KEY_BUILDING: {
else if (pc.equals(PlayerClassType::SNIPER))
do_cmd_snipe_browse(player_ptr);
else
- do_cmd_browse(player_ptr, cap_mon_ptr);
+ do_cmd_browse(player_ptr);
break;
}
}
if (pc.can_browse())
- do_cmd_mind(player_ptr, cap_mon_ptr);
+ do_cmd_mind(player_ptr);
else if (pc.equals(PlayerClassType::ELEMENTALIST))
do_cmd_element(player_ptr);
else if (pc.equals(PlayerClassType::IMITATOR))
else if (pc.equals(PlayerClassType::SNIPER))
do_cmd_snipe(player_ptr);
else
- (void)do_cmd_cast(player_ptr, cap_mon_ptr);
+ (void)do_cmd_cast(player_ptr);
break;
}
break;
}
case 'A': {
- do_cmd_activate(player_ptr, cap_mon_ptr);
+ do_cmd_activate(player_ptr);
break;
}
case 'E': {
}
case 'z': {
if (use_command && rogue_like_commands) {
- do_cmd_use(player_ptr, cap_mon_ptr);
+ do_cmd_use(player_ptr);
} else {
do_cmd_zap_rod(player_ptr);
}
}
case 'u': {
if (use_command && !rogue_like_commands)
- do_cmd_use(player_ptr, cap_mon_ptr);
+ do_cmd_use(player_ptr);
else
do_cmd_use_staff(player_ptr);
break;
}
case 'U': {
- do_cmd_racial_power(player_ptr, cap_mon_ptr);
+ do_cmd_racial_power(player_ptr);
break;
}
case 'M': {
* @param dam ダメージ量
* @return 効果があったらTRUEを返す
*/
-bool binding_field(PlayerType *player_ptr, int dam, CapturedMonsterType *cap_mon_ptr)
+bool binding_field(PlayerType *player_ptr, int dam)
{
POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
int mirror_num = 0; /* 鏡の数 */
&& centersign * ((point_x[1] - x) * (point_y[2] - y) - (point_y[1] - y) * (point_x[2] - x)) >= 0
&& centersign * ((point_x[2] - x) * (point_y[0] - y) - (point_y[2] - y) * (point_x[0] - x)) >= 0) {
if (player_has_los_bold(player_ptr, y, x) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) {
- (void)affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true, cap_mon_ptr);
+ (void)affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true);
}
}
}
* @param dam ダメージ量
* @return 効果があったらTRUEを返す
*/
-void seal_of_mirror(PlayerType *player_ptr, int dam, CapturedMonsterType *cap_mon_ptr)
+void seal_of_mirror(PlayerType *player_ptr, int dam)
{
for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++) {
for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++) {
if (!player_ptr->current_floor_ptr->grid_array[y][x].is_mirror())
continue;
- if (!affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::GENOCIDE, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true, cap_mon_ptr))
+ if (!affect_monster(player_ptr, 0, 0, y, x, dam, AttributeType::GENOCIDE, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), true))
continue;
if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
* @param spell 発動する特殊技能のID
* @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
*/
-bool cast_mirror_spell(PlayerType *player_ptr, mind_mirror_master_type spell, CapturedMonsterType *cap_mon_ptr)
+bool cast_mirror_spell(PlayerType *player_ptr, mind_mirror_master_type spell)
{
DIRECTION dir;
PLAYER_LEVEL plev = player_ptr->lev;
fire_beam(player_ptr, AttributeType::SEEKER, dir, damroll(11 + (plev - 5) / 4, 8));
break;
case SEALING_MIRROR:
- seal_of_mirror(player_ptr, plev * 4 + 100, cap_mon_ptr);
+ seal_of_mirror(player_ptr, plev * 4 + 100);
break;
case WATER_SHIELD:
t = 20 + randint1(20);
set_multishadow(player_ptr, 6 + randint1(6), false);
break;
case BINDING_FIELD:
- if (!binding_field(player_ptr, plev * 11 + 5, cap_mon_ptr))
+ if (!binding_field(player_ptr, plev * 11 + 5))
msg_print(_("適当な鏡を選べなかった!", "You were not able to choose suitable mirrors!"));
break;
#include "system/angband.h"
-class CapturedMonsterType;
class PlayerType;
bool check_multishadow(PlayerType *player_ptr);
bool mirror_concentration(PlayerType *player_ptr);
void remove_all_mirrors(PlayerType *player_ptr, bool explode);
-bool binding_field(PlayerType *player_ptr, int dam, CapturedMonsterType *cap_mon_ptr);
-void seal_of_mirror(PlayerType *player_ptr, int dam, CapturedMonsterType *cap_mon_ptr);
+bool binding_field(PlayerType *player_ptr, int dam);
+void seal_of_mirror(PlayerType *player_ptr, int dam);
bool confusing_light(PlayerType *player_ptr);
bool place_mirror(PlayerType *player_ptr);
bool mirror_tunnel(PlayerType *player_ptr);
bool set_dustrobe(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec);
enum mind_mirror_master_type : int;
-bool cast_mirror_spell(PlayerType *player_ptr, mind_mirror_master_type spell, CapturedMonsterType *cap_mon_ptr);
+bool cast_mirror_spell(PlayerType *player_ptr, mind_mirror_master_type spell);
#include "util/int-char-converter.h"
#include "view/display-messages.h"
-bool switch_class_racial_execution(PlayerType *player_ptr, const int32_t command, CapturedMonsterType *cap_mon_ptr)
+bool switch_class_racial_execution(PlayerType *player_ptr, const int32_t command)
{
DIRECTION dir = 0;
switch (player_ptr->pclass) {
return false;
handle_stuff(player_ptr);
- if (!do_cmd_cast(player_ptr, cap_mon_ptr))
+ if (!do_cmd_cast(player_ptr))
return false;
if (!player_ptr->paralyzed && !cmd_limit_cast(player_ptr)) {
handle_stuff(player_ptr);
command_dir = 0;
- (void)do_cmd_cast(player_ptr, cap_mon_ptr);
+ (void)do_cmd_cast(player_ptr);
}
return true;
case PlayerClassType::SAMURAI:
#include "system/angband.h"
-class CapturedMonsterType;
class PlayerType;
-bool switch_class_racial_execution(PlayerType *player_ptr, const int32_t command, CapturedMonsterType *cap_mon_ptr);
+bool switch_class_racial_execution(PlayerType *player_ptr, const int32_t command);
bool switch_mimic_racial_execution(PlayerType *player_ptr);
bool switch_race_racial_execution(PlayerType *player_ptr, const int32_t command);
ae_ptr->o_ptr->inscription = quark_add(buf);
}
-static bool set_activation_target(PlayerType *player_ptr, ae_type *ae_ptr, CapturedMonsterType *cap_mon_ptr)
+static bool set_activation_target(PlayerType *player_ptr, ae_type *ae_ptr)
{
bool old_target_pet = target_pet;
target_pet = true;
}
target_pet = old_target_pet;
- if (!fire_ball(player_ptr, AttributeType::CAPTURE, ae_ptr->dir, 0, 0))
+ CapturedMonsterType cap_mon_ptr;
+ if (!fire_ball(player_ptr, AttributeType::CAPTURE, ae_ptr->dir, 0, 0, &cap_mon_ptr))
return true;
- ae_ptr->o_ptr->pval = cap_mon_ptr->r_idx;
- ae_ptr->o_ptr->captured_monster_speed = cap_mon_ptr->speed;
- ae_ptr->o_ptr->captured_monster_current_hp = cap_mon_ptr->current_hp;
- ae_ptr->o_ptr->captured_monster_max_hp = cap_mon_ptr->max_hp;
- inscribe_nickname(ae_ptr, cap_mon_ptr);
+ ae_ptr->o_ptr->pval = cap_mon_ptr.r_idx;
+ ae_ptr->o_ptr->captured_monster_speed = cap_mon_ptr.speed;
+ ae_ptr->o_ptr->captured_monster_current_hp = cap_mon_ptr.current_hp;
+ ae_ptr->o_ptr->captured_monster_max_hp = cap_mon_ptr.max_hp;
+ inscribe_nickname(ae_ptr, &cap_mon_ptr);
return true;
}
ae_ptr->success = true;
}
-bool exe_monster_capture(PlayerType *player_ptr, ae_type *ae_ptr, CapturedMonsterType *cap_mon_ptr)
+bool exe_monster_capture(PlayerType *player_ptr, ae_type *ae_ptr)
{
if (ae_ptr->o_ptr->tval != ItemKindType::CAPTURE)
return false;
if (ae_ptr->o_ptr->pval == 0) {
- if (!set_activation_target(player_ptr, ae_ptr, cap_mon_ptr))
+ if (!set_activation_target(player_ptr, ae_ptr))
return true;
calc_android_exp(player_ptr);
#pragma once
struct ae_type;
-class CapturedMonsterType;
class PlayerType;
-bool exe_monster_capture(PlayerType *player_ptr, ae_type *ae_ptr, CapturedMonsterType *cap_mon_ptr);
+bool exe_monster_capture(PlayerType *player_ptr, ae_type *ae_ptr);
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad)
+bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad, std::optional<CapturedMonsterType *> cap_mon_ptr)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
if (typ == AttributeType::CHARM_LIVING)
ty = target_row;
}
- return project(player_ptr, 0, rad, ty, tx, dam, typ, flg).notice;
+ return project(player_ptr, 0, rad, ty, tx, dam, typ, flg, cap_mon_ptr).notice;
}
/*!
#include "system/angband.h"
#include "effect/attribute-types.h"
+#include <optional>
+class CapturedMonsterType;
class PlayerType;
-bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
+bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
* (cast magic) into "g" (get), and "s" (search) into "d" (drop).
* </pre>
*/
-void do_cmd_store(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void do_cmd_store(PlayerType *player_ptr)
{
if (player_ptr->wild_mode)
return;
prt(_("コマンド:", "You may: "), 20 + xtra_stock, 0);
request_command(player_ptr, true);
- store_process_command(player_ptr, cap_mon_ptr);
+ store_process_command(player_ptr);
bool need_redraw_store_inv = any_bits(player_ptr->update, PU_BONUS);
w_ptr->character_icky_depth = 1;
#pragma once
-class CapturedMonsterType;
class PlayerType;
-void do_cmd_store(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+void do_cmd_store(PlayerType *player_ptr);
* but not in the stores, to prevent chaos.
* </pre>
*/
-void store_process_command(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr)
+void store_process_command(PlayerType *player_ptr)
{
repeat_check();
if (rogue_like_commands && (command_cmd == 'l'))
else if (pc.equals(PlayerClassType::SNIPER))
do_cmd_snipe_browse(player_ptr);
else
- do_cmd_browse(player_ptr, cap_mon_ptr);
+ do_cmd_browse(player_ptr);
break;
}
extern bool leave_store;
-class CapturedMonsterType;
class PlayerType;
-void store_process_command(PlayerType *player_ptr, CapturedMonsterType *cap_mon_ptr);
+void store_process_command(PlayerType *player_ptr);