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
40016cac
Commit
40016cac
authored
Jun 26, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
797f58de
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
13 deletions
+39
-13
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+1
-0
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+25
-10
Classes/ocgcore/operations.cpp
Classes/ocgcore/operations.cpp
+13
-3
No files found.
Classes/ocgcore/field.h
View file @
40016cac
...
...
@@ -252,6 +252,7 @@ struct processor {
card_set
operated_set
;
card_set
discarded_set
;
card_set
destroy_canceled
;
card_set
indestructable_count_set
;
card_set
delayed_enable_set
;
card_set
set_group_pre_set
;
card_set
set_group_set
;
...
...
Classes/ocgcore/libduel.cpp
View file @
40016cac
...
...
@@ -195,10 +195,13 @@ int32 scriptlib::duel_destroy(lua_State *L) {
uint32
dest
=
LOCATION_GRAVE
;
if
(
lua_gettop
(
L
)
>=
3
)
dest
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
reason_player
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
4
)
reason_player
=
(
uint32
)
lua_tointeger
(
L
,
4
);
if
(
pcard
)
pduel
->
game_field
->
destroy
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
dest
,
0
);
pduel
->
game_field
->
destroy
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
PLAYER_NONE
,
dest
,
0
);
else
pduel
->
game_field
->
destroy
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
dest
,
0
);
pduel
->
game_field
->
destroy
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
PLAYER_NONE
,
dest
,
0
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
...
...
@@ -221,10 +224,13 @@ int32 scriptlib::duel_remove(lua_State *L) {
return
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
1
);
uint32
pos
=
(
uint32
)
lua_tointeger
(
L
,
2
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
reason_player
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
4
)
reason_player
=
(
uint32
)
lua_tointeger
(
L
,
4
);
if
(
pcard
)
pduel
->
game_field
->
send_to
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_REMOVED
,
0
,
pos
);
pduel
->
game_field
->
send_to
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
PLAYER_NONE
,
LOCATION_REMOVED
,
0
,
pos
);
else
pduel
->
game_field
->
send_to
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_REMOVED
,
0
,
pos
);
pduel
->
game_field
->
send_to
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
PLAYER_NONE
,
LOCATION_REMOVED
,
0
,
pos
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
...
...
@@ -246,10 +252,13 @@ int32 scriptlib::duel_sendto_grave(lua_State *L) {
}
else
return
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
1
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
2
);
uint32
reason_player
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
3
)
reason_player
=
(
uint32
)
lua_tointeger
(
L
,
3
);
if
(
pcard
)
pduel
->
game_field
->
send_to
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
pduel
->
game_field
->
send_to
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
else
pduel
->
game_field
->
send_to
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
pduel
->
game_field
->
send_to
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
PLAYER_NONE
,
LOCATION_GRAVE
,
0
,
POS_FACEUP
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
...
...
@@ -633,10 +642,13 @@ int32 scriptlib::duel_sendto_deck(lua_State *L) {
playerid
=
PLAYER_NONE
;
uint32
sequence
=
(
uint32
)
lua_tointeger
(
L
,
3
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
4
);
uint32
reason_player
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
5
)
reason_player
=
(
uint32
)
lua_tointeger
(
L
,
5
);
if
(
pcard
)
pduel
->
game_field
->
send_to
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
playerid
,
LOCATION_DECK
,
sequence
,
POS_FACEUP
);
pduel
->
game_field
->
send_to
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
playerid
,
LOCATION_DECK
,
sequence
,
POS_FACEUP
);
else
pduel
->
game_field
->
send_to
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
,
playerid
,
LOCATION_DECK
,
sequence
,
POS_FACEUP
);
pduel
->
game_field
->
send_to
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
,
playerid
,
LOCATION_DECK
,
sequence
,
POS_FACEUP
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
...
...
@@ -790,10 +802,13 @@ int32 scriptlib::duel_release(lua_State *L) {
}
else
return
luaL_error
(
L
,
"Parameter %d should be
\"
Card
\"
or
\"
Group
\"
."
,
1
);
uint32
reason
=
(
uint32
)
lua_tointeger
(
L
,
2
);
uint32
reason_player
=
pduel
->
game_field
->
core
.
reason_player
;
if
(
lua_gettop
(
L
)
>=
3
)
reason_player
=
(
uint32
)
lua_tointeger
(
L
,
3
);
if
(
pcard
)
pduel
->
game_field
->
release
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
);
pduel
->
game_field
->
release
(
pcard
,
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
);
else
pduel
->
game_field
->
release
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
pduel
->
game_field
->
core
.
reason_player
);
pduel
->
game_field
->
release
(
&
(
pgroup
->
container
),
pduel
->
game_field
->
core
.
reason_effect
,
reason
,
reason_player
);
return
lua_yieldk
(
L
,
0
,
(
lua_KContext
)
pduel
,
[](
lua_State
*
L
,
int32
status
,
lua_KContext
ctx
)
{
duel
*
pduel
=
(
duel
*
)
ctx
;
lua_pushinteger
(
L
,
pduel
->
game_field
->
returns
.
ivalue
[
0
]);
...
...
Classes/ocgcore/operations.cpp
View file @
40016cac
...
...
@@ -3402,6 +3402,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
continue
;
}
}
// monsters with EFFECT_INDESTRUCTABLE_COUNT cannot apply EFFECT_DESTROY_REPLACE
eset
.
clear
();
pcard
->
filter_effect
(
EFFECT_INDESTRUCTABLE_COUNT
,
&
eset
);
if
(
eset
.
size
())
{
...
...
@@ -3423,8 +3424,8 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pduel
->
lua
->
add_param
(
pcard
->
current
.
reason_player
,
PARAM_TYPE_INT
);
int32
ct
;
if
(
ct
=
eset
[
i
]
->
get_value
(
3
))
{
auto
i
t
=
pcard
->
indestructable_effects
.
emplace
(
eset
[
i
]
->
id
,
0
);
if
(
++
i
t
.
first
->
second
<=
ct
)
{
auto
re
t
=
pcard
->
indestructable_effects
.
emplace
(
eset
[
i
]
->
id
,
0
);
if
(
++
re
t
.
first
->
second
<=
ct
)
{
indestructable_effect_set
.
insert
(
eset
[
i
]);
is_destructable
=
false
;
}
...
...
@@ -3432,7 +3433,7 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
}
}
if
(
!
is_destructable
)
{
indestructable
_set
.
insert
(
pcard
);
core
.
indestructable_count
_set
.
insert
(
pcard
);
continue
;
}
}
...
...
@@ -3465,6 +3466,12 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
set_status
(
STATUS_DESTROY_CONFIRMED
,
FALSE
);
targets
->
container
.
erase
(
pcard
);
}
for
(
auto
&
pcard
:
core
.
indestructable_count_set
)
{
pcard
->
current
.
reason
=
pcard
->
temp
.
reason
;
pcard
->
current
.
reason_effect
=
pcard
->
temp
.
reason_effect
;
pcard
->
current
.
reason_player
=
pcard
->
temp
.
reason_player
;
targets
->
container
.
erase
(
pcard
);
}
for
(
auto
&
rep
:
extra
)
{
if
(
targets
->
container
.
count
(
rep
)
==
0
)
{
rep
->
temp
.
reason
=
rep
->
current
.
reason
;
...
...
@@ -3497,6 +3504,9 @@ int32 field::destroy(uint16 step, group * targets, effect * reason_effect, uint3
for
(
auto
&
pcard
:
core
.
destroy_canceled
)
pcard
->
set_status
(
STATUS_DESTROY_CONFIRMED
,
FALSE
);
core
.
destroy_canceled
.
clear
();
for
(
auto
&
pcard
:
core
.
indestructable_count_set
)
pcard
->
set_status
(
STATUS_DESTROY_CONFIRMED
,
FALSE
);
core
.
indestructable_count_set
.
clear
();
return
FALSE
;
}
case
3
:
{
...
...
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