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
bee4c504
Commit
bee4c504
authored
Aug 07, 2023
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
47aace20
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
Classes/ocgcore/effect.cpp
Classes/ocgcore/effect.cpp
+1
-1
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+2
-2
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+5
-5
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+5
-5
No files found.
Classes/ocgcore/effect.cpp
View file @
bee4c504
...
@@ -849,7 +849,7 @@ uint32 effect::get_active_type() {
...
@@ -849,7 +849,7 @@ uint32 effect::get_active_type() {
}
}
int32
effect
::
get_code_type
()
{
int32
effect
::
get_code_type
()
{
// start from the highest bit
// start from the highest bit
if
(
code
&
EVENT_CUSTOM
)
if
(
code
&
0xf0000000
)
return
CODE_CUSTOM
;
return
CODE_CUSTOM
;
else
if
(
code
&
0xf0000
)
else
if
(
code
&
0xf0000
)
return
CODE_COUNTER
;
return
CODE_COUNTER
;
...
...
Classes/ocgcore/effect.h
View file @
bee4c504
...
@@ -550,10 +550,10 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -550,10 +550,10 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define HALF_DAMAGE 0x80000001
#define HALF_DAMAGE 0x80000001
// flag effect
// flag effect
#define
HEADER
_FLAG_EFFECT 0x20000000
#define
EFFECT
_FLAG_EFFECT 0x20000000
#define MAX_CARD_ID 0xfffffff
#define MAX_CARD_ID 0xfffffff
// The type of e
vent in
code
// The type of e
ffect
code
#define CODE_CUSTOM 1 // header + id (28 bits)
#define CODE_CUSTOM 1 // header + id (28 bits)
#define CODE_COUNTER 2 // header + counter_id (16 bits)
#define CODE_COUNTER 2 // header + counter_id (16 bits)
#define CODE_PHASE 3 // header + phase_id (12 bits)
#define CODE_PHASE 3 // header + phase_id (12 bits)
...
...
Classes/ocgcore/libcard.cpp
View file @
bee4c504
...
@@ -1793,7 +1793,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) {
...
@@ -1793,7 +1793,7 @@ int32 scriptlib::card_register_flag_effect(lua_State *L) {
check_param_count
(
L
,
5
);
check_param_count
(
L
,
5
);
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
);
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
int32
reset
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
reset
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
flag
=
(
int32
)
lua_tointeger
(
L
,
4
);
int32
flag
=
(
int32
)
lua_tointeger
(
L
,
4
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
5
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
5
);
...
@@ -1827,7 +1827,7 @@ int32 scriptlib::card_get_flag_effect(lua_State *L) {
...
@@ -1827,7 +1827,7 @@ int32 scriptlib::card_get_flag_effect(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
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
);
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
lua_pushinteger
(
L
,
pcard
->
single_effect
.
count
(
code
));
lua_pushinteger
(
L
,
pcard
->
single_effect
.
count
(
code
));
return
1
;
return
1
;
}
}
...
@@ -1835,7 +1835,7 @@ int32 scriptlib::card_reset_flag_effect(lua_State *L) {
...
@@ -1835,7 +1835,7 @@ int32 scriptlib::card_reset_flag_effect(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
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
);
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
pcard
->
reset
(
code
,
RESET_CODE
);
pcard
->
reset
(
code
,
RESET_CODE
);
return
0
;
return
0
;
}
}
...
@@ -1843,7 +1843,7 @@ int32 scriptlib::card_set_flag_effect_label(lua_State *L) {
...
@@ -1843,7 +1843,7 @@ int32 scriptlib::card_set_flag_effect_label(lua_State *L) {
check_param_count
(
L
,
3
);
check_param_count
(
L
,
3
);
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
);
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
int32
lab
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
lab
=
(
int32
)
lua_tointeger
(
L
,
3
);
auto
eit
=
pcard
->
single_effect
.
find
(
code
);
auto
eit
=
pcard
->
single_effect
.
find
(
code
);
if
(
eit
==
pcard
->
single_effect
.
end
())
if
(
eit
==
pcard
->
single_effect
.
end
())
...
@@ -1859,7 +1859,7 @@ int32 scriptlib::card_get_flag_effect_label(lua_State *L) {
...
@@ -1859,7 +1859,7 @@ int32 scriptlib::card_get_flag_effect_label(lua_State *L) {
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
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
);
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
auto
rg
=
pcard
->
single_effect
.
equal_range
(
code
);
auto
rg
=
pcard
->
single_effect
.
equal_range
(
code
);
int32
count
=
0
;
int32
count
=
0
;
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
,
++
count
)
for
(;
rg
.
first
!=
rg
.
second
;
++
rg
.
first
,
++
count
)
...
...
Classes/ocgcore/libduel.cpp
View file @
bee4c504
...
@@ -85,7 +85,7 @@ int32 scriptlib::duel_register_flag_effect(lua_State *L) {
...
@@ -85,7 +85,7 @@ int32 scriptlib::duel_register_flag_effect(lua_State *L) {
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
int32
reset
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
reset
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
flag
=
(
int32
)
lua_tointeger
(
L
,
4
);
int32
flag
=
(
int32
)
lua_tointeger
(
L
,
4
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
5
);
int32
count
=
(
int32
)
lua_tointeger
(
L
,
5
);
...
@@ -118,7 +118,7 @@ int32 scriptlib::duel_get_flag_effect(lua_State *L) {
...
@@ -118,7 +118,7 @@ int32 scriptlib::duel_get_flag_effect(lua_State *L) {
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
int32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
effect_set
eset
;
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
code
,
&
eset
);
pduel
->
game_field
->
filter_player_effect
(
playerid
,
code
,
&
eset
);
...
@@ -130,7 +130,7 @@ int32 scriptlib::duel_reset_flag_effect(lua_State *L) {
...
@@ -130,7 +130,7 @@ int32 scriptlib::duel_reset_flag_effect(lua_State *L) {
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
auto
pr
=
pduel
->
game_field
->
effects
.
aura_effect
.
equal_range
(
code
);
auto
pr
=
pduel
->
game_field
->
effects
.
aura_effect
.
equal_range
(
code
);
for
(;
pr
.
first
!=
pr
.
second
;
)
{
for
(;
pr
.
first
!=
pr
.
second
;
)
{
...
@@ -146,7 +146,7 @@ int32 scriptlib::duel_set_flag_effect_label(lua_State *L) {
...
@@ -146,7 +146,7 @@ int32 scriptlib::duel_set_flag_effect_label(lua_State *L) {
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
int32
lab
=
(
int32
)
lua_tointeger
(
L
,
3
);
int32
lab
=
(
int32
)
lua_tointeger
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
effect_set
eset
;
effect_set
eset
;
...
@@ -165,7 +165,7 @@ int32 scriptlib::duel_get_flag_effect_label(lua_State *L) {
...
@@ -165,7 +165,7 @@ int32 scriptlib::duel_get_flag_effect_label(lua_State *L) {
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
return
0
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
HEADER
_FLAG_EFFECT
;
uint32
code
=
(
lua_tointeger
(
L
,
2
)
&
MAX_CARD_ID
)
|
EFFECT
_FLAG_EFFECT
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
effect_set
eset
;
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
code
,
&
eset
);
pduel
->
game_field
->
filter_player_effect
(
playerid
,
code
,
&
eset
);
...
...
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