d3api 1.0.0 → 1.1.0
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.
- data/.gitignore +2 -1
- data/lib/d3api.rb +7 -8
- data/lib/d3api/follower.rb +2 -2
- data/lib/d3api/hero.rb +6 -3
- data/lib/d3api/{hero_follower.rb → hero/follower.rb} +0 -0
- data/lib/d3api/{hero_follower_set.rb → hero/follower_set.rb} +0 -0
- data/lib/d3api/{hero_set.rb → hero/set.rb} +0 -0
- data/lib/d3api/{hero_skills.rb → hero/skill_set.rb} +1 -1
- data/lib/d3api/hero/stats.rb +48 -0
- data/lib/d3api/{equipped_item.rb → item/equipped_item.rb} +0 -0
- data/lib/d3api/{equipped_item_set.rb → item/equipped_item_set.rb} +0 -0
- data/lib/d3api/version.rb +1 -1
- data/spec/d3api/equipped_item_set_spec.rb +1 -15
- data/spec/d3api/equipped_item_spec.rb +1 -9
- data/spec/d3api/follower_spec.rb +1 -1
- data/spec/d3api/hero_follower_set_spec.rb +1 -33
- data/spec/d3api/hero_follower_spec.rb +1 -32
- data/spec/d3api/hero_skill_set_spec.rb +9 -0
- data/spec/d3api/hero_stats_spec.rb +37 -0
- data/spec/d3api/skills_spec.rb +5 -26
- data/spec/fixtures/equipped_item.yml +7 -0
- data/spec/fixtures/equipped_item_set.yml +13 -0
- data/spec/fixtures/hero_follower.yml +33 -0
- data/spec/fixtures/hero_follower_set.yml +34 -0
- data/spec/fixtures/hero_skill.yml +21 -0
- data/spec/fixtures/hero_skill_set.yml +21 -0
- data/spec/fixtures/stats.yml +30 -0
- metadata +28 -47
- data/lib/.DS_Store +0 -0
- data/lib/d3api/.DS_Store +0 -0
- data/spec/.DS_Store +0 -0
- data/spec/d3api/.DS_Store +0 -0
- data/spec/d3api/hero_skills_spec.rb +0 -30
data/.gitignore
CHANGED
data/lib/d3api.rb
CHANGED
@@ -7,15 +7,14 @@ module D3api
|
|
7
7
|
autoload :Career, 'd3api/career'
|
8
8
|
|
9
9
|
autoload :Hero, 'd3api/hero'
|
10
|
-
autoload :HeroSet, 'd3api/
|
10
|
+
autoload :HeroSet, 'd3api/hero/set'
|
11
|
+
autoload :HeroSkillSet, 'd3api/hero/skill_set'
|
12
|
+
autoload :HeroStats, 'd3api/hero/stats'
|
13
|
+
autoload :HeroFollowerSet, 'd3api/hero/follower_set'
|
14
|
+
autoload :HeroFollower, 'd3api/hero/follower'
|
11
15
|
|
12
|
-
autoload :EquippedItem, 'd3api/equipped_item'
|
13
|
-
autoload :EquippedItemSet, 'd3api/equipped_item_set'
|
14
|
-
|
15
|
-
autoload :HeroSkills, 'd3api/hero_skills'
|
16
|
-
|
17
|
-
autoload :HeroFollowerSet, 'd3api/hero_follower_set'
|
18
|
-
autoload :HeroFollower, 'd3api/hero_follower'
|
16
|
+
autoload :EquippedItem, 'd3api/item/equipped_item'
|
17
|
+
autoload :EquippedItemSet, 'd3api/item/equipped_item_set'
|
19
18
|
|
20
19
|
autoload :Skill, 'd3api/skill'
|
21
20
|
autoload :Item, 'd3api/item'
|
data/lib/d3api/follower.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module D3api
|
2
2
|
class Follower < BaseModel
|
3
|
-
attr_accessor :slug, :name, :portrait, :
|
3
|
+
attr_accessor :slug, :name, :portrait, :active_skills
|
4
4
|
|
5
5
|
def initialize(region, follower_type)
|
6
6
|
json_response = find(region, follower_type)
|
@@ -19,7 +19,7 @@ module D3api
|
|
19
19
|
self.slug = values['slug']
|
20
20
|
self.name = values['name']
|
21
21
|
self.portrait = values['portrait']
|
22
|
-
self.
|
22
|
+
self.active_skills = nil
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/d3api/hero.rb
CHANGED
@@ -4,7 +4,7 @@ module D3api
|
|
4
4
|
attr_accessor :id, :name, :hero_class, :gender,
|
5
5
|
:level, :hardcore, :last_updated,
|
6
6
|
:items, :active_skills, :passive_skills,
|
7
|
-
:followers
|
7
|
+
:followers, :stats
|
8
8
|
|
9
9
|
def initialize(region, battletag_name, battletag_id, hero_id)
|
10
10
|
json_response = find(region, battletag_name, battletag_id, hero_id)
|
@@ -32,15 +32,18 @@ module D3api
|
|
32
32
|
self.items ||= D3api::EquippedItemSet
|
33
33
|
.new(values['items'])
|
34
34
|
.item_set
|
35
|
-
self.active_skills ||= D3api::
|
35
|
+
self.active_skills ||= D3api::HeroSkillSet
|
36
36
|
.new('active', values['skills']['active'])
|
37
37
|
.skill_set
|
38
|
-
self.passive_skills ||= D3api::
|
38
|
+
self.passive_skills ||= D3api::HeroSkillSet
|
39
39
|
.new('passive', values['skills']['passive'])
|
40
40
|
.skill_set
|
41
41
|
self.followers ||= D3api::HeroFollowerSet
|
42
42
|
.new(values['followers'])
|
43
43
|
.follower_set
|
44
|
+
|
45
|
+
self.stats ||= D3api::HeroStats
|
46
|
+
.new(values['stats'])
|
44
47
|
end
|
45
48
|
|
46
49
|
def determine_gender(gender)
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module D3api
|
2
|
+
class HeroStats
|
3
|
+
attr_accessor :life, :damage, :attack_speed, :armor, :strength,
|
4
|
+
:dexterity, :vitality, :intelligence, :physical_resist,
|
5
|
+
:fire_resist, :cold_resist, :lightning_resist, :poison_resist,
|
6
|
+
:arcane_resist, :crit_damage, :block_chance, :block_amount_min,
|
7
|
+
:block_amount_max, :damage_increase, :crit_chance, :damage_reduction,
|
8
|
+
:thorns, :life_steal, :life_per_kill, :gold_find, :magic_find,
|
9
|
+
:life_on_hit, :primary_resource, :secondary_resource
|
10
|
+
|
11
|
+
def initialize(stat_values)
|
12
|
+
set_method(stat_values)
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
def set_method(values)
|
17
|
+
self.life = values['life']
|
18
|
+
self.damage = values['damage']
|
19
|
+
self.attack_speed = values['attackSpeed']
|
20
|
+
self.armor = values['armor']
|
21
|
+
self.strength = values['strength']
|
22
|
+
self.dexterity = values['dexterity']
|
23
|
+
self.vitality = values['vitality']
|
24
|
+
self.intelligence = values['intelligence']
|
25
|
+
self.physical_resist = values['physicalResist']
|
26
|
+
self.fire_resist = values['fireResist']
|
27
|
+
self.cold_resist = values['coldResist']
|
28
|
+
self.lightning_resist = values['lightningResist']
|
29
|
+
self.poison_resist = values['poisonResist']
|
30
|
+
self.arcane_resist = values['arcaneResist']
|
31
|
+
self.crit_damage = values['critDamage']
|
32
|
+
self.block_chance = values['blockChance']
|
33
|
+
self.block_amount_min = values['blockAmountMin']
|
34
|
+
self.block_amount_max = values['blockAmountMax']
|
35
|
+
self.damage_increase = values['damageIncrease']
|
36
|
+
self.crit_chance = values['critChance']
|
37
|
+
self.damage_reduction = values['damageReduction']
|
38
|
+
self.thorns = values['thorns']
|
39
|
+
self.life_steal = values['lifeSteal']
|
40
|
+
self.life_per_kill = values['lifePerKill']
|
41
|
+
self.gold_find = values['goldFind']
|
42
|
+
self.magic_find = values['magicFind']
|
43
|
+
self.life_on_hit = values['lifeOnHit']
|
44
|
+
self.primary_resource = values['primaryResource']
|
45
|
+
self.secondary_resource = values['secondaryResource']
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
File without changes
|
File without changes
|
data/lib/d3api/version.rb
CHANGED
@@ -1,21 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe D3api::EquippedItemSet do
|
4
|
-
subject { D3api::EquippedItemSet.new(
|
5
|
-
{'head' =>
|
6
|
-
{'id' => 'Helm_104',
|
7
|
-
'name' => 'Abyssal Visage',
|
8
|
-
'icon' => 'helm_104_barbarian_male',
|
9
|
-
'displayColor' => 'yellow',
|
10
|
-
'tooltipParams' => 'item/Cj4Ite7E6QkSBwgEFTr1Tl0d0pJdSR0wjxxFHb1b6EgdhgJj6iILCAAVy_4BABgKICAwDTjIA0AASAtQDGD_Axj01PfUC1ACWAA'},
|
11
|
-
'torso'=>
|
12
|
-
{'id' => 'ChestArmor_102',
|
13
|
-
'name' => 'Cleansing Mail',
|
14
|
-
'icon' => 'chestarmor_102_barbarian_male',
|
15
|
-
'displayColor' => 'yellow',
|
16
|
-
'tooltipParams' => 'item/CowBCNvS4ewCEgcIBBXqHRlgHRrEUXQdt8Ji6h2eI7xIHQRFP-IiCwgAFcf-AQAYFCAeMAk43AJAAEgGUAxg_QNqJQoMCAAQ5_mb84CAgIA7EhUIm7'}
|
17
|
-
}
|
18
|
-
)}
|
4
|
+
subject { D3api::EquippedItemSet.new( YAML.load_file( './spec/fixtures/equipped_item_set.yml' )['equippedItemSet'] ) }
|
19
5
|
|
20
6
|
context '#set_method' do
|
21
7
|
its(:item_set) { should be_kind_of(Array) }
|
@@ -1,15 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe D3api::EquippedItem do
|
4
|
-
subject { D3api::EquippedItem.new(
|
5
|
-
[ 'head', {'id' => 'Helm_104',
|
6
|
-
'name' => 'Abyssal Visage',
|
7
|
-
'icon' => 'helm_104_barbarian_male',
|
8
|
-
'displayColor' => 'yellow',
|
9
|
-
'tooltipParams' =>
|
10
|
-
'item/Cj4Ite7E6QkSBwgEFTr1Tl0d0pJdSR0wjxxFHb1b6EgdhgJj6iILCAAVy_4BABgKICAwDTjIA0AASAtQDGD_Axj01PfUC1ACWAA' }
|
11
|
-
]
|
12
|
-
) }
|
4
|
+
subject { D3api::EquippedItem.new( YAML.load_file( './spec/fixtures/equipped_item.yml' ) ) }
|
13
5
|
|
14
6
|
context '#set_method' do
|
15
7
|
its(:location) { should eql 'head' }
|
data/spec/d3api/follower_spec.rb
CHANGED
@@ -1,39 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe D3api::HeroFollowerSet do
|
4
|
-
subject { D3api::HeroFollowerSet.new(
|
5
|
-
{'templar'=>
|
6
|
-
{'slug' => 'templar',
|
7
|
-
'level' => 8,
|
8
|
-
'items' =>
|
9
|
-
{'mainHand' =>
|
10
|
-
{'id' => 'Spear_001',
|
11
|
-
'name' => 'Javelin',
|
12
|
-
'icon' => 'spear_001_demonhunter_male',
|
13
|
-
'displayColor' => 'white',
|
14
|
-
'tooltipParams' => 'item/ChkI6MLF7A4SBwgEFQsX9vkwCTiqA0AAYKoDGOmjz2A'},
|
15
|
-
'offHand'=>
|
16
|
-
{'id' => 'Shield_001',
|
17
|
-
'name' => 'Buckler',
|
18
|
-
'icon' => 'shield_001_demonhunter_male',
|
19
|
-
'displayColor' => 'white',
|
20
|
-
'tooltipParams' => 'item/ChkIsIumtgkSBwgEFYkDO2wwCTjmBEAAYOYEGJKO2MMN'}},
|
21
|
-
'stats' => {'goldFind' => 0, 'magicFind' => 0, 'experienceBonus' => 0},
|
22
|
-
'skills'=>
|
23
|
-
[{'skill'=>
|
24
|
-
{'slug'=> 'heal',
|
25
|
-
'name' => 'Heal',
|
26
|
-
'icon' => 'templar_heal_110',
|
27
|
-
'level' => 5,
|
28
|
-
'tooltipUrl' => 'skill/templar/heal',
|
29
|
-
'description' => 'Heals you and the Templar for 4651 Life.\r\n\r\nCooldown: 30 seconds',
|
30
|
-
'simpleDescription' => 'Heals you and the Templar.',
|
31
|
-
'skillCalcId' => 'a'}},
|
32
|
-
{},
|
33
|
-
{},
|
34
|
-
{}]}}
|
35
|
-
)
|
36
|
-
}
|
4
|
+
subject { D3api::HeroFollowerSet.new( YAML.load_file( './spec/fixtures/hero_follower_set.yml' ) ) }
|
37
5
|
|
38
6
|
context '#set_method' do
|
39
7
|
its(:follower_set) { should be_kind_of(Array) }
|
@@ -1,38 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe D3api::HeroFollower do
|
4
|
-
subject { D3api::HeroFollower.new('templar',
|
5
|
-
{'slug' => 'templar',
|
6
|
-
'level' => 8,
|
7
|
-
'items'=>
|
8
|
-
{'mainHand' =>
|
9
|
-
{'id' => 'Spear_001',
|
10
|
-
'name' => 'Javelin',
|
11
|
-
'icon' => 'spear_001_demonhunter_male',
|
12
|
-
'displayColor' => 'white',
|
13
|
-
'tooltipParams' => 'item/ChkI6MLF7A4SBwgEFQsX9vkwCTiqA0AAYKoDGOmjz2A'},
|
14
|
-
'offHand'=>
|
15
|
-
{'id' => 'Shield_001',
|
16
|
-
'name' => 'Buckler',
|
17
|
-
'icon' => 'shield_001_demonhunter_male',
|
18
|
-
'displayColor' => 'white',
|
19
|
-
'tooltipParams' => 'item/ChkIsIumtgkSBwgEFYkDO2wwCTjmBEAAYOYEGJKO2MMN'}},
|
20
|
-
'stats'=>{'goldFind' => 0, 'magicFind' => 0, 'experienceBonus' => 0},
|
21
|
-
'skills'=>
|
22
|
-
[{'skill'=>
|
23
|
-
{'slug' => 'heal',
|
24
|
-
'name' => 'Heal',
|
25
|
-
'icon' => 'templar_heal_110',
|
26
|
-
'level' => 5,
|
27
|
-
'tooltipUrl' => 'skill/templar/heal',
|
28
|
-
'description' => 'Heals you and the Templar for 4651 Life.\r\n\r\nCooldown: 30 seconds',
|
29
|
-
'simpleDescription' => 'Heals you and the Templar.',
|
30
|
-
'skillCalcId' => 'a'}},
|
31
|
-
{},
|
32
|
-
{},
|
33
|
-
{}]}
|
34
|
-
)
|
35
|
-
}
|
4
|
+
subject { D3api::HeroFollower.new( 'templar', YAML.load_file( './spec/fixtures/hero_follower.yml' ) ) }
|
36
5
|
|
37
6
|
context '#set_method' do
|
38
7
|
its(:follower_type) { should eql 'templar' }
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe D3api::HeroStats do
|
4
|
+
subject { D3api::HeroStats.new( YAML.load_file( './spec/fixtures/stats.yml')['heroStats'] ) }
|
5
|
+
|
6
|
+
context '#set_method' do
|
7
|
+
its(:life) { should eql 11161 }
|
8
|
+
its(:damage) { should eql 577.381 }
|
9
|
+
its(:attack_speed) { should eql 1.545 }
|
10
|
+
its(:armor) { should eql 2116 }
|
11
|
+
its(:strength) { should eql 595 }
|
12
|
+
its(:dexterity) { should eql 330 }
|
13
|
+
its(:vitality) { should eql 531 }
|
14
|
+
its(:intelligence) { should eql 399 }
|
15
|
+
its(:physical_resist) { should eql 71 }
|
16
|
+
its(:fire_resist) { should eql 51 }
|
17
|
+
its(:cold_resist) { should eql 36 }
|
18
|
+
its(:lightning_resist) { should eql 51 }
|
19
|
+
its(:poison_resist) { should eql 64 }
|
20
|
+
its(:arcane_resist) { should eql 49 }
|
21
|
+
its(:crit_damage) { should eql 1.63 }
|
22
|
+
its(:block_chance) { should eql 0.12 }
|
23
|
+
its(:block_amount_min) { should eql 180 }
|
24
|
+
its(:block_amount_max) { should eql 297 }
|
25
|
+
its(:damage_increase) { should eql 5.949999809265137 }
|
26
|
+
its(:crit_chance) { should eql 0.07000000029802322 }
|
27
|
+
its(:damage_reduction) { should eql 0.4846540093421936 }
|
28
|
+
its(:thorns) { should eql 20.0 }
|
29
|
+
its(:life_steal) { should eql 0.0 }
|
30
|
+
its(:life_per_kill) { should eql 0.0 }
|
31
|
+
its(:gold_find) { should eql 0.0 }
|
32
|
+
its(:magic_find) { should eql 0.25 }
|
33
|
+
its(:life_on_hit) { should eql 0.0 }
|
34
|
+
its(:primary_resource) { should eql 100 }
|
35
|
+
its(:secondary_resource) { should eql 0 }
|
36
|
+
end
|
37
|
+
end
|
data/spec/d3api/skills_spec.rb
CHANGED
@@ -1,28 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe D3api::Skill do
|
4
|
-
subject { D3api::Skill.new('active',
|
5
|
-
{'slug' => 'cleave',
|
6
|
-
'name' => 'Cleave',
|
7
|
-
'icon' => 'barbarian_cleave',
|
8
|
-
'level' => 3,
|
9
|
-
'categorySlug' => 'primary',
|
10
|
-
'tooltipUrl' => 'skill/barbarian/cleave',
|
11
|
-
'description' => 'Generate: 5 Fury per attack\r\n\r\nSwing your weapon in a wide arc to deal 140% weapon damage to all enemies caught in the swing.',
|
12
|
-
'simpleDescription' => 'Generate: 5 Fury per attack\r\n\r\nSwing your weapon in an arc and strike multiple enemies.',
|
13
|
-
'skillCalcId' => 'b'},
|
14
|
-
'rune'=>
|
15
|
-
{'slug' => 'cleave-c',
|
16
|
-
'type' => 'c',
|
17
|
-
'name' => 'Scattering Blast',
|
18
|
-
'level' => 30,
|
19
|
-
'description' => 'On Critical Hits, knock enemies back 9 yards and inflict 60% weapon damage to enemies where they land.',
|
20
|
-
'simpleDescription' => 'Critical Hits cause Knockback, and enemies deal additional damage where they land.',
|
21
|
-
'tooltipParams' => 'rune/cleave/c',
|
22
|
-
'skillCalcId' => 'b',
|
23
|
-
'order' => 2}}
|
24
|
-
)
|
25
|
-
}
|
4
|
+
subject { D3api::Skill.new('active', YAML.load_file( './spec/fixtures/hero_skill.yml' ) ) }
|
26
5
|
|
27
6
|
context '#set_method' do
|
28
7
|
its(:skill_type) { should eql 'active' }
|
@@ -30,13 +9,13 @@ describe D3api::Skill do
|
|
30
9
|
its(:skill_name) { should eql 'Cleave' }
|
31
10
|
its(:skill_icon) { should eql 'barbarian_cleave' }
|
32
11
|
its(:skill_tooltip_url) { should eql 'skill/barbarian/cleave' }
|
33
|
-
its(:skill_description) { should eql 'Generate: 5 Fury per attack
|
34
|
-
its(:skill_simple_description) { should eql 'Generate: 5 Fury per attack
|
12
|
+
its(:skill_description) { should eql 'Generate: 5 Fury per attack\\\\r\\\\n\\\\r\\\\nSwing your weapon in a wide arc\\n to deal 140% weapon damage to all enemies caught in the swing.' }
|
13
|
+
its(:skill_simple_description) { should eql 'Generate: 5 Fury per attack\\\\r\\\\n\\\\r\\\\nSwing your weapon in an\\n arc and strike multiple enemies.' }
|
35
14
|
its(:rune_slug) { should eql 'cleave-c' }
|
36
15
|
its(:rune_type) { should eql 'c' }
|
37
16
|
its(:rune_name) { should eql 'Scattering Blast' }
|
38
|
-
its(:rune_description) { should eql 'On Critical Hits, knock enemies back 9 yards and inflict 60% weapon
|
39
|
-
its(:rune_simple_description) { should eql 'Critical Hits cause Knockback, and enemies deal additional damage
|
17
|
+
its(:rune_description) { should eql 'On Critical Hits, knock enemies back 9 yards and inflict 60% weapon\\n damage to enemies where they land.' }
|
18
|
+
its(:rune_simple_description) { should eql 'Critical Hits cause Knockback, and enemies deal additional damage\\n where they land.' }
|
40
19
|
its(:rune_tooltip_params) { should eql 'rune/cleave/c' }
|
41
20
|
its(:rune_order) { should eql 2 }
|
42
21
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
equippedItemSet:
|
2
|
+
head:
|
3
|
+
id: 'Helm_104'
|
4
|
+
name: 'Abyssal Visage'
|
5
|
+
icon: 'helm_104_barbarian_male'
|
6
|
+
displayColor: 'yellow'
|
7
|
+
tooltipParams: 'item/Cj4Ite7E6QkSBwgEFTr1Tl0d0pJdSR0wjxxFHb1b6EgdhgJj6iILCAAVy_4BABgKICAwDTjIA0AASAtQDGD_Axj01PfUC1ACWAA'
|
8
|
+
torso:
|
9
|
+
id: 'ChestArmor_102'
|
10
|
+
name: 'Cleansing Mail'
|
11
|
+
icon: 'chestarmor_102_barbarian_male'
|
12
|
+
displayColor: 'yellow'
|
13
|
+
tooltipParams: 'item/CowBCNvS4ewCEgcIBBXqHRlgHRrEUXQdt8Ji6h2eI7xIHQRFP-IiCwgAFcf-AQAYFCAeMAk43AJAAEgGUAxg_QNqJQoMCAAQ5_mb84CAgIA7EhUIm7'
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
slug: templar
|
3
|
+
level: 8
|
4
|
+
items:
|
5
|
+
mainHand:
|
6
|
+
id: Spear_001
|
7
|
+
name: Javelin
|
8
|
+
icon: spear_001_demonhunter_male
|
9
|
+
displayColor: white
|
10
|
+
tooltipParams: item/ChkI6MLF7A4SBwgEFQsX9vkwCTiqA0AAYKoDGOmjz2A
|
11
|
+
offHand:
|
12
|
+
id: Shield_001
|
13
|
+
name: Buckler
|
14
|
+
icon: shield_001_demonhunter_male
|
15
|
+
displayColor: white
|
16
|
+
tooltipParams: item/ChkIsIumtgkSBwgEFYkDO2wwCTjmBEAAYOYEGJKO2MMN
|
17
|
+
stats:
|
18
|
+
goldFind: 0
|
19
|
+
magicFind: 0
|
20
|
+
experienceBonus: 0
|
21
|
+
skills:
|
22
|
+
- skill:
|
23
|
+
slug: heal
|
24
|
+
name: Heal
|
25
|
+
icon: templar_heal_110
|
26
|
+
level: 5
|
27
|
+
tooltipUrl: skill/templar/heal
|
28
|
+
description: ! 'Heals you and the Templar for 4651 Life.\\r\\n\\r\\nCooldown: 30 seconds'
|
29
|
+
simpleDescription: Heals you and the Templar.
|
30
|
+
skillCalcId: a
|
31
|
+
- {}
|
32
|
+
- {}
|
33
|
+
- {}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
templar:
|
3
|
+
slug: templar
|
4
|
+
level: 8
|
5
|
+
items:
|
6
|
+
mainHand:
|
7
|
+
id: Spear_001
|
8
|
+
name: Javelin
|
9
|
+
icon: spear_001_demonhunter_male
|
10
|
+
displayColor: white
|
11
|
+
tooltipParams: item/ChkI6MLF7A4SBwgEFQsX9vkwCTiqA0AAYKoDGOmjz2A
|
12
|
+
offHand:
|
13
|
+
id: Shield_001
|
14
|
+
name: Buckler
|
15
|
+
icon: shield_001_demonhunter_male
|
16
|
+
displayColor: white
|
17
|
+
tooltipParams: item/ChkIsIumtgkSBwgEFYkDO2wwCTjmBEAAYOYEGJKO2MMN
|
18
|
+
stats:
|
19
|
+
goldFind: 0
|
20
|
+
magicFind: 0
|
21
|
+
experienceBonus: 0
|
22
|
+
skills:
|
23
|
+
- skill:
|
24
|
+
slug: heal
|
25
|
+
name: Heal
|
26
|
+
icon: templar_heal_110
|
27
|
+
level: 5
|
28
|
+
tooltipUrl: skill/templar/heal
|
29
|
+
description: ! 'Heals you and the Templar for 4651 Life.\\r\\n\\r\\nCooldown: 30\n seconds'
|
30
|
+
simpleDescription: Heals you and the Templar.
|
31
|
+
skillCalcId: a
|
32
|
+
- {}
|
33
|
+
- {}
|
34
|
+
- {}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
skill:
|
3
|
+
slug: cleave
|
4
|
+
name: Cleave
|
5
|
+
icon: barbarian_cleave
|
6
|
+
level: 3
|
7
|
+
categorySlug: primary
|
8
|
+
tooltipUrl: skill/barbarian/cleave
|
9
|
+
description: ! 'Generate: 5 Fury per attack\\r\\n\\r\\nSwing your weapon in a wide arc\n to deal 140% weapon damage to all enemies caught in the swing.'
|
10
|
+
simpleDescription: ! 'Generate: 5 Fury per attack\\r\\n\\r\\nSwing your weapon in an\n arc and strike multiple enemies.'
|
11
|
+
skillCalcId: b
|
12
|
+
rune:
|
13
|
+
slug: cleave-c
|
14
|
+
type: c
|
15
|
+
name: Scattering Blast
|
16
|
+
level: 30
|
17
|
+
description: On Critical Hits, knock enemies back 9 yards and inflict 60% weapon\n damage to enemies where they land.
|
18
|
+
simpleDescription: Critical Hits cause Knockback, and enemies deal additional damage\n where they land.
|
19
|
+
tooltipParams: rune/cleave/c
|
20
|
+
skillCalcId: b
|
21
|
+
order: 2
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
- skill:
|
3
|
+
slug: cleave
|
4
|
+
name: Cleave
|
5
|
+
icon: barbarian_cleave
|
6
|
+
level: 3
|
7
|
+
categorySlug: primary
|
8
|
+
tooltipUrl: skill/barbarian/cleave
|
9
|
+
description: ! 'Generate: 5 Fury per attack\\r\\n\\r\\nSwing your weapon in a wide\n arc to deal 140% weapon damage to all enemies caught in the swing.'
|
10
|
+
simpleDescription: ! 'Generate: 5 Fury per attack\\r\\n\\r\\nSwing your weapon in\n an arc and strike multiple enemies.'
|
11
|
+
skillCalcId: b
|
12
|
+
rune:
|
13
|
+
slug: cleave-c
|
14
|
+
type: c
|
15
|
+
name: Scattering Blast
|
16
|
+
level: 30
|
17
|
+
description: 'On Critical Hits, knock enemies back 9 yards and inflict 60% weapon\n damage to enemies where they land.'
|
18
|
+
simpleDescription: 'Critical Hits cause Knockback, and enemies deal additional\n damage where they land.'
|
19
|
+
tooltipParams: rune/cleave/c
|
20
|
+
skillCalcId: b
|
21
|
+
order: 2
|
@@ -0,0 +1,30 @@
|
|
1
|
+
heroStats:
|
2
|
+
life: 11161
|
3
|
+
damage: 577.381
|
4
|
+
attackSpeed: 1.545
|
5
|
+
armor: 2116
|
6
|
+
strength: 595
|
7
|
+
dexterity: 330
|
8
|
+
vitality: 531
|
9
|
+
intelligence: 399
|
10
|
+
physicalResist: 71
|
11
|
+
fireResist: 51
|
12
|
+
coldResist: 36
|
13
|
+
lightningResist: 51
|
14
|
+
poisonResist: 64
|
15
|
+
arcaneResist: 49
|
16
|
+
critDamage: 1.63
|
17
|
+
blockChance: 0.12
|
18
|
+
blockAmountMin: 180
|
19
|
+
blockAmountMax: 297
|
20
|
+
damageIncrease: 5.949999809265137
|
21
|
+
critChance: 0.07000000029802322
|
22
|
+
damageReduction: 0.4846540093421936
|
23
|
+
thorns: 20.0
|
24
|
+
lifeSteal: 0.0
|
25
|
+
lifePerKill: 0.0
|
26
|
+
goldFind: 0.0
|
27
|
+
magicFind: 0.25
|
28
|
+
lifeOnHit: 0.0
|
29
|
+
primaryResource: 100
|
30
|
+
secondaryResource: 0
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: d3api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -137,43 +137,25 @@ files:
|
|
137
137
|
- README.md
|
138
138
|
- Rakefile
|
139
139
|
- d3api.gemspec
|
140
|
-
- lib/.DS_Store
|
141
140
|
- lib/d3api.rb
|
142
|
-
- lib/d3api/.DS_Store
|
143
141
|
- lib/d3api/artisan.rb
|
144
142
|
- lib/d3api/base_model.rb
|
145
143
|
- lib/d3api/career.rb
|
146
144
|
- lib/d3api/configuration.rb
|
147
145
|
- lib/d3api/connection.rb
|
148
|
-
- lib/d3api/equipped_item.rb
|
149
|
-
- lib/d3api/equipped_item_set.rb
|
150
146
|
- lib/d3api/follower.rb
|
151
147
|
- lib/d3api/hero.rb
|
152
|
-
- lib/d3api/
|
153
|
-
- lib/d3api/
|
154
|
-
- lib/d3api/
|
155
|
-
- lib/d3api/
|
148
|
+
- lib/d3api/hero/follower.rb
|
149
|
+
- lib/d3api/hero/follower_set.rb
|
150
|
+
- lib/d3api/hero/set.rb
|
151
|
+
- lib/d3api/hero/skill_set.rb
|
152
|
+
- lib/d3api/hero/stats.rb
|
156
153
|
- lib/d3api/item.rb
|
154
|
+
- lib/d3api/item/equipped_item.rb
|
155
|
+
- lib/d3api/item/equipped_item_set.rb
|
157
156
|
- lib/d3api/request.rb
|
158
157
|
- lib/d3api/skill.rb
|
159
158
|
- lib/d3api/version.rb
|
160
|
-
- spec/.DS_Store
|
161
|
-
- spec/cassettes/D3api_Artisan.yml
|
162
|
-
- spec/cassettes/D3api_Artisan_new.yml
|
163
|
-
- spec/cassettes/D3api_Artisan_top_level_hash_methods_from_BaseModel.yml
|
164
|
-
- spec/cassettes/D3api_Career.yml
|
165
|
-
- spec/cassettes/D3api_Career_new.yml
|
166
|
-
- spec/cassettes/D3api_Career_top_level_hash_methods_from_BaseModel.yml
|
167
|
-
- spec/cassettes/D3api_Follower.yml
|
168
|
-
- spec/cassettes/D3api_Follower_new.yml
|
169
|
-
- spec/cassettes/D3api_Follower_top_level_hash_to_methods.yml
|
170
|
-
- spec/cassettes/D3api_Hero.yml
|
171
|
-
- spec/cassettes/D3api_Hero_new.yml
|
172
|
-
- spec/cassettes/D3api_Hero_top_level_hash_to_methods.yml
|
173
|
-
- spec/cassettes/D3api_Item.yml
|
174
|
-
- spec/cassettes/D3api_Item_new.yml
|
175
|
-
- spec/cassettes/D3api_Item_top_level_hash_to_methods.yml
|
176
|
-
- spec/d3api/.DS_Store
|
177
159
|
- spec/d3api/artisan_spec.rb
|
178
160
|
- spec/d3api/career_spec.rb
|
179
161
|
- spec/d3api/equipped_item_set_spec.rb
|
@@ -182,10 +164,18 @@ files:
|
|
182
164
|
- spec/d3api/hero_follower_set_spec.rb
|
183
165
|
- spec/d3api/hero_follower_spec.rb
|
184
166
|
- spec/d3api/hero_set_spec.rb
|
185
|
-
- spec/d3api/
|
167
|
+
- spec/d3api/hero_skill_set_spec.rb
|
186
168
|
- spec/d3api/hero_spec.rb
|
169
|
+
- spec/d3api/hero_stats_spec.rb
|
187
170
|
- spec/d3api/item_spec.rb
|
188
171
|
- spec/d3api/skills_spec.rb
|
172
|
+
- spec/fixtures/equipped_item.yml
|
173
|
+
- spec/fixtures/equipped_item_set.yml
|
174
|
+
- spec/fixtures/hero_follower.yml
|
175
|
+
- spec/fixtures/hero_follower_set.yml
|
176
|
+
- spec/fixtures/hero_skill.yml
|
177
|
+
- spec/fixtures/hero_skill_set.yml
|
178
|
+
- spec/fixtures/stats.yml
|
189
179
|
- spec/spec_helper.rb
|
190
180
|
homepage: https://github.com/phereford/d3api
|
191
181
|
licenses: []
|
@@ -201,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
191
|
version: '0'
|
202
192
|
segments:
|
203
193
|
- 0
|
204
|
-
hash: -
|
194
|
+
hash: -2997824699744414621
|
205
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
196
|
none: false
|
207
197
|
requirements:
|
@@ -210,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
200
|
version: '0'
|
211
201
|
segments:
|
212
202
|
- 0
|
213
|
-
hash: -
|
203
|
+
hash: -2997824699744414621
|
214
204
|
requirements: []
|
215
205
|
rubyforge_project:
|
216
206
|
rubygems_version: 1.8.24
|
@@ -218,23 +208,6 @@ signing_key:
|
|
218
208
|
specification_version: 3
|
219
209
|
summary: Blizzard's Diablo 3 API
|
220
210
|
test_files:
|
221
|
-
- spec/.DS_Store
|
222
|
-
- spec/cassettes/D3api_Artisan.yml
|
223
|
-
- spec/cassettes/D3api_Artisan_new.yml
|
224
|
-
- spec/cassettes/D3api_Artisan_top_level_hash_methods_from_BaseModel.yml
|
225
|
-
- spec/cassettes/D3api_Career.yml
|
226
|
-
- spec/cassettes/D3api_Career_new.yml
|
227
|
-
- spec/cassettes/D3api_Career_top_level_hash_methods_from_BaseModel.yml
|
228
|
-
- spec/cassettes/D3api_Follower.yml
|
229
|
-
- spec/cassettes/D3api_Follower_new.yml
|
230
|
-
- spec/cassettes/D3api_Follower_top_level_hash_to_methods.yml
|
231
|
-
- spec/cassettes/D3api_Hero.yml
|
232
|
-
- spec/cassettes/D3api_Hero_new.yml
|
233
|
-
- spec/cassettes/D3api_Hero_top_level_hash_to_methods.yml
|
234
|
-
- spec/cassettes/D3api_Item.yml
|
235
|
-
- spec/cassettes/D3api_Item_new.yml
|
236
|
-
- spec/cassettes/D3api_Item_top_level_hash_to_methods.yml
|
237
|
-
- spec/d3api/.DS_Store
|
238
211
|
- spec/d3api/artisan_spec.rb
|
239
212
|
- spec/d3api/career_spec.rb
|
240
213
|
- spec/d3api/equipped_item_set_spec.rb
|
@@ -243,8 +216,16 @@ test_files:
|
|
243
216
|
- spec/d3api/hero_follower_set_spec.rb
|
244
217
|
- spec/d3api/hero_follower_spec.rb
|
245
218
|
- spec/d3api/hero_set_spec.rb
|
246
|
-
- spec/d3api/
|
219
|
+
- spec/d3api/hero_skill_set_spec.rb
|
247
220
|
- spec/d3api/hero_spec.rb
|
221
|
+
- spec/d3api/hero_stats_spec.rb
|
248
222
|
- spec/d3api/item_spec.rb
|
249
223
|
- spec/d3api/skills_spec.rb
|
224
|
+
- spec/fixtures/equipped_item.yml
|
225
|
+
- spec/fixtures/equipped_item_set.yml
|
226
|
+
- spec/fixtures/hero_follower.yml
|
227
|
+
- spec/fixtures/hero_follower_set.yml
|
228
|
+
- spec/fixtures/hero_skill.yml
|
229
|
+
- spec/fixtures/hero_skill_set.yml
|
230
|
+
- spec/fixtures/stats.yml
|
250
231
|
- spec/spec_helper.rb
|
data/lib/.DS_Store
DELETED
Binary file
|
data/lib/d3api/.DS_Store
DELETED
Binary file
|
data/spec/.DS_Store
DELETED
Binary file
|
data/spec/d3api/.DS_Store
DELETED
Binary file
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe D3api::HeroSkills do
|
4
|
-
subject { D3api::HeroSkills.new('active', [{'skill' =>
|
5
|
-
{'slug' => 'cleave',
|
6
|
-
'name' => 'Cleave',
|
7
|
-
'icon' => 'barbarian_cleave',
|
8
|
-
'level' => 3,
|
9
|
-
'categorySlug' => 'primary',
|
10
|
-
'tooltipUrl' => 'skill/barbarian/cleave',
|
11
|
-
'description' => 'Generate: 5 Fury per attack\r\n\r\nSwing your weapon in a wide arc to deal 140% weapon damage to all enemies caught in the swing.',
|
12
|
-
'simpleDescription' => 'Generate: 5 Fury per attack\r\n\r\nSwing your weapon in an arc and strike multiple enemies.',
|
13
|
-
'skillCalcId' => 'b'},
|
14
|
-
'rune'=>
|
15
|
-
{'slug' => 'cleave-c',
|
16
|
-
'type' => 'c',
|
17
|
-
'name' => 'Scattering Blast',
|
18
|
-
'level' => 30,
|
19
|
-
'description' => 'On Critical Hits, knock enemies back 9 yards and inflict 60% weapon damage to enemies where they land.',
|
20
|
-
'simpleDescription' => 'Critical Hits cause Knockback, and enemies deal additional damage where they land.',
|
21
|
-
'tooltipParams' => 'rune/cleave/c',
|
22
|
-
'skillCalcId' => 'b',
|
23
|
-
'order' => 2}}]
|
24
|
-
)
|
25
|
-
}
|
26
|
-
|
27
|
-
context '#set_method' do
|
28
|
-
its(:skill_set) { should be_kind_of(Array) }
|
29
|
-
end
|
30
|
-
end
|