From 82f831545fc2f9ca7115b5f33603b8a61404fd89 Mon Sep 17 00:00:00 2001 From: wkdgmr Date: Sat, 7 Oct 2023 00:17:08 -0400 Subject: [PATCH] knockback elemental arrow bugfix --- Source/missiles.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 883b5b8fe5b..18808bb4857 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -282,15 +282,14 @@ bool MonsterMHit(int pnum, int monsterId, int mindam, int maxdam, int dist, Miss } else { if (monster.mode != MonsterMode::Petrified && missileData.isArrow() && HasAnyOf(player._pIFlags, ItemSpecialEffect::Knockback)) { M_GetKnockback(monster); - missile.var6 = monster.position.old.x; - missile.var7 = monster.position.old.y; } else if (monster.mode != MonsterMode::Petrified && player.InvBody[INVLOC_HAND_LEFT]._itype == ItemType::Bow && player.InvBody[INVLOC_HAND_LEFT]._iMagical == ITEM_QUALITY_UNIQUE) { if (HasAllOf(player._pIFlags, ItemSpecialEffect::FastestAttack | ItemSpecialEffect::Empower) // Empowered Windforce || HasAllOf(player._pIFlags, ItemSpecialEffect::MultipleArrows | ItemSpecialEffect::Empower)) { // Empowered Gnat Sting M_GetKnockback(monster); - missile.var6 = monster.position.old.x; - missile.var7 = monster.position.old.y; + if (HasAllOf(player._pIFlags, ItemSpecialEffect::FastestAttack | ItemSpecialEffect::Empower)) { // Empowered Windforce + AddMissile(monster.position.old, { 2, 0 }, Direction::South, MissileID::WeaponExplosion, TARGET_MONSTERS, player.getId(), 0, 0); + } } } if (monster.type().type != MT_GOLEM) @@ -3062,8 +3061,6 @@ Missile *AddMissile(Point src, Point dst, Direction midir, MissileID mitype, void ProcessElementalArrow(Missile &missile) { - Player &player = Players[missile._misource]; - Point knockbackElement; missile._mirange--; if (missile._miAnimType == MissileGraphicID::ChargedBolt || missile._miAnimType == MissileGraphicID::MagmaBallExplosion) { ChangeLight(missile._mlid, missile.position.tile, missile._miAnimFrame + 5); @@ -3089,12 +3086,6 @@ void ProcessElementalArrow(Missile &missile) maxd = GenerateRnd(10) + 1 + currlevel * 2; } MoveMissileAndCheckMissileCol(missile, DamageType::Physical, mind, maxd, true, false); - if (player.InvBody[INVLOC_HAND_LEFT]._itype == ItemType::Bow - && player.InvBody[INVLOC_HAND_LEFT]._iMagical == ITEM_QUALITY_UNIQUE) { - if (HasAllOf(player._pIFlags, ItemSpecialEffect::FastestAttack | ItemSpecialEffect::Empower)) { // Empowered Windforce - Point knockbackElement = { missile.var6, missile.var7 }; - } - } if (missile._mirange == 0) { missile._mimfnum = 0; missile._mirange = missile._miAnimLen - 1; @@ -3136,14 +3127,7 @@ void ProcessElementalArrow(Missile &missile) break; } SetMissAnim(missile, eAnim); - if (player.InvBody[INVLOC_HAND_LEFT]._itype == ItemType::Bow - && player.InvBody[INVLOC_HAND_LEFT]._iMagical == ITEM_QUALITY_UNIQUE) { - if (HasAllOf(player._pIFlags, ItemSpecialEffect::FastestAttack | ItemSpecialEffect::Empower)) { // Empowered Windforce - CheckMissileCol(missile, damageType, eMind, eMaxd, false, knockbackElement, true); - } - } else { - CheckMissileCol(missile, damageType, eMind, eMaxd, false, missile.position.tile, true); - } + CheckMissileCol(missile, damageType, eMind, eMaxd, false, missile.position.tile, true); } else { if (missile.position.tile != Point { missile.var1, missile.var2 }) { missile.var1 = missile.position.tile.x;