* @param success TRUEは成功時、FALSEは失敗時の処理を行う
* @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
*/
-bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
+bool cast_learned_spell(player_type *caster_ptr, int spell, const bool success)
{
DIRECTION dir;
PLAYER_LEVEL plev = get_pseudo_monstetr_level(caster_ptr);
PLAYER_LEVEL summon_lev = caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2);
HIT_POINT damage = 0;
- bool pet = success;
+ bool pet = success; // read-only.
bool no_trump = FALSE;
- BIT_FLAGS p_mode, u_mode = 0L, g_mode;
-
- if (pet) {
- p_mode = PM_FORCE_PET;
- g_mode = 0;
- } else {
- p_mode = PM_NO_PET;
- g_mode = PM_ALLOW_GROUP;
- }
-
+ BIT_FLAGS p_mode = pet ? PM_FORCE_PET : PM_NO_PET;
+ BIT_FLAGS u_mode = 0L;
+ BIT_FLAGS g_mode = pet ? 0 : PM_ALLOW_GROUP;
if (!success || (randint1(50 + plev) < plev / 10))
u_mode = PM_ALLOW_UNIQUE;
case MS_XXX1:
break;
case MS_DISPEL: {
- MONSTER_IDX m_idx;
-
if (!target_set(caster_ptr, TARGET_KILL))
return FALSE;
- m_idx = floor_ptr->grid_array[target_row][target_col].m_idx;
+
+ MONSTER_IDX m_idx = floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx)
break;
+
if (!player_has_los_bold(caster_ptr, target_row, target_col))
break;
+
if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col))
break;
+
dispel_monster_status(caster_ptr, m_idx);
break;
}
if (!target_set(caster_ptr, TARGET_KILL))
return FALSE;
+
if (!floor_ptr->grid_array[target_row][target_col].m_idx)
break;
+
if (!player_has_los_bold(caster_ptr, target_row, target_col))
break;
+
if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col))
break;
+
m_ptr = &floor_ptr->m_list[floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(caster_ptr, m_name, m_ptr, 0);
(void)fire_beam(caster_ptr, GF_AWAY_ALL, dir, 100);
break;
-
case MS_TELE_LEVEL:
return teleport_level_other(caster_ptr);
break;
-
case MS_PSY_SPEAR:
if (!get_aim_dir(caster_ptr, &dir))
return FALSE;
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_SPIDER: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_DEMON: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_UNDEAD: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_DRAGON: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_HI_UNDEAD: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_HI_DRAGON: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_AMBERITE: {
} else {
no_trump = TRUE;
}
+
break;
}
case MS_S_UNIQUE: {
}
}
- if (!count) {
+ if (!count)
no_trump = TRUE;
- }
break;
}
msg_print("hoge?");
}
- if (no_trump) {
+ if (no_trump)
msg_print(_("何も現れなかった。", "No one appeared."));
- }
return TRUE;
}
#include "system/angband.h"
-bool cast_learned_spell(player_type *caster_ptr, int spell, bool success);
+bool cast_learned_spell(player_type *caster_ptr, int spell, const bool success);
void learn_spell(player_type *learner_ptr, int monspell);
void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode);