Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
nanahira
ygopro-core
Commits
2044525c
Commit
2044525c
authored
Jun 29, 2018
by
mercury233
Committed by
GitHub
Jun 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Duel.SSet (#165)
parent
09d4a3e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
11 deletions
+114
-11
field.h
field.h
+4
-1
libduel.cpp
libduel.cpp
+12
-2
operations.cpp
operations.cpp
+97
-7
processor.cpp
processor.cpp
+1
-1
No files found.
field.h
View file @
2044525c
...
@@ -227,6 +227,7 @@ struct processor {
...
@@ -227,6 +227,7 @@ struct processor {
card_set
discarded_set
;
card_set
discarded_set
;
card_set
destroy_canceled
;
card_set
destroy_canceled
;
card_set
delayed_enable_set
;
card_set
delayed_enable_set
;
card_set
set_group_set
;
effect_set_v
disfield_effects
;
effect_set_v
disfield_effects
;
effect_set_v
extram_effects
;
effect_set_v
extram_effects
;
effect_set_v
extras_effects
;
effect_set_v
extras_effects
;
...
@@ -277,6 +278,8 @@ struct processor {
...
@@ -277,6 +278,8 @@ struct processor {
uint32
copy_reset
;
uint32
copy_reset
;
uint8
copy_reset_count
;
uint8
copy_reset_count
;
uint32
last_control_changed_id
;
uint32
last_control_changed_id
;
uint32
set_group_used_zones
;
uint8
set_group_seq
[
7
];
uint8
dice_result
[
5
];
uint8
dice_result
[
5
];
uint8
coin_result
[
5
];
uint8
coin_result
[
5
];
uint8
to_bp
;
uint8
to_bp
;
...
@@ -553,7 +556,7 @@ public:
...
@@ -553,7 +556,7 @@ public:
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
);
int32
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
);
int32
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
,
uint8
confirm
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_rule
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
uint32
summon_type
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon_step
(
uint16
step
,
group
*
targets
,
card
*
target
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
int32
special_summon
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
group
*
targets
,
uint32
zone
);
...
...
libduel.cpp
View file @
2044525c
...
@@ -377,6 +377,9 @@ int32 scriptlib::duel_sets(lua_State *L) {
...
@@ -377,6 +377,9 @@ int32 scriptlib::duel_sets(lua_State *L) {
toplayer
=
lua_tointeger
(
L
,
3
);
toplayer
=
lua_tointeger
(
L
,
3
);
if
(
toplayer
!=
0
&&
toplayer
!=
1
)
if
(
toplayer
!=
0
&&
toplayer
!=
1
)
toplayer
=
playerid
;
toplayer
=
playerid
;
uint32
confirm
=
TRUE
;
if
(
lua_gettop
(
L
)
>
3
)
confirm
=
lua_toboolean
(
L
,
4
);
card
*
pcard
=
0
;
card
*
pcard
=
0
;
group
*
pgroup
=
0
;
group
*
pgroup
=
0
;
duel
*
pduel
=
0
;
duel
*
pduel
=
0
;
...
@@ -385,13 +388,20 @@ int32 scriptlib::duel_sets(lua_State *L) {
...
@@ -385,13 +388,20 @@ int32 scriptlib::duel_sets(lua_State *L) {
pduel
=
pcard
->
pduel
;
pduel
=
pcard
->
pduel
;
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
2
,
TRUE
))
{
}
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
2
,
TRUE
))
{
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
2
);
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
2
);
pduel
=
pgroup
->
pduel
;
if
(
pgroup
->
container
.
empty
())
{
return
0
;
}
else
if
(
pgroup
->
container
.
size
()
==
1
)
{
pcard
=
*
pgroup
->
container
.
begin
();
pduel
=
pcard
->
pduel
;
}
else
{
pduel
=
pgroup
->
pduel
;
}
}
else
}
else
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
2
);
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
2
);
if
(
pcard
)
if
(
pcard
)
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET
,
0
,
0
,
(
group
*
)
pcard
,
playerid
,
toplayer
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET
,
0
,
0
,
(
group
*
)
pcard
,
playerid
,
toplayer
);
else
else
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET_G
,
0
,
0
,
pgroup
,
playerid
,
toplayer
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SSET_G
,
0
,
0
,
pgroup
,
playerid
,
toplayer
,
confirm
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_create_token
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_create_token
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
2044525c
...
@@ -2358,7 +2358,7 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
...
@@ -2358,7 +2358,7 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
)
{
int32
field
::
sset_g
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
group
*
ptarget
,
uint8
confirm
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
card_set
*
set_cards
=
new
card_set
;
card_set
*
set_cards
=
new
card_set
;
...
@@ -2379,6 +2379,8 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
...
@@ -2379,6 +2379,8 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
returns
.
ivalue
[
0
]
=
0
;
returns
.
ivalue
[
0
]
=
0
;
return
TRUE
;
return
TRUE
;
}
}
core
.
set_group_set
.
clear
();
core
.
set_group_used_zones
=
0
;
core
.
phase_action
=
TRUE
;
core
.
phase_action
=
TRUE
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
set_cards
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
set_cards
;
return
FALSE
;
return
FALSE
;
...
@@ -2386,13 +2388,66 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
...
@@ -2386,13 +2388,66 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
case
1
:
{
case
1
:
{
card_set
*
set_cards
=
(
card_set
*
)
ptarget
;
card_set
*
set_cards
=
(
card_set
*
)
ptarget
;
card
*
target
=
*
set_cards
->
begin
();
card
*
target
=
*
set_cards
->
begin
();
target
->
enable_field_effect
(
false
);
uint32
flag
;
move_to_field
(
target
,
setplayer
,
toplayer
,
LOCATION_SZONE
,
POS_FACEDOWN
,
FALSE
);
int32
ct
=
get_useable_count
(
target
,
toplayer
,
LOCATION_SZONE
,
setplayer
,
LOCATION_REASON_TOFIELD
,
0xff
,
&
flag
);
if
(
ct
<=
0
)
{
core
.
units
.
begin
()
->
step
=
2
;
return
FALSE
;
}
if
(
target
->
data
.
type
&
TYPE_FIELD
)
{
returns
.
bvalue
[
2
]
=
5
;
return
FALSE
;
}
flag
|=
core
.
set_group_used_zones
;
if
(
setplayer
==
toplayer
)
{
flag
=
((
flag
&
0xff
)
<<
8
)
|
0xffff00ff
;
}
else
{
flag
=
((
flag
&
0xff
)
<<
24
)
|
0xffffff
;
}
flag
|=
0xe080e080
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
setplayer
);
pduel
->
write_buffer32
(
target
->
data
.
code
);
add_process
(
PROCESSOR_SELECT_PLACE
,
0
,
0
,
0
,
setplayer
,
flag
,
1
);
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
card_set
*
set_cards
=
(
card_set
*
)
ptarget
;
card_set
*
set_cards
=
(
card_set
*
)
ptarget
;
card
*
target
=
*
set_cards
->
begin
();
card
*
target
=
*
set_cards
->
begin
();
uint32
seq
=
returns
.
bvalue
[
2
];
core
.
set_group_seq
[
core
.
set_group_set
.
size
()]
=
seq
;
core
.
set_group_set
.
insert
(
target
);
core
.
set_group_used_zones
|=
(
1
<<
seq
);
set_cards
->
erase
(
target
);
if
(
!
set_cards
->
empty
())
core
.
units
.
begin
()
->
step
=
0
;
else
delete
set_cards
;
return
FALSE
;
}
case
3
:
{
card_set
*
set_cards
=
&
core
.
set_group_set
;
card
*
target
=
*
set_cards
->
begin
();
target
->
enable_field_effect
(
false
);
uint32
zone
;
if
(
target
->
data
.
type
&
TYPE_FIELD
)
{
zone
=
1
<<
5
;
}
else
{
for
(
uint32
i
=
0
;
i
<
7
;
i
++
)
{
zone
=
1
<<
i
;
if
(
core
.
set_group_used_zones
&
zone
)
{
core
.
set_group_used_zones
&=
~
zone
;
break
;
}
}
}
move_to_field
(
target
,
setplayer
,
toplayer
,
LOCATION_SZONE
,
POS_FACEDOWN
,
FALSE
,
0
,
FALSE
,
zone
);
return
FALSE
;
}
case
4
:
{
card_set
*
set_cards
=
&
core
.
set_group_set
;
card
*
target
=
*
set_cards
->
begin
();
target
->
set_status
(
STATUS_SET_TURN
,
TRUE
);
target
->
set_status
(
STATUS_SET_TURN
,
TRUE
);
if
(
target
->
data
.
type
&
TYPE_MONSTER
)
{
if
(
target
->
data
.
type
&
TYPE_MONSTER
)
{
effect
*
peffect
=
target
->
is_affected_by_effect
(
EFFECT_MONSTER_SSET
);
effect
*
peffect
=
target
->
is_affected_by_effect
(
EFFECT_MONSTER_SSET
);
...
@@ -2411,12 +2466,47 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
...
@@ -2411,12 +2466,47 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
core
.
operated_set
.
insert
(
target
);
core
.
operated_set
.
insert
(
target
);
set_cards
->
erase
(
target
);
set_cards
->
erase
(
target
);
if
(
!
set_cards
->
empty
())
if
(
!
set_cards
->
empty
())
core
.
units
.
begin
()
->
step
=
0
;
core
.
units
.
begin
()
->
step
=
2
;
else
delete
set_cards
;
return
FALSE
;
return
FALSE
;
}
}
case
3
:
{
case
5
:
{
if
(
confirm
)
{
pduel
->
write_buffer8
(
MSG_CONFIRM_CARDS
);
pduel
->
write_buffer8
(
toplayer
);
pduel
->
write_buffer8
(
core
.
operated_set
.
size
());
for
(
auto
cit
=
core
.
operated_set
.
begin
();
cit
!=
core
.
operated_set
.
end
();
++
cit
)
{
pduel
->
write_buffer32
((
*
cit
)
->
data
.
code
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
controler
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
location
);
pduel
->
write_buffer8
((
*
cit
)
->
current
.
sequence
);
}
}
return
FALSE
;
}
case
6
:
{
uint8
ct
=
core
.
operated_set
.
size
();
if
(
core
.
set_group_used_zones
&
(
1
<<
5
))
ct
--
;
pduel
->
write_buffer8
(
MSG_SHUFFLE_SET_CARD
);
pduel
->
write_buffer8
(
LOCATION_SZONE
);
pduel
->
write_buffer8
(
ct
);
uint8
i
=
0
;
for
(
auto
cit
=
core
.
operated_set
.
begin
();
cit
!=
core
.
operated_set
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
uint8
seq
=
core
.
set_group_seq
[
i
];
i
++
;
if
(
pcard
->
data
.
type
&
TYPE_FIELD
)
continue
;
pduel
->
write_buffer32
(
pcard
->
get_info_location
());
pduel
->
game_field
->
player
[
toplayer
].
list_szone
[
seq
]
=
pcard
;
pcard
->
current
.
sequence
=
seq
;
}
for
(
uint32
i
=
0
;
i
<
ct
;
++
i
)
{
pduel
->
write_buffer32
(
0
);
}
return
FALSE
;
}
case
7
:
{
returns
.
ivalue
[
0
]
=
core
.
operated_set
.
size
();
returns
.
ivalue
[
0
]
=
core
.
operated_set
.
size
();
adjust_instant
();
adjust_instant
();
raise_event
(
&
core
.
operated_set
,
EVENT_SSET
,
0
,
0
,
setplayer
,
setplayer
,
0
);
raise_event
(
&
core
.
operated_set
,
EVENT_SSET
,
0
,
0
,
setplayer
,
setplayer
,
0
);
...
...
processor.cpp
View file @
2044525c
...
@@ -417,7 +417,7 @@ int32 field::process() {
...
@@ -417,7 +417,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SSET_G
:
{
case
PROCESSOR_SSET_G
:
{
if
(
sset_g
(
it
->
step
,
it
->
arg1
,
it
->
arg2
,
it
->
ptarget
))
{
if
(
sset_g
(
it
->
step
,
it
->
arg1
,
it
->
arg2
,
it
->
ptarget
,
it
->
arg3
))
{
pduel
->
lua
->
add_param
(
returns
.
ivalue
[
0
],
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
returns
.
ivalue
[
0
],
PARAM_TYPE_INT
);
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
}
else
}
else
...
...
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