Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
bfacf1f8
Commit
bfacf1f8
authored
Nov 23, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
07420360
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
7 deletions
+56
-7
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+9
-2
Classes/ocgcore/field.cpp
Classes/ocgcore/field.cpp
+5
-5
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+2
-0
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+40
-0
No files found.
Classes/ocgcore/card.cpp
View file @
bfacf1f8
...
@@ -3599,8 +3599,15 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
...
@@ -3599,8 +3599,15 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
return
FALSE
;
return
FALSE
;
if
(
!
pduel
->
game_field
->
is_player_can_release
(
playerid
,
this
))
if
(
!
pduel
->
game_field
->
is_player_can_release
(
playerid
,
this
))
return
FALSE
;
return
FALSE
;
if
(
is_affected_by_effect
(
EFFECT_UNRELEASABLE_NONSUM
))
effect_set
eset
;
return
FALSE
;
filter_effect
(
EFFECT_UNRELEASABLE_NONSUM
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
reason_effect
,
PARAM_TYPE_EFFECT
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
return
FALSE
;
}
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_releasable_by_effect
(
uint8
playerid
,
effect
*
reason_effect
)
{
int32
card
::
is_releasable_by_effect
(
uint8
playerid
,
effect
*
reason_effect
)
{
...
...
Classes/ocgcore/field.cpp
View file @
bfacf1f8
...
@@ -1698,8 +1698,8 @@ effect* field::is_player_affected_by_effect(uint8 playerid, uint32 code) {
...
@@ -1698,8 +1698,8 @@ effect* field::is_player_affected_by_effect(uint8 playerid, uint32 code) {
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
)
{
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
rcount
=
0
;
uint32
rcount
=
0
;
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)
))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
))
{
if
(
release_list
)
if
(
release_list
)
release_list
->
insert
(
pcard
);
release_list
->
insert
(
pcard
);
pcard
->
release_param
=
1
;
pcard
->
release_param
=
1
;
...
@@ -1708,8 +1708,8 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
...
@@ -1708,8 +1708,8 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
}
}
if
(
use_hand
)
{
if
(
use_hand
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)
))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
))
{
if
(
release_list
)
if
(
release_list
)
release_list
->
insert
(
pcard
);
release_list
->
insert
(
pcard
);
pcard
->
release_param
=
1
;
pcard
->
release_param
=
1
;
...
@@ -1720,7 +1720,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
...
@@ -1720,7 +1720,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
int32
ex_oneof_max
=
0
;
int32
ex_oneof_max
=
0
;
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
(
pcard
->
is_position
(
POS_FACEUP
)
||
!
use_con
)
if
(
pcard
&&
pcard
!=
exc
&&
!
(
exg
&&
exg
->
has_card
(
pcard
))
&&
(
pcard
->
is_position
(
POS_FACEUP
)
||
!
use_con
)
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
)
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
)
))
{
&&
(
!
use_con
||
pduel
->
lua
->
check_matching
(
pcard
,
fun
,
exarg
))
&&
pcard
->
is_releasable_by_nonsummon
(
playerid
))
{
pcard
->
release_param
=
1
;
pcard
->
release_param
=
1
;
if
(
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
ex_list
)
if
(
ex_list
)
...
...
Classes/ocgcore/libcard.cpp
View file @
bfacf1f8
...
@@ -2409,6 +2409,7 @@ int32 scriptlib::card_is_releasable(lua_State *L) {
...
@@ -2409,6 +2409,7 @@ int32 scriptlib::card_is_releasable(lua_State *L) {
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
pcard
->
current
.
reason
|=
REASON_COST
;
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
if
(
pcard
->
is_releasable_by_nonsummon
(
p
))
if
(
pcard
->
is_releasable_by_nonsummon
(
p
))
lua_pushboolean
(
L
,
1
);
lua_pushboolean
(
L
,
1
);
...
@@ -2420,6 +2421,7 @@ int32 scriptlib::card_is_releasable_by_effect(lua_State *L) {
...
@@ -2420,6 +2421,7 @@ int32 scriptlib::card_is_releasable_by_effect(lua_State *L) {
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
pcard
->
current
.
reason
|=
REASON_EFFECT
;
pcard
->
current
.
reason
&=
~
REASON_COST
;
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
effect
*
re
=
pcard
->
pduel
->
game_field
->
core
.
reason_effect
;
effect
*
re
=
pcard
->
pduel
->
game_field
->
core
.
reason_effect
;
if
(
pcard
->
is_releasable_by_nonsummon
(
p
)
&&
pcard
->
is_releasable_by_effect
(
p
,
re
))
if
(
pcard
->
is_releasable_by_nonsummon
(
p
)
&&
pcard
->
is_releasable_by_effect
(
p
,
re
))
...
...
Classes/ocgcore/libduel.cpp
View file @
bfacf1f8
...
@@ -2641,7 +2641,17 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) {
...
@@ -2641,7 +2641,17 @@ int32 scriptlib::duel_get_release_group_count(lua_State *L) {
if
(
lua_gettop
(
L
)
>
1
)
if
(
lua_gettop
(
L
)
>
1
)
hand
=
lua_toboolean
(
L
,
2
);
hand
=
lua_toboolean
(
L
,
2
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
if
(
hand
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
playerid
].
list_hand
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_release_list
(
playerid
,
0
,
0
,
0
,
FALSE
,
hand
,
0
,
0
,
0
,
0
));
lua_pushinteger
(
L
,
pduel
->
game_field
->
get_release_list
(
playerid
,
0
,
0
,
0
,
FALSE
,
hand
,
0
,
0
,
0
,
0
));
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
if
(
hand
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
playerid
].
list_hand
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_check_release_group
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_check_release_group
(
lua_State
*
L
)
{
...
@@ -2663,7 +2673,12 @@ int32 scriptlib::duel_check_release_group(lua_State *L) {
...
@@ -2663,7 +2673,12 @@ int32 scriptlib::duel_check_release_group(lua_State *L) {
uint32
extraargs
=
lua_gettop
(
L
)
-
4
;
uint32
extraargs
=
lua_gettop
(
L
)
-
4
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
FALSE
,
2
,
extraargs
,
pexception
,
pexgroup
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
lua_pushboolean
(
L
,
result
);
lua_pushboolean
(
L
,
result
);
return
1
;
return
1
;
...
@@ -2692,7 +2707,12 @@ int32 scriptlib::duel_select_release_group(lua_State *L) {
...
@@ -2692,7 +2707,12 @@ int32 scriptlib::duel_select_release_group(lua_State *L) {
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
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
);
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
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_RELEASE
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
);
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
)
{
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
duel
*
pduel
=
(
duel
*
)
ctx
;
...
@@ -2724,7 +2744,17 @@ int32 scriptlib::duel_check_release_group_ex(lua_State *L) {
...
@@ -2724,7 +2744,17 @@ int32 scriptlib::duel_check_release_group_ex(lua_State *L) {
uint32
extraargs
=
lua_gettop
(
L
)
-
4
;
uint32
extraargs
=
lua_gettop
(
L
)
-
4
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
fcount
=
(
uint32
)
lua_tointeger
(
L
,
3
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
playerid
].
list_hand
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
TRUE
,
2
,
extraargs
,
pexception
,
pexgroup
);
int32
result
=
pduel
->
game_field
->
check_release_list
(
playerid
,
fcount
,
use_con
,
TRUE
,
2
,
extraargs
,
pexception
,
pexgroup
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
playerid
].
list_hand
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
lua_pushboolean
(
L
,
result
);
lua_pushboolean
(
L
,
result
);
return
1
;
return
1
;
...
@@ -2753,7 +2783,17 @@ int32 scriptlib::duel_select_release_group_ex(lua_State *L) {
...
@@ -2753,7 +2783,17 @@ int32 scriptlib::duel_select_release_group_ex(lua_State *L) {
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_oneof
.
clear
();
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
playerid
].
list_hand
)
if
(
pcard
)
{
pcard
->
temp
.
reason
=
pcard
->
current
.
reason
;
pcard
->
current
.
reason
|=
REASON_COST
;
}
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
,
2
,
extraargs
,
pexception
,
pexgroup
);
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
,
2
,
extraargs
,
pexception
,
pexgroup
);
for
(
uint8
p
=
0
;
p
<
2
;
p
++
)
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
p
].
list_mzone
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
for
(
auto
&
pcard
:
pduel
->
game_field
->
player
[
playerid
].
list_hand
)
if
(
pcard
)
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_RELEASE
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
);
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
)
{
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
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