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
xiaoye
mycard
Commits
aab554d9
Commit
aab554d9
authored
Nov 23, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
决斗盘布局更换,卡片效果文字描绘加入动画,一帧一个字
parent
acef34a4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
27 deletions
+41
-27
lib/iduel_action.rb
lib/iduel_action.rb
+1
-3
lib/scene_duel.rb
lib/scene_duel.rb
+4
-4
lib/window_action.rb
lib/window_action.rb
+1
-1
lib/window_cardinfo.rb
lib/window_cardinfo.rb
+31
-15
lib/window_roomchat.rb
lib/window_roomchat.rb
+4
-4
No files found.
lib/iduel_action.rb
View file @
aab554d9
...
@@ -202,11 +202,9 @@ class Action
...
@@ -202,11 +202,9 @@ class Action
ChangePhase
.
new
(
from_player
,
parse_phase
(
$1
))
ChangePhase
.
new
(
from_player
,
parse_phase
(
$1
))
else
else
p
str
,
1
p
str
,
1
#system("pause")
end
end
else
else
p
str
,
2
p
str
,
2
#system("pause")
end
end
result
.
id
=
id
result
.
id
=
id
result
result
...
@@ -387,7 +385,7 @@ end
...
@@ -387,7 +385,7 @@ end
class
Game_Field
class
Game_Field
def
escape
def
escape
"LP:
#{
@lp
}
\r\n
手卡:
#{
@hand
.
size
}
\r\n
卡组:
#{
@deck
.
size
}
\r\n
墓地:
#{
@graveyard
.
size
}
\r\n
除外:
#{
@removed
.
size
}
\r\n
前场:
\r\n
"
+
"LP:
#{
@lp
}
\r\n
手卡:
#{
@hand
.
size
}
\r\n
卡组:
#{
@deck
.
size
}
\r\n
墓地:
#{
@graveyard
.
size
}
\r\n
除外:
#{
@removed
.
size
}
\r\n
前场:
\r\n
"
+
@field
[
6
..
10
].
collect
{
|
card
|
" <
#{
"
#{
escape_position_short
(
card
)
}
|
#{
card
.
position
==
:set
?
'??'
:
"[
#{
card
.
card_type
}
][
#{
card
.
name
}
]
#{
card
.
atk
}#{
' '
+
card
.
def
.
to_s
}
"
}
"
if
card
}
>
\r\n
"
}.
join
+
@field
[
6
..
10
].
collect
{
|
card
|
" <
#{
"
#{
Action
.
escape_position_short
(
card
)
}
|
#{
card
.
position
==
:set
?
'??'
:
"[
#{
card
.
card_type
}
][
#{
card
.
name
}
]
#{
card
.
atk
}#{
' '
+
card
.
def
.
to_s
}
"
}
"
if
card
}
>
\r\n
"
}.
join
+
"后场:"
+
"后场:"
+
@field
[
1
..
5
].
collect
{
|
card
|
"<
#{
card
.
position
==
:set
?
'??'
:
card
.
escape
if
card
}
>"
}.
join
+
@field
[
1
..
5
].
collect
{
|
card
|
"<
#{
card
.
position
==
:set
?
'??'
:
card
.
escape
if
card
}
>"
}.
join
+
"
\r\n
场地|<
#{
@field
[
0
]
?
@field
[
0
].
escape
:
'无'
}
>
\r\n
"
+
"
\r\n
场地|<
#{
@field
[
0
]
?
@field
[
0
].
escape
:
'无'
}
>
\r\n
"
+
...
...
lib/scene_duel.rb
View file @
aab554d9
...
@@ -51,9 +51,9 @@ class Scene_Duel < Scene
...
@@ -51,9 +51,9 @@ class Scene_Duel < Scene
Action
.
player_field
=
@player_field
Action
.
player_field
=
@player_field
Action
.
opponent_field
=
@opponent_field
Action
.
opponent_field
=
@opponent_field
@cardinfo_window
=
Window_CardInfo
.
new
(
1024
-
160
,
0
)
@cardinfo_window
=
Window_CardInfo
.
new
(
715
,
0
)
@action_window
=
Window_Action
.
new
@action_window
=
Window_Action
.
new
@chat_window
=
Window_RoomChat
.
new
(
716
,
567
,
307
,
203
)
@chat_window
=
Window_RoomChat
.
new
(
@cardinfo_window
.
x
,
@cardinfo_window
.
height
,
1024
-
@cardinfo_window
.
x
,
768
-
@cardinfo_window
.
height
)
end
end
def
change_phase
(
phase
)
def
change_phase
(
phase
)
...
@@ -75,7 +75,6 @@ class Scene_Duel < Scene
...
@@ -75,7 +75,6 @@ class Scene_Duel < Scene
def
first_to_go
def
first_to_go
Action
::
FirstToGo
.
new
(
true
).
run
Action
::
FirstToGo
.
new
(
true
).
run
end
end
def
handle
(
event
)
def
handle
(
event
)
case
event
case
event
when
Event
::
MouseMotion
when
Event
::
MouseMotion
...
@@ -157,10 +156,11 @@ class Scene_Duel < Scene
...
@@ -157,10 +156,11 @@ class Scene_Duel < Scene
end
end
end
end
def
update
def
update
super
@cardinfo_window
.
update
while
event
=
Iduel
::
Event
.
poll
while
event
=
Iduel
::
Event
.
poll
handle_iduel
(
event
)
handle_iduel
(
event
)
end
end
super
end
end
def
refresh_rect
(
x
,
y
,
width
,
height
)
def
refresh_rect
(
x
,
y
,
width
,
height
)
return
unless
$scene
==
self
#线程的情况
return
unless
$scene
==
self
#线程的情况
...
...
lib/window_action.rb
View file @
aab554d9
...
@@ -6,7 +6,7 @@ class Window_Action < Window_List
...
@@ -6,7 +6,7 @@ class Window_Action < Window_List
Color_Disabled
=
[
0x66
,
0x66
,
0x66
]
Color_Disabled
=
[
0x66
,
0x66
,
0x66
]
Color_Selected
=
[
0x00
,
0x00
,
0xFF
]
Color_Selected
=
[
0x00
,
0x00
,
0xFF
]
def
initialize
#,list,list_available=Array.new(list.size, true))
def
initialize
#,list,list_available=Array.new(list.size, true))
super
(
0
,
0
,
100
,
20
*
WLH
,
300
)
super
(
0
,
0
,
96
,
20
*
WLH
,
300
)
@background
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0xCC555500
)
@background
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0xCC555500
)
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0xCC555500
)
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0xCC555500
)
@font
=
TTF
.
open
(
'fonts/WenQuanYi Micro Hei.ttf'
,
16
)
@font
=
TTF
.
open
(
'fonts/WenQuanYi Micro Hei.ttf'
,
16
)
...
...
lib/window_cardinfo.rb
View file @
aab554d9
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
class
Window_CardInfo
<
Window
class
Window_CardInfo
<
Window
WLH
=
20
WLH
=
20
def
initialize
(
x
,
y
)
def
initialize
(
x
,
y
)
super
(
x
,
y
,
1
60
,
768
,
300
)
super
(
x
,
y
,
1
024
-
x
,
530
,
300
)
@font
=
TTF
.
open
(
"fonts/WenQuanYi Micro Hei.ttf"
,
16
)
@font
=
TTF
.
open
(
"fonts/WenQuanYi Micro Hei.ttf"
,
16
)
self
.
card
=
nil
self
.
card
=
nil
end
end
...
@@ -12,22 +12,38 @@ class Window_CardInfo < Window
...
@@ -12,22 +12,38 @@ class Window_CardInfo < Window
@card
=
card
||
Card
.
find
(
nil
)
@card
=
card
||
Card
.
find
(
nil
)
refresh
refresh
end
end
def
refresh
def
update
@contents
.
put
@card
.
image
,
0
,
0
if
@lore_start
@contents
.
fill_rect
(
0
,
230
,
@width
,
@height
-
230
,
0xCC005555
)
if
@lore_start
>=
@card
.
lore
.
size
@font
.
draw_blended_utf8
(
@contents
,
"[
#{
@card
.
name
}
]"
,
0
,
230
,
0xFF
,
0xFF
,
0x55
)
@lore_start
=
nil
#停止描绘
return
start
=
0
line
=
0
@card
.
lore
.
size
.
times
do
|
char
|
if
@font
.
text_size
(
@card
.
lore
[
start
..
char
])[
0
]
>
@width
@font
.
draw_blended_utf8
(
@contents
,
@card
.
lore
[
start
...
char
],
0
,
254
+
line
*
WLH
,
0xFF
,
0xFF
,
0xFF
)
start
=
char
line
=
line
.
next
end
end
char
=
@card
.
lore
[
@lore_start
]
width
=
@font
.
text_size
(
char
)[
0
]
if
@lore_pos
[
0
]
+
width
>
@width
@lore_pos
[
0
]
=
0
@lore_pos
[
1
]
+=
WLH
end
@font
.
draw_blended_utf8
(
@contents
,
char
,
@lore_pos
[
0
],
@lore_pos
[
1
],
0xFF
,
0xFF
,
0xFF
)
@lore_pos
[
0
]
+=
width
@lore_start
+=
1
end
end
if
start
<=
@card
.
lore
.
size
-
1
end
@font
.
draw_blended_utf8
(
@contents
,
@card
.
lore
[
start
...
@card
.
lore
.
size
],
0
,
254
+
line
*
WLH
,
0xFF
,
0xFF
,
0xFF
)
def
refresh
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0xCC005555
)
@contents
.
put
@card
.
image
,
0
,
0
@font
.
draw_blended_utf8
(
@contents
,
"[
#{
@card
.
name
}
]"
,
160
,
0
,
0xFF
,
0xFF
,
0x55
)
@font
.
draw_blended_utf8
(
@contents
,
"卡类:
#{
@card
.
card_type
}
"
,
160
,
WLH
,
0xFF
,
0xFF
,
0x55
)
if
@card
.
monster?
@font
.
draw_blended_utf8
(
@contents
,
"种族:
#{
@card
.
type
}
"
,
160
,
WLH
*
2
,
0xFF
,
0xFF
,
0xFF
)
@font
.
draw_blended_utf8
(
@contents
,
"星级:
#{
@card
.
level
}
"
,
160
,
WLH
*
3
,
0xFF
,
0xFF
,
0xFF
)
@font
.
draw_blended_utf8
(
@contents
,
"攻击力:
#{
@card
.
atk
}
"
,
160
,
WLH
*
4
,
0xFF
,
0xFF
,
0xFF
)
@font
.
draw_blended_utf8
(
@contents
,
"防御力:
#{
@card
.
def
}
"
,
160
,
WLH
*
5
,
0xFF
,
0xFF
,
0xFF
)
end
end
@lore_start
=
0
@lore_pos
=
[
0
,
234
]
end
end
end
end
lib/window_roomchat.rb
View file @
aab554d9
...
@@ -6,10 +6,10 @@ class Window_RoomChat < Window
...
@@ -6,10 +6,10 @@ class Window_RoomChat < Window
Player_Color
=
[
0
,
0
,
0xFF
]
Player_Color
=
[
0
,
0
,
0xFF
]
Opponent_Color
=
[
0x66
,
0x66
,
0
]
Opponent_Color
=
[
0x66
,
0x66
,
0
]
def
initialize
(
x
,
y
,
width
,
height
)
def
initialize
(
x
,
y
,
width
,
height
)
super
(
x
,
y
,
width
,
height
)
super
(
x
,
y
,
width
,
height
-
WLH
)
@chat_input
=
Widget_InputBox
.
new
(
416
,
723
,
586
,
24
){
|
text
|
Action
::
Chat
.
new
(
true
,
text
).
run
}
@chat_input
=
Widget_InputBox
.
new
(
@x
,
@y
+
@height
,
@width
,
WLH
){
|
text
|
Action
::
Chat
.
new
(
true
,
text
).
run
}
@font
=
TTF
.
open
(
"fonts/WenQuanYi Micro Hei.ttf"
,
16
)
@font
=
TTF
.
open
(
"fonts/WenQuanYi Micro Hei.ttf"
,
16
)
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0x
FF
FFFFFF
)
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0x
99
FFFFFF
)
@scroll
=
Widget_ScrollBar
.
new
(
@x
+
@width
-
20
,
@y
,
@height
,
0
)
@scroll
=
Widget_ScrollBar
.
new
(
@x
+
@width
-
20
,
@y
,
@height
,
0
)
@list
=
[]
@list
=
[]
$chat_window
=
self
$chat_window
=
self
...
@@ -19,7 +19,7 @@ class Window_RoomChat < Window
...
@@ -19,7 +19,7 @@ class Window_RoomChat < Window
refresh
refresh
end
end
def
refresh
def
refresh
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0x
66
FFFFFF
)
@contents
.
fill_rect
(
0
,
0
,
@width
,
@height
,
0x
99
FFFFFF
)
@list
.
last
(
7
).
each_with_index
do
|
chat
,
index
|
@list
.
last
(
7
).
each_with_index
do
|
chat
,
index
|
player
,
content
=
chat
player
,
content
=
chat
@font
.
draw_blended_utf8
(
@contents
,
content
,
0
,
index
*
WLH
,
*
(
player
?
Player_Color
:
Opponent_Color
))
@font
.
draw_blended_utf8
(
@contents
,
content
,
0
,
index
*
WLH
,
*
(
player
?
Player_Color
:
Opponent_Color
))
...
...
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