From d93787d9420e87616bcd9dbd518a9b6740d67041 Mon Sep 17 00:00:00 2001 From: AlumiuN Date: Fri, 21 Apr 2023 12:16:54 +1200 Subject: [PATCH 1/2] Fix inaccurate handling of D2 super laser damage with quad-lasers (as D2 was bugged and didn't apply the intended penalty to them) --- similar/main/laser.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/similar/main/laser.cpp b/similar/main/laser.cpp index 2610cdbe1..80727a8ac 100644 --- a/similar/main/laser.cpp +++ b/similar/main/laser.cpp @@ -656,14 +656,13 @@ static void do_omega_stuff(fvmsegptridx &vmsegptridx, const vmobjptridx_t parent } } +// Note that this is only used for determining if the quad laser per-bolt damage penalty should be applied, and consequently excludes super lasers static int is_laser_weapon_type(const weapon_id_type weapon_type) { return weapon_type == weapon_id_type::LASER_ID_L1 || weapon_type == weapon_id_type::LASER_ID_L2 || weapon_type == weapon_id_type::LASER_ID_L3 || - weapon_type == weapon_id_type::LASER_ID_L4 || - weapon_type == weapon_id_type::LASER_ID_L5 || - weapon_type == weapon_id_type::LASER_ID_L6; + weapon_type == weapon_id_type::LASER_ID_L4; } } From 5534e10d7489d588856cb475525eb181197a96cc Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 22 Apr 2023 15:02:12 +0000 Subject: [PATCH 2/2] Add further comments around the laser damage penalty logic Due to original game bugs, which Rebirth intentionally replicates in order to match the balance of the original game, the logic looks odd. Add comments explaining that the oddity is intentional. --- similar/main/laser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/similar/main/laser.cpp b/similar/main/laser.cpp index 80727a8ac..4fa9e4ba3 100644 --- a/similar/main/laser.cpp +++ b/similar/main/laser.cpp @@ -656,6 +656,11 @@ static void do_omega_stuff(fvmsegptridx &vmsegptridx, const vmobjptridx_t parent } } +/* Descent 2 attempted to penalize super lasers, but did so incorrectly, so the + * penalty only applied successfully on non-super lasers. Therefore, this test + * excludes super lasers from the penalty, in order to behave more like the + * original game. + */ // Note that this is only used for determining if the quad laser per-bolt damage penalty should be applied, and consequently excludes super lasers static int is_laser_weapon_type(const weapon_id_type weapon_type) { @@ -741,6 +746,13 @@ imobjptridx_t Laser_create_new(const vms_vector &direction, const vms_vector &po #endif } #if defined(DXX_BUILD_DESCENT_II) + /* Descent 1 attempted to penalize laser damage, but did so + * incorrectly, so it never applied to the player's weapons. + * Therefore, this penalty check is applied only in the Descent 2 + * build, and then only if not playing a Descent 1 mission, so that + * when the Descent 2 build plays a Descent 1 mission, the weapons work + * more like they would in a Descent 1 build playing that mission. + */ else if (!EMULATING_D1 && is_laser_weapon_type(weapon_type) && (parent->ctype.player_info.powerup_flags & PLAYER_FLAGS_QUAD_LASERS)) obj->ctype.laser_info.multiplier = F1_0*3/4; else if (weapon_type == weapon_id_type::GUIDEDMISS_ID) {