diff --git a/crawl-ref/source/attack.cc b/crawl-ref/source/attack.cc index 1636bf629e0..80226ac8247 100644 --- a/crawl-ref/source/attack.cc +++ b/crawl-ref/source/attack.cc @@ -999,8 +999,8 @@ int attack::calc_damage() bullet_time_method bypass = bullet_time_method::none; - if (attacker->props[BULLET_TIME_TARGET_KEY].get_int64() == defender->mid - && (bullet_time_method)attacker->props[BULLET_TIME_METHOD_KEY].get_byte() + if (attacker->props[BULLET_TIME_TARGET_KEY].get_int() == defender->mid + && (bullet_time_method)attacker->props[BULLET_TIME_METHOD_KEY].get_int() == bullet_time_method::armour) { ac_rule = ac_type::none; diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 2cbb80fae0f..f9d0d9065a3 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -3865,7 +3865,7 @@ static string _bullet_time_method_verb(bullet_time_method method) return "bypassing"; default: - return "bugs"; + return "bugging"; } } @@ -3883,6 +3883,7 @@ static string _bullet_time_method_name(bullet_time_method method) return "shield"; default: + mprf("%i buggy method", (char)method); return "bugs"; } } @@ -3907,8 +3908,8 @@ void bullet_time(monster &mons) return; const coord_def target_pos = target->pos(); - mons.props[BULLET_TIME_TARGET_KEY] = (int64_t)target->mid; - mons.props[BULLET_TIME_METHOD_KEY] = (char)bullet_time_method::none; + mons.props[BULLET_TIME_TARGET_KEY] = (int)target->mid; + mons.props[BULLET_TIME_METHOD_KEY] = (int)bullet_time_method::none; if (!handle_throw(&mons, beem, false, false) // Killed by reflection etc @@ -3919,7 +3920,7 @@ void bullet_time(monster &mons) } const bullet_time_method method = - (bullet_time_method)mons.props[BULLET_TIME_METHOD_KEY].get_byte(); + (bullet_time_method)mons.props[BULLET_TIME_METHOD_KEY].get_int(); // XX: At this point could apply a status to the player to make the relevant // stat appear as 0 briefly, but maybe it's overkill for such a transfient effect. @@ -3939,12 +3940,13 @@ void bullet_time(monster &mons) return; } - if (you.see_cell(target_pos) && you.see_cell(mons.pos())) + if (method != bullet_time_method::none && you.see_cell(target_pos) + && you.see_cell(mons.pos())) { - mprf("%s catches %s off guard, %s %s %s", mons.name(DESC_THE), - target->name(DESC_THE), _bullet_time_method_verb(method), - target->pronoun(PRONOUN_POSSESSIVE), - _bullet_time_method_name(method)); + mprf("%s catches %s off guard, %s %s %s", mons.name(DESC_THE).c_str(), + target->name(DESC_THE).c_str(), _bullet_time_method_verb(method).c_str(), + target->pronoun(PRONOUN_POSSESSIVE).c_str(), + _bullet_time_method_name(method).c_str()); } // Fire second shot. The bypass is handled via the props. diff --git a/crawl-ref/source/mon-behv.h b/crawl-ref/source/mon-behv.h index ec908e115b2..47682be4f2c 100644 --- a/crawl-ref/source/mon-behv.h +++ b/crawl-ref/source/mon-behv.h @@ -14,8 +14,8 @@ #define MON_SPELL_USABLE_KEY "mon_spell_usable" -#define BULLET_TIME_METHOD_KEY "bullet_time_bypass" -#define BULLET_TIME_TARGET_KEY "bullet_time_bypass_mid" +#define BULLET_TIME_METHOD_KEY "bullet_time_method" +#define BULLET_TIME_TARGET_KEY "bullet_time_target" class actor; diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 938f2e125e3..fe52b132f98 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -5855,7 +5855,7 @@ void monster::react_to_damage(const actor *oppressor, int damage, // Rockfish schools disperse into individual fishies (if they're // still alive at all after everything else processes) - if (type == MONS_ROCKFISH_SCHOOL) + if (type == MONS_ROCK_FISH_SCHOOL) rockfish_disperse_fineff::schedule(oppressor, this, pos()); // Damage sharing from the spectral weapon to its owner diff --git a/crawl-ref/source/ranged-attack.cc b/crawl-ref/source/ranged-attack.cc index 4e6acac0b83..17e202d0b66 100644 --- a/crawl-ref/source/ranged-attack.cc +++ b/crawl-ref/source/ranged-attack.cc @@ -108,10 +108,10 @@ bool ranged_attack::attack() bullet_time_method bypass = bullet_time_method::none; - if (attacker->props[BULLET_TIME_TARGET_KEY].get_int64() == defender->mid) + if ((mid_t)attacker->props[BULLET_TIME_TARGET_KEY].get_int() == defender->mid) { bypass = (bullet_time_method) - attacker->props[BULLET_TIME_METHOD_KEY].get_byte(); + attacker->props[BULLET_TIME_METHOD_KEY].get_int(); } ev_margin = bypass == bullet_time_method::evasion ? -1 @@ -213,9 +213,9 @@ bool ranged_attack::handle_phase_blocked() maybe_trigger_jinxbite(); } - if (attacker->props[BULLET_TIME_TARGET_KEY].get_int64() == defender->mid) + if ((mid_t)attacker->props[BULLET_TIME_TARGET_KEY].get_int() == defender->mid) { - attacker->props[BULLET_TIME_METHOD_KEY] + attacker->props[BULLET_TIME_METHOD_KEY].get_int() = (char)bullet_time_method::shield; } @@ -226,9 +226,9 @@ bool ranged_attack::handle_phase_dodged() { did_hit = false; - if (attacker->props[BULLET_TIME_TARGET_KEY].get_int64() == defender->mid) + if ((mid_t)attacker->props[BULLET_TIME_TARGET_KEY].get_int() == defender->mid) { - attacker->props[BULLET_TIME_METHOD_KEY] + attacker->props[BULLET_TIME_METHOD_KEY].get_int() = (char)bullet_time_method::evasion; } @@ -285,9 +285,10 @@ static bool _jelly_eat_missile(const item_def& projectile, int damage_done) bool ranged_attack::handle_phase_hit() { - if (attacker->props[BULLET_TIME_TARGET_KEY].get_int64() == defender->mid) + mprf("Bullet time %i, %i", attacker->props[BULLET_TIME_TARGET_KEY].get_int(), defender->mid); + if ((mid_t)attacker->props[BULLET_TIME_TARGET_KEY].get_int() == defender->mid) { - attacker->props[BULLET_TIME_METHOD_KEY] + attacker->props[BULLET_TIME_METHOD_KEY].get_int() = (char)bullet_time_method::armour; }