Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public List<SpellDpsDetailStats> getSpellDpsDetailStatsBySimulationRunId(Integer simulationRunId) {
- Double avgDetailDps = 0.0;
- Double avgDetailResistedDps = 0.0;
- Double avgDetailAbsorbedDps = 0.0;
- List<SpellDpsDetailStats> spellDpsDetailStats = new ArrayList<>();
- List<SpellDpsDetailGrouped> spellDpsDetailGrouped = spelldmgRepository.findSpellDmgDetailResistedAborbedTotalBySimulationId(simulationRunId);
- for(SpellDpsDetailGrouped sd : spellDpsDetailGrouped) {
- try {
- double fightLength = getFightLengthInSeconds(simulationRunId);
- avgDetailDps = sd.getTotalDamage() / fightLength;
- avgDetailResistedDps = sd.getTotalResisted() / fightLength;
- avgDetailAbsorbedDps = sd.getTotalAbsorbed() / fightLength;
- } catch (Exception e) {
- e.printStackTrace();
- }
- Long normalCounter = spelldmgRepository.findCountNormalHitsBySimulationIdAndSpellId(simulationRunId, sd.getSpellId());
- Long missCounter = spelldmgRepository.findCountMissBySimulationIdAndSpellId(simulationRunId, sd.getSpellId());
- Long resistCounter = spelldmgRepository.findCountResistHitsBySimulationIdAndSpellId(simulationRunId, sd.getSpellId());
- Long dodgeCounter = spelldmgRepository.findCountDodgeBySimulationIdAndSpellId(simulationRunId, sd.getSpellId());
- Long parryCounter = spelldmgRepository.findCountParryBySimulationIdAndSpellId(simulationRunId, sd.getSpellId());
- Long critCounter = spelldmgRepository.findCountCritHitsBySimulationIdAndSpellId(simulationRunId, sd.getSpellId());
- Double normalRate = (normalCounter / (double) sd.getCountTotalHits()) * 100;
- Double missRate = (missCounter / (double) sd.getCountTotalHits()) * 100;
- Double resistRate = (resistCounter / (double) sd.getCountTotalHits()) * 100;
- Double dodgeRate = (dodgeCounter / (double) sd.getCountTotalHits()) * 100;
- Double parryRate = (parryCounter / (double) sd.getCountTotalHits()) * 100;
- Double critRate = (critCounter / (double) sd.getCountTotalHits()) * 100;
- SpellDpsDetailStats spellDpsDetailStatsEntry = new SpellDpsDetailStats(sd.getSpellName(), avgDetailDps, avgDetailResistedDps, avgDetailAbsorbedDps, resistRate, critRate, normalRate, missRate, dodgeRate, parryRate, sd.getTotalDamage(), normalCounter, sd.getCountTotalHits());
- spellDpsDetailStats.add(spellDpsDetailStatsEntry);
- }
- return spellDpsDetailStats;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement