{"id":25430684,"url":"https://github.com/camilo-j/pokemon-ruby","last_synced_at":"2025-11-05T19:03:01.170Z","repository":{"id":77152825,"uuid":"583370775","full_name":"Camilo-J/Pokemon-Ruby","owner":"Camilo-J","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-29T15:28:29.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T03:41:21.739Z","etag":null,"topics":["cli","oop","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Camilo-J.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-29T15:22:22.000Z","updated_at":"2023-02-01T23:58:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"3695ef31-78f8-4d65-b643-06396259b4d5","html_url":"https://github.com/Camilo-J/Pokemon-Ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Camilo-J%2FPokemon-Ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Camilo-J%2FPokemon-Ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Camilo-J%2FPokemon-Ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Camilo-J%2FPokemon-Ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Camilo-J","download_url":"https://codeload.github.com/Camilo-J/Pokemon-Ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149994,"owners_count":22022853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","oop","ruby"],"created_at":"2025-02-17T03:40:20.853Z","updated_at":"2025-11-05T19:02:56.147Z","avatar_url":"https://github.com/Camilo-J.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon-ruby\n\nThis project consists to build a very close recreation of the classic Pokemon\ngame. You will be able to select one pokemon at the beginning of the game. Then\nyou can train your pokemon in a battle with other random trainers. You will be\nable to see your pokemon stats to check your progress. When you feel ready, you\nwill be able to challenge Gym Leader Brock. If you defeat Brock you won the game\n💪🏼.\n\n## HAPPY PATH\n\nWhen you start the game, the program displays a welcome message and then asks\nfor your name.\n\n```bash\n$ ruby game.rb\n#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#\n#$#$#$#$#$#$#$                               $#$#$#$#$#$#$#\n#$##$##$##$ ---        Pokemon Ruby         --- #$##$##$#$#\n#$#$#$#$#$#$#$                               $#$#$#$#$#$#$#\n#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#\n\nHello there! Welcome to the world of POKEMON! My name is OAK!\nPeople call me the POKEMON PROF!\n\nThis world is inhabited by creatures called POKEMON! For some\npeople, POKEMON are pets. Others use them for fights. Myself...\nI study POKEMON as a profession.\nFirst, what is your name?\n\u003e\n```\n\nWhen you put your name, the program will print some text where it uses the name\nyou give it. Then the program prompts you to choose a pokemon between Bulbasaur,\nCharmander, and Squirtle:\n\n```bash\n\u003e Great Master\nRight! So your name is GREAT MASTER!\nYour very own POKEMON legend is about to unfold! A world of\ndreams and adventures with POKEMON awaits! Let's go!\nHere, GREAT MASTER! There are 3 POKEMON here! Haha!\nWhen I was young, I was a serious POKEMON trainer.\nIn my old age, I have only 3 left, but you can have one! Choose!\n\n1. Bulbasaur    2. Charmander   3. Squirtle\n\u003e\n```\n\nWhen you select Charmander (for example), the program confirms your selection\ndisplaying a message. Then it prompts you to give your pokemon a name\n(optional). If you don't give any name, the name of the pokemon will be the\npokemon species (Charmander for example)\n\n```bash\n\u003e Charmander\n\nYou selected CHARMANDER. Great choice!\nGive your pokemon a name?\n\u003e\n```\n\nAfter you input a name (or nothing at all), the program will print a final\nmessage using your name and your pokemon name. Finally, it will display the game\nmenu:\n\n```bash\n\u003e Great Char\nGREAT MASTER, raise your young GREAT CHAR by making it fight!\nWhen you feel ready you can challenge BROCK, the PEWTER's GYM LEADER\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nIf you input \"Stats\", the main statistics of your pokemon will be shown:\n\n```bash\n\u003e Stats\n\nGreat Char:\nKind: Charmander\nLevel: 1\nType: fire\nStats:\nHP: 12\nAttack: 6\nDefense: 6\nSpecial Attack: 6\nSpecial Defense: 6\nSpeed: 6\nExperience Points: 0\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nIf you type Train, the program will challenge a Random Person with a random\npokemon to a battle. The program displays the pokemon kind and level and asks\nyou to choose between Fight and Leave.\n\n```bash\n\u003e Train\n\nGreat master challenge Random Person for training\nRandom Person has a Onix level 4\nWhat do you want to do now?\n\n1. Fight        2. Leave\n\u003e\n```\n\nIf you select Fight, the program will start a battle between you and Random\nPerson. It will display the hp of each pokemon and then prompt you to select a\nmove printing the available move for your pokemon.\n\n```bash\n\u003e Fight\n\nRandom Person sent out ONIX!\nGreat master sent out GREAT CHAR!\n-------------------Battle Start!-------------------\n\nGreat master's Great Char - Level 1\nHP: 12\nRandom Person's Onix - Level 4\nHP: 17\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e\n```\n\nIf you select a valid move, the program will select a random move for the\nopponent as well and process the result. The result includes the calculation of:\n\n- Who attacks first?\n- The attack move of the attacker hit the opponent?\n- The attack inflicted a Critical Hit?\n- The attack is effective? (could be super effective, not very effective, not\n  effective at all or regular)\n- How much damage will be inflicted?\n\nAfter doing all the calculations, the program will print the result including\nthe new status for each pokemon.\n\n```bash\n\u003e scratch\n\n--------------------------------------------------\nGreat Char used SCRATCH!\nIt's not very effective...\nAnd it hit Onix with 1 damage\n--------------------------------------------------\nOnix used ROCK THROW!\nIt's super effective!\nAnd it hit Great Char with 6 damage\n--------------------------------------------------\nGreat master's Great Char - Level 1\nHP: 6\nRandom Person's Onix - Level 4\nHP: 16\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e\n```\n\nIf both of the pokemons are still alive the program prompt for a new move. The\nbattle continues until one of the pokemon faints (hp ≤ 0). If one pokemon faints\nbefore making his move, the move won't be made at all. The program will print\nwho was the winner and print the menu again.\n\n```bash\n\u003e scratch\n\n--------------------------------------------------\nOnix used ROCK THROW!\nIt was a CRITICAL hit!\nIt's super effective!\nAnd it hit Great Char with 9 damage\n--------------------------------------------------\nGreat Char FAINTED!\n--------------------------------------------------\nOnix WINS!\n-------------------Battle Ended!-------------------\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nIf you won a battle, the program will show the amount of experience points your\npokemon gained. Here is an example of a battle vs a Bulbasaur level 2:\n\n```bash\n\u003e train\n\nGreat master challenge Random Person for training\nRandom Person has a Bulbasaur level 2\nWhat do you want to do now?\n\n1. Fight        2. Leave\n\u003e fight\n\nRandom Person sent out BULBASAUR!\nGreat master sent out GREAT CHAR!\n-------------------Battle Start!-------------------\n\nGreat master's Great Char - Level 1\nHP: 12\nRandom Person's Bulbasaur - Level 2\nHP: 13\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e ember\n\n--------------------------------------------------\nGreat Char used EMBER!\nIt's super effective!\nAnd it hit Bulbasaur with 6 damage\n--------------------------------------------------\nBulbasaur used VINE WHIP!\nIt's not very effective...\nAnd it hit Great Char with 1 damage\n--------------------------------------------------\nGreat master's Great Char - Level 1\nHP: 11\nRandom Person's Bulbasaur - Level 2\nHP: 7\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e ember\n\n--------------------------------------------------\nBulbasaur used TACKLE!\nAnd it hit Great Char with 3 damage\n--------------------------------------------------\nGreat Char used EMBER!\nIt's super effective!\nAnd it hit Bulbasaur with 6 damage\n--------------------------------------------------\nGreat master's Great Char - Level 1\nHP: 8\nRandom Person's Bulbasaur - Level 2\nHP: 1\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e scratch\n\n--------------------------------------------------\nBulbasaur used VINE WHIP!\nIt's not very effective...\nAnd it hit Great Char with 1 damage\n--------------------------------------------------\nGreat Char used SCRATCH!\nAnd it hit Bulbasaur with 3 damage\n--------------------------------------------------\nBulbasaur FAINTED!\n--------------------------------------------------\nGreat Char WINS!\nGreat Char gained 18 experience points\n-------------------Battle Ended!-------------------\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nIf you check your stats you can confirm the experience points added:\n\n```bash\n\u003e stats\n\nGreat Char:\nKind: Charmander\nLevel: 1\nType: fire\nStats:\nHP: 12\nAttack: 6\nDefense: 6\nSpecial Attack: 6\nSpecial Defense: 6\nSpeed: 6\nExperience Points: 18\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nWhen you gain enough experience points, you will level up and the program will\nshow you a message and recalculate your stats based on your new level.\n\n```bash\n\u003e scratch\n\n--------------------------------------------------\nCharmander used SCRATCH!\nAnd it hit Great Char with 4 damage\n--------------------------------------------------\nGreat Char used SCRATCH!\nAnd it hit Charmander with 4 damage\n--------------------------------------------------\nCharmander FAINTED!\n--------------------------------------------------\nGreat Char WINS!\nGreat Char gained 35 experience points\nGreat Char reached level 5!\n-------------------Battle Ended!-------------------\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nWhen you feel ready, you can challenge de Leader for a fight. If you win the\nbattle the game show you a congratulation message. In this example Great Char\nhas reached level 20 and can defeat Brock's Onix:\n\n```bash\n\u003e Leader\n\nGreat master challenge the Gym Leader Brock for a fight!\nBrock has a Onix level 10\nWhat do you want to do now?\n\n1. Fight        2. Leave\n\u003e Fight\n\nBrock sent out ONIX!\nGreat master sent out GREAT CHAR!\n-------------------Battle Start!-------------------\n\nGreat master's Great Char - Level 20\nHP: 51\nBrock's Onix - Level 10\nHP: 29\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e ember\n\n--------------------------------------------------\nOnix used TACKLE!\nAnd it hit Great Char with 3 damage\n--------------------------------------------------\nGreat Char used EMBER!\nIt's not very effective...\nAnd it hit Onix with 5 damage\n--------------------------------------------------\nGreat master's Great Char - Level 20\nHP: 48\nBrock's Onix - Level 10\nHP: 24\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e ember\n\n--------------------------------------------------\nGreat Char used EMBER!\nIt's not very effective...\nAnd it hit Onix with 5 damage\n--------------------------------------------------\nOnix used TACKLE!\nAnd it hit Great Char with 3 damage\n--------------------------------------------------\nGreat master's Great Char - Level 20\nHP: 45\nBrock's Onix - Level 10\nHP: 19\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e scratch\n\n--------------------------------------------------\nOnix used ROCK THROW!\nIt's super effective!\nAnd it hit Great Char with 8 damage\n--------------------------------------------------\nGreat Char used SCRATCH!\nIt's not very effective...\nAnd it hit Onix with 6 damage\n--------------------------------------------------\nGreat master's Great Char - Level 20\nHP: 37\nBrock's Onix - Level 10\nHP: 13\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e ember\n\n--------------------------------------------------\nGreat Char used EMBER!\nIt's not very effective...\nAnd it hit Onix with 5 damage\n--------------------------------------------------\nOnix used TACKLE!\nAnd it hit Great Char with 3 damage\n--------------------------------------------------\nGreat master's Great Char - Level 20\nHP: 34\nBrock's Onix - Level 10\nHP: 8\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e ember\n\n--------------------------------------------------\nOnix used ROCK THROW!\nIt's super effective!\nAnd it hit Great Char with 8 damage\n--------------------------------------------------\nGreat Char used EMBER!\nIt was a CRITICAL hit!\nIt's not very effective...\nAnd it hit Onix with 7 damage\n--------------------------------------------------\nGreat master's Great Char - Level 20\nHP: 26\nBrock's Onix - Level 10\nHP: 1\n\nGreat master, select your move:\n\n1. scratch      2. ember\n\u003e scratch\n\n--------------------------------------------------\nGreat Char used SCRATCH!\nIt's not very effective...\nAnd it hit Onix with 6 damage\n--------------------------------------------------\nOnix FAINTED!\n--------------------------------------------------\nGreat Char WINS!\nGreat Char gained 110 experience points\n-------------------Battle Ended!-------------------\nCongratulation! You have won the game!\nYou can continue training your Pokemon if you want\n-----------------------Menu-----------------------\n\n1. Stats        2. Train        3. Leader       4. Exit\n\u003e\n```\n\nWhen you write Exit, the program print a goodbye message:\n\n```bash\n\u003e Exit\n\nThanks for playing Pokemon Ruby\nThis game was created with love by: [your names]\n```\n\n# Game Mechanics\n\n## Pokemon Battle\n\nPokémon battles are turn-based: they consist of repeated rounds or turns, each\nof which requires both participants to choose an action (move) to take and then\nresolves the outcome of those actions. The resolution does not depend on the\ntiming when the buttons are pressed or other input combinations; only your\nchoice of actions to take can help you towards victory.\n\nThe objective of Pokémon battling is to cause the opponent's Pokémon to faint by\nreducing their hit points (HP) to zero. On each turn, both players choose the\naction to take, and then the battle mechanics resolve the result including Who\nattacks first? Does the attack hit the opponent? How much damage did the attack\ninflict? Does the attack finalize the battle?\n\n## Stats\n\nAll Pokémon have six statistics or stats: **Hit Points** (HP), **Attack**,\n**Defense**, **Special Attack,** **Special Defense**, and **Speed**. They are a\nfunction of your Pokémon's level and species, they are also affected by\nIndividual Values (or factors) that make no two Pokémon the same. To see how\nexactly the stats are determined check **Stats Mechanics**.\n\n- **Hit points (hp):** determines how much damage it can take before fainting. A\n  pokemon start a battle with his maximum HP but it is his **Current HP** the\n  one that represents its health during a battle. The health points lost during\n  battle do not affect the original HP, just the current hp.\n- **Attack/Defense/Special Attack/Special Defense:** These stats control how\n  much damage is done when a move is used. Your Pokémon's Attack and Special\n  Attack determine how much damage it does when it attacks with regular\n  (physical) or special moves respectively, while its Defense and Special\n  Defense determine how much damage it takes when it is attacked by a regular\n  (physical) or special move respectively. These values are used on the **Damage\n  Formula** calculation.\n- **Speed**: This determines how fast your Pokémon is, which effectively means\n  it controls the order in which the Pokémon in battle will move each turn.\n  However, that this is not universal: the primary factor of move order is\n  actually the **priority.** (check details on Move Order)\n\n## Types and Type Effectiveness\n\nEach Pokémon species has one or two out of eighteen types. Types are like\nelements or essences that define what kinds of moves the Pokémon is susceptible\nto and what kinds of moves it can shake off easily. The types in the Pokémon\ngames are Normal, Fire, Water, Electric, Grass, Ice, Fighting, Poison, Ground,\nFlying, Psychic, Bug, Rock, Ghost, Dragon, Dark, Steel and Fairy. Each type is\nweak to some types (which causes **moves of those types** to deal double damage\nagainst Pokémon of this type), resistant to other types (whose **moves** will\ndeal half damage against Pokémon of this type), and immune to yet other types\n(meaning **moves of those types** will deal no damage to Pokémon of this type at\nall), with those leftover dealing normal damage against it. This is summarized\nin the following table:\n\n![Effectiveness Table](https://s3.us-west-2.amazonaws.com/secure.notion-static.com/5aff39c6-1db4-4d6c-bb98-e65ef3b0819d/Untitled.png?X-Amz-Algorithm=AWS4-HMAC-SHA256\u0026X-Amz-Content-Sha256=UNSIGNED-PAYLOAD\u0026X-Amz-Credential=AKIAT73L2G45EIPT3X45%2F20220224%2Fus-west-2%2Fs3%2Faws4_request\u0026X-Amz-Date=20220224T233046Z\u0026X-Amz-Expires=86400\u0026X-Amz-Signature=1047a2fa3c01e8995fe457aec77dd8c00a4fca1f8f94c177eb44a3d06e02b728\u0026X-Amz-SignedHeaders=host\u0026response-content-disposition=filename%20%3D%22Untitled.png%22\u0026x-id=GetObject)\n\nIf a Pokémon has two types, the damage from a given type of attack will be\nmultiplied for both factors, so that for instance, if you use a **Fire move**\nagainst a **Water/Grass-type**, the damage will be halved because Water is\nresistant to Fire but then doubled because Grass is weak to Fire - the end\nresult is normal, neutral damage.\n\n## Moves\n\n### Move Category\n\nThe **regular**(physical) or **special** classification of the move is what\ndetermines whether the Damage Formula plugs in the user's Attack and the\ntarget's Defense or the user's Special Attack and the target's Special Defense.\n\nA move is classified as special if its type is one of the following: Fire,\nWater, Electric, Grass, Ice, Psychic, Dragon, or Dark. Every other move is\nclassified as regular (physical)\n\n### Move Base Power\n\nThis number represents how powerful a damaging move is.\n\n### Target\n\nIn this game, the target of the move will be always the opponent pokemon (status\nor healing moves are not considered)\n\n### Accuracy\n\nA move has a chance to miss and had no effect at all on the target. Accuracy is\na number from 1 to 100 representing the percentage chance of hitting the target.\n\n### Priority\n\nEvery move has a priority level, which is the primary factor of the order in\nwhich the Pokémon execute their moves each turn. Moves with a higher priority\nare always executed before moves with a lower priority\n\n## Experience Points\n\nAny level 1 pokemon starts with 0 experience points. To level up, the pokemon\nneeds to gain experience points. The only way to gain experience points is by\nwinning battles.\n\nEach pokemon has a base experience that depends entirely on their species. For\nexample, Charmander has a base experience of 62. The amount of experience you\ngain when defeating an opponent depends on the base experience and level of the\nopponent pokemon. The formula is:\n\n`(base_experience * level / 7.0).floor`\n\nIf you win a battle vs a Charmander level 5 your pokemon will gain:\n\n`(62 * 5 / 7.0).floor = 44` You would gain 44 experience points.\n\n## Effort Values and Effort Points\n\nEach pokemon has an effort value associated with each of his stats (one effort\nvalue for hp, another for the attack, and so on). When created, a new pokemon\nstarts with 0 effort value on all its stats. This effort value plays a role when\nthe pokemon stats are calculated. The higher the effort value, the higher the\nstat. So, how the effort values are incremented? Well, winning pokemon battles.\n\nEach pokemon has an effort points property. This represents the number of effort\npoints you will gain if you defeat that pokemon in a battle. The effort point\nhas the form: `type: amount`. For example, Bulbasaur has `special attack: 1`.\nMeaning that if you defeat Bulbasaur in a battle, you will gain 1 effort point\non your special attack stat. Charmander has `speed: 1`, so if you defeat\nCharmander in a battle you will gain 1 effort point on your speed stat.\n\nTo see how the effort values affect the overall pokemon stats, check the section\n**Stats Mechanics**.\n\n## Battle Mechanics\n\n### Turn order\n\nAfter each player has chosen a move, the execution order is determined by:\n\n- The move with higher priority goes first.\n- The pokemon with greater speed goes first\n- Random order.\n\n### Accuracy Check\n\nApply the accuracy number of the move. A move with 85 of accuracy has an 85%\nchance of hitting the target.\n\n### Critical Hit Ratio\n\nFor this exercise, every move has a 1/16 chance of being a critical hit. A\ncritical hit deals 1.5 times the damage it normally would.\n\n### Damage Formula Calculation\n\nThe base damage is calculated as follow:\n\n`(((2 * level / 5.0 + 2).floor * offensive_stat * move_power / target_defensive_stat).floor / 50.0).floor + 2`\n\n- **level**: the user (attacker) pokemon level.\n- **offensive_stat**: If the move has a special category this value is the\n  user's **special attack stat.** Otherwise, this value is the user **attack\n  stat.**\n- **move_power**: Is the move base power\n- **target_defensive_stat**: If the movie has a special category then this value\n  is the **target** **special defense stat.** Otherwise, this value is the\n  **target** **defense stat.**\n\nThe base damage is multiplied by 1.5 if the move has a critical hit. Finally,\nthe result is multiplied by the Type Effectiveness. The final result is rounded\ndown (floor).\n\n## Stats Mechanics\n\nThis section explain how the pokemon stats are calculated. The formula is the following:\n\nFor the HP stat:\n\n`stat = ((2 * base_stat + stat_individual_value + stat_effort) * level / 100 + level + 10).floor`\n\nFor the rest of stats (attack, special attack, defense, special defense and speed)\n\n`stat = ((2 * base_stat + stat_individual_values + stat_effort) * level / 100 + 5).floor`\n\nThe details of both formula are:\n\n- **base_stat**: This is the base value of the stat. The base value is a given\n  value and is set when the pokemon is created and never changes.\n- **stat_individual_value**: This is a random number between 0 and 31. The\n  individual value for each stat is randomly set when the pokemon is created and\n  never changes.\n- **stat_effort**: This value is calculated based on the effort value of each\n  stat. Each stat starts with an effort value of 0 and is increased over time\n  when your pokemon win battles. The stat_effort is calculated in this way:\n  `(stat_effort_value / 4.0).floor`\n- **level:** the current pokemon level\n\nFor example, a just created Charmander **could** have the following stats\n(emphasis on could for the random chance for the individual values)\n\nFrom the Pokedex:\n\n- **base stats: { hp: 39, attack: 52, defense: 43, special_attack: 60, special_defense: 50, speed: 65 }**\n\nWhen initialized:\n\n- **level: 1**\n- **individual values: {hp: 3, attack: 18, defense: 23, special_attack: 1, special_defense: 15, speed: 10 }**\n- **effort values: {hp: 0, attack: 0, defense: 0, special_attack: 0, special_defense: 0, speed: 0 }**\n- **stats: ??????????**\n\nLet's calculated the stats for HP:\n\n`hp = ((2 * 39 + 3 + 0) * 1 / 100 + 1 + 10).floor`\n\n`hp = 11`\n\nAnd for any other stat like attack:\n\n`attack = ((2 * 52 + 18 + 0) * 1 / 100 + 5).floor`\n\n`attack = 6`\n\nIf we calculate the rest of stats the result will be:\n\n- **stats: {hp: 11, attack: 6, defense: 6, special_attack: 6, special_defense: 6, speed: 6 }**\n\nA lot of 6s... well, which different individual values the result could be\ndifferent. Another thing to take into consideration is that all the\n`stat_effort` has been 0's. With training, our pokemon will gain effort points\nthat will increase the effort value and finally increase the stat_effort (\n`stat_effort = (stat_effort_value / 4.0).floor`)\n\n## Level Mechanics\n\nThe level of the pokemon affects directly all the other stats. Each pokemon\nneeds a certain amount of experience points to reach and increase his level. A\npokemon created with level 1 has 0 experience points. Each pokemon species has a\nspecific `growth_rate` that could be `slow`, `medium_slow`, `medium_fast`, or\n`fast`.\n\nEach growth rate has a different formula to calculate how many experience points\nthe pokemon needs to reach a certain level. The formulas are:\n\n![slow growth rate](https://wikimedia.org/api/rest_v1/media/math/render/svg/3c84db75e33b927e9a33c527db921cc939f59a2f)\n\nslow growth rate\n\n![medium_slow growth rate](https://wikimedia.org/api/rest_v1/media/math/render/svg/9678c538b685da094f4a023a09a1d09534ed4362)\n\nmedium_slow growth rate\n\n![medium_fast growth rate](https://wikimedia.org/api/rest_v1/media/math/render/svg/699b8bed541837f5062dc25f1de14f04d7cdaa99)\n\nmedium_fast growth rate\n\n![fast growth rate](https://wikimedia.org/api/rest_v1/media/math/render/svg/dceb8ae6b45c5e669a115f0d1f875dba72a3f093)\n\nfast growth rate\n\nWhere `EXP` is the minimum amount of experience points to reach level `n`\n\nFor example, Charmander has a medium_slow growth rate, so for reach the level 3\nwould require:\n\n`exp = (6 / 5.0 * 3**3 - 15 * 3**2 + 100 * 3 -140).floor`\n\n`exp =  57`\n\nWhen Charmander reaches 57 experience points it will obtain Level 3. Every time\nyour pokemon gain experience, don't forget to check if he has reached a new\nlevel 🙂\n\n# About the program\n\nWhile you and your team are free to structure the code as you like, we have some\nrecommendations :\n\n## Pokedex Module\n\nThe Pokedex module store all the immutable information about the game (pokemon\nproperties by species, pokemon move, level tables, and more). You will find a\n`pokedex.rb` file with some structure.\n\n## Pokemon Class\n\nHere are some suggestions about the pokemon class, their properties, value\ntypes, and some methods:\n\nA `Pokemon` in general has the following properties:\n\n- species: a string with the pokemon species. Example: `\"Charmander\"`\n- type: an array of symbols with the pokemon types or type. Example:\n  `[:grass, :poison]`\n- base_exp: an integer with the base experience of the pokemon 'base\n  experience'. Example: `60`\n- growth_rate: a symbol representing the growth rate velocity of the pokemon. It\n  could be :slow, :medium_slow, :medium_fast, :fast. Example: `:medium_slow`\n- base_stats: a hash with the number of each base stat of the pokemon. Example:\n  `{ hp: 45, attack: 49, defense: 49, special_attack: 65, special_defense: 65, speed: 45 }`\n- effort_points: a hash containing the type of stat and the amount of points.\n  Example: `{ type: :special_attack, amount: 1 }`\n- moves: an array of strings with the moves the pokemon can perform. Example\n  `[\"tackle\", \"vine whip\"]`\n\nAll this variables comes from the Pokedex module.\n\nWhen a `Pokemon` is created, in addition to the previous variables, it will have\nas well:\n\n- name A name given by the user. If no name is given, the name should be the\n  pokemon species. Example: `\"Colita\"`\n- level: A number given by the developer on creation. if no level is given the\n  level is set to 1. This number represents the current level of the Pokemon.\n  Example: `1`\n- individual_stats: a hash with a random generated number between 0 and 31 for\n  each of the pokemon stat. Example:\n  `{ hp: 3, attack: 6, defense: 18, special_attack: 0, special_defense: 23, speed: 18 }`\n- effort_values: a hash with a number for each base stat of the pokemon that\n  represents the number of effort points that the pokemon has gained during the\n  training. All the effort points start with 0. Example:\n  `{ hp: 0, attack: 0, defense: 0, special_attack: 0, special_defense: 0, speed: 0 }`\n- experience_points: A number representing the number of experience points\n  gained by the pokemon through training. The initial value for this variable\n  depends on the level of the pokemon on creation. If the level is 1, the\n  experience points start with 0. If the level is greater than 1, the experience\n  points are set to the minimum amount of experience points for that level. This\n  minimum amount is obtained from the level tables of the Pokedex module.\n- stats: a hash with the calculated number for each stat of the pokemon. For the\n  calculation, a formula is used (look at how to calculate pokemon stats).\n  Example:\n  `{ hp: 20, attack: 11, defense: 12, special_attack: 15, special_defense: 15, speed: 20 }`\n\nYou can ask a `Pokemon` to:\n\n- Prepare for battle: setting the necessary variables to be ready to start\n  fighting.\n- Receive damage: to reduce its current hp accordingly\n- Set a current move: to be used in the current battle turn\n- Is fainted?: to know if his current hp is below zero\n- Attack: using its current move it attacks a target, make all the necessary\n  calculations and inflect damage to the target (calling their receive_damage\n  method)\n- Increase stats: To add experience points and effort points when winning a\n  battle.\n\n## Battle Class\n\nA `Battle` needs 2 `Players` to work consistently. Additionally, it could track\nwho is winning the battle.\n\nYou can ask a `Battle` to:\n\n- Prepare a battle: Take the two pokemon players and prepare them for the\n  battle.\n- Start a battle: This could include a call to the preparation action, the order\n  calculation, and the loop where both pokemon fight each other. The battle\n  should keep track of one of the pokemon faints to end the battle\n  appropriately.\n\n## Player Class\n\nWhen a `Player` is created, it is given a name and a pokemon (only the species\nname). Optionally a pokemon name and a pokemon level. If the pokemon level is\nnot given, the pokemon will be level 1. The `Player` class then creates a new\npokemon using the Pokemon class and the information given.\n\nYou can ask a `Player` to:\n\n- Select a move: Ask the user for a move and use this information to set the\n  move on his pokemon.\n\n## Bot Class\n\nA `Bot` is a special kind of Player. The only difference is that, when asked to\nselect a move, it does it randomly instead of asking the user for input.\n\n## Game Class\n\nThe `Game` class controls the main flow of the program. It can relay exclusively\non methods.\n\nYou can ask a `Game` to:\n\n- Start a game: Display the welcome message, gather information to create a\n  `Player` and his `Pokemon`, and display the main menu. Then it controls the\n  user input to call the other actions like `train`, `show_stats`,\n  `challenge_leader`, or `exit`.\n- Start a training: when the user selects that option it creates a random\n  opponent, shows the information about the possible battle to the user, and\n  asks him to decide between fight or leave. If the user select fight its start\n  a new `Battle`\n- Start a leader challenge: Similar to the training but with a specific\n  opponent: Brock with a Level 10 Onix! When the battle finishes, it should\n  check if the `Player` wins in order to display the congratulation message.\n- Show stats: Display the current stats of the Player's Pokemon.\n- Say goodbye: The last message before leaving the game.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamilo-j%2Fpokemon-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamilo-j%2Fpokemon-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamilo-j%2Fpokemon-ruby/lists"}