d3_mpq 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -88,6 +88,7 @@ Example: d3_mpq --csv-input extracted_mpqs/StringList/ csv StringList
88
88
  * ItemTypes
89
89
  * Recipes
90
90
  * RecipeDetails
91
+ * SocketedEffects
91
92
  * StringList
92
93
 
93
94
  MESSAGE
@@ -8,30 +8,13 @@ module D3MPQ::CoreData::GameBalance
8
8
  :read_length => 0x100,
9
9
  :trim_padding => true
10
10
 
11
- uint32 :ref1
12
- uint32 :ref2
11
+ uint32 :item_hash # item_socketed
12
+ uint32 :item_type_hash # item_type_to_socket
13
13
 
14
14
  zeroes
15
- uint32 :ui1
16
- uint32 :ui1b
17
- zeroes :length => 2
18
- uint32 :ui2
19
- uint32 :ui3
20
- uint32 :ui3b
21
- uint32 :ui3c
22
- zeroes :length => 2
23
- uint32 :ui4
24
- uint32 :ui4b
25
- ffs :length => 2
26
- zeroes :length => 2
27
- uint32 :ui5
28
- zeroes
29
-
30
- # TODO
31
- skip :length => 48
32
-
15
+ mod_codes :mod_codes, :initial_length => 5
33
16
 
34
- string :name2,
17
+ string :nls_key,
35
18
  :read_length => 0x100,
36
19
  :trim_padding => true
37
20
 
@@ -0,0 +1,27 @@
1
+ module D3MPQ::CSVGenerator
2
+ class SocketedEffects < Base
3
+ MPQ_READER = D3MPQ::CoreData::GameBalance::SocketedEffects
4
+
5
+ map = {
6
+ :name => :name,
7
+ :hash => Proc.new { |subject| subject.name.to_d3_hash },
8
+ :item_hash => :item_hash,
9
+ :item_type_hash => :item_type_hash,
10
+ :nls_key => :nls_key
11
+ }
12
+
13
+ 5.times do |i|
14
+ m = "modcode#{i}"
15
+ map["#{m}_mod_id".intern] = Proc.new { |subject| subject.mod_codes[i].mod_code }
16
+ map["#{m}_param1".intern] = Proc.new { |subject| subject.mod_codes[i].mod_param1 }
17
+ map["#{m}_param2".intern] = Proc.new { |subject| subject.mod_codes[i].mod_param2 }
18
+ map["#{m}_param3".intern] = Proc.new { |subject| subject.mod_codes[i].mod_param3 }
19
+ map["#{m}_opcode".intern] = Proc.new { |subject| subject.mod_codes[i].trace.join("|") }
20
+ map["#{m}_value_min".intern] = Proc.new { |subject| subject.mod_codes[i].min }
21
+ map["#{m}_value_max".intern] = Proc.new { |subject| subject.mod_codes[i].max }
22
+ end
23
+
24
+ map_to_csv(map)
25
+ end
26
+ end
27
+
@@ -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/socketed_effects'
12
13
  require 'd3_mpq/csv_generator/string_list'
13
14
  end
14
15
  end
@@ -1,4 +1,4 @@
1
1
  module D3MPQ
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
4
4
 
@@ -1,4 +1,4 @@
1
1
  module D3MPQ
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.9"
3
3
  end
4
4
 
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3MPQ::CSVGenerator::SocketedEffects do
4
+ let(:dir) { "spec/fixtures/CoreData/GameBalance/SocketedEffects.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.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bindata
16
- requirement: &81675720 !ruby/object:Gem::Requirement
16
+ requirement: &77424910 !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: *81675720
24
+ version_requirements: *77424910
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &81675480 !ruby/object:Gem::Requirement
27
+ requirement: &77424470 !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: *81675480
35
+ version_requirements: *77424470
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &81675240 !ruby/object:Gem::Requirement
38
+ requirement: &77424130 !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: *81675240
46
+ version_requirements: *77424130
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: guard
49
- requirement: &81675010 !ruby/object:Gem::Requirement
49
+ requirement: &77423770 !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: *81675010
57
+ version_requirements: *77423770
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard-rspec
60
- requirement: &81674790 !ruby/object:Gem::Requirement
60
+ requirement: &77423380 !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: *81674790
68
+ version_requirements: *77423380
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: libnotify
71
- requirement: &81471020 !ruby/object:Gem::Requirement
71
+ requirement: &77423040 !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: *81471020
79
+ version_requirements: *77423040
80
80
  description: Parsing data out of Diablo 3.
81
81
  email:
82
82
  - deradon87@gmail.com
@@ -120,6 +120,7 @@ files:
120
120
  - lib/d3_mpq/csv_generator/item_types.rb
121
121
  - lib/d3_mpq/csv_generator/item_enhancements.rb
122
122
  - lib/d3_mpq/csv_generator/recipes.rb
123
+ - lib/d3_mpq/csv_generator/socketed_effects.rb
123
124
  - lib/d3_mpq/csv_generator/string_list.rb
124
125
  - lib/d3_mpq/csv_generator/base.rb
125
126
  - lib/d3_mpq/csv_generator/affix_list.rb
@@ -6922,6 +6923,7 @@ files:
6922
6923
  - spec/unit/string_list_spec.rb
6923
6924
  - spec/unit/csv_generator/recipes_spec.rb
6924
6925
  - spec/unit/csv_generator/affix_list_spec.rb
6926
+ - spec/unit/csv_generator/socketed_effects_spec.rb
6925
6927
  - spec/unit/csv_generator/item_types_spec.rb
6926
6928
  - spec/unit/csv_generator/recipe_details_spec.rb
6927
6929
  - spec/unit/csv_generator/string_list_spec.rb
@@ -13744,6 +13746,7 @@ test_files:
13744
13746
  - spec/unit/string_list_spec.rb
13745
13747
  - spec/unit/csv_generator/recipes_spec.rb
13746
13748
  - spec/unit/csv_generator/affix_list_spec.rb
13749
+ - spec/unit/csv_generator/socketed_effects_spec.rb
13747
13750
  - spec/unit/csv_generator/item_types_spec.rb
13748
13751
  - spec/unit/csv_generator/recipe_details_spec.rb
13749
13752
  - spec/unit/csv_generator/string_list_spec.rb