gloomhaven 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 393f54e0e2243c1a46963690dbf208357449c18cfa7fc56235917cff2f359e12
4
- data.tar.gz: 57e3b110c45dbe0f31a84dfa0c70c81fd3e2eef047d7fb2703dde29ed905b4d1
3
+ metadata.gz: 0a68a6302a5ef217ff720a198849c57281d97d8f3ab82b408dd84ccd91401c24
4
+ data.tar.gz: fbde2a84dee1c47de00b31638a6ac8df9ad7f41a428b99e95b90443ac58d0fa4
5
5
  SHA512:
6
- metadata.gz: 883a4061661982065865e92592f56de5f256f6d7bb0a3c9672e8283e46eb726b2886f42ae7a923fd50b55f619d69a6d35b8f7585aaa58aa28abb036fcd0d5dda
7
- data.tar.gz: 777fe4268b9906e35b6c9a4be17516bd029016cfb5c4c145a6c1d644777d497d0c344a1dda29e6c83544067d9a602788b45e87eaab43c834a7e5da6886a63f29
6
+ metadata.gz: 51acac5cada8f4c9d7ccc16da03cff1214487b6d59e23dadfd46309f18ddd03d128f7d9599d99c5829ff71a359149096c645e3041cbed418ebb698b95bb643a8
7
+ data.tar.gz: 5e5baa61ed10f61ebc569cb1805975a4f3dd08f5f7ae3ac06a2f9efca277b1a52c6cac5f626c6829c6c12ef992d8a283455d1c89ec0960dacb1b2375a06b1f61
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gloomhaven (1.0.4)
4
+ gloomhaven (1.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -46,6 +46,7 @@ require 'gloomhaven'
46
46
  => 19
47
47
 
48
48
  # Let's bless and curse the deck
49
+ # Note that blessing/cursing a deck will automatically reshuffle the remaining (undrawn) cards.
49
50
  @deck.bless!
50
51
  @deck.curse!
51
52
 
@@ -86,4 +87,76 @@ require 'gloomhaven'
86
87
  #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
87
88
  #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>
88
89
  ]
90
+ ```
91
+
92
+ #### Player
93
+ Create a `Gloomhaven::Player` `@player` object. Includes attribute tracking for `player#gold`, `player#xp`.
94
+
95
+ ```
96
+ @player = Gloomhaven::Player.new(character_class: 'Mindthief', name: 'Ratteo')
97
+ => #<Gloomhaven::Player @name="Ratteo" @gold=0 @xp=0>
98
+
99
+ # check / set gold
100
+ @player.gold
101
+ => 0
102
+
103
+ @player.gold = 10
104
+ => 10
105
+
106
+ @player.gold
107
+ => 10
108
+
109
+ # Note: can do the same attr setting w/ @player.xp
110
+ ```
111
+
112
+ New players have a default, 20-card attack modifier `@deck` object.
113
+ `@player`s can also add valid perks of class `Gloomhaven::Perk` to directly modify their deck.
114
+
115
+ ```
116
+ @player.deck
117
+ => #<Gloomhaven::Deck>
118
+
119
+ # Basic starting attack modifier deck comes with each player
120
+ @player.deck.cards.count
121
+ => 20
122
+
123
+ # Default characters don't have any perks
124
+ @player.perks
125
+ => []
126
+
127
+ # If we add perks, it will directly modify the deck
128
+ # Let's remove two -1 cards
129
+ @player.add_perk!(Gloomhaven::Perk.new('remove_two_minus_one_cards'))
130
+ => [#<Gloomhaven::Perk:0x007fc6918989b0 @key="remove_two_minus_one_cards", @description="Remove two -1 cards", @adds=[], @removes=[{"card_name"=>"Attack -1", "count"=>2}]>]
131
+
132
+ # And confirm the perks
133
+ @player.perks
134
+ => [#<Gloomhaven::Perk:0x007fc6918989b0 @key="remove_two_minus_one_cards", @description="Remove two -1 cards", @adds=[], @removes=[{"card_name"=>"Attack -1", "count"=>2}]>]
135
+
136
+ # Finally, the deck should have two less cards because of the perk.
137
+ @player.deck.cards.count
138
+ => 18
139
+
140
+ # Perfect. Let's just double check the cards directly
141
+ p @player.deck.cards.to_a
142
+ [
143
+ #<Gloomhaven::Card @name="2x", @attack=0, @crit=true, @miss=false, @rolling=false, @shuffle=true>,
144
+ #<Gloomhaven::Card @name="Attack +0", @attack=0, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
145
+ #<Gloomhaven::Card @name="Attack +0", @attack=0, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
146
+ #<Gloomhaven::Card @name="Attack +0", @attack=0, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
147
+ #<Gloomhaven::Card @name="Attack +0", @attack=0, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
148
+ #<Gloomhaven::Card @name="Attack +0", @attack=0, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
149
+ #<Gloomhaven::Card @name="Attack +0", @attack=0, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
150
+ #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
151
+ #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
152
+ #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
153
+ #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
154
+ #<Gloomhaven::Card @name="Attack +1", @attack=1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
155
+ #<Gloomhaven::Card @name="Attack +2", @attack=2, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
156
+ #<Gloomhaven::Card @name="Attack -1", @attack=-1, @crit=false, @miss=false, @rolling=false, @shuffle=false>, # <-- Note we only have 3x -1 cards now
157
+ #<Gloomhaven::Card @name="Attack -1", @attack=-1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
158
+ #<Gloomhaven::Card @name="Attack -1", @attack=-1, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
159
+ #<Gloomhaven::Card @name="Attack -2", @attack=-2, @crit=false, @miss=false, @rolling=false, @shuffle=false>,
160
+ #<Gloomhaven::Card @name="Null", @attack=0, @crit=false, @miss=true, @rolling=false, @shuffle=true>
161
+ ]
89
162
  ```
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.0.5
2
+ - Updated error message for Player creation to list valid types
3
+
1
4
  # 1.0.4
2
5
  - Fixed issues with YAML loading data externally.
3
6
 
@@ -46,7 +46,9 @@ module Gloomhaven
46
46
  def validate_character_class!(character_class)
47
47
  raise ArgumentError.new("options[:character_class] cannot be blank") if character_class.nil?
48
48
 
49
- raise TypeError.new("Invalid character_class: #{character_class} is not supported") unless Gloomhaven::CHARACTERS.keys.include?(character_class.downcase)
49
+ unless Gloomhaven::CHARACTERS.keys.include?(character_class.downcase)
50
+ raise TypeError.new("Invalid character_class: #{character_class} is not supported. Must be one of the following: #{Gloomhaven::CHARACTERS.keys}")
51
+ end
50
52
  end
51
53
  end
52
54
  end
@@ -1,3 +1,3 @@
1
1
  module Gloomhaven
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloomhaven
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Teo Dell'Amico