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