Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)
for (DamagingProjectileAPI thisProj : projList) { if(deadProjectiles.contains(thisProj)) continue; if(thisProj.getWeapon() == null) continue; if(thisProj.getWeapon().getDerivedStats() == null) continue; if(thisProj.didDamage()) { deadProjectiles.add(thisProj); CombatEntityAPI thisProjTarget = thisProj.getDamageTarget(); if(thisProjTarget instanceof ShipAPI){ if(thisProj instanceof MissileAPI){ for(ShipAPI shipTarget : engine.getShips()){ if(reflectingMap.contains(shipTarget)){ //Only do this step on valid ships! EXPENSIVE! if(MathUtils.isPointWithinCircle(thisProj.getLocation(), shipTarget.getLocation(), shipTarget.getCollisionRadius() + 50f)){ float dps = thisProj.getWeapon().getDerivedStats().getDamagePerShot() * shieldDamageMissile; dps = dpsAfterDamageType(thisProj.getWeapon().getDamageType(), dps, shipTarget); shipTarget.getFluxTracker().increaseFlux(dps, true); damagedMap.add(shipTarget); } } } } else { ShipAPI shipTarget = (ShipAPI) thisProjTarget; if(reflectingMap.contains(shipTarget)) { float dps = thisProj.getWeapon().getDerivedStats().getDamagePerShot() * shieldDamageShot; dps = dpsAfterDamageType(thisProj.getWeapon().getDamageType(), dps, shipTarget); shipTarget.getFluxTracker().increaseFlux(dps, true); damagedMap.add(shipTarget); } } } } }