Skip to content

Commit

Permalink
Adding Radiant Shield and ground effects
Browse files Browse the repository at this point in the history
  • Loading branch information
xephero committed Apr 1, 2018
1 parent 75737d6 commit 406c790
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 10 deletions.
4 changes: 3 additions & 1 deletion app.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion templates/about.html
Expand Up @@ -15,8 +15,10 @@ <h2>Does it account for...</h2>
<li>Excludes ticks from DoTs snapshotted after the tether window</li>
<li>Includes ticks from DoTs snapshotted inside the tether window, including ticks that happen afterward</li>
<li>Includes the portion of Wildfire damage generated by damage inside the tether window</li>
<li>Includes damage from ground effect DoTs (Shadow Flare, Doton, Salted Earth)</li>
<li>Includes damage from Radiant Shield</li>
</ul>
<p>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.</p>
<p>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.</p>

<h2>How it works</h2>

Expand All @@ -39,4 +41,12 @@ <h2>Who made this?</h2>

<p>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.</p>
<p>If you notice any issues, feel free to join the <a href="https://discord.gg/zFH3XvB">FFLogs Extensions discord</a>, or open issues and pull requests on the <a href="https://github.com/xephero/tethercalc">GitHub repo</a> for this site.</p>

<h2>Changes</h2>

<p>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.</p>

<p>On March 11, 2018, I fixed an error that caused partial wildfire damage to not work correctly. That was address in commit <a href="https://github.com/xephero/tethercalc/commit/0a5f34b0a6957e0abb4b62cdde9486a106cdf569">0a5f34b</a></p>

<p>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.</p>
{% endblock %}
48 changes: 40 additions & 8 deletions tethercalc.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 406c790

Please sign in to comment.