From c5c65d4475a517ed551fe5c431a9e5300f793bf2 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 2 Apr 2023 10:54:42 -0400 Subject: [PATCH] Fixed #8462 --- core/src/mindustry/maps/SectorDamage.java | 5 +++++ core/src/mindustry/type/Weapon.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/core/src/mindustry/maps/SectorDamage.java b/core/src/mindustry/maps/SectorDamage.java index 0582e86233..de34be2753 100644 --- a/core/src/mindustry/maps/SectorDamage.java +++ b/core/src/mindustry/maps/SectorDamage.java @@ -323,6 +323,11 @@ public class SectorDamage{ if(Structs.find(unit.abilities, a -> a instanceof RepairFieldAbility) instanceof RepairFieldAbility h){ sumRps += h.amount / h.reload * 60f; } + sumRps += unit.type.weapons.sumf(w -> w.shotsPerSec() * (w.bullet.healPercent * 60f + w.bullet.healAmount)); + if(unit.canBuild()){ + //assume it rebuilds 1 block with 'standard' build cost (20) and health (50) every 2 seconds + sumRps += unit.type.buildSpeed * (60f / 20f) * (1f / 2f) * 50f; + } }else{ float bossMult = unit.isBoss() ? 3f : 1f; curEnemyDps += unit.type.dpsEstimate * unit.damageMultiplier() * bossMult; diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 5b56d1c9fb..f3b0eb5e75 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -173,6 +173,10 @@ public class Weapon implements Cloneable{ return (bullet.estimateDPS() / reload) * shoot.shots * 60f; } + public float shotsPerSec(){ + return shoot.shots * 60f / reload; + } + //TODO copy-pasted code public void drawOutline(Unit unit, WeaponMount mount){ if(!outlineRegion.found()) return;