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
796d2794
Commit
796d2794
authored
Mar 23, 2012
by
zh99998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本0.4.6,ygocore房间加人声音+托盘提示,不规范修正先进入ygocore再进入iduel后房间全为等待中问题
parent
a287617c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
4 deletions
+30
-4
Rakefile
Rakefile
+1
-1
audio/se/join.ogg
audio/se/join.ogg
+0
-0
lib/main.rb
lib/main.rb
+1
-0
lib/scene.rb
lib/scene.rb
+1
-1
lib/scene_duel.rb
lib/scene_duel.rb
+3
-0
lib/ygocore/event.rb
lib/ygocore/event.rb
+20
-0
lib/ygocore/game.rb
lib/ygocore/game.rb
+3
-1
lib/ygocore/room.rb
lib/ygocore/room.rb
+1
-1
No files found.
Rakefile
View file @
796d2794
...
@@ -24,7 +24,7 @@ end
...
@@ -24,7 +24,7 @@ end
spec
=
Gem
::
Specification
.
new
do
|
s
|
spec
=
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
'mycard'
s
.
name
=
'mycard'
s
.
version
=
'0.4.
5
'
s
.
version
=
'0.4.
6
'
s
.
extra_rdoc_files
=
[
'README.txt'
,
'LICENSE.txt'
]
s
.
extra_rdoc_files
=
[
'README.txt'
,
'LICENSE.txt'
]
s
.
summary
=
'a card game'
s
.
summary
=
'a card game'
s
.
description
=
s
.
summary
s
.
description
=
s
.
summary
...
...
audio/se/join.ogg
0 → 100644
View file @
796d2794
File added
lib/main.rb
View file @
796d2794
...
@@ -47,6 +47,7 @@ begin
...
@@ -47,6 +47,7 @@ begin
WM
::
icon
=
Surface
.
load
(
"graphics/system/icon.gif"
)
WM
::
icon
=
Surface
.
load
(
"graphics/system/icon.gif"
)
$screen
=
Screen
.
open
(
$config
[
'screen'
][
'width'
],
$config
[
'screen'
][
'height'
],
0
,
HWSURFACE
|
(
$config
[
'screen'
][
'fullscreen'
]
?
FULLSCREEN
:
0
))
$screen
=
Screen
.
open
(
$config
[
'screen'
][
'width'
],
$config
[
'screen'
][
'height'
],
0
,
HWSURFACE
|
(
$config
[
'screen'
][
'fullscreen'
]
?
FULLSCREEN
:
0
))
Mixer
.
open
(
Mixer
::
DEFAULT_FREQUENCY
,
Mixer
::
DEFAULT_FORMAT
,
Mixer
::
DEFAULT_CHANNELS
,
512
)
Mixer
.
open
(
Mixer
::
DEFAULT_FREQUENCY
,
Mixer
::
DEFAULT_FORMAT
,
Mixer
::
DEFAULT_CHANNELS
,
512
)
Mixer
.
set_volume_music
(
60
)
TTF
.
init
TTF
.
init
Thread
.
abort_on_exception
=
true
Thread
.
abort_on_exception
=
true
...
...
lib/scene.rb
View file @
796d2794
...
@@ -51,7 +51,7 @@ class Scene
...
@@ -51,7 +51,7 @@ class Scene
# ● 开始处理
# ● 开始处理
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
def
start
def
start
if
$config
[
'bgm'
]
and
@@last_bgm
!=
bgm
if
$config
[
'bgm'
]
and
@@last_bgm
!=
bgm
and
File
.
file?
"audio/bgm/
#{
bgm
}
"
@@bgm
.
destroy
if
@@bgm
@@bgm
.
destroy
if
@@bgm
@@bgm
=
Mixer
::
Music
.
load
"audio/bgm/
#{
bgm
}
"
@@bgm
=
Mixer
::
Music
.
load
"audio/bgm/
#{
bgm
}
"
Mixer
.
fade_in_music
(
@@bgm
,
-
1
,
800
)
Mixer
.
fade_in_music
(
@@bgm
,
-
1
,
800
)
...
...
lib/scene_duel.rb
View file @
796d2794
...
@@ -43,6 +43,8 @@ class Scene_Duel < Scene
...
@@ -43,6 +43,8 @@ class Scene_Duel < Scene
@player_lp_window
=
Window_LP
.
new
(
0
,
0
,
@room
.
player1
,
true
)
@player_lp_window
=
Window_LP
.
new
(
0
,
0
,
@room
.
player1
,
true
)
@opponent_lp_window
=
Window_LP
.
new
(
360
,
0
,
@room
.
player2
,
false
)
@opponent_lp_window
=
Window_LP
.
new
(
360
,
0
,
@room
.
player2
,
false
)
@join_se
=
Mixer
::
Wave
.
load
(
"audio/se/join.ogg"
)
create_action_window
create_action_window
create_chat_window
create_chat_window
super
super
...
@@ -159,6 +161,7 @@ class Scene_Duel < Scene
...
@@ -159,6 +161,7 @@ class Scene_Duel < Scene
player
=
$game
.
room
.
player1
==
$game
.
user
?
$game
.
room
.
player2
:
$game
.
room
.
player1
player
=
$game
.
room
.
player1
==
$game
.
user
?
$game
.
room
.
player2
:
$game
.
room
.
player1
if
player
if
player
notify_send
(
"对手加入房间"
,
"
#{
player
.
name
}
(
#{
player
.
id
}
)"
)
notify_send
(
"对手加入房间"
,
"
#{
player
.
name
}
(
#{
player
.
id
}
)"
)
Mixer
.
play_channel
(
-
1
,
@join_se
,
0
)
else
else
notify_send
(
"对手离开房间"
,
"对手离开房间"
)
notify_send
(
"对手离开房间"
,
"对手离开房间"
)
end
end
...
...
lib/ygocore/event.rb
View file @
796d2794
...
@@ -4,6 +4,12 @@ class Game_Event
...
@@ -4,6 +4,12 @@ class Game_Event
#User_Filter = /<li>(:::观战:|===决斗1=|===决斗2=)<font color="(?:blue|gray)">(.+?)(\(未认证\)|)<\/font>;<\/li>/
#User_Filter = /<li>(:::观战:|===决斗1=|===决斗2=)<font color="(?:blue|gray)">(.+?)(\(未认证\)|)<\/font>;<\/li>/
#Room_Filter = /<div style="width:300px; height:150px; border:1px #ececec solid; float:left;padding:5px; margin:5px;">房间名称:(.+?)(<font color="d28311" title="竞技场模式">\[竞\]<\/font>|) (<font color=(?:\")?red(?:\")?>决斗已开始!<\/font>|<font color=(?:\")?blue(?:\")?>等待<\/font>)<font size="1">\(ID:(\d+)\)<\/font>#{User_Filter}+?<\/div>/
#Room_Filter = /<div style="width:300px; height:150px; border:1px #ececec solid; float:left;padding:5px; margin:5px;">房间名称:(.+?)(<font color="d28311" title="竞技场模式">\[竞\]<\/font>|) (<font color=(?:\")?red(?:\")?>决斗已开始!<\/font>|<font color=(?:\")?blue(?:\")?>等待<\/font>)<font size="1">\(ID:(\d+)\)<\/font>#{User_Filter}+?<\/div>/
class
AllRooms
<
Game_Event
class
AllRooms
<
Game_Event
def
self
.
notify_send
(
title
,
msg
)
command
=
"notify-send -i graphics/system/icon.ico
#{
title
}
#{
msg
}
"
command
=
"start ruby/bin/
#{
command
}
"
.
encode
"GBK"
if
RUBY_PLATFORM
[
"win"
]
||
RUBY_PLATFORM
[
"ming"
]
system
(
command
)
$log
.
info
command
end
def
self
.
parse
(
info
)
def
self
.
parse
(
info
)
@rooms
=
[]
@rooms
=
[]
info
.
scan
(
Room_Filter
)
do
|
id
,
name
,
status
,
users
|
info
.
scan
(
Room_Filter
)
do
|
id
,
name
,
status
,
users
|
...
@@ -27,6 +33,20 @@ class Game_Event
...
@@ -27,6 +33,20 @@ class Game_Event
player2
=
User
.
new
(
name
.
to_sym
,
name
,
certified
)
player2
=
User
.
new
(
name
.
to_sym
,
name
,
certified
)
end
end
end
end
if
player1
==
$game
.
user
or
player2
==
$game
.
user
$game
.
room
=
Room
.
new
(
id
.
to_i
,
name
)
end
if
$game
.
room
and
id
.
to_i
==
$game
.
room
.
id
and
((
$game
.
room
.
player1
.
nil?
and
player1
and
player1
!=
$game
.
user
)
or
(
$game
.
room
.
player2
.
nil?
and
player2
and
player2
!=
$game
.
user
))
@@join_se
||=
Mixer
::
Wave
.
load
(
"audio/se/join.ogg"
)
Mixer
.
play_channel
(
-
1
,
@@join_se
,
0
)
if
$game
.
room
.
player1
.
nil?
and
player1
and
player1
!=
$game
.
user
player
=
player1
elsif
$game
.
room
.
player2
.
nil?
and
player2
and
player2
!=
$game
.
user
player
=
player2
end
notify_send
(
"对手加入房间"
,
"
#{
player
.
name
}
(
#{
player
.
id
}
)"
)
end
room
=
Room
.
new
(
id
.
to_i
,
name
,
player1
,
player2
,
false
,
[
0
,
0
,
0
])
room
=
Room
.
new
(
id
.
to_i
,
name
,
player1
,
player2
,
false
,
[
0
,
0
,
0
])
room
.
status
=
status
.
to_sym
room
.
status
=
status
.
to_sym
room
.
name
=~
/^(P)?(M)?\#?(.*?)(?:<font color="d28311" title="竞技场模式">\[竞\]<\/font>)?$/
room
.
name
=~
/^(P)?(M)?\#?(.*?)(?:<font color="d28311" title="竞技场模式">\[竞\]<\/font>)?$/
...
...
lib/ygocore/game.rb
View file @
796d2794
...
@@ -94,7 +94,9 @@ class Ygocore < Game
...
@@ -94,7 +94,9 @@ class Ygocore < Game
Game_Event
.
push
Game_Event
::
AllRooms
.
parse
info
Game_Event
.
push
Game_Event
::
AllRooms
.
parse
info
Game_Event
.
push
Game_Event
::
AllUsers
.
parse
info
Game_Event
.
push
Game_Event
::
AllUsers
.
parse
info
yield
if
block_given?
yield
if
block_given?
end
rescue
nil
end
rescue
Exception
=>
exception
$log
.
warn
(
'刷新大厅'
){[
exception
.
inspect
,
*
exception
.
backtrace
].
collect
{
|
str
|
str
.
encode
(
"UTF-8"
)}.
join
(
"
\n
"
)}
end
end
end
end
end
end
...
...
lib/ygocore/room.rb
View file @
796d2794
...
@@ -5,7 +5,7 @@ class Room
...
@@ -5,7 +5,7 @@ class Room
alias
pvp?
pvp
alias
pvp?
pvp
alias
match?
match
alias
match?
match
def
full?
def
full?
@status
==
:start
$game
.
is_a?
(
Ygocore
)
?
(
@status
==
:
start
)
:
super
#不规范修正iduel房间识别问题
end
end
def
extra
def
extra
result
=
{}
result
=
{}
...
...
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