''' Created on 28.04.2015 @author: Felk ''' from __future__ import division, print_function from tppVisu.stat import Stat, StatAccEva from tppVisu.tables import abilityFuncs from tppVisu.util import Stages, TypeSet, Effs, enum Gender = enum(male='m', female='f', none='-') class Pokemon(object): '''class to represent a pokemon. Including all the needed data like types, moves, etc.''' def __init__(self, natID, name, type1, type2, stats, moves, gender, ability='', status='', statusVolatile='', happiness=0, level=100, weight=1, stages=Stages(0, 0, 0, 0, 0, 0, 0)): '''name, type1, type2, ability, status, statusVolatile are strings. natID is a number. stats is a Stats-namedtuple, see util. gender is an enum, see above. moves is an array of Move-objects, see module move.''' self.natID = natID self.name = name self.type1 = type1.lower() if type1 != None else None self.type2 = type2.lower() if type2 != None else None self.gender = gender self.ability = ability.title() # First letters uppercase self.abilityVisuable = abilityFuncs.isVisuable(self.ability) self.moves = moves
'Rollout'] # no special display message. Just force a highlight on this move. others = ['Dream Eater', 'Future Sight', 'Present', 'Wake-Up Slap', 'Focus Punch', 'Last Resort', 'U-Turn'] MoveAnomaly = enum(recoiling='recoiling', leeching='leeching', selfdestructing='selfdestructing', lasting_two_turns='lasting 2 turns', power_doubling='lower damage displayed', health_dependend='full health assumed.', special_powerrange='full power range displayed', round_dependend='first round displayed', other='') def getAnomaly(move): if move.name in recoiling: return MoveAnomaly.recoiling elif move.name in leeching: return MoveAnomaly.leeching elif move.name in selfdestructing: return MoveAnomaly.selfdestructing elif move.name in lasting_two_turns: return MoveAnomaly.lasting_two_turns elif move.name in power_doubling: return MoveAnomaly.power_doubling elif move.name in health_dependend: return MoveAnomaly.health_dependend elif move.name in special_powerrange: return MoveAnomaly.special_powerrange elif move.name in round_dependend: return MoveAnomaly.round_dependend elif move.name in others: return MoveAnomaly.other
''' Created on 29.04.2015 @author: Felk ''' from __future__ import division, print_function from tppVisu.tables.moveAnomalies import getAnomaly from tppVisu.tables.moveHits import getMinMaxHits from tppVisu.tables.movePriorities import getPriority from tppVisu.tables.moveVisuables import isVisuable from tppVisu.util import enum MoveCategory = enum(physical='physical', special='special', nonDamaging='nonDamaging') class Move(object): '''class to represent a pokemon move, including all the needed data like type, category, power etc.''' def __init__(self, name, description, type, category, power, pp, accuracy): '''name, description and type are strings. categoryis an Enum, see above. power, pp and accuracy are numbers.''' self.name = name.title( ) # First letters uppercase. Dirty fix. TODO Might not work for U-turn self.description = description self.type = type self.category = category self.power = power self.pp = pp
''' Created on 28.04.2015 @author: Felk ''' from __future__ import division, print_function from tppVisu.stat import Stat, StatAccEva from tppVisu.tables import abilityFuncs from tppVisu.util import Stages, TypeSet, Effs, enum Gender = enum(male='m', female='f', none='-') class Pokemon(object): '''class to represent a pokemon. Including all the needed data like types, moves, etc.''' def __init__(self, natID, name, type1, type2, stats, moves, gender, ability='', status='', statusVolatile='', happiness=0, level=100, weight=1, stages=Stages(0, 0, 0, 0, 0, 0, 0)):
'Rollout') # no special display message. Just force a highlight on this move. others = ('Dream Eater', 'Future Sight', 'Present', 'Wake-Up Slap', 'Focus Punch', 'Last Resort', 'U-Turn') MoveAnomaly = enum(recoiling='recoiling', leeching='leeching', selfdestructing='selfdestructing', lasting_two_turns='lasting 2 turns', power_doubling='lower damage displayed', health_dependend='full health assumed.', special_powerrange='full power range displayed', round_dependend='first round displayed', other='') def getAnomaly(move): if move.name in recoiling: return MoveAnomaly.recoiling elif move.name in leeching: return MoveAnomaly.leeching elif move.name in selfdestructing: return MoveAnomaly.selfdestructing elif move.name in lasting_two_turns: return MoveAnomaly.lasting_two_turns elif move.name in power_doubling: return MoveAnomaly.power_doubling elif move.name in health_dependend: return MoveAnomaly.health_dependend elif move.name in special_powerrange: return MoveAnomaly.special_powerrange elif move.name in round_dependend: return MoveAnomaly.round_dependend elif move.name in others: return MoveAnomaly.other
''' Created on 29.04.2015 @author: Felk ''' from __future__ import division, print_function from tppVisu.tables.moveAnomalies import getAnomaly from tppVisu.tables.moveHits import getMinMaxHits from tppVisu.tables.movePriorities import getPriority from tppVisu.tables.moveVisuables import isVisuable from tppVisu.util import enum MoveCategory = enum(physical='physical', special='special', nonDamaging='nonDamaging') class Move(object): '''class to represent a pokemon move, including all the needed data like type, category, power etc.''' def __init__(self, name, description, type, category, power, pp, accuracy): '''name, description and type are strings. categoryis an Enum, see above. power, pp and accuracy are numbers.''' self.name = name.title() # First letters uppercase. Dirty fix. TODO Might not work for U-turn self.description = description self.type = type self.category = category self.power = power self.pp = pp self.accuracy = accuracy self.priority = getPriority(self) self.visuable = isVisuable(self)
Created on 02.05.2015 @author: Felk ''' from __future__ import division, print_function from collections import namedtuple from copy import deepcopy from tppVisu.move import MoveCategory from tppVisu.tables import moveFuncs, abilityFuncs from tppVisu.tables.typeEffs import getEff from tppVisu.util import Eff, enum Kind = enum(normal='normal', status='status', ohko='ohko', notVisuable='notVisuable') class MoveResult(object): def __init__(self, env, accuracy, speed, kind=Kind.normal, eff=Eff.NORMAL, damage=None): self.env = env if accuracy == None: self.accuracy = None else: self.accuracy = int(accuracy) self.speed = int(speed) self.kind = kind self.eff = eff if damage == None: self.damage = None else: self.damage = tuple(int(D) for D in damage)