Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
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
List
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
syntax_j
mycard
Commits
d1bdc32e
Commit
d1bdc32e
authored
Nov 22, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
背面卡图更换
parent
d5296ddb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
7 deletions
+28
-7
graphics/field/card_small.gif
graphics/field/card_small.gif
+0
-0
lib/card.rb
lib/card.rb
+5
-2
lib/game_card.rb
lib/game_card.rb
+10
-1
lib/scene_duel.rb
lib/scene_duel.rb
+1
-2
lib/window_field.rb
lib/window_field.rb
+12
-2
No files found.
graphics/field/card_small.gif
0 → 100644
View file @
d1bdc32e
5.56 KB
lib/card.rb
View file @
d1bdc32e
...
...
@@ -13,6 +13,8 @@ class Card
#PicPath = '/media/44CACC1DCACC0D5C/game/yu-gi-oh/YGODATA/YGOPIC'
PicPath
=
'E:/game/yu-gi-oh/YGODATA/YGOPIC'
CardBack
=
Surface
.
load
"graphics/field/card.jpg"
CardBack_Small
=
Surface
.
load
"graphics/field/card_small.gif"
class
<<
self
def
find
(
id
,
order_by
=
nil
)
case
id
...
...
@@ -24,8 +26,7 @@ class Card
when
Hash
old_new
(
id
)
when
nil
Card
.
find
(
1
)
#.instance_eval{@image = CardBack} unless @all[1]
@all
[
1
]
Card
::
Unknown
else
sql
=
"select * from YGODATA where "
<<
id
sql
<<
" order by
#{
order_by
}
"
if
order_by
...
...
@@ -165,4 +166,6 @@ attr_accessor :tokens
def
spell?
[:
通常魔法
,
:
速攻魔法
,
:
装备魔法
,
:
场地魔法
,
:
仪式魔法
,
:
永续魔法
].
include?
card_type
end
Unknown
=
Card
.
new
(
'id'
=>
0
,
'number'
=>
:"00000000"
,
'name'
=>
""
,
'lore'
=>
''
,
'card_type'
=>
:
通常怪兽
,
'stats'
=>
""
,
'archettypes'
=>
""
,
'mediums'
=>
""
)
Unknown
.
instance_eval
{
@image
=
CardBack
;
@image_small
=
CardBack_Small
}
end
\ No newline at end of file
lib/game_card.rb
View file @
d1bdc32e
#encoding: UTF-8
class
Game_Card
attr_accessor
:card
,
:position
#attack|defense|set,
attr_accessor
:atk
,
:def
@@count
=
0
def
initialize
(
card
=
nil
)
@@count
+=
1
puts
"创建活动卡片<
#{
card
?
card
.
name
:
'??'
}
>,共计
#{
@@count
}
张"
@card
=
card
||
Card
.
find
(
nil
)
reset
end
def
reset
@position
=
:set
@atk
=
@card
.
atk
@def
=
@card
.
def
end
def
known?
true
@card
!=
Card
::
Unknown
end
def
image_small
if
@position
==
:set
...
...
@@ -19,6 +25,9 @@ class Game_Card
end
end
def
method_missing
(
method
,
*
args
)
if
method
.
to_s
[
0
,
9
]
==
"original_"
method
=
method
.
to_s
[
9
,
method
.
to_s
.
size
-
9
]
end
@card
.
send
(
method
,
*
args
)
end
end
\ No newline at end of file
lib/scene_duel.rb
View file @
d1bdc32e
...
...
@@ -42,7 +42,7 @@ class Scene_Duel < Scene
@player_field
=
Game_Field
.
new
Deck
.
load
(
"test1.TXT"
)
@opponent_field
=
Game_Field
.
new
@fieldback_window
=
Window_FieldBack
.
new
(
1
28
,
175
)
@fieldback_window
=
Window_FieldBack
.
new
(
1
30
,
174
)
@player_field_window
=
Window_Field
.
new
(
4
,
398
,
@player_field
,
true
)
@opponent_field_window
=
Window_Field
.
new
(
4
,
60
,
@opponent_field
,
false
)
...
...
@@ -54,7 +54,6 @@ class Scene_Duel < Scene
@cardinfo_window
=
Window_CardInfo
.
new
(
1024
-
160
,
0
)
@action_window
=
Window_Action
.
new
$screen
.
update_rect
(
0
,
0
,
0
,
0
)
end
def
change_phase
(
phase
)
...
...
lib/window_field.rb
View file @
d1bdc32e
...
...
@@ -26,7 +26,7 @@ class Window_Field < Window
super
(
x
,
y
,
711
,
282
)
@field
=
field
@player
=
player
@font
=
TTF
.
open
(
'fonts/WenQuanYi Micro Hei.ttf'
,
12
)
@items
=
{}
@cards
=
{}
refresh
...
...
@@ -81,6 +81,16 @@ class Window_Field < Window
@contents
.
put
(
@cards
[
index
].
image_small
,
@items
[
index
][
0
],
@items
[
index
][
1
])
@contents
.
put
(
@border
,
@items
[
index
][
0
]
-
1
,
@items
[
index
][
1
]
-
1
)
if
status
==
1
end
if
(
6
..
10
).
include?
(
index
)
and
@cards
[
index
].
position
!=
:set
size
=
@font
.
text_size
(
'/'
)
y
=
Field_Pos
[
index
][
1
]
+
Card_Size
[
1
]
-
size
[
1
]
size
=
size
[
0
]
x
=
Field_Pos
[
index
][
0
]
+
(
Card_Size
[
0
]
-
size
)
/
2
@font
.
draw_blended_utf8
(
@contents
,
'/'
,
x
,
y
,
0xFF
,
0xFF
,
0xFF
)
@font
.
draw_blended_utf8
(
@contents
,
@cards
[
index
].
atk
.
to_s
,
x
-
@font
.
text_size
(
@cards
[
index
].
atk
.
to_s
)[
0
],
y
,
0xFF
,
0xFF
,
0xFF
)
@font
.
draw_blended_utf8
(
@contents
,
@cards
[
index
].
def
.
to_s
,
x
+
size
,
y
,
0xFF
,
0xFF
,
0xFF
)
end
end
def
item_rect
(
index
)
@items
[
index
]
...
...
@@ -172,7 +182,7 @@ class Window_Field < Window
}
end
$scene
.
action_window
.
list
=
@action_names
$scene
.
cardinfo_window
.
card
=
@card
$scene
.
cardinfo_window
.
card
=
@card
if
@card
.
known?
$scene
.
action_window
.
x
=
@x
+
@items
[
@index
][
0
]
-
(
$scene
.
action_window
.
width
-
@items
[
@index
][
2
])
/
2
$scene
.
action_window
.
y
=
@y
+
@items
[
@index
][
1
]
-
$scene
.
action_window
.
viewport
[
3
]
#height
end
...
...
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