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
26b4ce92
Commit
26b4ce92
authored
Jun 23, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lua_State* to check_tuner_material
parent
11c76618
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
15 deletions
+21
-15
field.cpp
field.cpp
+14
-10
field.h
field.h
+4
-2
libduel.cpp
libduel.cpp
+3
-3
No files found.
field.cpp
View file @
26b4ce92
...
...
@@ -2525,29 +2525,29 @@ void field::get_synchro_material(uint8 playerid, card_set* material, effect* tun
}
}
}
int32
field
::
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
int32
field
::
check_synchro_material
(
lua_State
*
L
,
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
if
(
mg
)
{
for
(
auto
&
tuner
:
mg
->
container
)
{
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
if
(
check_tuner_material
(
L
,
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
return
TRUE
;
}
}
else
{
card_set
material
;
get_synchro_material
(
pcard
->
current
.
controler
,
&
material
);
for
(
auto
&
tuner
:
material
)
{
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
if
(
check_tuner_material
(
L
,
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
return
TRUE
;
}
}
return
FALSE
;
}
int32
field
::
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
int32
field
::
check_tuner_material
(
lua_State
*
L
,
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
if
(
!
tuner
||
(
tuner
->
current
.
location
==
LOCATION_MZONE
&&
!
tuner
->
is_position
(
POS_FACEUP
))
||
!
tuner
->
is_tuner
(
pcard
)
||
!
tuner
->
is_can_be_synchro_material
(
pcard
))
return
FALSE
;
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
if
(
pcheck
)
pcheck
->
get_value
(
tuner
);
if
((
mg
&&
!
mg
->
has_card
(
tuner
))
||
!
pduel
->
lua
->
check_
matching
(
tuner
,
findex1
,
0
))
{
if
((
mg
&&
!
mg
->
has_card
(
tuner
))
||
!
pduel
->
lua
->
check_
filter
(
L
,
tuner
,
findex1
,
0
))
{
pduel
->
restore_assumes
();
return
FALSE
;
}
...
...
@@ -2559,7 +2559,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
}
pduel
->
lua
->
add_param
(
pcustom
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
findex2
,
PARAM_TYPE_INDEX
);
pduel
->
lua
->
add_param
(
interpreter
::
get_function_handle
(
L
,
findex2
),
PARAM_TYPE_FUNCTION
);
pduel
->
lua
->
add_param
(
min
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
max
,
PARAM_TYPE_INT
);
if
(
pduel
->
lua
->
check_condition
(
pcustom
->
target
,
5
))
{
...
...
@@ -2625,7 +2625,9 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
if
(
smat
)
{
if
(
pcheck
)
pcheck
->
get_value
(
smat
);
if
((
smat
->
current
.
location
==
LOCATION_MZONE
&&
!
smat
->
is_position
(
POS_FACEUP
))
||
!
smat
->
is_can_be_synchro_material
(
pcard
,
tuner
)
||
!
pduel
->
lua
->
check_matching
(
smat
,
findex2
,
1
))
{
if
((
smat
->
current
.
location
==
LOCATION_MZONE
&&
!
smat
->
is_position
(
POS_FACEUP
))
||
!
smat
->
is_can_be_synchro_material
(
pcard
,
tuner
)
||
!
pduel
->
lua
->
check_filter
(
L
,
smat
,
findex2
,
1
))
{
pduel
->
restore_assumes
();
return
FALSE
;
}
...
...
@@ -2676,7 +2678,9 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
continue
;
if
(
pcheck
)
pcheck
->
get_value
(
mcard
);
if
((
mcard
->
current
.
location
==
LOCATION_MZONE
&&
!
mcard
->
is_position
(
POS_FACEUP
))
||
!
mcard
->
is_can_be_synchro_material
(
pcard
,
tuner
)
||
!
pduel
->
lua
->
check_matching
(
mcard
,
findex2
,
1
))
{
if
((
mcard
->
current
.
location
==
LOCATION_MZONE
&&
!
mcard
->
is_position
(
POS_FACEUP
))
||
!
mcard
->
is_can_be_synchro_material
(
pcard
,
tuner
)
||
!
pduel
->
lua
->
check_filter
(
L
,
mcard
,
findex2
,
1
))
{
pduel
->
restore_assumes
();
return
FALSE
;
}
...
...
@@ -2719,7 +2723,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
pcheck
->
get_value
(
pm
);
if
(
pm
->
current
.
location
==
LOCATION_MZONE
&&
!
pm
->
is_position
(
POS_FACEUP
))
continue
;
if
(
!
pduel
->
lua
->
check_
matching
(
pm
,
findex2
,
1
))
if
(
!
pduel
->
lua
->
check_
filter
(
L
,
pm
,
findex2
,
1
))
continue
;
nsyn
.
push_back
(
pm
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
...
...
@@ -2740,7 +2744,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
pcheck
->
get_value
(
pm
);
if
(
pm
->
current
.
location
==
LOCATION_MZONE
&&
!
pm
->
is_position
(
POS_FACEUP
))
continue
;
if
(
!
pduel
->
lua
->
check_
matching
(
pm
,
findex2
,
1
))
if
(
!
pduel
->
lua
->
check_
filter
(
L
,
pm
,
findex2
,
1
))
continue
;
nsyn
.
push_back
(
pm
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
...
...
field.h
View file @
26b4ce92
...
...
@@ -477,8 +477,10 @@ public:
int32
get_must_material_list
(
uint8
playerid
,
uint32
limit
,
card_set
*
must_list
);
int32
check_must_material
(
group
*
mg
,
uint8
playerid
,
uint32
limit
);
void
get_synchro_material
(
uint8
playerid
,
card_set
*
material
,
effect
*
tuner_limit
=
nullptr
);
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
//check material
int32
check_synchro_material
(
lua_State
*
L
,
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
lua_State
*
L
,
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
,
int32
opmin
);
...
...
libduel.cpp
View file @
26b4ce92
...
...
@@ -3252,7 +3252,7 @@ int32 scriptlib::duel_check_synchro_material(lua_State *L) {
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
lua_pushvalue
(
L
,
1
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
,
smat
,
mg
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
L
,
pcard
,
2
,
3
,
min
,
max
,
smat
,
mg
));
return
1
;
}
int32
scriptlib
::
duel_select_tuner_material
(
lua_State
*
L
)
{
...
...
@@ -3277,7 +3277,7 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
}
lua_pushvalue
(
L
,
2
);
if
(
!
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
4
,
5
,
min
,
max
,
0
,
mg
))
if
(
!
pduel
->
game_field
->
check_tuner_material
(
L
,
pcard
,
tuner
,
4
,
5
,
min
,
max
,
0
,
mg
))
return
0
;
lua_pop
(
L
,
1
);
pduel
->
game_field
->
core
.
select_cards
.
clear
();
...
...
@@ -3309,7 +3309,7 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
lua_pushvalue
(
L
,
1
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
3
,
4
,
min
,
max
,
0
,
mg
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tuner_material
(
L
,
pcard
,
tuner
,
3
,
4
,
min
,
max
,
0
,
mg
));
return
1
;
}
int32
scriptlib
::
duel_get_ritual_material
(
lua_State
*
L
)
{
...
...
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