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
1f985569
Commit
1f985569
authored
Dec 31, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iduel replay,支持从iduel对战中复制出来的战报
parent
8f49dcd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/iduel/replay.rb
lib/iduel/replay.rb
+6
-5
No files found.
lib/iduel/replay.rb
View file @
1f985569
#encoding: UTF-8
#encoding: UTF-8
class
Replay
class
Replay
Delimiter
=
/^.+?\(\d+\)
\(\d+:\d+:\d+\): (?:\r)?\n
/
Delimiter
=
/^.+?\(\d+\)
(?:\(\d+:\d+:\d+\))?(?:: |:)\n ?
/
Player_Filter
=
/^(.+?)\((\d+)\)
\(\d+:\d+:\d+\): (?:\r)?\n
\[\d+\] ◎→/
Player_Filter
=
/^(.+?)\((\d+)\)
(?:\(\d+:\d+:\d+\))?(?:: |:)\n ?
\[\d+\] ◎→/
Opponent_Filter
=
/^(.+?)\((\d+)\)
\(\d+:\d+:\d+\): (?:\r)?\n
\[\d+\] ●→/
Opponent_Filter
=
/^(.+?)\((\d+)\)
(?:\(\d+:\d+:\d+\))?(?:: |:)\n ?
\[\d+\] ●→/
attr_accessor
:room
,
:player1
,
:player2
,
:actions
attr_accessor
:room
,
:player1
,
:player2
,
:actions
def
add
(
action
)
def
add
(
action
)
# user = action.from_player ? $game.player1 : $game.player2
# user = action.from_player ? $game.player1 : $game.player2
...
@@ -25,10 +25,11 @@ class Replay
...
@@ -25,10 +25,11 @@ class Replay
result
.
player2
=
User
.
new
(
1
,
"对手"
)
result
.
player2
=
User
.
new
(
1
,
"对手"
)
end
end
result
.
actions
=
contents
.
split
(
Delimiter
).
collect
do
|
action_str
|
result
.
actions
=
contents
.
split
(
Delimiter
).
collect
do
|
action_str
|
action_str
.
chomp!
action_str
.
strip!
next
if
action_str
.
empty?
action
=
Action
.
parse
action_str
action
=
Action
.
parse
action_str
Game_Event
::
Action
.
new
(
action
,
action_str
)
Game_Event
::
Action
.
new
(
action
,
action_str
)
end
end
.
compact
$game
.
room
=
result
.
room
=
Room
.
new
(
0
,
"Replay"
,
result
.
player1
,
result
.
player2
)
$game
.
room
=
result
.
room
=
Room
.
new
(
0
,
"Replay"
,
result
.
player1
,
result
.
player2
)
result
result
end
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