d3_mpq 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,6 +20,9 @@ module D3MPQ
20
20
  write_stringlist
21
21
  when "d3mpq_recipe"
22
22
  write_recipe
23
+ when "d3mpq_coredata_gamebalance_setitembonuses"
24
+ @field = nil
25
+ write_recipe
23
26
  when "d3mpq_attributes"
24
27
  write_single_file("analyze")
25
28
  when "d3mpq_coredata_actor"
@@ -88,6 +88,7 @@ Example: d3_mpq --csv-input extracted_mpqs/StringList/ csv StringList
88
88
  * ItemTypes
89
89
  * Recipes
90
90
  * RecipeDetails
91
+ * SetItemBonuses
91
92
  * SocketedEffects
92
93
  * StringList
93
94
 
@@ -8,13 +8,14 @@ module D3MPQ::CoreData::GameBalance
8
8
  :read_length => 0x100,
9
9
  :trim_padding => true
10
10
 
11
- skip :length => 0xD0 - 4
11
+ uint32 :parent_set_hash
12
+ uint32 :num_of_set
13
+
14
+ zeroes
15
+
16
+ mod_codes :mod_codes, :initial_length => 8
12
17
  end
13
18
 
14
- # # Rest
15
- # 194.times do |i|
16
- # float "fp#{i}".intern
17
- # end
18
19
  end
19
20
  end
20
21
 
@@ -0,0 +1,26 @@
1
+ module D3MPQ::CSVGenerator
2
+ class SetItemBonuses < Base
3
+ MPQ_READER = D3MPQ::CoreData::GameBalance::SetItemBonuses
4
+
5
+ map = {
6
+ :name => :name,
7
+ :hash => Proc.new { |subject| subject.name.to_d3_hash },
8
+ :parent_set_hash => :parent_set_hash,
9
+ :num_of_set => :num_of_set
10
+ }
11
+
12
+ 6.times do |i|
13
+ m = "modcode#{i}"
14
+ map["#{m}_mod_id".intern] = Proc.new { |subject| subject.mod_codes[i].mod_code }
15
+ map["#{m}_param1".intern] = Proc.new { |subject| subject.mod_codes[i].mod_param1 }
16
+ map["#{m}_param2".intern] = Proc.new { |subject| subject.mod_codes[i].mod_param2 }
17
+ map["#{m}_param3".intern] = Proc.new { |subject| subject.mod_codes[i].mod_param3 }
18
+ map["#{m}_opcode".intern] = Proc.new { |subject| subject.mod_codes[i].trace.join("|") }
19
+ map["#{m}_value_min".intern] = Proc.new { |subject| subject.mod_codes[i].min }
20
+ map["#{m}_value_max".intern] = Proc.new { |subject| subject.mod_codes[i].max }
21
+ end
22
+
23
+ map_to_csv(map)
24
+ end
25
+ end
26
+
@@ -9,6 +9,7 @@ module D3MPQ
9
9
  require 'd3_mpq/csv_generator/item_types'
10
10
  require 'd3_mpq/csv_generator/recipe_details'
11
11
  require 'd3_mpq/csv_generator/recipes'
12
+ require 'd3_mpq/csv_generator/set_item_bonuses'
12
13
  require 'd3_mpq/csv_generator/socketed_effects'
13
14
  require 'd3_mpq/csv_generator/string_list'
14
15
  end
@@ -1,4 +1,4 @@
1
1
  module D3MPQ
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
4
4
 
@@ -1,4 +1,4 @@
1
1
  module D3MPQ
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
4
4
 
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3MPQ::CSVGenerator::SetItemBonuses do
4
+ let(:dir) { "spec/fixtures/CoreData/GameBalance/SetItemBonuses.gam" }
5
+
6
+ specify "#write" do
7
+ subject.files = dir
8
+ subject.write
9
+ end
10
+ end
11
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d3_mpq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-12 00:00:00.000000000 Z
12
+ date: 2012-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bindata
16
- requirement: &77424910 !ruby/object:Gem::Requirement
16
+ requirement: &69007620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *77424910
24
+ version_requirements: *69007620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &77424470 !ruby/object:Gem::Requirement
27
+ requirement: &69007210 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *77424470
35
+ version_requirements: *69007210
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &77424130 !ruby/object:Gem::Requirement
38
+ requirement: &69006860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *77424130
46
+ version_requirements: *69006860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard
49
- requirement: &77423770 !ruby/object:Gem::Requirement
49
+ requirement: &69006500 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *77423770
57
+ version_requirements: *69006500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-rspec
60
- requirement: &77423380 !ruby/object:Gem::Requirement
60
+ requirement: &69006110 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *77423380
68
+ version_requirements: *69006110
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: libnotify
71
- requirement: &77423040 !ruby/object:Gem::Requirement
71
+ requirement: &69005780 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *77423040
79
+ version_requirements: *69005780
80
80
  description: Parsing data out of Diablo 3.
81
81
  email:
82
82
  - deradon87@gmail.com
@@ -124,6 +124,7 @@ files:
124
124
  - lib/d3_mpq/csv_generator/string_list.rb
125
125
  - lib/d3_mpq/csv_generator/base.rb
126
126
  - lib/d3_mpq/csv_generator/affix_list.rb
127
+ - lib/d3_mpq/csv_generator/set_item_bonuses.rb
127
128
  - lib/d3_mpq/csv_generator/actor.rb
128
129
  - lib/d3_mpq/csv_generator/recipe_details.rb
129
130
  - lib/d3_mpq/csv_generator/items.rb
@@ -6925,6 +6926,7 @@ files:
6925
6926
  - spec/unit/csv_generator/affix_list_spec.rb
6926
6927
  - spec/unit/csv_generator/socketed_effects_spec.rb
6927
6928
  - spec/unit/csv_generator/item_types_spec.rb
6929
+ - spec/unit/csv_generator/set_item_bonuses_spec.rb
6928
6930
  - spec/unit/csv_generator/recipe_details_spec.rb
6929
6931
  - spec/unit/csv_generator/string_list_spec.rb
6930
6932
  - spec/unit/csv_generator/item_spec.rb
@@ -13748,6 +13750,7 @@ test_files:
13748
13750
  - spec/unit/csv_generator/affix_list_spec.rb
13749
13751
  - spec/unit/csv_generator/socketed_effects_spec.rb
13750
13752
  - spec/unit/csv_generator/item_types_spec.rb
13753
+ - spec/unit/csv_generator/set_item_bonuses_spec.rb
13751
13754
  - spec/unit/csv_generator/recipe_details_spec.rb
13752
13755
  - spec/unit/csv_generator/string_list_spec.rb
13753
13756
  - spec/unit/csv_generator/item_spec.rb