Skip to content

Commit

Permalink
Add revives fix #90 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
jalyna committed Jan 26, 2019
1 parent 1d3c5fb commit f04987f
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
Please keep to the changelog format described on [keepachangelog.com](http://keepachangelog.com).

## [Unreleased]

### Added
- Added Revive and Max Revive

## [0.4.1] - 2019-01-22

### Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Oakdex::Pokedex::Move.where(type: 'Ground').size
# => 26

Oakdex::Pokedex::Item.all.size
# => 5, still WIP
# => 7, still WIP

Oakdex::Pokedex::Item.where(category: 'Potion').size
# => 5
Expand Down Expand Up @@ -135,7 +135,7 @@ const allPokemon = oakdexPokedex.allPokemon()
console.log(allPokemon.length); // 807

const allItems = oakdexPokedex.allItems()
console.log(allItems.length); // 5, WIP
console.log(allItems.length); // 7, WIP

const darkPokemon = oakdexPokedex.allPokemon({ type: 'Dark' })
console.log(darkPokemon.length); // 46
Expand Down
2 changes: 1 addition & 1 deletion data/item.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions data/item/max_revive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"names": {
"en": "Max Revive",
"de": "Top-Beleber",
"fr": "Rappel Max",
"es": "Revivir Máximo",
"it": "Revital. Max"
},
"category": "Revives",
"descriptions": [
{
"games": ["Gold", "Silver", "Crystal"],
"translations": {
"en": "Fully restores a fainted Pokémon.",
"de": "Belebt POKéMON plus volle KP."
}
},
{
"games": ["Ruby", "Sapphire", "Emerald"],
"translations": {
"en": "Revives a fainted Pokémon with all its HP.",
"de": "Belebt POKéMON und füllt KP vollständig wieder auf."
}
},
{
"games": ["FireRed", "LeafGreen"],
"translations": {
"en": "A medicine that revives a fainted Pokémon, restoring HP fully.",
"de": "Belebt ein POKéMON und füllt die KP vollständig wieder auf."
}
},
{
"games": ["Diamond", "Pearl", "Platinum", "HeartGold",
"SoulSilver", "Black", "White", "Black 2", "White 2"],
"translations": {
"en": "A medicine that revives a fainted Pokémon. It fully restores the Pokémon's HP.",
"de": "Eine Medizin, die ein kampfunfähiges Pokémon wiederbelebt. Die KP werden vollständig wiederhergestellt."
}
},
{
"games": ["X", "Y", "Omega Ruby", "Alpha Sapphire", "Sun", "Moon", "Ultra Sun", "Ultra Moon"],
"translations": {
"en": "A medicine that can revive fainted Pokémon. It also fully restores a fainted Pokémon's maximum HP.",
"de": "Eine Medizin, die ein kampfunfähiges Pokémon wiederbelebt. Die KP werden vollständig wiederhergestellt."
}
}
],
"prices": [
{
"games": [
"Red", "Blue", "Yellow", "Gold", "Silver", "Crystal", "Ruby", "Sapphire",
"Emerald", "FireRed", "LeafGreen", "Diamond", "Pearl", "Platinum", "HeartGold",
"SoulSilver", "Black", "White", "Black 2", "White 2", "X", "Y", "Omega Ruby",
"Alpha Sapphire", "Sun", "Moon", "Ultra Sun", "Ultra Moon"
],
"buying": 0,
"selling": 2000
}
],
"pockets": [
{
"generations": [1, 2, 3],
"pocket": "Items"
},
{
"generations": [4, 5, 6, 7],
"pocket": "Medicine"
}
],
"fling_power": 30,
"effects": [
{
"condition": "Always",
"target": "Single Pokemon",
"pokemon_changes": [
{
"field": "current_hp",
"change_by_percent": 100,
"revive": true
}
]
}
]
}
91 changes: 91 additions & 0 deletions data/item/revive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"names": {
"en": "Revive",
"de": "Beleber",
"fr": "Rappel",
"es": "Revivir",
"it": "Revitaliz."
},
"category": "Revives",
"descriptions": [
{
"games": ["Gold", "Silver", "Crystal"],
"translations": {
"en": "Restores a fainted Pokémon to ½ HP.",
"de": "Belebt POKéMON plus halbe KP."
}
},
{
"games": ["Ruby", "Sapphire", "Emerald"],
"translations": {
"en": "Revives a fainted Pokémon with half its HP.",
"de": "Belebt POKéMON und füllt die KP zur Hälfte wieder auf."
}
},
{
"games": ["FireRed", "LeafGreen"],
"translations": {
"en": "A medicine that revives a fainted Pokémon, restoring HP by half the maximum amount.",
"de": "Belebt ein POKéMON und füllt dessen KP zur Hälfte wieder auf."
}
},
{
"games": ["Diamond", "Pearl", "Platinum", "HeartGold",
"SoulSilver", "Black", "White", "Black 2", "White 2"],
"translations": {
"en": "A medicine that revives a fainted Pokémon. It restores half the Pokémon's maximum HP.",
"de": "Eine Medizin, die ein kampfunfähiges Pokémon wiederbelebt. Die Hälfte der maximalen KP werden wiederhergestellt."
}
},
{
"games": ["X", "Y", "Omega Ruby", "Alpha Sapphire", "Sun", "Moon", "Ultra Sun", "Ultra Moon"],
"translations": {
"en": "A medicine that can revive fainted Pokémon. It also restores half of a fainted Pokémon's maximum HP.",
"de": "Eine Medizin, die ein kampfunfähiges Pokémon wiederbelebt. Die Hälfte der maximalen KP wird wiederhergestellt."
}
}
],
"prices": [
{
"games": [
"Red", "Blue", "Yellow", "Gold", "Silver", "Crystal", "Ruby", "Sapphire",
"Emerald", "FireRed", "LeafGreen", "Diamond", "Pearl", "Platinum", "HeartGold",
"SoulSilver", "Black", "White", "Black 2", "White 2", "X", "Y", "Omega Ruby",
"Alpha Sapphire"
],
"buying": 1500,
"selling": 750
},
{
"games": [
"Sun", "Moon", "Ultra Sun", "Ultra Moon"
],
"buying": 2000,
"selling": 1000
}
],
"pockets": [
{
"generations": [1, 2, 3],
"pocket": "Items"
},
{
"generations": [4, 5, 6, 7],
"pocket": "Medicine"
}
],
"fling_power": 30,
"effects": [
{
"condition": "Always",
"target": "Single Pokemon",
"pokemon_changes": [
{
"field": "current_hp",
"change_by_percent": 50,
"revive": true
}
]
}
]
}
3 changes: 3 additions & 0 deletions data/schemas/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"minimum": -100,
"maximum": 100
},
"revive": {
"type": "boolean"
},
"change_by": {
"type": "integer",
"minimum": -10000,
Expand Down
2 changes: 2 additions & 0 deletions doc/item.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ Additional restrictions:
* Minimum: `-100`
* Maximum: `100`

#### `revive` (boolean)

#### `change_by` (integer)

Additional restrictions:
Expand Down
2 changes: 1 addition & 1 deletion test/test-oakdex-pokedex.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe('OakdexPokedex', function() {
describe('#allItems', function() {
it('finds all items', function(done) {
const list = oakdexPokedex.allItems()
expect(list.length).to.equal(5);
expect(list.length >= 7).to.be(true);
done();
});

Expand Down

0 comments on commit f04987f

Please sign in to comment.