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
c00efc2b
Commit
c00efc2b
authored
Nov 20, 2011
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
卡片操作 移动系基本完成
parent
3f1a32a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
40 deletions
+125
-40
lib/action.rb
lib/action.rb
+11
-9
lib/iduel_action.rb
lib/iduel_action.rb
+31
-5
lib/window_field.rb
lib/window_field.rb
+83
-26
No files found.
lib/action.rb
View file @
c00efc2b
...
...
@@ -88,7 +88,6 @@ class Action
@position
=
position
end
def
run
#p 1
from_field
=
case
@from_pos
when
Integer
player_field
.
field
...
...
@@ -117,16 +116,11 @@ class Action
from_field
.
delete_at
from_pos
end
end
#p @to_pos
#p self
#p @to_pos
to_field
=
case
@to_pos
when
Integer
player_field
.
field
when
:hand
player_field
.
hand
#when :field
# player_field.field
when
:graveyard
player_field
.
graveyard
when
:deck
...
...
@@ -136,11 +130,10 @@ class Action
when
:removed
player_field
.
removed
end
#p to_field
if
@to_pos
.
is_a?
Integer
to_field
[
@to_pos
]
=
@card
#elsif to_field == player_field.field
# to_pos = from_field.index(nil) || 11
#elsif to_field == player_field.field
# to_pos = from_field.index(nil) || 11
else
to_field
.
unshift
@card
end
...
...
@@ -197,6 +190,14 @@ class Action
super
(
from_player
,
from_pos
,
:opponent
,
card
)
end
end
class
Tribute
<
SendToGraveyard
;
end
class
Flip
<
Move
def
initialize
(
from_player
,
from_pos
,
card
)
super
(
from_player
,
from_pos
,
from_pos
,
card
)
end
end
class
FlipSummon
<
Flip
end
class
Refresh_Field
<
Action
attr_reader
:lp
,
:hand_count
,
:deck_count
,
:graveyard_count
,
:removed_count
,
:field
def
initialize
(
from_player
,
msg
,
lp
,
hand_count
,
deck_count
,
graveyard_count
,
removed_count
,
field
)
...
...
@@ -209,6 +210,7 @@ class Action
@field
=
field
end
end
class
Turn_End
<
Refresh_Field
attr_reader
:turn
def
initialize
(
from_player
,
msg
,
lp
,
hand_count
,
deck_count
,
graveyard_count
,
removed_count
,
field
,
turn
)
...
...
lib/iduel_action.rb
View file @
c00efc2b
...
...
@@ -250,7 +250,16 @@ class Action
end
class
Set
def
escape
"[
#{
@id
}
] ◎→从手卡~取一张
#{
@card
.
monster?
?
"怪兽卡"
:
"魔/陷卡"
}
盖到场上(
#{
@to_pos
}
)"
case
@from_pos
when
@to_pos
if
(
0
..
5
).
include?
@to_pos
#魔陷
"[
#{
@id
}
] ◎→(
#{
@from_pos
}
)
#{
@card
.
escape
}
变为里侧表示"
elsif
(
6
..
10
).
include?
@to_pos
#怪兽
"[
#{
@id
}
] ◎→从怪兽区(
#{
@from_pos
}
)~取一张怪兽卡盖到场上(
#{
@to_pos
}
)"
end
when
:hand
"[
#{
@id
}
] ◎→从手卡~取一张
#{
@card
.
monster?
?
"怪兽卡"
:
"魔/陷卡"
}
盖到场上(
#{
@to_pos
}
)"
end
end
end
class
Summon
...
...
@@ -260,7 +269,7 @@ class Action
end
class
SpecialSummon
def
escape
"[
#{
@id
}
] ◎→从
手卡~特殊召唤
#{
@card
.
escape
}
(
#{
@to_pos
}
)呈守备
表示"
"[
#{
@id
}
] ◎→从
#{
Action
.
escape_pos2
(
@from_pos
)
}
~特殊召唤
#{
@card
.
escape
}
(
#{
@to_pos
}
)呈
#{
case
@position
;
when
:attack
;
"攻击"
;
when
:defense
;
"守备"
;
when
:set
;
"背面守备"
;
end
}
表示"
end
end
class
Activate
...
...
@@ -273,6 +282,11 @@ class Action
"[
#{
@id
}
] ◎→将
#{
@card
.
escape
}
从~
#{
Action
.
escape_pos2
(
@from_pos
)
}
~送往墓地"
end
end
class
Tribute
def
escape
"[
#{
@id
}
] ◎→将~
#{
Action
.
escape_pos2
(
@from_pos
)
}
~的
#{
@card
.
escape
}
解~放"
end
end
class
Remove
def
escape
"[
#{
@id
}
] ◎→将
#{
Action
.
escape_pos2
(
@from_pos
)
}
的
#{
@card
.
escape
}
从游戏中除外"
...
...
@@ -288,7 +302,7 @@ class Action
when
:removed
"除外区"
when
0
..
10
"场上(
#{
pos
}
)"
"场上(
#{
@from_
pos
}
)"
end
"[
#{
@id
}
] ◎→从
#{
pos
}
取
#{
@card
.
escape
}
加入手卡"
end
...
...
@@ -303,7 +317,7 @@ class Action
when
:removed
"除外区"
when
0
..
10
"场上(
#{
pos
}
)"
"场上(
#{
@from_
pos
}
)"
end
"[
#{
@id
}
] ◎→
#{
@from_pos
==
:hand
?
"一张卡"
:
@card
.
escape
}
从
#{
pos
}
~放回卡组顶端"
#TODO:set=【一张卡】
end
...
...
@@ -321,6 +335,16 @@ class Action
"[
#{
@id
}
] ◎→
#{
@card
.
escape
}
从
#{
pos
}
返回额外牌堆"
end
end
class
Flip
<
Move
def
escape
"[
#{
@id
}
] ◎→(
#{
@from_pos
}
)
#{
@card
.
escape
}
打开"
end
end
class
FlipSummon
<
Flip
def
escape
"[
#{
@id
}
] ◎→(
#{
@from_pos
}
)
#{
@card
.
escape
}
反转"
end
end
class
Effect_Activate
def
escape
pos
=
case
@from_pos
...
...
@@ -332,10 +356,12 @@ class Action
"己方卡组"
when
:extra
"己方额外牌堆"
when
:removed
"己方除外区"
when
0
..
10
"(
#{
@from_pos
}
)"
end
"[
#{
@id
}
] ◎→
#{
pos
}#{
@card
.
escape
}
效果发
~
动"
"[
#{
@id
}
] ◎→
#{
pos
}#{
@card
.
escape
}
效果发
#{
"~"
unless
(
0
..
10
).
include?
@from_pos
}
动"
end
end
end
...
...
lib/window_field.rb
View file @
c00efc2b
...
...
@@ -110,7 +110,6 @@ class Window_Field < Window
when
:removed
@card
=
@field
.
removed
.
first
@action_names
=
{
"特殊召唤"
=>
@card
.
monster?
,
"发动"
=>
!
@card
.
monster?
,
"效果发动"
=>
true
,
"加入手卡"
=>
true
,
"返回卡组"
=>
true
,
...
...
@@ -119,7 +118,6 @@ class Window_Field < Window
when
:graveyard
@card
=
@field
.
graveyard
.
first
@action_names
=
{
"特殊召唤"
=>
@card
.
monster?
,
"发动"
=>
!
@card
.
monster?
,
"效果发动"
=>
true
,
"加入手卡"
=>
true
,
"返回卡组"
=>
true
,
...
...
@@ -132,21 +130,23 @@ class Window_Field < Window
"送入墓地"
=>
true
,
"从游戏中除外"
=>
true
,
"加入手卡"
=>
true
,
"
打开/
盖伏"
=>
true
"盖伏"
=>
true
}
when
6
..
10
@card
=
@field
.
field
[
@index
]
@action_names
=
{
"攻/守形式转换"
=>
true
,
"里侧/表侧转换"
=>
true
,
"转为里侧守备"
=>
true
,
"攻击宣言"
=>
true
,
@action_names
=
{
"攻击表示"
=>
false
,
"守备表示"
=>
false
,
"里侧表示"
=>
true
,
"反转召唤"
=>
true
,
"打开"
=>
true
,
"效果发动"
=>
true
,
"转移控制权"
=>
true
,
"攻击宣言"
=>
false
,
"转移控制权"
=>
false
,
"放回卡组顶端"
=>
true
,
"送入墓地"
=>
true
,
"解放"
=>
true
,
"加入手卡"
=>
true
,
"送入对手墓地"
=>
tru
e
#"送入对手墓地" => fals
e
}
when
Integer
#手卡
@card
=
@field
.
hand
[
@index
-
11
]
...
...
@@ -231,36 +231,93 @@ class Window_Field < Window
Action
::
SendToGraveyard
.
new
(
true
,
:extra
,
@card
).
run
end
when
:removed
# @action_names = {"特殊召唤" => @card.monster?,
# "发动" => !@card.monster?,
# "效果发动" => true,
# "加入手卡" => true,
# "返回卡组" => true,
# "送入墓地" => true
case
$scene
.
action_window
.
index
when
0
#特殊召唤
if
pos
=
@field
.
empty_field
(
@card
)
Action
::
Summon
.
new
(
true
,
:removed
,
pos
,
@card
).
run
Action
::
S
pecialS
ummon
.
new
(
true
,
:removed
,
pos
,
@card
).
run
else
p
"场位已满"
end
when
1
#发动
when
1
#效果发动
Action
::
Effect_Activate
.
new
(
true
,
:removed
,
@card
).
run
when
2
#加入手卡
Action
::
ReturnToHand
.
new
(
true
,
:removed
,
@card
).
run
when
3
Action
::
ReturnToDeck
.
new
(
true
,
:removed
,
@card
).
run
when
4
Action
::
SendToGraveyard
.
new
(
true
,
:removed
,
@card
).
run
end
when
:graveyard
case
$scene
.
action_window
.
index
when
0
#特殊召唤
if
pos
=
@field
.
empty_field
(
@card
)
Action
::
Activate
.
new
(
true
,
:remove
d
,
pos
,
@card
).
run
Action
::
SpecialSummon
.
new
(
true
,
:graveyar
d
,
pos
,
@card
).
run
else
p
"场位已满"
end
when
2
#效果发动
Action
::
Effect_Activate
.
new
(
true
,
:removed
,
@card
).
run
when
3
#加入手卡
Action
::
ReturnToHand
.
new
(
true
,
:removed
,
@card
).
run
when
1
#效果发动
Action
::
Effect_Activate
.
new
(
true
,
:graveyard
,
@card
).
run
when
2
#加入手卡
Action
::
ReturnToHand
.
new
(
true
,
:graveyard
,
@card
).
run
when
3
Action
::
ReturnToDeck
.
new
(
true
,
:graveyard
,
@card
).
run
when
4
Action
::
ReturnToDeck
.
new
(
true
,
:removed
,
@card
).
run
Action
::
Remove
.
new
(
true
,
:graveyard
,
@card
).
run
end
when
0
..
5
#后场
case
$scene
.
action_window
.
index
when
0
#效果发动
Action
::
Effect_Activate
.
new
(
true
,
@index
,
@card
).
run
when
1
#返回卡组
Action
::
ReturnToDeck
.
new
(
true
,
@index
,
@card
).
run
when
2
#送入墓地
Action
::
SendToGraveyard
.
new
(
true
,
@index
,
@card
).
run
when
3
#从游戏中除外
Action
::
Remove
.
new
(
true
,
@index
,
@card
).
run
when
4
#加入手卡
Action
::
ReturnToHand
.
new
(
true
,
@index
,
@card
).
run
when
5
#盖伏
Action
::
Set
.
new
(
true
,
@index
,
@index
,
@card
).
run
end
when
6
..
10
#前场
#{"攻击表示" => false,
# "守备表示" => false,
# "里侧表示" => true,
# "反转召唤" => true,
# "打开" => true,
# "效果发动" => true,
# "攻击宣言" => false,
# "转移控制权" => false,
# "放回卡组顶端" => true,
# "送入墓地" => true,
# "解放" => true,
# "加入手卡" => true,
case
$scene
.
action_window
.
index
when
0
p
"未实现"
when
1
p
"未实现"
when
2
Action
::
Set
.
new
(
true
,
@index
,
@index
,
@card
).
run
when
3
Action
::
FlipSummon
.
new
(
true
,
@index
,
@card
).
run
when
4
Action
::
Flip
.
new
(
true
,
@index
,
@card
).
run
when
5
Action
::
SendToGraveyard
.
new
(
true
,
:removed
,
@card
).
run
Action
::
Effect_Activate
.
new
(
true
,
@index
,
@card
).
run
when
6
p
"未实现"
when
7
p
"未实现"
when
8
Action
::
ReturnToDeck
.
new
(
true
,
@index
,
@card
).
run
when
9
Action
::
SendToGraveyard
.
new
(
true
,
@index
,
@card
).
run
when
10
Action
::
Tribute
.
new
(
true
,
@index
,
@card
).
run
when
11
Action
::
ReturnToHand
.
new
(
true
,
@index
,
@card
).
run
end
when
0
..
10
#场上
when
Integer
#手卡
case
$scene
.
action_window
.
index
when
0
#召唤
...
...
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