-
Notifications
You must be signed in to change notification settings - Fork 3
Pokemon #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pokemon #6
Conversation
auto name = get_user_input<std::string>("What's your name? "); | ||
std::cout << "Hello, " << name << '!' << '\n'; | ||
std::cin.get(); | ||
/* auto name = get_user_input<std::string>("What's your name? "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the program just returns 0?
|
||
struct Pokemon | ||
{ | ||
std::string m_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct is too huge and flat, use sub structs to improve it
{ | ||
attack *= 2; // crit damage | ||
} | ||
int damage = ((((((2 * source.m_level / 5 + 2) * attack * source.m_next_move.m_power) / target.m_def) / 50) + 2) * random_range<int>(217, 255)) / 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link this URL for future reference: https://www.math.miami.edu/~jam/azure/compendium/battdam.htm, could be hard to find later (in a comment above this line)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is linked at the start of that function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better put the comment directly above the line where this formula is used, makes for a better reading flow but that's just nitpicking :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This PR is referencing issue #1.
The Pokemon loads it's
next_move
which is selected by the player from a list of possible options. The move selection and the possible moves, fetched from the Pokemon API will be implemented by @hentai-chan .The attack damage is calculated using the formula found here
Testing and usage
A move can only be made if the Pokemon
isAlive = true