d1lcs 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -3
- data/lib/d1lcs/element.rb +41 -12
- data/lib/d1lcs/version.rb +1 -1
- data/lib/d1lcs.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ff396cdb40a2e945e4cec628228b2177522112d
|
4
|
+
data.tar.gz: 9973ddb26cc17116610c64cb6b3ef0b544ce9732
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc1a6bceb5bc02075aaf6dd4825cd39ee7c4b71d659178d829e1194d2fa80b21478acdbe825afb367ec30ebf835a9dd144f82ebcd076d0d3ea9a7105d6d1aac3
|
7
|
+
data.tar.gz: 57dd8098387c3a0e74acace3d37f329219de49e1eccc5477fa339fe645782c6e784a7df6164092d382588cb7e4fc7b3a4c1c4032b592bbb014cb20dafe252409
|
data/Rakefile
CHANGED
data/lib/d1lcs/element.rb
CHANGED
@@ -36,20 +36,22 @@ module D1lcs
|
|
36
36
|
return
|
37
37
|
end
|
38
38
|
|
39
|
-
@
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
@formatted = [pcname,
|
40
|
+
level,
|
41
|
+
hpmp,
|
42
|
+
classes,
|
43
|
+
position_skill,
|
44
|
+
skills,
|
45
|
+
timing_janre,
|
46
|
+
charaID,
|
47
|
+
plname
|
48
|
+
].flatten
|
47
49
|
end
|
48
50
|
|
49
51
|
# 1行キャラクターシートを出力する
|
50
52
|
# @return [String]
|
51
53
|
def chara_sheet_line
|
52
|
-
|
54
|
+
@formatted.clone.fill(nil, 6..6).compact.join('|')
|
53
55
|
end
|
54
56
|
alias :print :chara_sheet_line
|
55
57
|
alias :to_s :chara_sheet_line
|
@@ -90,15 +92,31 @@ module D1lcs
|
|
90
92
|
@chara_sheet['skill'].map { |array| array['name'].chars.first }.join
|
91
93
|
end
|
92
94
|
|
95
|
+
# ポジションスキル
|
96
|
+
# @return [String]/[nil]
|
97
|
+
def position_skill
|
98
|
+
if(@chara_sheet['position'])
|
99
|
+
positionID_short(@chara_sheet['position']['id'])
|
100
|
+
else
|
101
|
+
' '
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
93
105
|
# スキルタイミング・ジャンル
|
94
106
|
# @return [Array<String>] [timing, string] の順番
|
95
107
|
def timing_janre
|
96
|
-
timing = [0,
|
97
|
-
janre = Array.new(6, 0)
|
108
|
+
timing = [0, 1, 2, 0] # 常時, 対応, 行動, 誘発
|
109
|
+
janre = Array.new(6, 0) # 意志, 感覚, 交渉, 肉体, 技術, 知識
|
98
110
|
@chara_sheet['skill'].each { |skill|
|
99
|
-
timing[skill['timing'].to_i
|
111
|
+
timing[skill['timing'].to_i] += 1
|
100
112
|
janre[skill['janre'].to_i - 1] += 1
|
113
|
+
p skill['timing_name']
|
101
114
|
}
|
115
|
+
if(@chara_sheet['position'])
|
116
|
+
timing[@chara_sheet['position_skill']['timing'].to_i] += 1
|
117
|
+
janre[@chara_sheet['position_skill']['janre'].to_i - 1] += 1
|
118
|
+
end
|
119
|
+
p timing
|
102
120
|
[timing, janre].map { |array|
|
103
121
|
array.map { |value|
|
104
122
|
unify_dispsize2(value.to_s).tr('0', ' ')
|
@@ -175,5 +193,16 @@ module D1lcs
|
|
175
193
|
]
|
176
194
|
class_ids[class_id.to_i - 1]
|
177
195
|
end
|
196
|
+
|
197
|
+
# ポジションIDから全角2文字の短縮形に変換する
|
198
|
+
# @param [Fixnum] position_id JSONから読み込むことを考慮し文字列型
|
199
|
+
# @return [String]
|
200
|
+
def positionID_short(position_id)
|
201
|
+
position_ids = ['冒険', '凡人', '夢追', '神話', '負犬', '守護',
|
202
|
+
'悪党', 'カリ', '修羅', '遊人', '従者', '不明',
|
203
|
+
'迷子', '伝説', '罪人', '傷追', '型破', '裏住'
|
204
|
+
]
|
205
|
+
position_ids[position_id - 1]
|
206
|
+
end
|
178
207
|
end
|
179
208
|
end
|
data/lib/d1lcs/version.rb
CHANGED
data/lib/d1lcs.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: d1lcs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- koi-chan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|