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
3a410d4c
Commit
3a410d4c
authored
Jun 26, 2024
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use ref in PROCESSOR_SELECT_SYNCHRO
parent
c752dee9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
34 deletions
+29
-34
libduel.cpp
libduel.cpp
+22
-13
operations.cpp
operations.cpp
+7
-21
No files found.
libduel.cpp
View file @
3a410d4c
...
@@ -3220,14 +3220,25 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
...
@@ -3220,14 +3220,25 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
}
}
if
(
mg
)
auto
filter1
=
interpreter
::
get_function_handle
(
L
,
3
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
nullptr
,
nullptr
,
playerid
,
min
+
(
max
<<
16
),
0
,
0
,
pcard
,
mg
);
auto
filter2
=
interpreter
::
get_function_handle
(
L
,
4
);
else
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
nullptr
,
nullptr
,
playerid
+
0x10000
,
min
+
(
max
<<
16
),
0
,
0
,
pcard
,
smat
);
if
(
mg
)
{
lua_pushvalue
(
L
,
3
);
for
(
auto
&
pm
:
mg
->
container
)
{
lua_pushvalue
(
L
,
4
);
if
(
pduel
->
game_field
->
check_tuner_material
(
L
,
pcard
,
pm
,
3
,
4
,
min
,
max
,
nullptr
,
mg
))
lua_pushvalue
(
L
,
2
);
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
pm
);
lua_xmove
(
L
,
pduel
->
lua
->
lua_state
,
3
);
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
nullptr
,
nullptr
,
playerid
,
min
+
(
max
<<
16
),
filter1
,
filter2
,
pcard
,
mg
);
}
else
{
field
::
card_set
material
;
pduel
->
game_field
->
get_synchro_material
(
playerid
,
&
material
);
for
(
auto
&
tuner
:
material
)
{
if
(
pduel
->
game_field
->
check_tuner_material
(
L
,
pcard
,
tuner
,
3
,
4
,
min
,
max
,
smat
,
nullptr
))
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
tuner
);
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
nullptr
,
nullptr
,
playerid
+
0x10000
,
min
+
(
max
<<
16
),
filter1
,
filter2
,
pcard
,
smat
);
}
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_check_synchro_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_check_synchro_material
(
lua_State
*
L
)
{
...
@@ -3280,11 +3291,9 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
...
@@ -3280,11 +3291,9 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
tuner
);
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
tuner
);
pduel
->
game_field
->
returns
.
bvalue
[
1
]
=
0
;
pduel
->
game_field
->
returns
.
bvalue
[
1
]
=
0
;
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
1
,
nullptr
,
nullptr
,
playerid
,
min
+
(
max
<<
16
),
0
,
0
,
pcard
,
mg
);
auto
filter1
=
interpreter
::
get_function_handle
(
L
,
4
);
lua_pushvalue
(
L
,
4
);
auto
filter2
=
interpreter
::
get_function_handle
(
L
,
5
);
lua_pushvalue
(
L
,
5
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
1
,
nullptr
,
nullptr
,
playerid
,
min
+
(
max
<<
16
),
filter1
,
filter2
,
pcard
,
mg
);
lua_pushvalue
(
L
,
2
);
lua_xmove
(
L
,
pduel
->
lua
->
lua_state
,
3
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_check_tuner_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_check_tuner_material
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
3a410d4c
...
@@ -5290,20 +5290,6 @@ int32 field::activate_effect(uint16 step, effect* peffect) {
...
@@ -5290,20 +5290,6 @@ int32 field::activate_effect(uint16 step, effect* peffect) {
int32
field
::
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
,
int32
filter1
,
int32
filter2
)
{
int32
field
::
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
,
int32
filter1
,
int32
filter2
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
core
.
select_cards
.
clear
();
if
(
mg
)
{
for
(
auto
&
pm
:
mg
->
container
)
{
if
(
check_tuner_material
(
pcard
,
pm
,
-
3
,
-
2
,
min
,
max
,
smat
,
mg
))
core
.
select_cards
.
push_back
(
pm
);
}
}
else
{
card_set
material
;
get_synchro_material
(
playerid
,
&
material
);
for
(
auto
&
tuner
:
material
)
{
if
(
check_tuner_material
(
pcard
,
tuner
,
-
3
,
-
2
,
min
,
max
,
smat
,
mg
))
core
.
select_cards
.
push_back
(
tuner
);
}
}
if
(
core
.
select_cards
.
size
()
==
0
)
if
(
core
.
select_cards
.
size
()
==
0
)
return
TRUE
;
return
TRUE
;
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
MSG_HINT
);
...
@@ -5315,7 +5301,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5315,7 +5301,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
}
}
case
1
:
{
case
1
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
lua_pop
(
pduel
->
lua
->
current_state
,
3
);
pduel
->
lua
->
add_param
(
nullptr
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
nullptr
,
PARAM_TYPE_GROUP
);
core
.
limit_tuner
=
0
;
core
.
limit_tuner
=
0
;
return
TRUE
;
return
TRUE
;
...
@@ -5331,7 +5316,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5331,7 +5316,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
return
FALSE
;
return
FALSE
;
core
.
synchro_materials
.
clear
();
core
.
synchro_materials
.
clear
();
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
-
2
,
PARAM_TYPE_INDEX
);
pduel
->
lua
->
add_param
(
filter2
,
PARAM_TYPE_FUNCTION
);
pduel
->
lua
->
add_param
(
min
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
min
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
max
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
max
,
PARAM_TYPE_INT
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
...
@@ -5342,7 +5327,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5342,7 +5327,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
lua_pop
(
pduel
->
lua
->
current_state
,
3
);
group
*
pgroup
=
pduel
->
new_group
(
core
.
synchro_materials
);
group
*
pgroup
=
pduel
->
new_group
(
core
.
synchro_materials
);
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
...
@@ -5441,7 +5425,9 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5441,7 +5425,9 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
pcheck
->
get_value
(
pm
);
pcheck
->
get_value
(
pm
);
if
(
pm
->
current
.
location
==
LOCATION_MZONE
&&
!
pm
->
is_position
(
POS_FACEUP
))
if
(
pm
->
current
.
location
==
LOCATION_MZONE
&&
!
pm
->
is_position
(
POS_FACEUP
))
continue
;
continue
;
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
2
,
1
))
pduel
->
lua
->
add_param
(
pm
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
if
(
!
pduel
->
lua
->
check_condition
(
filter2
,
2
))
continue
;
continue
;
nsyn
.
push_back
(
pm
);
nsyn
.
push_back
(
pm
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
...
@@ -5462,7 +5448,9 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5462,7 +5448,9 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
pcheck
->
get_value
(
pm
);
pcheck
->
get_value
(
pm
);
if
(
pm
->
current
.
location
==
LOCATION_MZONE
&&
!
pm
->
is_position
(
POS_FACEUP
))
if
(
pm
->
current
.
location
==
LOCATION_MZONE
&&
!
pm
->
is_position
(
POS_FACEUP
))
continue
;
continue
;
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
2
,
1
))
pduel
->
lua
->
add_param
(
pm
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
if
(
!
pduel
->
lua
->
check_condition
(
filter2
,
2
))
continue
;
continue
;
nsyn
.
push_back
(
pm
);
nsyn
.
push_back
(
pm
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
...
@@ -5593,7 +5581,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5593,7 +5581,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
return
FALSE
;
return
FALSE
;
}
}
case
8
:
{
case
8
:
{
lua_pop
(
pduel
->
lua
->
current_state
,
3
);
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
int32
mcount
=
(
int32
)
core
.
must_select_cards
.
size
();
int32
mcount
=
(
int32
)
core
.
must_select_cards
.
size
();
for
(
int32
i
=
mcount
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
for
(
int32
i
=
mcount
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
...
@@ -5608,7 +5595,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5608,7 +5595,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
return
TRUE
;
return
TRUE
;
}
}
case
9
:
{
case
9
:
{
lua_pop
(
pduel
->
lua
->
current_state
,
3
);
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
pgroup
->
container
.
insert
(
smat
);
pgroup
->
container
.
insert
(
smat
);
...
...
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