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
8287c520
Commit
8287c520
authored
Jan 16, 2024
by
mercury233
Committed by
GitHub
Jan 16, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update CheckReleaseGroupEx and so on (#534)
parent
5a7c9657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
libduel.cpp
libduel.cpp
+46
-46
No files found.
libduel.cpp
View file @
8287c520
...
...
@@ -2664,58 +2664,56 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) {
return
1
;
}
int32
scriptlib
::
duel_check_release_group
(
lua_State
*
L
)
{
const
int32
must_param
=
5
;
const
int32
must_param
=
4
;
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
card
*
pexception
=
nullptr
;
group
*
pexgroup
=
nullptr
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
4
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
4
,
TRUE
))
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
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
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
;
}
int32
scriptlib
::
duel_select_release_group
(
lua_State
*
L
)
{
const
int32
must_param
=
6
;
const
int32
must_param
=
5
;
check_action_permission
(
L
);
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
4
);
card
*
pexception
=
0
;
group
*
pexgroup
=
0
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
6
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
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
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
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
->
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
;
...
...
@@ -2729,58 +2727,60 @@ int32 scriptlib::duel_select_release_group(lua_State *L) {
});
}
int32
scriptlib
::
duel_check_release_group_ex
(
lua_State
*
L
)
{
const
int32
must_param
=
5
;
const
int32
must_param
=
6
;
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
4
);
int32
use_hand
=
lua_toboolean
(
L
,
5
);
card
*
pexception
=
nullptr
;
group
*
pexgroup
=
nullptr
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
5
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
5
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
6
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
,
TRUE
))
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
,
TRUE
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
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
;
}
int32
scriptlib
::
duel_select_release_group_ex
(
lua_State
*
L
)
{
const
int32
must_param
=
6
;
const
int32
must_param
=
7
;
check_action_permission
(
L
);
check_param_count
(
L
,
must_param
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
2
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
int32
use_con
=
FALSE
;
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
2
);
use_con
=
TRUE
;
}
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
5
);
uint32
min
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
max
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
5
);
int32
use_hand
=
lua_toboolean
(
L
,
6
);
card
*
pexception
=
0
;
group
*
pexgroup
=
0
;
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
6
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
if
(
check_param
(
L
,
PARAM_TYPE_CARD
,
7
,
TRUE
))
pexception
=
*
(
card
**
)
lua_touserdata
(
L
,
7
);
else
if
(
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
,
TRUE
))
pexgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
uint32
extraargs
=
lua_gettop
(
L
)
-
must_param
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
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
,
TRUE
,
3
,
extraargs
,
pexception
,
pexgroup
,
reason
);
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
->
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