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
8c3684de
Commit
8c3684de
authored
Sep 16, 2025
by
nanahira
Committed by
GitHub
Sep 16, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #35 from mycard/develop-8888
Develop 8888
parents
d15a8ef7
3bb7fb97
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
11 deletions
+38
-11
duel.cpp
duel.cpp
+1
-1
field.cpp
field.cpp
+10
-0
interpreter.cpp
interpreter.cpp
+1
-4
interpreter.h
interpreter.h
+5
-5
libcard.cpp
libcard.cpp
+10
-0
libduel.cpp
libduel.cpp
+9
-1
scriptlib.h
scriptlib.h
+2
-0
No files found.
duel.cpp
View file @
8c3684de
...
...
@@ -33,8 +33,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 @
8c3684de
...
...
@@ -2651,6 +2651,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 @
8c3684de
...
...
@@ -14,14 +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
)
{
mem_tracker
=
new
LuaMemTracker
(
YGOPRO_LUA_MEMORY_SIZE
);
lua_state
=
lua_newstate
(
LuaMemTracker
::
AllocThunk
,
mem_tracker
);
current_state
=
lua_state
;
pduel
=
pd
;
std
::
memcpy
(
lua_getextraspace
(
lua_state
),
&
pd
,
LUA_EXTRASPACE
);
//set_duel_info
no_action
=
0
;
call_depth
=
0
;
disable_action_check
=
0
;
//Initial
#ifdef YGOPRO_NO_LUA_SAFE
...
...
interpreter.h
View file @
8c3684de
...
...
@@ -34,17 +34,17 @@ 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
;
LuaMemTracker
*
mem_tracker
;
param_list
params
;
param_list
resumes
;
coroutine_map
coroutines
;
int32_t
no_action
;
int32_t
call_depth
;
int32_t
disable_action_check
;
int32_t
preloaded
;
int32_t
no_action
{}
;
int32_t
call_depth
{}
;
int32_t
disable_action_check
{}
;
int32_t
preloaded
{}
;
explicit
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
);
~
interpreter
();
...
...
libcard.cpp
View file @
8c3684de
...
...
@@ -3673,6 +3673,15 @@ int32_t scriptlib::card_clear_meta(lua_State *L) {
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
return
pcard
->
meta
.
luaop_clear
();
}
int32_t
scriptlib
::
card_check_spsummon_once
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
auto
playerid
=
(
int32_t
)
lua_tointeger
(
L
,
2
);
auto
pduel
=
pcard
->
pduel
;
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_spsummon_once
(
pcard
,
playerid
));
return
1
;
}
static
const
struct
luaL_Reg
cardlib
[]
=
{
//millux
...
...
@@ -3969,6 +3978,7 @@ static const struct luaL_Reg cardlib[] = {
{
"HasMetaValue"
,
scriptlib
::
card_has_meta_value
},
{
"ClearMeta"
,
scriptlib
::
card_clear_meta
},
{
"GetMetaKeys"
,
scriptlib
::
card_get_meta_keys
},
{
"CheckSPSummonOnce"
,
scriptlib
::
card_check_spsummon_once
},
{
nullptr
,
nullptr
}
};
void
scriptlib
::
open_cardlib
(
lua_State
*
L
)
{
...
...
libduel.cpp
View file @
8c3684de
...
...
@@ -372,11 +372,18 @@ int32_t scriptlib::duel_clear_registry(lua_State *L) {
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
;
}
int32_t
scriptlib
::
duel_is_global_flag
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
uint32_t
flag
=
(
uint32_t
)
lua_tointeger
(
L
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushboolean
(
L
,
(
pduel
->
game_field
->
core
.
global_flag
&
flag
)
==
flag
);
return
1
;
}
int32_t
scriptlib
::
duel_is_global_flag
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
...
...
@@ -5353,6 +5360,7 @@ static const struct luaL_Reg duellib[] = {
{
"IsGlobalFlag"
,
scriptlib
::
duel_is_global_flag
},
{
"EnableGlobalFlag"
,
scriptlib
::
duel_enable_global_flag
},
{
"IsGlobalFlag"
,
scriptlib
::
duel_is_global_flag
},
{
"GetLP"
,
scriptlib
::
duel_get_lp
},
{
"SetLP"
,
scriptlib
::
duel_set_lp
},
{
"IsTurnPlayer"
,
scriptlib
::
duel_is_turn_player
},
...
...
scriptlib.h
View file @
8c3684de
...
...
@@ -338,6 +338,7 @@ public:
static
int32_t
card_reset_negate_effect
(
lua_State
*
L
);
static
int32_t
card_assume_prop
(
lua_State
*
L
);
static
int32_t
card_set_spsummon_once
(
lua_State
*
L
);
static
int32_t
card_check_spsummon_once
(
lua_State
*
L
);
static
void
open_cardlib
(
lua_State
*
L
);
//Effect functions
...
...
@@ -437,6 +438,7 @@ public:
//Duel functions
static
int32_t
duel_enable_global_flag
(
lua_State
*
L
);
static
int32_t
duel_is_global_flag
(
lua_State
*
L
);
static
int32_t
duel_get_lp
(
lua_State
*
L
);
static
int32_t
duel_set_lp
(
lua_State
*
L
);
static
int32_t
duel_is_turn_player
(
lua_State
*
L
);
...
...
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