pcattori / pokemon Goto Github PK
View Code? Open in Web Editor NEWPython Pokemon API : 1st Generation Pokemon Simulation
License: MIT License
Python Pokemon API : 1st Generation Pokemon Simulation
License: MIT License
Support for items
https://github.com/pcattori/pokemon/blob/battle/pokemon/battle/battle.py#L107
exhausting generator. should wrap with list()
import pokemon
moves = ('scratch', 'growl', 'ember', 'leer')
charmander = pokemon.Pokemon.of_species('charmander', level=3, moves=[
pokemon.MOVEDEX.by_name(move) for move in moves])
>>> charmander.species
Species(national_pokedex_number=4, name='charmander', types=['fire'], base_stats=Stats(hp=39, attack=52, defense=43, special=50, speed=65))
>>> charmander.level
3
>>> charmander.ivs
Stats(hp=0, attack=4, defense=4, special=12, speed=10)
>>> charmander.evs
Stats(hp=0, attack=0, defense=0, special=0, speed=0)
>>> charmander.stats
Stats(hp=15, attack=8, defense=7, special=8, speed=9)
>>> charmander.moves
[Move(name='scratch', type_='normal', category='physical', power=40, accuracy=100, pp=35), Move(name='growl', type_='normal', category='status', power=None, accuracy=100, pp=40), Move(name='ember', type_='fire', category='special', power=40, accuracy=100, pp=25), Move(name='leer', type_='normal', category='status', power=None, accuracy=100, pp=30)]
maybe pokemon.species('charmander')
and pokemon.move('ember')
convenience functions?
http://bulbapedia.bulbagarden.net/wiki/Status_condition
"Terse composition":
class FallbackWrapper:
def __init__(self, fallback):
# hit __dict__ directly to avoid calling __setattr__ before
# `_fallback` is assigned
self.__dict__['_fallback'] = fallback
def __getattr__(self, attr):
return getattr(self._fallback, attr)
def __setattr__(self, attr, value):
if attr not in self.__dict__ and hasattr(self._fallback, attr):
setattr(self._fallback, attr, value)
# default behavior
super().__setattr__(attr, value)
I'm having trouble trying to import any of the modules. It gives me an input error when I try to do it.
Maybe run an emulator instead of modeling in python? (requires interpreting emulator outputs)
formulas.py
Catch rate: http://bulbapedia.bulbagarden.net/wiki/Catch_rate (not in scope yet)
Permanent Statistics: http://bulbapedia.bulbagarden.net/wiki/Statistic#Permanent_stats
Status: http://bulbapedia.bulbagarden.net/wiki/Status_condition
Base Stats: http://bulbapedia.bulbagarden.net/wiki/Base_stats
Nature: http://bulbapedia.bulbagarden.net/wiki/Nature (not in Gen 1)
Entry Hazards: http://bulbapedia.bulbagarden.net/wiki/List_of_moves_that_cause_entry_hazards (not in Gen 1)
Might make more sense...
eg. squirtle.moves[2]
vs squirtle.moves['bubble']
especially since moves are currently keyed by their name
dependency injection via 2 optional parameters
See title
base vs current vs in-battle
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.