From 7df67daaf3dd30241afa7dfe9f857bbe2f809c55 Mon Sep 17 00:00:00 2001 From: Eevee Date: Thu, 13 May 2010 00:15:20 -0700 Subject: [PATCH] Pokedex: colorify type efficacy. --- plugins/Pokedex/plugin.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/Pokedex/plugin.py b/plugins/Pokedex/plugin.py index 2fc8b53..9b35221 100644 --- a/plugins/Pokedex/plugin.py +++ b/plugins/Pokedex/plugin.py @@ -206,7 +206,11 @@ class Pokedex(callbacks.Plugin): elif isinstance(obj, tables.Type): reply_template = u"""{name}, a type. """ - reply_factors = { 200: u'2', 50: u'½', 0: u'0' } + offensive_reply_factors = { + 200: u'\x03092×\x0f', + 50: u'\x0304½×\x0f', + 0: u'\x03140×\x0f', + } offensive_modifiers = {} for matchup in obj.damage_efficacies: @@ -216,11 +220,17 @@ class Pokedex(callbacks.Plugin): if offensive_modifiers: reply_template += u"""{offensive_modifiers}. """ for factor in offensive_modifiers: - offensive_modifiers[factor] = u'{factor}× against {types}'.format( - factor=reply_factors[factor], + offensive_modifiers[factor] = u'{factor} against {types}'.format( + factor=offensive_reply_factors[factor], types=', '.join(sorted(offensive_modifiers[factor])) ) + defensive_reply_factors = { + 200: u'\x03042×\x0f', + 50: u'\x0309½×\x0f', + 0: u'\x03110×\x0f', + } + defensive_modifiers = {} for matchup in obj.target_efficacies: if matchup.damage_factor != 100: @@ -229,8 +239,8 @@ class Pokedex(callbacks.Plugin): if defensive_modifiers: reply_template += u"""{defensive_modifiers}. """ for factor in defensive_modifiers: - defensive_modifiers[factor] = u'{factor}× from {types}'.format( - factor=reply_factors[factor], + defensive_modifiers[factor] = u'{factor} from {types}'.format( + factor=defensive_reply_factors[factor], types=', '.join(sorted(defensive_modifiers[factor])) ) -- 2.7.4