- This class also performs simple substitution on the effect, replacing
- `$effect_chance` with the move's actual effect chance.
- """
-
- def __init__(self, effect_column):
- self.effect_column = effect_column
-
- def __get__(self, move, move_class):
- if move is None:
- # Don't crash with getattr on the class
- return NotImplemented
- return _MoveEffects(self.effect_column, move)['en']
-
-class MoveEffectsProperty(object):
- """Property that wraps move effects. Used like this:
-
- MoveClass.effects = MoveEffectProperty('effect')
-
- some_move.effects[lang] # returns a MarkdownString
- some_move.effects[lang].as_html # returns a chunk of HTML
+ This class attempts to detect if the wrapped property is a dict-based
+ association proxy, and will act like such a dict if so. Don't rely on it
+ for querying, of course.