kipyin / phanpy Goto Github PK
View Code? Open in Web Editor NEWCheck out pokemaster
Home Page: https://github.com/kipyin/pokemaster
License: MIT License
Check out pokemaster
Home Page: https://github.com/kipyin/pokemaster
License: MIT License
For PR #7 , I cannot do relative imports.
For example, in ./core/status.py
, I want to do
from .tables import ailments
But it tells me that
ImportError: attempted relative import with no known parent package
I've found this and this, but it seems that the solutions are quite complicated. There ought to be a simpler solution.
Using some tables, I was able to cover a good portion of them, but I just haven't kept track of them.
It would be a huge milestone for the project if all the checkboxes are checked. This indeed will take a while.
core.algorithms.stat_changer(...)
.core.algorithms.ailment_inflictor(...)
.Tasks:
Getting
runfile('/Users/Kip/Documents/GitHub/mechanisms/core/helpers.py')
Traceback (most recent call last):
File "<ipython-input-4-771f1c2a8333>", line 1, in <module>
runfile('/Users/Kip/Documents/GitHub/mechanisms/core/helpers.py')
File "/Users/Kip/anaconda/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 710, in runfile
execfile(filename, namespace)
File "/Users/Kip/anaconda/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/Kip/Documents/GitHub/mechanisms/core/helpers.py", line 15, in <module>
pkg_path = resource_filename('mechanisms', 'data')
File "/Users/Kip/anaconda/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1220, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File "/Users/Kip/anaconda/lib/python3.5/site-packages/pkg_resources/__init__.py", line 440, in get_provider
__import__(moduleOrReq)
ImportError: No module named 'mechanisms'
>>> p = Pokemon(123)
>>> p.moves
Out[425]: deque([night-slash, x-scissor, vacuum-wave, double-hit])
>>> p.moves = Move(123)
>>> p.moves
Out[427]: deque([night-slash, x-scissor, vacuum-wave, double-hit])
I've tried:
class Pokemon():
...
@property
def moves(self):
___condition = ((tb.pokemon_moves["pokemon_id"] == self.id) &
(tb.pokemon_moves["pokemon_move_method_id"] == 1) &
(tb.pokemon_moves.level < self.level + 1))
__all_moves = tb.pokemon_moves[___condition]["move_id"]
# FIXME: this is resetting self._moves every time the moves
# property is called.
self._moves = deque([Move(x) for x in __all_moves.values[-4:]])
return self._moves
@moves.setter
def moves(self, move):
self._moves[0] = move
self._moves.rotate()
Also tried:
class Pokemon():
def __init__(self, ...):
...
___condition = ((tb.pokemon_moves["pokemon_id"] == self.id) &
(tb.pokemon_moves["pokemon_move_method_id"] == 1) &
(tb.pokemon_moves.level < self.level + 1))
__all_moves = tb.pokemon_moves[___condition]["move_id"]
self.moves = deque([Move(x) for x in __all_moves.values[-4:]])
Both methods reset self.moves
every time it is called.
However, if I don't do return self._move
in the second block of code, it worked fine.
Even though I've tried to insert values into events
, like this (in main.py
):
def inflict_ailment(f1, m1, f2, m2):
...
events_self = f1.trainer.events.self.status
if ...:
if ...:
...
events_self[turn] = ailment.name
...
And when I called f1.trainer.events[1]
, which is supposed to return the things happened in the first turn, I got:
opponent damage NaN 0.0
stats accuracy 0.0
attack 0.0
critical 0.0
defense 0.0
evasion 0.0
specialAttack 0.0
specialDefense 0.0
speed 0.0
status NaN 0.0
self damage NaN 0.0
stats accuracy 0.0
attack 0.0
critical 0.0
defense 0.0
evasion 0.0
specialAttack 0.0
specialDefense 0.0
speed 0.0
status NaN 0.0
order 0.0
move 0.0
item 0.0
How should field effect/conditions such as grounded, spikes, trick-room be programmed?
Moves like bide, endure, and future-sight all have a charge
flag. They deal damage in a future turn.
Currently, I don't have an easy solution to this problem.
Of course, I can add a flag
and a timer
when a Pokemon used one of these moves, and add checker()
to check if the Pokemon has the flag
or not before it makes a move. Finally, the checker()
overrides the move with the charging move if the timer
hits 0 (and the flag
goes away).
Is there any other way to solve this?
All scripts need to support switching between game versions.
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.