Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gurzeh 4553 #4589

Merged
merged 5 commits into from
Aug 25, 2016
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions pokemongo_bot/cell_workers/update_live_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,14 @@ def _update_title(self, title, platform):
self.terminal_title = False

self._compute_next_update()


# hard coded values to supplement unknown current_level_xp
global xp_per_level
xp_per_level = [[0, 0], [1000, 1000], [2000, 3000], [3000, 6000], [4000, 10000], [5000, 15000], [6000, 21000], [7000, 28000], [8000, 36000], [9000, 45000], [10000, 55000], [10000, 65000], [10000, 75000], [10000, 85000], [15000, 100000], [20000, 120000], [20000, 140000], [20000, 160000], [25000, 185000], [25000, 210000], [50000, 260000], [75000, 335000], [100000, 435000], [125000, 560000], [150000, 710000], [190000, 900000], [200000, 1100000], [250000, 1350000], [300000, 1650000], [350000, 2000000], [500000, 2500000], [500000, 3000000], [750000, 3750000], [1000000, 4750000], [1250000, 6000000], [1500000, 7500000], [2000000, 9500000], [2500000, 12000000], [3000000, 15000000], [5000000, 20000000]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do i read this? is there any pattern?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are couples of xp / level (40 of them)
The first value is the XP to reach the level, the second is the total XP earned.
Reference is there http://heavy.com/games/2016/07/pokemon-go-xp-gained-per-level-how-much-needed-need-to-up-advance-chart-graph-image/


def _get_stats(self, player_stats):
global xp_per_level

metrics = self.bot.metrics
metrics.capture_stats()
runtime = metrics.runtime()
Expand All @@ -182,7 +188,7 @@ def _get_stats(self, player_stats):
username = player_data.get('username', '?')
distance_travelled = metrics.distance_travelled()
current_level = int(player_stats.get('level', 0))
prev_level_xp = int(player_stats.get('prev_level_xp', 0))
prev_level_xp = int(xp_per_level[current_level-1][1])
next_level_xp = int(player_stats.get('next_level_xp', 0))
experience = player_stats.get('experience', 0)
current_level_xp = experience - prev_level_xp
Expand Down Expand Up @@ -252,6 +258,8 @@ def _get_stats_line(self, player_stats):
if not self.displayed_stats:
return ''

global xp_per_level

# Gather stats values.
metrics = self.bot.metrics
metrics.capture_stats()
Expand All @@ -261,7 +269,7 @@ def _get_stats_line(self, player_stats):
username = player_data.get('username', '?')
distance_travelled = metrics.distance_travelled()
current_level = int(player_stats.get('level', 0))
prev_level_xp = int(player_stats.get('prev_level_xp', 0))
prev_level_xp = int(xp_per_level[current_level-1][1])
next_level_xp = int(player_stats.get('next_level_xp', 0))
experience = int(player_stats.get('experience', 0))
current_level_xp = experience - prev_level_xp
Expand Down