Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-images-generator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-images-generator
Commits
e80a98ef
Commit
e80a98ef
authored
Apr 05, 2017
by
不如归去
Committed by
GitHub
Apr 05, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3 from IamIpanda/master
Merge Develop
parents
94fa2e2a
5640bc3f
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
71 additions
and
5 deletions
+71
-5
Global.rb
Global.rb
+5
-4
LanguageConstants.rb
LanguageConstants.rb
+2
-0
MSEConstants.rb
MSEConstants.rb
+5
-0
MSETranslator.rb
MSETranslator.rb
+10
-0
Test.rb
Test.rb
+9
-1
YgoCoreConstants.rb
YgoCoreConstants.rb
+3
-0
YgoCoreJudgers.rb
YgoCoreJudgers.rb
+25
-0
locales/en-US.yml
locales/en-US.yml
+3
-0
locales/ja-JP.yml
locales/ja-JP.yml
+3
-0
locales/zh-CN.yml
locales/zh-CN.yml
+3
-0
locales/zh-Classical.yml
locales/zh-Classical.yml
+3
-0
No files found.
Global.rb
View file @
e80a98ef
...
...
@@ -3,6 +3,7 @@
module
Global
class
<<
self
attr_accessor
:language
attr_accessor
:raw_image_path
attr_accessor
:git_path
attr_accessor
:git_uri
attr_accessor
:database_path
...
...
@@ -17,8 +18,8 @@ module Global
attr_accessor
:sql_fix_name
end
self
.
language
=
'zh-CN'
self
.
git_path
=
'pics
'
self
.
database_path
=
'ygopro-database'
self
.
raw_image_path
=
'ygopro-images-raw/pics/
'
self
.
database_path
=
'ygopro-database
/locales/
'
self
.
git_uri
=
'https://github.com/mycard/ygopro-images-raw.git'
self
.
database_name
=
'%s.cdb'
self
.
temp_database_name
=
"working-cards.cdb"
...
...
@@ -31,11 +32,11 @@ module Global
self
.
mse_set_path
=
"mse-sets"
module_function
def
full_database_path
return
File
.
join
self
.
database_path
,
sprintf
(
self
.
database_name
,
self
.
language
)
return
self
.
database_path
+
self
.
language
+
"/cards.cdb"
end
def
full_image_path
return
self
.
git
_path
return
self
.
raw_image
_path
end
def
full_answer_path
...
...
LanguageConstants.rb
View file @
e80a98ef
...
...
@@ -25,6 +25,8 @@ class LanguageConstants
attr_accessor
:term_cartoon
attr_accessor
:term_xyz
attr_accessor
:term_pendulum
attr_accessor
:term_link
attr_accessor
:term_spsummon
attr_accessor
:pendulum_effect_head
attr_accessor
:monster_effect_head
attr_accessor
:term_races
# 偷个鸡
...
...
MSEConstants.rb
View file @
e80a98ef
...
...
@@ -53,6 +53,7 @@ module MSEConstants
TagText
=
"rule text"
TagAtk
=
"attack"
TagDef
=
"defense"
TagLink
=
"link number"
TagNumber
=
"number"
TagRarity
=
"rarity"
TagPendulum
=
"pendulum"
...
...
@@ -103,6 +104,7 @@ module MSEConstants
Token
=
"token monster"
Token2
=
"token card"
Synchro
=
"synchro monster"
Link
=
"link monster"
Spell
=
"spell card"
Trap
=
"trap card"
Special
=
{
10000000
=>
"obelisk"
,
10000010
=>
"ra"
,
10000020
=>
"slifer"
}
...
...
@@ -110,4 +112,7 @@ module MSEConstants
SetFileName
=
"set"
SingleFileMaxCount
=
200
LinkMarkerHead
=
"Link Marker "
LinkMarks
=
[
"DL"
,
"Down"
,
"DR"
,
"Left"
,
""
,
"Right"
,
"UL"
,
"Up"
,
"UR"
]
end
MSETranslator.rb
View file @
e80a98ef
...
...
@@ -47,6 +47,11 @@ module MSETranslator
else
file
.
write
self
.
generate_text
MSEConstants
::
MSETags
::
TagText
,
YGOCoreJudgers
.
get_desc
(
card
)
end
# Link data
if
YGOCoreJudgers
.
is_link
card
file
.
write
self
.
generate_line
MSEConstants
::
MSETags
::
TagLink
,
YGOCoreJudgers
.
get_link
(
card
)
write_link_lines
file
,
card
end
file
.
write
self
.
generate_line
MSEConstants
::
MSETags
::
TagAtk
,
YGOCoreJudgers
.
get_attack
(
card
)
file
.
write
self
.
generate_line
MSEConstants
::
MSETags
::
TagDef
,
YGOCoreJudgers
.
get_defense
(
card
)
file
.
write
self
.
generate_line
MSEConstants
::
MSETags
::
TagCode
,
YGOCoreJudgers
.
get_id
(
card
).
to_s
...
...
@@ -63,6 +68,11 @@ module MSETranslator
file
.
write
self
.
generate_line
MSEConstants
::
MSETags
::
TagCode
,
YGOCoreJudgers
.
get_id
(
card
).
to_s
end
def
write_link_lines
(
file
,
card
)
markers
=
YGOCoreJudgers
.
get_link_marks
card
(
0
..
8
).
each
{
|
i
|
file
.
write
self
.
generate_line
MSEConstants
::
LinkMarkerHead
+
MSEConstants
::
LinkMarks
[
i
],
'yes'
if
markers
[
i
]
}
end
LineHead
=
"
\t
"
#" "
def
generate_line
(
key
,
word
)
"
#{
LineHead
}#{
key
}
:
#{
word
}
\n
"
...
...
Test.rb
View file @
e80a98ef
...
...
@@ -29,4 +29,12 @@ def unit_test_god
p
MSETranslator
.
split_effect
YGOCoreJudgers
.
get_desc
(
Sqlite
.
load
(
17390179
)[
0
])
end
unit_test_god
def
link_test
require
'./Commands.rb'
Commands
.
generate_all
end
def
god_test
require
'./Commands.rb'
MSETranslator
.
generate_mse
Sqlite
.
load
(
10000010
)
end
\ No newline at end of file
YgoCoreConstants.rb
View file @
e80a98ef
...
...
@@ -37,6 +37,7 @@ module YGOCoreConstants
Devine
=
0x200000
# 幻兽神
Creatorgod
=
0x400000
# 创世神
Wyrm
=
0x800000
# 幻龙
Cyverse
=
0x1000000
# 电子界
end
module
Rule
...
...
@@ -71,6 +72,8 @@ module YGOCoreConstants
Cartoon
=
0x400000
# 卡通
Xyz
=
0x800000
# Xyz
Pendulum
=
0x1000000
# 灵摆
SpSummon
=
0x2000000
# 特殊召唤
Link
=
0x4000000
# 连接
end
PendulumLeftMod
=
65536
...
...
YgoCoreJudgers.rb
View file @
e80a98ef
...
...
@@ -138,6 +138,14 @@ module YGOCoreJudgers
return
card
[
ColumnType
]
&
YGOCoreConstants
::
Type
::
Pendulum
!=
0
end
def
is_spsummon
(
card
)
return
card
[
ColumnType
]
&
YGOCoreConstants
::
Type
::
SpSummon
!=
0
end
def
is_link
(
card
)
return
card
[
ColumnType
]
&
YGOCoreConstants
::
Type
::
Link
!=
0
end
def
get_id
(
card
)
return
card
[
ColumnID
].
to_i
end
...
...
@@ -163,14 +171,27 @@ module YGOCoreJudgers
def
get_defense
(
card
)
value
=
card
[
ColumnDef
].
to_i
return
"?"
if
value
==
YGOCoreConstants
::
QuestionMark
return
""
if
self
.
is_link
card
value
end
def
get_link
(
card
)
return
""
unless
self
.
is_link
card
return
card
[
ColumnLevel
].
to_i
end
def
get_link_marks
(
card
)
value
=
card
[
ColumnDef
]
sprintf
(
"%09b"
,
value
).
scan
(
/\d/
).
reverse
.
map
{
|
s
|
s
==
'1'
}
end
def
get_level
(
card
)
return
0
if
self
.
is_link
card
return
card
[
ColumnLevel
].
to_i
%
YGOCoreConstants
::
PendulumLeftMod
end
def
get_monster_level_str
(
card
)
return
""
if
self
.
is_link
card
return
MSEConstants
::
MSESpellTrap
::
Level
*
self
.
get_level
(
card
)
end
...
...
@@ -309,6 +330,8 @@ module YGOCoreJudgers
return
MSEConstants
::
MSECardType
::
Fusion
elsif
self
.
is_sync
card
return
MSEConstants
::
MSECardType
::
Synchro
elsif
self
.
is_link
card
return
MSEConstants
::
MSECardType
::
Link
elsif
self
.
is_effect
card
return
MSEConstants
::
MSECardType
::
Effect
end
...
...
@@ -326,7 +349,9 @@ module YGOCoreJudgers
types
.
push
LanguageConstants
.
current
.
term_fusion
if
self
.
is_fusion
card
types
.
push
LanguageConstants
.
current
.
term_synchro
if
self
.
is_sync
card
types
.
push
LanguageConstants
.
current
.
term_pendulum
if
self
.
is_pendulum
card
types
.
push
LanguageConstants
.
current
.
term_link
if
self
.
is_link
card
# 子类别
types
.
push
LanguageConstants
.
current
.
term_spsummon
if
self
.
is_spsummon
card
types
.
push
LanguageConstants
.
current
.
term_spirit
if
self
.
is_spirit
card
types
.
push
LanguageConstants
.
current
.
term_union
if
self
.
is_union
card
types
.
push
LanguageConstants
.
current
.
term_dual
if
self
.
is_dual
card
...
...
locales/en-US.yml
View file @
e80a98ef
...
...
@@ -23,6 +23,8 @@ en-US:
cartoon
:
"
Cartoon"
xyz
:
"
Xyz"
pendulum
:
"
Pendulum"
spsummon
:
"
Special
Summon"
link
:
"
Link"
races
:
-
"
"
-
"
Warrior"
...
...
@@ -49,6 +51,7 @@ en-US:
-
"
Divine-Beast"
-
"
Creator
God"
-
"
Wyrm"
-
"
Cyverse"
pendulum_effect_head
:
!ruby/regexp
/Pendulum Scale\s*=\s*\d+\n*\[\s*Pendulum Effect\s*\]\n*(\-n\/a(\-)*)*/
monster_effect_head
:
!ruby/regexp
/\n*(-+?\n+)*\n*\[\s*(Monster Effect|Flavor Text)\s*\]\s*?\n/
mse_language
:
en
...
...
locales/ja-JP.yml
View file @
e80a98ef
...
...
@@ -23,6 +23,8 @@ ja-JP:
cartoon
:
"
トゥーン"
xyz
:
"
エクシーズ"
pendulum
:
"
ペンデュラム"
spsummon
:
"
特殊召唤"
link
:
"
リンク"
races
:
-
"
"
-
"
戦士族"
...
...
@@ -49,6 +51,7 @@ ja-JP:
-
"
幻神獣族"
-
"
創造神族"
-
"
幻竜族"
-
"
サイバース族"
pendulum_effect_head
:
!ruby/regexp
/【Pスケール:青(.*)/赤(.*)】(\n)*/
monster_effect_head
:
!ruby/regexp
/(\n)*(【モンスター効果】|【モンスター情報】)\n/
mse_language
:
jp
...
...
locales/zh-CN.yml
View file @
e80a98ef
...
...
@@ -23,6 +23,8 @@ zh-CN:
cartoon
:
"
卡通"
xyz
:
"
超量"
pendulum
:
"
灵摆"
spsummon
:
"
特殊召唤"
link
:
"
连接"
races
:
-
"
"
-
"
战士族"
...
...
@@ -49,6 +51,7 @@ zh-CN:
-
"
幻兽神族"
-
"
创世神族"
-
"
幻龙族"
-
"
电子界族"
pendulum_effect_head
:
!ruby/regexp
/←\d+ 【灵摆】 \d+→\n?/
monster_effect_head
:
!ruby/regexp
/(\n)*(?:【怪兽效果】|【怪兽简介】|【怪兽描述】)\n/
mse_language
:
cn
...
...
locales/zh-Classical.yml
View file @
e80a98ef
...
...
@@ -23,6 +23,8 @@ zh-Classical:
cartoon
:
"
卡通"
xyz
:
"
超量"
pendulum
:
"
灵摆"
spsummon
:
"
特殊召唤"
link
:
"
连接"
races
:
-
"
"
-
"
战士族"
...
...
@@ -49,6 +51,7 @@ zh-Classical:
-
"
幻兽神族"
-
"
创世神族"
-
"
幻龙族"
-
"
电子界族"
pendulum_effect_head
:
!ruby/regexp
/←\d+ 【灵摆】 \d+→\n?/
monster_effect_head
:
!ruby/regexp
/(\n)?(?:【怪兽效果】|【怪兽简介】|【怪兽描述】)\n/
mse_language
:
cn
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment