diff --git a/changelog/snippets/fix.6426.md b/changelog/snippets/fix.6426.md new file mode 100644 index 0000000000..10222f6d50 --- /dev/null +++ b/changelog/snippets/fix.6426.md @@ -0,0 +1 @@ +- (#6426) Fix the "Active game mods for blueprint loading" log message. diff --git a/changelog/snippets/fix.6445.md b/changelog/snippets/fix.6445.md new file mode 100644 index 0000000000..50eccb253d --- /dev/null +++ b/changelog/snippets/fix.6445.md @@ -0,0 +1,5 @@ +- (#6445) Fix overcharge dealing half damage to static and ACU shields. + +- (#6445) Shields now block damage from knocking down/setting fire to trees. + +- (#6445) Fix normal damage being applied before anti-shield damage, which didn't let the normal damage overkill under a shield. diff --git a/lua/RuleInit.lua b/lua/RuleInit.lua index 7d87369242..9db7918960 100644 --- a/lua/RuleInit.lua +++ b/lua/RuleInit.lua @@ -13,7 +13,10 @@ doscript '/lua/system/utils.lua' doscript '/lua/system/repr.lua' doscript '/lua/system/debug.lua' -LOG('Active game mods for blueprint loading: ',repr(__active_mods)) +LOG('Active game mods for blueprint loading:') +for _, mod in __active_mods do + LOG(string.format('\t"%-30s v%02d (%-37s by %s', tostring(mod.name) .. '"', tostring(mod.version), tostring(mod.uid) .. ')', tostring(mod.author))) +end doscript '/lua/footprints.lua' doscript '/lua/system/Blueprints.lua' diff --git a/lua/shield.lua b/lua/shield.lua index 84fd60bc46..8a6d344f4f 100644 --- a/lua/shield.lua +++ b/lua/shield.lua @@ -461,7 +461,7 @@ Shield = ClassShield(moho.shield_methods, Entity) { ---@return number damageAbsorbed If not all damage is absorbed, the remainder passes to targets under the shield. OnGetDamageAbsorption = function(self, instigator, amount, type) if type == "TreeForce" or type == "TreeFire" then - return + return amount end -- Allow decoupling the shield from the owner's armor multiplier local absorptionMulti = self.AbsorptionTypeDamageTypeToMulti[type] or self.Owner:GetArmorMult(type) @@ -516,13 +516,19 @@ Shield = ClassShield(moho.shield_methods, Entity) { local tick = GetGameTick() -- damage correction for overcharge - -- These preset damages deal `2 * dmg * absorbMult or armorMult`, currently absorption multiplier is 1x so we need to divide by 2 + + -- If the absorption multiplier is less than 1, then the shield will get hit by two instances of area damage, the absorbed amount and the remainder. + -- This means that the following code then requires a multiplier to correct the total damage amount since both instances will be overriden. + -- For example with 0.25 absorption we would have a 0.25 damage and 0.75 damage instance hitting the shield. Both get set to 800 OC structure damage, + -- but then 0.25x armor is applied again (second OnGetDamageAbsorption call), reducing it to 2x200 damage, which requires a 2x multiplication to bring it to the expected 800. + -- Currently the absorption multiplier is 1, so we don't need a multiplier on the damage to balance it out. + if dmgType == 'Overcharge' then local wep = instigator:GetWeaponByLabel('OverCharge') - if self.StaticShield then -- fixed damage for static shields - amount = wep:GetBlueprint().Overcharge.structureDamage / 2 - elseif self.CommandShield then -- fixed damage for UEF bubble shield - amount = wep:GetBlueprint().Overcharge.commandDamage / 2 + if self.StaticShield then + amount = wep:GetBlueprint().Overcharge.structureDamage + elseif self.CommandShield then + amount = wep:GetBlueprint().Overcharge.commandDamage end end diff --git a/lua/sim/Projectile.lua b/lua/sim/Projectile.lua index 7db39fcf32..c6bd350623 100644 --- a/lua/sim/Projectile.lua +++ b/lua/sim/Projectile.lua @@ -637,16 +637,7 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { local damageSelf = DamageData.DamageSelf or false -- do initial damage in a radius - DamageArea( - instigator, - cachedPosition, - radius, - damage + (DamageData.InitialDamageAmount or 0), - damageType, - damageFriendly, - damageSelf - ) - + -- anti-shield damage first so that the remaining damage can overkill under the shield local damageToShields = DamageData.DamageToShields if damageToShields then DamageArea( @@ -660,6 +651,16 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { ) end + DamageArea( + instigator, + cachedPosition, + radius, + damage + (DamageData.InitialDamageAmount or 0), + damageType, + damageFriendly, + damageSelf + ) + -- check for and deal damage over time local DoTTime = DamageData.DoTTime if DoTTime > 0 then @@ -685,14 +686,7 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { local damageType = DamageData.DamageType -- do initial damage - Damage( - instigator, - cachedPosition, - targetEntity, - damage + (DamageData.InitialDamageAmount or 0), - damageType - ) - + -- anti-shield damage first so remainder can overkill under the shield local damageToShields = DamageData.DamageToShields if damageToShields then Damage( @@ -704,6 +698,14 @@ Projectile = ClassProjectile(ProjectileMethods, DebugProjectileComponent) { ) end + Damage( + instigator, + cachedPosition, + targetEntity, + damage + (DamageData.InitialDamageAmount or 0), + damageType + ) + -- check for and apply damage over time local DoTTime = DamageData.DoTTime if DoTTime > 0 then