Skip to content

Commit

Permalink
Merge pull request favll#14 from falau/fb
Browse files Browse the repository at this point in the history
IV/moveset message for FB
  • Loading branch information
falau committed Sep 24, 2016
2 parents 8df44c4 + 5b4d9b5 commit 855fc43
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pogom/app_fb.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,24 @@ def _generate_notify_msg(self, recipient, notify_list, pokemon_list):
exp_ctime = "{h:0>2}:{m:0>2}:{s:0>2}".format(
h=local_time.hour, m=local_time.minute,
s=local_time.second)
msg = (
msg = [
u"野生的 {pokemon_name} 出現了!",
u"消失於: {ctime}"
]
move_1, move_2 = m.get('move_1', ''), m.get('move_2', '')
atk, dfn, sta = (
m.get('individual_attack', 0),
m.get('individual_defense', 0),
m.get('individual_stamina', 0)
)
if all((move_1, move_2)):
msg.append(u'{m1}/{m2}'.format(
m1=move_1, m2=move_2
))
if any((atk, dfn, sta)):
iv = 100 * (atk + dfn + sta) / 45.0
msg.append(u'IV: {iv:0.2f}%'.format(iv=iv))
msg.append(u'攻: {atk}, 防: {dfn}, 耐: {sta}'.format(atk=atk, dfn=dfn, sta=sta))
msg = u"\n".join(msg)
msg = msg.format(
pokemon_name=m['pokemon_name'],
Expand Down

0 comments on commit 855fc43

Please sign in to comment.