From 406c790dfb9f92d841cdd167481bab7cfa4c916d Mon Sep 17 00:00:00 2001 From: xephero Date: Sat, 31 Mar 2018 19:31:33 -0700 Subject: [PATCH] Adding Radiant Shield and ground effects --- app.py | 4 +++- templates/about.html | 12 ++++++++++- tethercalc.py | 48 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/app.py b/app.py index 32663e3..6183abc 100644 --- a/app.py +++ b/app.py @@ -12,6 +12,8 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) +LAST_CALC_DATE = datetime.fromtimestamp(1522550000) + class Report(db.Model): report_id = db.Column(db.String(16), primary_key=True) fight_id = db.Column(db.Integer, primary_key=True) @@ -72,7 +74,7 @@ def calc(report_id, fight_id): if report: # Recompute if no computed timestamp - if not report.computed: + if not report.computed or report.computed < LAST_CALC_DATE: try: results, friends, encounter_info = tethercalc(report_id, fight_id) except TetherCalcException as exception: diff --git a/templates/about.html b/templates/about.html index ec27289..7635b30 100644 --- a/templates/about.html +++ b/templates/about.html @@ -15,8 +15,10 @@

Does it account for...

  • Excludes ticks from DoTs snapshotted after the tether window
  • Includes ticks from DoTs snapshotted inside the tether window, including ticks that happen afterward
  • Includes the portion of Wildfire damage generated by damage inside the tether window
  • +
  • Includes damage from ground effect DoTs (Shadow Flare, Doton, Salted Earth)
  • +
  • Includes damage from Radiant Shield
  • -

    One thing it doesn't currently include is Radiant Shield damage. These are based on the player's own stats and buffs, rather than the casting Summoner's, so should theoretically be buffed by Dragon Sight. It's a small portion though.

    +

    One thing it deliberately does not account for is range information. I don't check to make sure the tethered player is actually in range because in almost all cases, if someone is the target of a tether, there's nothing stopping them from being in range. Excluding damage just because someone is out of range, when they had no reason not to be, would give a skewed and inaccurate result of the real potential gains.

    How it works

    @@ -39,4 +41,12 @@

    Who made this?

    I am Platinum Xephera on the Ultros server. I made this because, while the methodology is fairly straightforward, it is incredibly tedious to do by hand with FFLogs. Doing it across many pulls, for every tether usage, is just way too much work compared to the bonus given. Many dragoons didn't bother, I know I didn't, and I thought more would if there was a tool that did the tedious stuff for them. I hope the {{ report_count }} analyzed reports have been useful.

    If you notice any issues, feel free to join the FFLogs Extensions discord, or open issues and pull requests on the GitHub repo for this site.

    + +

    Changes

    + +

    I've made some errors in the past with this calculation which have necessitated some corrections. Note that viewing a stored report calculated on an older method than the current one will automatically recalculate and update the results. If you're looking at a report here, it's using the most up to date version.

    + +

    On March 11, 2018, I fixed an error that caused partial wildfire damage to not work correctly. That was address in commit 0a5f34b

    + +

    On March 31, 2018, I added support for ground effect AoEs (Shadow Flare, Doton, and Salted Earth), which were unintentionally being ignored, as well as Radiant Shield damage, which was intentionally overlooked since it was a minor contribution.

    {% endblock %} diff --git a/tethercalc.py b/tethercalc.py index 8594b55..5175eb8 100644 --- a/tethercalc.py +++ b/tethercalc.py @@ -138,10 +138,35 @@ def get_tick_damages(report, start, end): options = { 'start': start, 'end': end + 60000, # 60s is the longest dot - 'filter': 'source.type="player" and ((type="applydebuff" ' - 'or type="refreshdebuff" or type="removedebuff") ' - 'or isTick="true" and type="damage" and target.disposition="enemy" ' - 'and ability.name!="Combined DoTs")' + 'filter': """ + source.type="player" and + ability.id not in (1000493, 1000819, 1000820, 1001203, 1000821, 1000140, 1001195, 1001291, 1001221) + and ( + ( + type="applydebuff" or type="refreshdebuff" or type="removedebuff" + ) or ( + isTick="true" and + type="damage" and + target.disposition="enemy" and + ability.name!="Combined DoTs" + ) or ( + ( + type="applybuff" or type="refreshbuff" or type="removebuff" + ) and ( + ability.id=1000190 or ability.id=1000749 or ability.id=1000501 + ) + ) or ( + type="damage" and ability.id=799 + ) + ) + """ + # Filter explanation: + # 1. source.type is player because tether doesn't affect pets or npcs + # 2. exclude non-dot debuff events like foe req that spam event log to minimize requests + # 3. include debuff events + # 4. include individual dot ticks on enemy + # 5. include only buffs corresponding to ground effect dots + # 6. include radiant shield damage } tick_data = fflogs_api('events', report, options) @@ -184,27 +209,34 @@ def get_tick_damages(report, start, end): continue # Debuff applications inside window - if event['type'] in ['applydebuff', 'refreshdebuff'] and event['timestamp'] < end: + if event['type'] in ['applydebuff', 'refreshdebuff', 'applybuff', 'refreshbuff'] and event['timestamp'] < end: # Add to active if not present if action not in active_debuffs: active_debuffs.append(action) # Debuff applications outside window - elif event['type'] in ['applydebuff', 'refreshdebuff'] and event['timestamp'] > end: + elif event['type'] in ['applydebuff', 'refreshdebuff', 'applybuff', 'refreshbuff'] and event['timestamp'] > end: # Remove from active if present if action in active_debuffs: active_debuffs.remove(action) # Debuff fades at any time - elif event['type'] == 'removedebuff': + elif event['type'] in ['removedebuff', 'removebuff']: # Remove from active if present if action in active_debuffs: active_debuffs.remove(action) # Damage tick elif event['type'] == 'damage': + # If this is radiant shield, add to the supportID + if action[1] == 799 and event['timestamp'] < end: + if event['supportID'] in tick_damage: + tick_damage[event['supportID']] += event['amount'] + else: + tick_damage[event['supportID']] = event['amount'] + # Add damage only if it's from a snapshotted debuff - if action in active_debuffs: + elif action in active_debuffs: if event['sourceID'] in tick_damage: tick_damage[event['sourceID']] += event['amount'] else: