auto innocent = true;
auto thief = false;
for (auto i = 0; i < MAX_NUM_BLOWS; i++) {
- if (r_ptr->blow[i].d_dice != 0) {
+ if (r_ptr->blows[i].d_dice != 0) {
innocent = false;
}
- if ((r_ptr->blow[i].effect == RaceBlowEffectType::EAT_ITEM) || (r_ptr->blow[i].effect == RaceBlowEffectType::EAT_GOLD)) {
+ if ((r_ptr->blows[i].effect == RaceBlowEffectType::EAT_ITEM) || (r_ptr->blows[i].effect == RaceBlowEffectType::EAT_GOLD)) {
thief = true;
}
}
// B:blow_type:blow_effect:dice
size_t i = 0;
for (; i < 4; i++) {
- if (r_ptr->blow[i].method == RaceBlowMethodType::NONE) {
+ if (r_ptr->blows[i].method == RaceBlowMethodType::NONE) {
break;
}
}
return PARSE_ERROR_INVALID_FLAG;
}
- r_ptr->blow[i].method = rbm->second;
- r_ptr->blow[i].effect = rbe->second;
+ r_ptr->blows[i].method = rbm->second;
+ r_ptr->blows[i].effect = rbe->second;
if (tokens.size() < 4) {
return PARSE_ERROR_NONE;
}
const auto &dice = str_split(tokens[3], 'd', false, 2);
- info_set_value(r_ptr->blow[i].d_dice, dice[0]);
- info_set_value(r_ptr->blow[i].d_side, dice[1]);
+ info_set_value(r_ptr->blows[i].d_dice, dice[0]);
+ info_set_value(r_ptr->blows[i].d_side, dice[1]);
} else if (tokens[0] == "F") {
// F:flags
if (tokens.size() < 2 || tokens[1].size() == 0) {
void set_monster_blow_method(lore_type *lore_ptr, int m)
{
- RaceBlowMethodType method = lore_ptr->r_ptr->blow[m].method;
+ RaceBlowMethodType method = lore_ptr->r_ptr->blows[m].method;
lore_ptr->p = nullptr;
lore_ptr->pc = TERM_WHITE;
switch (method) {
void set_monster_blow_effect(lore_type *lore_ptr, int m)
{
- RaceBlowEffectType effect = lore_ptr->r_ptr->blow[m].effect;
+ RaceBlowEffectType effect = lore_ptr->r_ptr->blows[m].effect;
lore_ptr->q = nullptr;
lore_ptr->qc = TERM_WHITE;
switch (effect) {
DEPTH level = r_ptr->level;
int32_t a = r_ptr->r_blows[i];
- int32_t d1 = r_ptr->blow[i].d_dice;
- int32_t d2 = r_ptr->blow[i].d_side;
+ int32_t d1 = r_ptr->blows[i].d_dice;
+ int32_t d2 = r_ptr->blows[i].d_side;
int32_t d = d1 * d2;
if (d >= ((4 + level) * MAX_UCHAR) / 80) {
r_ptr->r_wake = r_ptr->r_ignore = MAX_UCHAR;
for (int i = 0; i < 4; i++) {
- if (r_ptr->blow[i].effect != RaceBlowEffectType::NONE || r_ptr->blow[i].method != RaceBlowMethodType::NONE) {
+ if (r_ptr->blows[i].effect != RaceBlowEffectType::NONE || r_ptr->blows[i].method != RaceBlowMethodType::NONE) {
if (r_ptr->r_blows[i] != MAX_UCHAR) {
n++;
}
const auto *m_ptr = mam_ptr->m_ptr;
auto *r_ptr = &monraces_info[m_ptr->r_idx];
for (int ap_cnt = 0; ap_cnt < MAX_NUM_BLOWS; ap_cnt++) {
- mam_ptr->effect = r_ptr->blow[ap_cnt].effect;
- mam_ptr->method = r_ptr->blow[ap_cnt].method;
- mam_ptr->d_dice = r_ptr->blow[ap_cnt].d_dice;
- mam_ptr->d_side = r_ptr->blow[ap_cnt].d_side;
+ mam_ptr->effect = r_ptr->blows[ap_cnt].effect;
+ mam_ptr->method = r_ptr->blows[ap_cnt].method;
+ mam_ptr->d_dice = r_ptr->blows[ap_cnt].d_dice;
+ mam_ptr->d_side = r_ptr->blows[ap_cnt].d_side;
if (!m_ptr->is_valid()) {
break;
this->obvious = false;
this->damage = 0;
this->act = nullptr;
- this->effect = r_ptr->blow[ap_cnt].effect;
- this->method = r_ptr->blow[ap_cnt].method;
- this->d_dice = r_ptr->blow[ap_cnt].d_dice;
- this->d_side = r_ptr->blow[ap_cnt].d_side;
+ this->effect = r_ptr->blows[ap_cnt].effect;
+ this->method = r_ptr->blows[ap_cnt].method;
+ this->d_dice = r_ptr->blows[ap_cnt].d_dice;
+ this->d_side = r_ptr->blows[ap_cnt].d_side;
if (!this->check_monster_continuous_attack()) {
break;
static void on_dead_explosion(PlayerType *player_ptr, monster_death_type *md_ptr)
{
for (int i = 0; i < 4; i++) {
- if (md_ptr->r_ptr->blow[i].method != RaceBlowMethodType::EXPLODE) {
+ if (md_ptr->r_ptr->blows[i].method != RaceBlowMethodType::EXPLODE) {
continue;
}
BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
- AttributeType typ = mbe_info[enum2i(md_ptr->r_ptr->blow[i].effect)].explode_type;
- DICE_NUMBER d_dice = md_ptr->r_ptr->blow[i].d_dice;
- DICE_SID d_side = md_ptr->r_ptr->blow[i].d_side;
+ AttributeType typ = mbe_info[enum2i(md_ptr->r_ptr->blows[i].effect)].explode_type;
+ DICE_NUMBER d_dice = md_ptr->r_ptr->blows[i].d_dice;
+ DICE_SID d_side = md_ptr->r_ptr->blows[i].d_side;
int damage = damroll(d_dice, d_side);
(void)project(player_ptr, md_ptr->m_idx, 3, md_ptr->md_y, md_ptr->md_x, damage, typ, flg);
break;
}
for (int i = 0; i < 4; i++) {
- if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+ if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
return false;
}
}
}
for (int i = 0; i < 4; i++) {
- if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+ if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
return false;
}
- if (r_ptr->blow[i].effect != RaceBlowEffectType::DR_MANA) {
- dam += r_ptr->blow[i].d_dice;
+ if (r_ptr->blows[i].effect != RaceBlowEffectType::DR_MANA) {
+ dam += r_ptr->blows[i].d_dice;
}
}
return false;
}
- if ((r_ptr->blow[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[3].method == RaceBlowMethodType::EXPLODE)) {
+ if ((r_ptr->blows[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[3].method == RaceBlowMethodType::EXPLODE)) {
return false;
}
return false;
}
- if ((r_ptr->blow[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blow[3].method == RaceBlowMethodType::EXPLODE)) {
+ if ((r_ptr->blows[0].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[1].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[2].method == RaceBlowMethodType::EXPLODE) || (r_ptr->blows[3].method == RaceBlowMethodType::EXPLODE)) {
return false;
}
int n = 0; /* Number of blows */
const int max_blows = 4;
for (int m = 0; m < max_blows; m++) {
- if (r_ptr->blow[m].method != RaceBlowMethodType::NONE) {
+ if (r_ptr->blows[m].method != RaceBlowMethodType::NONE) {
n++;
} /* Count blows */
- if (r_ptr->blow[m].method == RaceBlowMethodType::SHOOT) {
+ if (r_ptr->blows[m].method == RaceBlowMethodType::SHOOT) {
p = m; /* Remember position */
break;
}
(*dd) = 0;
(*ds) = 0;
} else {
- (*dd) = r_ptr->blow[p].d_dice;
- (*ds) = r_ptr->blow[p].d_side;
+ (*dd) = r_ptr->blows[p].d_dice;
+ (*ds) = r_ptr->blows[p].d_side;
}
}
break;
case SUMMON_KAMIKAZE:
for (int i = 0; i < 4; i++) {
- if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+ if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
is_match = true;
}
}
break;
case SUMMON_KAMIKAZE_LIVING:
for (int i = 0; i < 4; i++) {
- if (r_ptr->blow[i].method == RaceBlowMethodType::EXPLODE) {
+ if (r_ptr->blows[i].method == RaceBlowMethodType::EXPLODE) {
is_match = true;
}
}
int dam_melee = 0;
for (int m = 0; m < 4; m++) {
/* Skip non-attacks */
- if (r_ptr->blow[m].method == RaceBlowMethodType::NONE || (r_ptr->blow[m].method == RaceBlowMethodType::SHOOT)) {
+ if (r_ptr->blows[m].method == RaceBlowMethodType::NONE || (r_ptr->blows[m].method == RaceBlowMethodType::SHOOT)) {
continue;
}
/* Extract the attack info */
- dam_melee += blow_damcalc(m_ptr, player_ptr, &r_ptr->blow[m]);
- if (r_ptr->blow[m].method == RaceBlowMethodType::EXPLODE) {
+ dam_melee += blow_damcalc(m_ptr, player_ptr, &r_ptr->blows[m]);
+ if (r_ptr->blows[m].method == RaceBlowMethodType::EXPLODE) {
break;
}
}
bool MonsterRaceInfo::is_explodable() const
{
- return std::any_of(std::begin(this->blow), std::end(this->blow),
+ return std::any_of(std::begin(this->blows), std::end(this->blows),
[](const auto &blow) { return blow.method == RaceBlowMethodType::EXPLODE; });
}
EnumClassFlagGroup<MonsterPopulationType> population_flags; //!< 能力フラグ(出現数関連) / Population Flags
EnumClassFlagGroup<MonsterSpeakType> speak_flags; //!< 能力フラグ(セリフ) / Speaking Flags
EnumClassFlagGroup<MonsterBrightnessType> brightness_flags; //!< 能力フラグ(明暗) / Speaking Lite or Dark
- MonsterBlow blow[MAX_NUM_BLOWS]{}; //!< 打撃能力定義 / Up to four blows per round
+ MonsterBlow blows[MAX_NUM_BLOWS]{}; //!< 打撃能力定義 / Up to four blows per round
//! 指定護衛リスト <モンスター種族ID,護衛数ダイス数,護衛数ダイス面>
std::vector<std::tuple<MonsterRaceId, DICE_NUMBER, DICE_SID>> reinforces;
*/
void display_monster_blow(lore_type *lore_ptr, int m, int attack_numbers)
{
- int d1 = lore_ptr->r_ptr->blow[m].d_dice;
- int d2 = lore_ptr->r_ptr->blow[m].d_side;
+ int d1 = lore_ptr->r_ptr->blows[m].d_dice;
+ int d2 = lore_ptr->r_ptr->blows[m].d_side;
void (*display_monster_blows_pf)(lore_type *, int, int, int, int) = _(display_monster_blow_jp, display_monster_blow_en);
(*display_monster_blows_pf)(lore_ptr, attack_numbers, d1, d2, m);
}
{
const int max_attack_numbers = 4;
for (int m = 0; m < max_attack_numbers; m++) {
- if (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::SHOOT)) {
+ if (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::SHOOT)) {
continue;
}
int attack_numbers = 0;
for (int m = 0; m < max_attack_numbers; m++) {
- if (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::SHOOT) || (((lore_ptr->r_ptr->r_blows[m] == 0) && !lore_ptr->know_everything))) {
+ if (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::NONE || (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::SHOOT) || (((lore_ptr->r_ptr->r_blows[m] == 0) && !lore_ptr->know_everything))) {
continue;
}
int n = 0; /* Number of blows */
const int max_blows = 4;
for (int m = 0; m < max_blows; m++) {
- if (lore_ptr->r_ptr->blow[m].method != RaceBlowMethodType::NONE) {
+ if (lore_ptr->r_ptr->blows[m].method != RaceBlowMethodType::NONE) {
n++;
} /* Count blows */
- if (lore_ptr->r_ptr->blow[m].method == RaceBlowMethodType::SHOOT) {
+ if (lore_ptr->r_ptr->blows[m].method == RaceBlowMethodType::SHOOT) {
p = m; /* Remember position */
break;
}
}
if (know_armour(lore_ptr->r_idx, lore_ptr->know_everything)) {
- strnfmt(lore_ptr->tmp_msg[lore_ptr->vn], sizeof(lore_ptr->tmp_msg[lore_ptr->vn]), _("威力 %dd%d の射撃をする", "fire an arrow (Power:%dd%d)"), lore_ptr->r_ptr->blow[p].d_dice,
- lore_ptr->r_ptr->blow[p].d_side);
+ strnfmt(lore_ptr->tmp_msg[lore_ptr->vn], sizeof(lore_ptr->tmp_msg[lore_ptr->vn]), _("威力 %dd%d の射撃をする", "fire an arrow (Power:%dd%d)"), lore_ptr->r_ptr->blows[p].d_dice,
+ lore_ptr->r_ptr->blows[p].d_side);
} else {
angband_strcpy(lore_ptr->tmp_msg[lore_ptr->vn], _("射撃をする", "fire an arrow"), sizeof(lore_ptr->tmp_msg[lore_ptr->vn]));
}