@Override public TrackStatus visit(int time, CombatLogEntry cle) { if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_MODIFIER_ADD && cle.getInflictorName().equals(BH_TRACK)) { trackStatus.put(cle.getTargetName(), new TrackStatus(cle.getAttackerName(), true)); } if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_MODIFIER_REMOVE && cle.getInflictorName().equals(BH_TRACK)) { trackStatus.remove(cle.getTargetName()); } if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_DEATH && trackStatus.getOrDefault(cle.getTargetName(), new TrackStatus()).tracked) { return trackStatus.get(cle.getTargetName()); } return null; } }
private String getAttackerNameCompiled(CombatLogEntry cle) { return compileName(cle.getAttackerName(), cle.isAttackerIllusion()); }
private String getTargetNameCompiled(CombatLogEntry cle) { return compileName(cle.getTargetName(), cle.isTargetIllusion()); }
time = Math.round(cle.getTimestamp()); combatLogEntry.type = cle.getType().name(); combatLogEntry.attackername = cle.getAttackerName(); combatLogEntry.targetname = cle.getTargetName(); combatLogEntry.sourcename = cle.getDamageSourceName(); combatLogEntry.targetsourcename = cle.getTargetSourceName(); combatLogEntry.inflictor = cle.getInflictorName(); combatLogEntry.attackerhero = cle.isAttackerHero(); combatLogEntry.targethero = cle.isTargetHero(); combatLogEntry.attackerillusion = cle.isAttackerIllusion(); combatLogEntry.targetillusion = cle.isTargetIllusion(); combatLogEntry.value = cle.getValue(); float stunDuration = cle.getStunDuration(); if (stunDuration > 0) { combatLogEntry.stun_duration = stunDuration; float slowDuration = cle.getSlowDuration(); if (slowDuration > 0) { combatLogEntry.slow_duration = slowDuration; if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_PURCHASE) { combatLogEntry.valuename = cle.getValueName(); else if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_GOLD) { combatLogEntry.gold_reason = cle.getGoldReason(); else if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_XP) {
@OnCombatLogEntry public void onCombatLogEntry(CombatLogEntry cle) { String time = "[" + GAMETIME_FORMATTER.print(Duration.millis((int) (1000.0f * cle.getTimestamp())).toPeriod()) + "]"; switch (cle.getType()) { case DOTA_COMBATLOG_DAMAGE: log.info("{} {} hits {}{} for {} damage{}", getAttackerNameCompiled(cle), getTargetNameCompiled(cle), cle.getInflictorName() != null ? String.format(" with %s", cle.getInflictorName()) : "", cle.getValue(), cle.getHealth() != 0 ? String.format(" (%s->%s)", cle.getHealth() + cle.getValue(), cle.getHealth()) : "" ); break; time, getAttackerNameCompiled(cle), cle.getInflictorName(), getTargetNameCompiled(cle), cle.getValue(), cle.getHealth() - cle.getValue(), cle.getHealth() ); break; time, getTargetNameCompiled(cle), cle.getInflictorName(), getAttackerNameCompiled(cle) );
private boolean isWardDeath(CombatLogEntry e) { return e.getType().equals(DotaUserMessages.DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_DEATH) && WARDS_TARGET_NAMES.contains(e.getTargetName()); }
@OnCombatLogEntry public void onCombatLogEntry(Context ctx, CombatLogEntry entry) { if (!isWardDeath(entry)) return; String killer; if ((killer = entry.getDamageSourceName()) != null) { wardKillersByWardClass.get(entry.getTargetName()).add(killer); } }
@Override public Integer visit(int time, CombatLogEntry cle) { if (cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_MODIFIER_ADD && cle.getAttackerName().equals("npc_dota_hero_alchemist") && cle.getInflictorName().equals("modifier_alchemist_goblins_greed") && !cle.isAttackerIllusion()) { greevilsGreedLearned = true; && cle.getType() == DOTA_COMBATLOG_TYPES.DOTA_COMBATLOG_DEATH && cle.getAttackerName().equals("npc_dota_hero_alchemist") && !cle.isAttackerIllusion()) { if (isDeny(cle.getTargetName())) { return null;