smite_ruby 1.5.0 → 1.5.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/smite/god_stats.rb +10 -8
- data/smite_ruby.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97929724f336dab713e837fff95c08b90ba671cf
|
|
4
|
+
data.tar.gz: ccd5b5111ce4d5c9f0a6d9f3d1dc497c4165bda8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52e8a7b71d3cdf517607abea7570c763ba5b226dbcfd93d70d967fd00f23a85b5e05f7a82a04f84aa2dc67c3d9892ae6cd88449c6f9685576e39d8fe0baa06df
|
|
7
|
+
data.tar.gz: 08d928ae5d9ada988c5a8f469005dfcbac64e22bedbace02dbc80e92924b76623f5abdf405bd56817a3979d0c864ff69da86cdea614d4d25a3cefc076cfea6cd
|
data/Gemfile.lock
CHANGED
data/lib/smite/god_stats.rb
CHANGED
|
@@ -49,7 +49,15 @@ module Smite
|
|
|
49
49
|
|
|
50
50
|
def with_items(new_items, stacks = @stacks)
|
|
51
51
|
stacks.delete_if { |k,v| v.nil? }
|
|
52
|
-
|
|
52
|
+
stack_map = new_items.each_with_object({}) do |item, hash|
|
|
53
|
+
base_stacks = item.stacking? ? 0 : 1
|
|
54
|
+
|
|
55
|
+
given_stacks = stacks[item.name.downcase] || base_stacks
|
|
56
|
+
actual_stacks = [given_stacks, base_stacks].max
|
|
57
|
+
actual_stacks = [actual_stacks, item.max_stacks ].min.to_i
|
|
58
|
+
hash[item.name.downcase] = actual_stacks
|
|
59
|
+
end
|
|
60
|
+
GodStats.new(name, @data, { level: level, items: new_items, stacks: stack_map })
|
|
53
61
|
end
|
|
54
62
|
|
|
55
63
|
def bonus_from_items
|
|
@@ -146,13 +154,7 @@ module Smite
|
|
|
146
154
|
item.passive_effects.each do |effect|
|
|
147
155
|
next unless attributes.include?(effect.attribute)
|
|
148
156
|
|
|
149
|
-
|
|
150
|
-
multiplier = if @stacks.empty? || @stacks[item.name.downcase].nil?
|
|
151
|
-
base_stacks
|
|
152
|
-
else
|
|
153
|
-
[ [@stacks[item.name.downcase], base_stacks].max , item.max_stacks ].min.to_i
|
|
154
|
-
end
|
|
155
|
-
|
|
157
|
+
multiplier = @stacks[item.name.downcase]
|
|
156
158
|
if effect.percentage?
|
|
157
159
|
@item_bonus[:perc][effect.attribute.to_sym] += multiplier * effect.amount/100.0
|
|
158
160
|
else
|
data/smite_ruby.gemspec
CHANGED