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
482b469c
Commit
482b469c
authored
Dec 19, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程与回合结束
parent
fe974547
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
78 additions
and
64 deletions
+78
-64
README.txt
README.txt
+2
-2
lib/action.rb
lib/action.rb
+15
-1
lib/card.rb
lib/card.rb
+1
-1
lib/game.rb
lib/game.rb
+1
-1
lib/game_card.rb
lib/game_card.rb
+6
-0
lib/iduel/action.rb
lib/iduel/action.rb
+3
-2
lib/iduel/iduel.rb
lib/iduel/iduel.rb
+13
-9
lib/nbx/action.rb
lib/nbx/action.rb
+5
-4
lib/scene_duel.rb
lib/scene_duel.rb
+24
-39
lib/scene_hall.rb
lib/scene_hall.rb
+1
-1
lib/scene_watch.rb
lib/scene_watch.rb
+2
-0
lib/window_field.rb
lib/window_field.rb
+2
-3
lib/window_list.rb
lib/window_list.rb
+1
-1
lib/window_phases.rb
lib/window_phases.rb
+2
-0
mycard.cmd
mycard.cmd
+0
-0
No files found.
README.txt
View file @
482b469c
==
iduel
==
mycard
You should document your project here.
这是一个游戏王对战器,与nbx和iduel协议兼容,目前开发进度50%
\ No newline at end of file
lib/action.rb
View file @
482b469c
...
@@ -69,6 +69,13 @@ class Action
...
@@ -69,6 +69,13 @@ class Action
super
(
from_player
)
super
(
from_player
)
@phase
=
phase
@phase
=
phase
end
end
def
run
$game
.
phase
=
phase
if
@from_player
and
phase
==
:EP
Game_Event
.
push
Game_Event
::
Action
.
new
(
TurnEnd
.
new
(
true
,
$game
.
player_field
,
$game
.
turn_player
?
turn
:
turn
.
next
))
end
super
end
end
end
class
Move
<
Action
class
Move
<
Action
attr_reader
:from_pos
,
:to_pos
,
:card
,
:position
attr_reader
:from_pos
,
:to_pos
,
:card
,
:position
...
@@ -258,6 +265,8 @@ class Action
...
@@ -258,6 +265,8 @@ class Action
@field
=
field
@field
=
field
end
end
def
run
def
run
super
return
if
@field
.
is_a?
Game_Field
#本地信息,无需处理。
player_field
.
lp
=
@field
[
:lp
]
player_field
.
lp
=
@field
[
:lp
]
if
player_field
.
hand
.
size
>
@field
[
:hand
]
if
player_field
.
hand
.
size
>
@field
[
:hand
]
player_field
.
hand
.
pop
(
player_field
.
hand
.
size
-
@field
[
:hand
])
player_field
.
hand
.
pop
(
player_field
.
hand
.
size
-
@field
[
:hand
])
...
@@ -284,7 +293,6 @@ class Action
...
@@ -284,7 +293,6 @@ class Action
player_field
.
field
[
pos
]
=
nil
player_field
.
field
[
pos
]
=
nil
end
end
end
end
p
player_field
end
end
end
end
...
@@ -294,6 +302,12 @@ class Action
...
@@ -294,6 +302,12 @@ class Action
super
(
from_player
,
field
,
msg
)
super
(
from_player
,
field
,
msg
)
@turn
=
turn
@turn
=
turn
end
end
def
run
$game
.
phase
=
:DP
$game
.
turn
=
@turn
.
next
$game
.
turn_player
=
!
from_player
super
end
end
end
class
Show
<
Move
class
Show
<
Move
attr_reader
:from_pos
,
:card
attr_reader
:from_pos
,
:card
...
...
lib/card.rb
View file @
482b469c
...
@@ -22,7 +22,7 @@ class Card
...
@@ -22,7 +22,7 @@ class Card
@all
[
id
]
||
old_new
(
@db
.
get_first_row
(
"select * from YGODATA where id =
#{
id
}
"
))
@all
[
id
]
||
old_new
(
@db
.
get_first_row
(
"select * from YGODATA where id =
#{
id
}
"
))
when
Symbol
when
Symbol
row
=
@db
.
get_first_row
(
"select * from YGODATA where name = '
#{
id
}
'"
)
row
=
@db
.
get_first_row
(
"select * from YGODATA where name = '
#{
id
}
'"
)
row
&&
(
@all
[
row
[
'id'
].
to_i
]
||
old_new
(
row
)
)
(
row
&&
(
@all
[
row
[
'id'
].
to_i
]
||
old_new
(
row
)))
||
Card
.
new
(
'id'
=>
0
,
'number'
=>
:"00000000"
,
'name'
=>
name
,
'card_type'
=>
:
通常怪兽
,
'stats'
=>
""
,
'archettypes'
=>
""
,
'mediums'
=>
""
,
'lore'
=>
""
)
when
Hash
when
Hash
old_new
(
id
)
old_new
(
id
)
when
nil
when
nil
...
...
lib/game.rb
View file @
482b469c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
#游戏适配器的抽象类
#游戏适配器的抽象类
class
Game
class
Game
attr_reader
:users
,
:rooms
attr_reader
:users
,
:rooms
attr_accessor
:user
,
:room
,
:player_field
,
:opponent_field
attr_accessor
:user
,
:room
,
:player_field
,
:opponent_field
,
:turn
,
:turn_player
,
:phase
def
initialize
def
initialize
@users
=
[]
@users
=
[]
@rooms
=
[]
@rooms
=
[]
...
...
lib/game_card.rb
View file @
482b469c
...
@@ -9,6 +9,12 @@ class Game_Card
...
@@ -9,6 +9,12 @@ class Game_Card
@card
=
card
||
Card
.
find
(
nil
)
@card
=
card
||
Card
.
find
(
nil
)
reset
reset
end
end
def
atk
@card
.
atk
.
to_i
#把"?"转为0
end
def
def
@card
.
atk
.
to_i
#把"?"转为0
end
def
reset
def
reset
@position
=
:set
@position
=
:set
@atk
=
@card
.
atk
@atk
=
@card
.
atk
...
...
lib/iduel/action.rb
View file @
482b469c
#encoding: UTF-8
#encoding: UTF-8
#这个文件iduel和nbx相同,编辑时推荐使用软/硬链接来保持一致
require_relative
'../action'
require_relative
'../action'
class
Action
class
Action
CardFilter
=
/((?:<)?(?:\[.*?\])?\[(?:.*?)\][\s\d]*(?:>)?|一张怪兽卡|一张魔\/陷卡|\?\?)/
CardFilter
=
/((?:<)?(?:\[.*?\])?\[(?:.*?)\][\s\d]*(?:>)?|一张怪兽卡|一张魔\/陷卡|\?\?)/
...
@@ -31,7 +32,7 @@ class Action
...
@@ -31,7 +32,7 @@ class Action
if
index
=
card
.
rindex
(
"["
)
if
index
=
card
.
rindex
(
"["
)
index
+=
1
index
+=
1
name
=
card
[
index
,
card
.
rindex
(
"]"
)
-
index
].
to_sym
name
=
card
[
index
,
card
.
rindex
(
"]"
)
-
index
].
to_sym
Card
.
find
(
name
)
||
Card
.
new
(
'id'
=>
0
,
'number'
=>
:"00000000"
,
'name'
=>
name
,
'card_type'
=>
:
通常怪兽
,
'stats'
=>
""
,
'archettypes'
=>
""
,
'mediums'
=>
""
)
Card
.
find
(
name
)
else
else
Card
.
find
(
nil
)
Card
.
find
(
nil
)
end
end
...
@@ -313,7 +314,7 @@ class Action
...
@@ -313,7 +314,7 @@ class Action
end
end
class
TurnEnd
class
TurnEnd
def
escape
def
escape
"[
#{
@id
}
]
#{
from_player
?
'◎'
:
'●'
}
→=[0:0:0]==回合结束==<
0
>=[0]
\r\n
"
+
@field
.
escape
"[
#{
@id
}
]
#{
from_player
?
'◎'
:
'●'
}
→=[0:0:0]==回合结束==<
#{
@turn
}
>=[0]
\r\n
"
+
@field
.
escape
end
end
end
end
class
Shuffle
class
Shuffle
...
...
lib/iduel/iduel.rb
View file @
482b469c
#encoding: UTF-8
#encoding: UTF-8
class
Iduel
<
Game
class
Iduel
<
Game
V
ERSION
=
"20110131"
V
ersion
=
"20110131"
Server
=
"iduel.ocgsoft.cn"
Server
=
"iduel.ocgsoft.cn"
Port
=
38522
Port
=
38522
...
@@ -15,15 +15,19 @@ class Iduel < Game
...
@@ -15,15 +15,19 @@ class Iduel < Game
require_relative
'action'
require_relative
'action'
require_relative
'event'
require_relative
'event'
require_relative
'user'
require_relative
'user'
begin
@conn
=
TCPSocket
.
open
(
Server
,
Port
)
@conn
=
TCPSocket
.
open
(
Server
,
Port
)
@conn
.
set_encoding
"GBK"
@conn
.
set_encoding
"GBK"
Thread
.
abort_on_exception
=
true
Thread
.
abort_on_exception
=
true
@recv
=
Thread
.
new
{
recv
@conn
.
gets
(
RS
)
while
@conn
}
@recv
=
Thread
.
new
{
recv
@conn
.
gets
(
RS
)
while
@conn
}
rescue
Game_Event
.
push
Game_Event
::
Error
.
new
(
$!
.
class
,
$!
.
message
)
end
end
end
def
login
(
username
,
password
)
def
login
(
username
,
password
)
md5
=
Digest
::
MD5
.
hexdigest
(
password
)
md5
=
Digest
::
MD5
.
hexdigest
(
password
)
send
(
0
,
username
,
md5
,
checknum
(
"LOGINMSG"
,
username
,
md5
),
V
ERSION
)
send
(
0
,
username
,
md5
,
checknum
(
"LOGINMSG"
,
username
,
md5
),
V
ersion
)
end
end
def
refresh
def
refresh
send
(
1
,
@key
,
checknum
(
"UPINFOMSG"
,
@session
))
send
(
1
,
@key
,
checknum
(
"UPINFOMSG"
,
@session
))
...
@@ -45,7 +49,7 @@ class Iduel < Game
...
@@ -45,7 +49,7 @@ class Iduel < Game
end
end
end
end
def
action
(
action
)
def
action
(
action
)
send
(
2
,
"
#{
checknum
(
"RMSG"
,
@session
)
}
@
#{
@key
}
"
,
"
#{
action
.
escape
}
▊▊▊000000"
)
if
@room
.
include?
@user
#TODO:iduel校验字串
send
(
2
,
"
#{
checknum
(
"RMSG"
,
@session
)
}
@
#{
@key
}
"
,
"
#{
action
.
escape
}
鈻娾枈鈻�00000"
)
if
@room
.
include?
@user
#TODO:iduel鏍¢獙瀛椾覆
end
end
def
exit
def
exit
send
(
11
,
@key
,
checknum
(
"ULO"
,
"
#{
@session
}
"
))
send
(
11
,
@key
,
checknum
(
"ULO"
,
"
#{
@session
}
"
))
...
@@ -58,13 +62,13 @@ class Iduel < Game
...
@@ -58,13 +62,13 @@ class Iduel < Game
def
send
(
head
,
*
args
)
def
send
(
head
,
*
args
)
info
=
"#
#{
head
.
to_s
(
16
).
upcase
}
|
#{
args
.
join
(
','
)
}
"
.
encode
(
"GBK"
)
+
RS
info
=
"#
#{
head
.
to_s
(
16
).
upcase
}
|
#{
args
.
join
(
','
)
}
"
.
encode
(
"GBK"
)
+
RS
puts
"<<
#{
info
}
"
puts
"<<
#{
info
}
"
(
@conn
.
write
info
)
rescue
Game_Event
.
push
Game_Event
::
Error
.
new
(
0
)
(
@conn
.
write
info
)
rescue
Game_Event
.
push
Game_Event
::
Error
.
new
(
$!
.
class
,
$!
.
message
)
end
end
def
recv
(
info
)
def
recv
(
info
)
if
info
.
nil?
if
info
.
nil?
@conn
.
close
@conn
.
close
@conn
=
nil
@conn
=
nil
Game_Event
::
Error
.
new
(
0
)
Game_Event
::
Error
.
parse
(
0
)
else
else
info
.
chomp!
(
RS
)
info
.
chomp!
(
RS
)
info
.
encode!
"UTF-8"
,
:invalid
=>
:replace
,
:undef
=>
:replace
info
.
encode!
"UTF-8"
,
:invalid
=>
:replace
,
:undef
=>
:replace
...
...
lib/nbx/action.rb
View file @
482b469c
#encoding: UTF-8
#encoding: UTF-8
#这个文件iduel和nbx相同,编辑时推荐使用软/硬链接来保持一致
require_relative
'../action'
require_relative
'../action'
class
Action
class
Action
CardFilter
=
/((?:<)?(?:\[.*?\])?\[(?:.*?)\][\s\d]*(?:>)?|一张怪兽卡|一张魔\/陷卡|\?\?)/
CardFilter
=
/((?:<)?(?:\[.*?\])?\[(?:.*?)\][\s\d]*(?:>)?|一张怪兽卡|一张魔\/陷卡|\?\?)/
...
@@ -12,7 +13,7 @@ class Action
...
@@ -12,7 +13,7 @@ class Action
pos
[
index
,
pos
.
index
(
")"
)
-
index
].
to_i
pos
[
index
,
pos
.
index
(
")"
)
-
index
].
to_i
else
else
case
pos
case
pos
when
"手卡"
when
"手卡"
,
"手牌"
:hand
:hand
when
"场上"
,
"魔陷区"
,
"怪兽区"
when
"场上"
,
"魔陷区"
,
"怪兽区"
:field
:field
...
@@ -31,7 +32,7 @@ class Action
...
@@ -31,7 +32,7 @@ class Action
if
index
=
card
.
rindex
(
"["
)
if
index
=
card
.
rindex
(
"["
)
index
+=
1
index
+=
1
name
=
card
[
index
,
card
.
rindex
(
"]"
)
-
index
].
to_sym
name
=
card
[
index
,
card
.
rindex
(
"]"
)
-
index
].
to_sym
Card
.
find
(
name
)
||
Card
.
new
(
'id'
=>
0
,
'number'
=>
:"00000000"
,
'name'
=>
name
,
'card_type'
=>
:
通常怪兽
,
'stats'
=>
""
,
'archettypes'
=>
""
,
'mediums'
=>
""
)
Card
.
find
(
name
)
else
else
Card
.
find
(
nil
)
Card
.
find
(
nil
)
end
end
...
@@ -253,7 +254,7 @@ class Action
...
@@ -253,7 +254,7 @@ class Action
ReturnToExtra
.
new
from_player
,
parse_pos
(
$2
),
parse_card
(
$1
)
ReturnToExtra
.
new
from_player
,
parse_pos
(
$2
),
parse_card
(
$1
)
when
/从
#{
PosFilter
}
取
#{
CardFilter
}
加入手卡/
when
/从
#{
PosFilter
}
取
#{
CardFilter
}
加入手卡/
ReturnToHand
.
new
from_player
,
parse_pos
(
$1
),
parse_card
(
$2
)
ReturnToHand
.
new
from_player
,
parse_pos
(
$1
),
parse_card
(
$2
)
when
/(?:己方)?
#{
PosFilter
}
.*
#{
CardFilter
}
效果发(?:\~)?动/
when
/(?:己方)?
#{
PosFilter
}
.*
?
#{
CardFilter
}
效果发(?:\~)?动/
Effect_Activate
.
new
(
from_player
,
parse_pos
(
$1
),
parse_card
(
$2
))
Effect_Activate
.
new
(
from_player
,
parse_pos
(
$1
),
parse_card
(
$2
))
when
/
#{
PosFilter
}#{
CardFilter
}
(?:变|改)为
#{
PositionFilter
}
/
when
/
#{
PosFilter
}#{
CardFilter
}
(?:变|改)为
#{
PositionFilter
}
/
ChangePosition
.
new
(
from_player
,
parse_pos
(
$1
),
parse_card
(
$2
),
parse_position
(
$3
))
ChangePosition
.
new
(
from_player
,
parse_pos
(
$1
),
parse_card
(
$2
),
parse_position
(
$3
))
...
@@ -313,7 +314,7 @@ class Action
...
@@ -313,7 +314,7 @@ class Action
end
end
class
TurnEnd
class
TurnEnd
def
escape
def
escape
"[
#{
@id
}
]
#{
from_player
?
'◎'
:
'●'
}
→=[0:0:0]==回合结束==<
0
>=[0]
\r\n
"
+
@field
.
escape
"[
#{
@id
}
]
#{
from_player
?
'◎'
:
'●'
}
→=[0:0:0]==回合结束==<
#{
@turn
}
>=[0]
\r\n
"
+
@field
.
escape
end
end
end
end
class
Shuffle
class
Shuffle
...
...
lib/scene_duel.rb
View file @
482b469c
...
@@ -33,40 +33,33 @@ class Scene_Duel < Scene
...
@@ -33,40 +33,33 @@ class Scene_Duel < Scene
@background
=
Surface
.
load
"graphics/field/main.png"
@background
=
Surface
.
load
"graphics/field/main.png"
Surface
.
blit
(
@background
,
0
,
0
,
0
,
0
,
$screen
,
0
,
0
)
Surface
.
blit
(
@background
,
0
,
0
,
0
,
0
,
$screen
,
0
,
0
)
@player1_lp
=
Window_LP
.
new
(
0
,
0
,
@room
.
player1
,
true
)
init_game
@player2_lp
=
Window_LP
.
new
(
360
,
0
,
@room
.
player2
,
false
)
@phases_window
=
Window_Phases
.
new
(
124
,
357
)
@turn_player
=
true
$game
.
player_field
=
Game_Field
.
new
@deck
$game
.
opponent_field
=
Game_Field
.
new
@fieldback_window
=
Window_FieldBack
.
new
(
130
,
174
)
@player_lp_window
=
Window_LP
.
new
(
0
,
0
,
@room
.
player1
,
true
)
@opponent_lp_window
=
Window_LP
.
new
(
360
,
0
,
@room
.
player2
,
false
)
@player_field_window
=
Window_Field
.
new
(
4
,
398
,
$game
.
player_field
,
true
)
@player_field_window
=
Window_Field
.
new
(
4
,
398
,
$game
.
player_field
,
true
)
@opponent_field_window
=
Window_Field
.
new
(
4
,
60
,
$game
.
opponent_field
,
false
)
@opponent_field_window
=
Window_Field
.
new
(
4
,
60
,
$game
.
opponent_field
,
false
)
@opponent_field_window
.
angle
=
180
@opponent_field_window
.
angle
=
180
@phases_window
=
Window_Phases
.
new
(
124
,
357
)
@fieldback_window
=
Window_FieldBack
.
new
(
130
,
174
)
@cardinfo_window
=
Window_CardInfo
.
new
(
715
,
0
)
@cardinfo_window
=
Window_CardInfo
.
new
(
715
,
0
)
@player_field_window
.
action_window
=
Window_Action
.
new
@chat_window
=
Window_RoomChat
.
new
(
@cardinfo_window
.
x
,
@cardinfo_window
.
height
,
1024
-
@cardinfo_window
.
x
,
768
-
@cardinfo_window
.
height
)
@chat_window
=
Window_RoomChat
.
new
(
@cardinfo_window
.
x
,
@cardinfo_window
.
height
,
1024
-
@cardinfo_window
.
x
,
768
-
@cardinfo_window
.
height
)
create_action_window
super
super
#(Thread.list - [Thread.current]).each{|t|t.kill}
#p Thread.list
end
end
def
create_action_window
def
change_phase
(
phase
)
@player_field_window
.
action_window
=
Window_Action
.
new
action
Action
::
ChangePhase
.
new
(
@turn_player
,
[
:DP
,
:SP
,
:M1
,
:BP
,
:M2
,
:EP
][
phase
])
end
def
init_game
if
phase
==
5
$game
.
player_field
=
Game_Field
.
new
@deck
@turn_player
=
!
@turn_player
$game
.
opponent_field
=
Game_Field
.
new
@phase
=
0
$game
.
turn_player
=
true
#
@phases_window
.
player
=
@turn_player
$game
.
turn
=
0
action
Action
::
TurnEnd
.
new
(
true
,
"Turn End"
,
$game
.
player_field
.
lp
,
$game
.
player_field
.
hand
.
size
,
$game
.
player_field
.
deck
.
size
,
$game
.
player_field
.
graveyard
.
size
,
$game
.
player_field
.
removed
.
size
,
$game
.
player_field
,
1
)
else
@phase
=
@phases_window
.
phase
=
phase
@phases_window
.
refresh
end
end
def
change_phase
(
phase
)
action
Action
::
ChangePhase
.
new
(
true
,
phase
)
end
end
def
reset
def
reset
action
Action
::
Reset
.
new
(
true
)
action
Action
::
Reset
.
new
(
true
)
...
@@ -80,12 +73,8 @@ class Scene_Duel < Scene
...
@@ -80,12 +73,8 @@ class Scene_Duel < Scene
case
event
.
button
case
event
.
button
when
Mouse
::
BUTTON_LEFT
when
Mouse
::
BUTTON_LEFT
if
@phases_window
.
include?
event
.
x
,
event
.
y
if
@phases_window
.
include?
event
.
x
,
event
.
y
if
@turn_player
@phases_window
.
mousemoved
event
.
x
,
event
.
y
@phases_window
.
mousemoved
event
.
x
,
event
.
y
change_phase
(
@phases_window
.
index
)
change_phase
(
Window_Phases
::
Phases
[
@phases_window
.
index
])
else
@phases_window
.
index
=
@phase
end
end
end
when
Mouse
::
BUTTON_RIGHT
when
Mouse
::
BUTTON_RIGHT
if
@player_field_window
.
action_window
if
@player_field_window
.
action_window
...
@@ -113,14 +102,7 @@ class Scene_Duel < Scene
...
@@ -113,14 +102,7 @@ class Scene_Duel < Scene
def
action
(
action
)
def
action
(
action
)
if
action
.
from_player
Game_Event
.
push
Game_Event
::
Action
.
new
(
action
)
str
=
action
.
escape
if
str
=~
/^\[\d+\] (?:●|◎)→(.*)$/m
str
=
$1
end
$chat_window
.
add
action
.
from_player
,
str
end
action
.
run
end
end
def
handle_game
(
event
)
def
handle_game
(
event
)
...
@@ -131,9 +113,12 @@ class Scene_Duel < Scene
...
@@ -131,9 +113,12 @@ class Scene_Duel < Scene
str
=
$1
str
=
$1
end
end
$chat_window
.
add
event
.
action
.
from_player
,
str
$chat_window
.
add
event
.
action
.
from_player
,
str
action
event
.
actio
n
event
.
action
.
ru
n
@player_field_window
.
refresh
@player_field_window
.
refresh
@opponent_field_window
.
refresh
@opponent_field_window
.
refresh
@phases_window
.
player
=
$game
.
turn_player
@phases_window
.
phase
=
$game
.
phase
@fieldback_window
.
card
=
$game
.
player_field
.
field
[
0
]
||
$game
.
opponent_field
.
field
[
0
]
when
Game_Event
::
Error
when
Game_Event
::
Error
Widget_Msgbox
.
new
(
event
.
title
,
event
.
message
){
$scene
=
Scene_Title
.
new
}
Widget_Msgbox
.
new
(
event
.
title
,
event
.
message
){
$scene
=
Scene_Title
.
new
}
when
Game_Event
::
Leave
when
Game_Event
::
Leave
...
...
lib/scene_hall.rb
View file @
482b469c
...
@@ -54,7 +54,7 @@ class Scene_Hall < Scene
...
@@ -54,7 +54,7 @@ class Scene_Hall < Scene
if
@roomlist
.
list
and
room
=
@roomlist
.
list
.
find
{
|
room
|
room
.
player1
==
$game
.
user
or
room
.
player2
==
$game
.
user
}
if
@roomlist
.
list
and
room
=
@roomlist
.
list
.
find
{
|
room
|
room
.
player1
==
$game
.
user
or
room
.
player2
==
$game
.
user
}
$game
.
qroom
room
$game
.
qroom
room
end
end
$game
.
close
$game
.
exit
$scene
=
Scene_Login
.
new
$scene
=
Scene_Login
.
new
end
end
when
Event
::
KeyUp
when
Event
::
KeyUp
...
...
lib/scene_watch.rb
View file @
482b469c
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#==============================================================================
#==============================================================================
require_relative
'scene_duel'
require_relative
'scene_duel'
class
Scene_Watch
<
Scene_Duel
class
Scene_Watch
<
Scene_Duel
def
create_action_window
end
def
action
(
action
)
def
action
(
action
)
action
.
run
action
.
run
end
end
...
...
lib/window_field.rb
View file @
482b469c
...
@@ -32,7 +32,6 @@ class Window_Field < Window
...
@@ -32,7 +32,6 @@ class Window_Field < Window
refresh
refresh
end
end
def
refresh
def
refresh
$scene
.
fieldback_window
.
card
=
$game
.
player_field
.
field
[
0
]
||
$game
.
opponent_field
.
field
[
0
]
rescue
nil
@items
.
clear
@items
.
clear
@cards
.
clear
@cards
.
clear
if
!
@field
.
deck
.
empty?
if
!
@field
.
deck
.
empty?
...
@@ -97,7 +96,7 @@ class Window_Field < Window
...
@@ -97,7 +96,7 @@ class Window_Field < Window
end
end
def
index
=
(
index
)
def
index
=
(
index
)
return
if
index
==
@index
return
if
index
==
@index
if
@index
if
@index
and
@items
.
has_key?
(
@index
)
||
(
@index
==
:deck
and
!
@field
.
deck
.
empty?
)
||
(
@index
==
:removed
and
!
@field
.
removed
.
empty?
)
||
(
@index
==
:extra
and
!
@field
.
extra
.
empty?
)
||
(
@index
==
:graveyard
and
!
@field
.
graveyard
.
empty?
)
clear
(
@items
[
@index
][
0
]
-
1
,
@items
[
@index
][
1
]
-
1
,
@items
[
@index
][
2
]
+
2
,
@items
[
@index
][
3
]
+
2
)
clear
(
@items
[
@index
][
0
]
-
1
,
@items
[
@index
][
1
]
-
1
,
@items
[
@index
][
2
]
+
2
,
@items
[
@index
][
3
]
+
2
)
draw_item
(
@index
,
0
)
draw_item
(
@index
,
0
)
end
end
...
@@ -214,7 +213,7 @@ class Window_Field < Window
...
@@ -214,7 +213,7 @@ class Window_Field < Window
end
end
end
end
def
clicked
def
clicked
return
if
!
@player
||
@index
.
nil?
return
unless
@action_window
&&
@index
action
=
case
@index
action
=
case
@index
when
:deck
when
:deck
case
@action_window
.
index
case
@action_window
.
index
...
...
lib/window_list.rb
View file @
482b469c
...
@@ -40,7 +40,7 @@ class Window_List < Window
...
@@ -40,7 +40,7 @@ class Window_List < Window
def
list
=
(
list
)
def
list
=
(
list
)
@list
=
list
@list
=
list
@item_max
=
@list
.
size
@item_max
=
@list
.
size
@height
=
@item_max
*
WLH
@height
=
@item_max
*
self
.
class
::
WLH
refresh
refresh
end
end
def
refresh
def
refresh
...
...
lib/window_phases.rb
View file @
482b469c
class
Window_Phases
<
Window_List
class
Window_Phases
<
Window_List
WLH
=
80
#其实是列宽
WLH
=
80
#其实是列宽
Phases
=
[
:DP
,
:SP
,
:M1
,
:BP
,
:M2
,
:EP
]
def
initialize
(
x
,
y
)
def
initialize
(
x
,
y
)
@phases_player
=
Surface
.
load
'graphics/system/phases_player.png'
@phases_player
=
Surface
.
load
'graphics/system/phases_player.png'
@phases_opponent
=
Surface
.
load
'graphics/system/phases_opponent.png'
@phases_opponent
=
Surface
.
load
'graphics/system/phases_opponent.png'
...
@@ -14,6 +15,7 @@ class Window_Phases < Window_List
...
@@ -14,6 +15,7 @@ class Window_Phases < Window_List
refresh
refresh
end
end
def
phase
=
(
phase
)
def
phase
=
(
phase
)
phase
=
Phases
.
index
(
phase
)
unless
(
0
..
5
).
include?
phase
return
if
phase
==
@phase
return
if
phase
==
@phase
@index
=
@phase
@index
=
@phase
@phase
=
phase
@phase
=
phase
...
...
iduel
.cmd
→
mycard
.cmd
View file @
482b469c
File moved
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