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
81e40af1
Commit
81e40af1
authored
Sep 29, 2025
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master'
parents
1162d9c7
9a0d752c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
11 deletions
+28
-11
card.cpp
card.cpp
+2
-0
duel.cpp
duel.cpp
+1
-1
field.cpp
field.cpp
+12
-0
interpreter.cpp
interpreter.cpp
+7
-5
interpreter.h
interpreter.h
+4
-3
libduel.cpp
libduel.cpp
+1
-1
operations.cpp
operations.cpp
+1
-1
No files found.
card.cpp
View file @
81e40af1
...
...
@@ -1754,6 +1754,8 @@ int32_t card::add_effect(effect* peffect) {
return
0
;
if
(
peffect
->
type
&
EFFECT_TYPES_TRIGGER_LIKE
&&
is_continuous_event
(
peffect
->
code
))
return
0
;
if
(
peffect
->
type
&
EFFECT_TYPES_CHAIN_LINK
&&
peffect
->
owner
==
pduel
->
game_field
->
temp_card
)
return
0
;
// the trigger effect in phase is "once per turn" by default
if
(
peffect
->
get_code_type
()
==
CODE_PHASE
&&
peffect
->
code
&
(
PHASE_DRAW
|
PHASE_STANDBY
|
PHASE_END
)
&&
peffect
->
type
&
(
EFFECT_TYPE_TRIGGER_O
|
EFFECT_TYPE_TRIGGER_F
)
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
...
...
duel.cpp
View file @
81e40af1
...
...
@@ -31,8 +31,8 @@ duel::~duel() {
delete
pgroup
;
for
(
auto
&
peffect
:
effects
)
delete
peffect
;
delete
lua
;
delete
game_field
;
delete
lua
;
}
void
duel
::
clear
()
{
for
(
auto
&
pcard
:
cards
)
...
...
field.cpp
View file @
81e40af1
...
...
@@ -1164,6 +1164,8 @@ void field::add_effect(effect* peffect, uint8_t owner_player) {
return
;
if
(
effects
.
indexer
.
find
(
peffect
)
!=
effects
.
indexer
.
end
())
return
;
if
(
peffect
->
type
&
EFFECT_TYPES_CHAIN_LINK
&&
peffect
->
owner
==
temp_card
)
return
;
effect_container
::
iterator
it
;
if
(
!
(
peffect
->
type
&
EFFECT_TYPE_ACTIONS
))
{
it
=
effects
.
aura_effect
.
emplace
(
peffect
->
code
,
peffect
);
...
...
@@ -2622,6 +2624,16 @@ int32_t field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int3
return
FALSE
;
}
}
effect
*
extra_synchro_material_effect
=
tuner
->
is_affected_by_effect
(
EFFECT_EXTRA_SYNCHRO_MATERIAL
);
if
(
extra_synchro_material_effect
)
{
if
(
!
extra_synchro_material_effect
->
check_count_limit
(
playerid
))
{
return
FALSE
;
}
int32_t
value
=
extra_synchro_material_effect
->
get_value
(
pcard
);
if
(
value
<=
0
)
{
return
FALSE
;
}
}
int32_t
mzone_limit
=
get_mzone_limit
(
playerid
,
playerid
,
LOCATION_REASON_TOFIELD
);
if
(
mzone_limit
<
0
)
{
if
(
location
==
LOCATION_HAND
)
{
...
...
interpreter.cpp
View file @
81e40af1
...
...
@@ -14,13 +14,11 @@
#include "ocgapi.h"
#include "interpreter.h"
interpreter
::
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
)
:
coroutines
(
256
)
{
interpreter
::
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
)
:
coroutines
(
256
),
pduel
(
pd
),
enable_unsafe_feature
(
enable_unsafe_libraries
)
{
lua_state
=
luaL_newstate
();
current_state
=
lua_state
;
pduel
=
pd
;
std
::
memcpy
(
lua_getextraspace
(
lua_state
),
&
pd
,
LUA_EXTRASPACE
);
//set_duel_info
no_action
=
0
;
call_depth
=
0
;
//Initial
#ifdef YGOPRO_NO_LUA_SAFE
luaL_openlibs
(
lua_state
);
...
...
@@ -146,7 +144,11 @@ int32_t interpreter::load_script(const char* script_name) {
return
OPERATION_FAIL
;
++
no_action
;
luaL_checkstack
(
current_state
,
2
,
nullptr
);
int32_t
error
=
luaL_loadbuffer
(
current_state
,
(
const
char
*
)
buffer
,
len
,
script_name
)
||
lua_pcall
(
current_state
,
0
,
0
,
0
);
int32_t
error
=
0
;
if
(
enable_unsafe_feature
)
error
=
luaL_loadbuffer
(
current_state
,
(
const
char
*
)
buffer
,
len
,
script_name
)
||
lua_pcall
(
current_state
,
0
,
0
,
0
);
else
error
=
luaL_loadbufferx
(
current_state
,
(
const
char
*
)
buffer
,
len
,
script_name
,
"t"
)
||
lua_pcall
(
current_state
,
0
,
0
,
0
);
if
(
error
)
{
interpreter
::
sprintf
(
pduel
->
strbuffer
,
"%s"
,
lua_tostring
(
current_state
,
-
1
));
handle_message
(
pduel
,
1
);
...
...
interpreter.h
View file @
81e40af1
...
...
@@ -44,14 +44,15 @@ public:
using
param_list
=
std
::
list
<
std
::
pair
<
lua_param
,
LuaParamType
>>
;
duel
*
pduel
;
char
msgbuf
[
64
];
char
msgbuf
[
64
]
{}
;
lua_State
*
lua_state
;
lua_State
*
current_state
;
param_list
params
;
param_list
resumes
;
coroutine_map
coroutines
;
int32_t
no_action
;
int32_t
call_depth
;
int32_t
no_action
{};
int32_t
call_depth
{};
bool
enable_unsafe_feature
{};
explicit
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
);
~
interpreter
();
...
...
libduel.cpp
View file @
81e40af1
...
...
@@ -15,7 +15,7 @@
int32_t
scriptlib
::
duel_enable_global_flag
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32_t
flag
=
(
int32_t
)
lua_tointeger
(
L
,
1
);
uint32_t
flag
=
(
u
int32_t
)
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
core
.
global_flag
|=
flag
;
return
0
;
...
...
operations.cpp
View file @
81e40af1
...
...
@@ -24,7 +24,7 @@ int32_t field::negate_chain(uint8_t chaincount) {
pchain
.
flag
|=
CHAIN_DISABLE_ACTIVATE
;
pchain
.
disable_reason
=
core
.
reason_effect
;
pchain
.
disable_player
=
core
.
reason_player
;
if
((
pchain
.
triggering_effect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
phandler
->
current
.
location
==
LOCATION_SZONE
))
{
if
((
pchain
.
triggering_effect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
phandler
->
is_has_relation
(
pchain
)
&&
(
phandler
->
current
.
location
==
LOCATION_SZONE
))
{
phandler
->
set_status
(
STATUS_LEAVE_CONFIRMED
,
TRUE
);
phandler
->
set_status
(
STATUS_ACTIVATE_DISABLED
,
TRUE
);
}
...
...
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