oakdex-pokemon 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bc10f1743d1e49cba854ccb4d828946bfe2ba24
4
- data.tar.gz: 0005b3369fa9f8356410a19d67c2465b518c475d
3
+ metadata.gz: ef6baa578b6a2d019f42ec21901039fb0a8fd18a
4
+ data.tar.gz: f0529da87af14479aa59e4f9da3b75a8d3469c08
5
5
  SHA512:
6
- metadata.gz: 11bce0d46c290aafef648b719aabc56c68ecb35be8c43558fce6a5f7b7a6012fc8d1597af148e93647e7d30a836f753208a155f85ffb2216dbd5301717397530
7
- data.tar.gz: 79695d00038b1480f409277f07f4a17ca16cc85cf5345ecb66acba53abd92abe9ba5498b66d0ed78f0d24e364917601244b31db2e0fee207f98095f5b857d57e
6
+ metadata.gz: 47762037c82bd2c59fd552186383d9db8701475fcc67bb3623098e7e62ca86ac1ff37cddadd9459e0ec14a5685c38fbfe0765f047b989ba188c82ee656cce863
7
+ data.tar.gz: 74310774386369c5edba3930439d9cabcfc617a105870c5a1fc5a90d0ad3283589a8408c10628ce97c877c4a69ec7dfd8404e0e771d5c8c245030674251e92ce
data/README.md CHANGED
@@ -41,7 +41,8 @@ bulbasaur = Oakdex::Pokemon.create('Bulbasaur', { # many options available
41
41
  ],
42
42
  original_trainer: 'Cool trainer name',
43
43
  item_id: 'Lucky Egg',
44
- wild: true
44
+ wild: true,
45
+ primary_status_condition: 'sleep'
45
46
  })
46
47
 
47
48
  pikachu.gender # => female
@@ -27,6 +27,14 @@ module Oakdex
27
27
  @attributes = attributes
28
28
  end
29
29
 
30
+ def primary_status_condition
31
+ @attributes[:primary_status_condition]
32
+ end
33
+
34
+ def primary_status_condition=(value)
35
+ @attributes[:primary_status_condition] = value
36
+ end
37
+
30
38
  def name
31
39
  @species.names['en']
32
40
  end
@@ -43,6 +51,10 @@ module Oakdex
43
51
  @attributes[:hp]
44
52
  end
45
53
 
54
+ def fainted?
55
+ current_hp.zero?
56
+ end
57
+
46
58
  def moves_with_pp
47
59
  moves.select { |m| m.pp > 0 }
48
60
  end
@@ -5,6 +5,7 @@ module Oakdex
5
5
  REQUIRED_ATTRIBUTES = %i[exp gender ability nature hp iv ev moves]
6
6
  OPTIONAL_ATTRIBUTES = %i[
7
7
  original_trainer
8
+ primary_status_condition
8
9
  wild
9
10
  item_id
10
11
  amie
@@ -28,6 +29,10 @@ module Oakdex
28
29
 
29
30
  private
30
31
 
32
+ def primary_status_condition
33
+ @options[:primary_status_condition]
34
+ end
35
+
31
36
  def original_trainer
32
37
  @options[:original_trainer]
33
38
  end
@@ -1,5 +1,5 @@
1
1
  module Oakdex
2
2
  class Pokemon
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oakdex-pokemon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jalyna Schroeder