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
bfbd9ded
Commit
bfbd9ded
authored
Jun 22, 2024
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lua_State* to get_release_list
parent
554f5f8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
field.cpp
field.cpp
+6
-6
field.h
field.h
+2
-2
libduel.cpp
libduel.cpp
+6
-6
No files found.
field.cpp
View file @
bfbd9ded
...
...
@@ -1662,13 +1662,13 @@ effect* field::is_player_affected_by_effect(uint8 playerid, uint32 code) {
}
return
nullptr
;
}
int32
field
::
get_release_list
(
uint8
playerid
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_oneof
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
)
{
int32
field
::
get_release_list
(
lua_State
*
L
,
uint8
playerid
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_oneof
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
)
{
uint32
rcount
=
0
;
effect
*
re
=
core
.
reason_effect
;
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_
matching
(
pcard
,
fun
,
exarg
)))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_
filter
(
L
,
pcard
,
fun
,
exarg
)))
{
if
(
release_list
)
release_list
->
insert
(
pcard
);
pcard
->
release_param
=
1
;
...
...
@@ -1679,7 +1679,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_
matching
(
pcard
,
fun
,
exarg
)))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_
filter
(
L
,
pcard
,
fun
,
exarg
)))
{
if
(
release_list
)
release_list
->
insert
(
pcard
);
pcard
->
release_param
=
1
;
...
...
@@ -1692,7 +1692,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
(
pcard
->
is_position
(
POS_FACEUP
)
||
!
use_con
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
,
reason
)
&&
(
reason
!=
REASON_EFFECT
||
pcard
->
is_releasable_by_effect
(
playerid
,
re
))
&&
(
!
use_con
||
pduel
->
lua
->
check_
matching
(
pcard
,
fun
,
exarg
)))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_
filter
(
L
,
pcard
,
fun
,
exarg
)))
{
pcard
->
release_param
=
1
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
ex_list
)
...
...
@@ -1715,10 +1715,10 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
}
return
rcount
+
ex_oneof_max
;
}
int32
field
::
check_release_list
(
uint8
playerid
,
int32
count
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
)
{
int32
field
::
check_release_list
(
lua_State
*
L
,
uint8
playerid
,
int32
count
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
)
{
card_set
relcard
;
card_set
relcard_oneof
;
get_release_list
(
playerid
,
&
relcard
,
&
relcard
,
&
relcard_oneof
,
use_con
,
use_hand
,
fun
,
exarg
,
exc
,
exg
,
reason
);
get_release_list
(
L
,
playerid
,
&
relcard
,
&
relcard
,
&
relcard_oneof
,
use_con
,
use_hand
,
fun
,
exarg
,
exc
,
exg
,
reason
);
bool
has_oneof
=
false
;
for
(
auto
&
pcard
:
core
.
must_select_cards
)
{
auto
it
=
relcard
.
find
(
pcard
);
...
...
field.h
View file @
bfbd9ded
...
...
@@ -437,8 +437,8 @@ public:
int32
filter_field_card
(
uint8
self
,
uint32
location
,
uint32
location2
,
group
*
pgroup
);
effect
*
is_player_affected_by_effect
(
uint8
playerid
,
uint32
code
);
int32
get_release_list
(
uint8
playerid
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_oneof
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
);
int32
check_release_list
(
uint8
playerid
,
int32
count
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
);
int32
get_release_list
(
lua_State
*
L
,
uint8
playerid
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_oneof
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
);
int32
check_release_list
(
lua_State
*
L
,
uint8
playerid
,
int32
count
,
int32
use_con
,
int32
use_hand
,
int32
fun
,
int32
exarg
,
card
*
exc
,
group
*
exg
,
uint32
reason
);
int32
get_summon_release_list
(
card
*
target
,
card_set
*
release_list
,
card_set
*
ex_list
,
card_set
*
ex_list_oneof
,
group
*
mg
=
nullptr
,
uint32
ex
=
0
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
int32
get_summon_count_limit
(
uint8
playerid
);
int32
get_draw_count
(
uint8
playerid
);
...
...
libduel.cpp
View file @
bfbd9ded
...
...
@@ -2704,7 +2704,7 @@ int32 scriptlib::duel_get_release_group(lua_State *L) {
reason
=
(
uint32
)
lua_tointeger
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
group
*
pgroup
=
pduel
->
new_group
();
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pgroup
->
container
,
&
pgroup
->
container
,
&
pgroup
->
container
,
FALSE
,
hand
,
0
,
0
,
nullptr
,
nullptr
,
reason
);
pduel
->
game_field
->
get_release_list
(
L
,
playerid
,
&
pgroup
->
container
,
&
pgroup
->
container
,
&
pgroup
->
container
,
FALSE
,
hand
,
0
,
0
,
nullptr
,
nullptr
,
reason
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
...
...
@@ -2725,7 +2725,7 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) {
if
(
lua_gettop
(
L
)
>=
3
)
reason
=
(
uint32
)
lua_tointeger
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_release_list
(
playerid
,
nullptr
,
nullptr
,
FALSE
,
FALSE
,
hand
,
0
,
0
,
nullptr
,
nullptr
,
reason
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_release_list
(
L
,
playerid
,
nullptr
,
nullptr
,
nullptr
,
FALSE
,
hand
,
0
,
0
,
nullptr
,
nullptr
,
reason
));
return
1
;
}
int32
scriptlib
::
duel_check_release_group
(
lua_State
*
L
)
{
...
...
@@ -2748,7 +2748,7 @@ int32 scriptlib::duel_check_release_group(lua_State *L) {
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
4
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
,
REASON_COST
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
L
,
playerid
,
fcount
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
,
REASON_COST
);
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
lua_pushboolean
(
L
,
result
);
return
1
;
...
...
@@ -2778,7 +2778,7 @@ int32 scriptlib::duel_select_release_group(lua_State *L) {
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
,
REASON_COST
);
pduel
->
game_field
->
get_release_list
(
L
,
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
,
REASON_COST
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_RELEASE
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
...
...
@@ -2813,7 +2813,7 @@ int32 scriptlib::duel_check_release_group_ex(lua_State *L) {
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
use_hand
,
2
,
extraargs
,
pexception
,
pexgroup
,
reason
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
L
,
playerid
,
fcount
,
use_con
,
use_hand
,
2
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
lua_pushboolean
(
L
,
result
);
return
1
;
...
...
@@ -2845,7 +2845,7 @@ int32 scriptlib::duel_select_release_group_ex(lua_State *L) {
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
pduel
->
game_field
->
get_release_list
(
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
use_hand
,
2
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
get_release_list
(
L
,
playerid
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_oneof
,
use_con
,
use_hand
,
2
,
extraargs
,
pexception
,
pexgroup
,
reason
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_RELEASE
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
...
...
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