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
6bc19b69
Commit
6bc19b69
authored
Nov 07, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
parent
b3da9d1d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
12 deletions
+71
-12
Classes/ocgcore/card.cpp
Classes/ocgcore/card.cpp
+54
-6
Classes/ocgcore/card.h
Classes/ocgcore/card.h
+2
-2
Classes/ocgcore/effect.h
Classes/ocgcore/effect.h
+1
-1
Classes/ocgcore/field.h
Classes/ocgcore/field.h
+1
-0
Classes/ocgcore/libcard.cpp
Classes/ocgcore/libcard.cpp
+7
-2
Classes/ocgcore/libduel.cpp
Classes/ocgcore/libduel.cpp
+4
-1
Classes/ocgcore/processor.cpp
Classes/ocgcore/processor.cpp
+2
-0
No files found.
Classes/ocgcore/card.cpp
View file @
6bc19b69
...
@@ -392,6 +392,8 @@ int32 card::is_pre_set_card(uint32 set_code) {
...
@@ -392,6 +392,8 @@ int32 card::is_pre_set_card(uint32 set_code) {
int32
card
::
is_fusion_set_card
(
uint32
set_code
)
{
int32
card
::
is_fusion_set_card
(
uint32
set_code
)
{
if
(
is_set_card
(
set_code
))
if
(
is_set_card
(
set_code
))
return
TRUE
;
return
TRUE
;
if
(
pduel
->
game_field
->
core
.
not_material
)
return
FALSE
;
uint32
settype
=
set_code
&
0xfff
;
uint32
settype
=
set_code
&
0xfff
;
uint32
setsubtype
=
set_code
&
0xf000
;
uint32
setsubtype
=
set_code
&
0xf000
;
effect_set
eset
;
effect_set
eset
;
...
@@ -464,7 +466,7 @@ uint32 card::get_type() {
...
@@ -464,7 +466,7 @@ uint32 card::get_type() {
return
type
;
return
type
;
}
}
uint32
card
::
get_fusion_type
()
{
uint32
card
::
get_fusion_type
()
{
if
(
current
.
location
==
LOCATION_SZONE
&&
(
data
.
type
&
TYPE_MONSTER
))
if
(
current
.
location
==
LOCATION_SZONE
&&
(
data
.
type
&
TYPE_MONSTER
)
&&
!
pduel
->
game_field
->
core
.
not_material
)
return
data
.
type
;
return
data
.
type
;
return
get_type
();
return
get_type
();
}
}
...
@@ -1032,7 +1034,7 @@ uint32 card::get_attribute() {
...
@@ -1032,7 +1034,7 @@ uint32 card::get_attribute() {
uint32
card
::
get_fusion_attribute
(
uint8
playerid
)
{
uint32
card
::
get_fusion_attribute
(
uint8
playerid
)
{
effect_set
effects
;
effect_set
effects
;
filter_effect
(
EFFECT_CHANGE_FUSION_ATTRIBUTE
,
&
effects
);
filter_effect
(
EFFECT_CHANGE_FUSION_ATTRIBUTE
,
&
effects
);
if
(
!
effects
.
size
())
if
(
!
effects
.
size
()
||
pduel
->
game_field
->
core
.
not_material
)
return
get_attribute
();
return
get_attribute
();
uint32
attribute
=
0
;
uint32
attribute
=
0
;
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
...
@@ -2789,7 +2791,28 @@ effect* card::check_control_effect() {
...
@@ -2789,7 +2791,28 @@ effect* card::check_control_effect() {
*/
*/
return
ret_effect
;
return
ret_effect
;
}
}
int32
card
::
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
)
{
int32
card
::
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
)
{
group
*
matgroup
=
0
;
if
(
fusion_m
&&
!
not_material
)
{
matgroup
=
pduel
->
new_group
(
fusion_m
->
container
);
uint32
summon_type
=
SUMMON_TYPE_FUSION
;
if
((
chkf
&
0x200
)
>
0
)
summon_type
=
SUMMON_TYPE_SPECIAL
;
effect_set
eset
;
filter_effect
(
EFFECT_MATERIAL_LIMIT
,
&
eset
);
for
(
auto
cit
=
matgroup
->
container
.
begin
();
cit
!=
matgroup
->
container
.
end
();)
{
card
*
pcard
=
*
cit
++
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
summon_type
,
PARAM_TYPE_INT
);
if
(
!
eset
[
i
]
->
check_value_condition
(
3
))
matgroup
->
container
.
erase
(
pcard
);
}
}
}
else
if
(
fusion_m
)
{
matgroup
=
pduel
->
new_group
(
fusion_m
->
container
);
}
auto
ecit
=
single_effect
.
find
(
EFFECT_FUSION_MATERIAL
);
auto
ecit
=
single_effect
.
find
(
EFFECT_FUSION_MATERIAL
);
if
(
ecit
==
single_effect
.
end
())
if
(
ecit
==
single_effect
.
end
())
return
FALSE
;
return
FALSE
;
...
@@ -2797,24 +2820,47 @@ int32 card::fusion_check(group* fusion_m, card* cg, uint32 chkf) {
...
@@ -2797,24 +2820,47 @@ int32 card::fusion_check(group* fusion_m, card* cg, uint32 chkf) {
if
(
!
peffect
->
condition
)
if
(
!
peffect
->
condition
)
return
FALSE
;
return
FALSE
;
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
fusion_m
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
matgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
cg
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
cg
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
chkf
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
chkf
,
PARAM_TYPE_INT
);
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
pduel
->
game_field
->
core
.
reason_player
=
peffect
->
get_handler_player
();
pduel
->
game_field
->
core
.
reason_player
=
peffect
->
get_handler_player
();
pduel
->
game_field
->
core
.
not_material
=
not_material
;
int32
res
=
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
4
);
int32
res
=
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
4
);
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
pduel
->
game_field
->
core
.
reason_player
=
op
;
pduel
->
game_field
->
core
.
reason_player
=
op
;
pduel
->
game_field
->
core
.
not_material
=
0
;
return
res
;
return
res
;
}
}
void
card
::
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
)
{
void
card
::
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
)
{
group
*
matgroup
=
0
;
if
(
fusion_m
&&
!
not_material
)
{
matgroup
=
pduel
->
new_group
(
fusion_m
->
container
);
uint32
summon_type
=
SUMMON_TYPE_FUSION
;
if
((
chkf
&
0x200
)
>
0
)
summon_type
=
SUMMON_TYPE_SPECIAL
;
effect_set
eset
;
filter_effect
(
EFFECT_MATERIAL_LIMIT
,
&
eset
);
for
(
auto
cit
=
matgroup
->
container
.
begin
();
cit
!=
matgroup
->
container
.
end
();)
{
card
*
pcard
=
*
cit
++
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
summon_type
,
PARAM_TYPE_INT
);
if
(
!
eset
[
i
]
->
check_value_condition
(
3
))
matgroup
->
container
.
erase
(
pcard
);
}
}
}
else
if
(
fusion_m
)
{
matgroup
=
pduel
->
new_group
(
fusion_m
->
container
);
}
effect
*
peffect
=
0
;
effect
*
peffect
=
0
;
auto
ecit
=
single_effect
.
find
(
EFFECT_FUSION_MATERIAL
);
auto
ecit
=
single_effect
.
find
(
EFFECT_FUSION_MATERIAL
);
if
(
ecit
!=
single_effect
.
end
())
if
(
ecit
!=
single_effect
.
end
())
peffect
=
ecit
->
second
;
peffect
=
ecit
->
second
;
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_FUSION
,
0
,
peffect
,
fusion_m
,
playerid
+
(
chkf
<<
16
),
0
,
0
,
0
,
cg
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_FUSION
,
0
,
peffect
,
matgroup
,
playerid
+
(
chkf
<<
16
),
not_material
,
0
,
0
,
cg
);
}
}
int32
card
::
check_fusion_substitute
(
card
*
fcard
)
{
int32
card
::
check_fusion_substitute
(
card
*
fcard
)
{
effect_set
eset
;
effect_set
eset
;
...
@@ -3652,6 +3698,8 @@ int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) {
...
@@ -3652,6 +3698,8 @@ int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) {
int32
card
::
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
)
{
int32
card
::
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
)
{
if
(
is_status
(
STATUS_FORBIDDEN
))
if
(
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
if
(
pduel
->
game_field
->
core
.
not_material
)
return
TRUE
;
effect_set
eset
;
effect_set
eset
;
filter_effect
(
EFFECT_CANNOT_BE_FUSION_MATERIAL
,
&
eset
);
filter_effect
(
EFFECT_CANNOT_BE_FUSION_MATERIAL
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
...
...
Classes/ocgcore/card.h
View file @
6bc19b69
...
@@ -294,8 +294,8 @@ public:
...
@@ -294,8 +294,8 @@ public:
effect
*
is_affected_by_effect
(
int32
code
);
effect
*
is_affected_by_effect
(
int32
code
);
effect
*
is_affected_by_effect
(
int32
code
,
card
*
target
);
effect
*
is_affected_by_effect
(
int32
code
,
card
*
target
);
effect
*
check_control_effect
();
effect
*
check_control_effect
();
int32
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
);
int32
fusion_check
(
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
);
void
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
);
void
fusion_select
(
uint8
playerid
,
group
*
fusion_m
,
card
*
cg
,
uint32
chkf
,
uint8
not_material
);
int32
check_fusion_substitute
(
card
*
fcard
);
int32
check_fusion_substitute
(
card
*
fcard
);
int32
is_not_tuner
(
card
*
scard
);
int32
is_not_tuner
(
card
*
scard
);
...
...
Classes/ocgcore/effect.h
View file @
6bc19b69
...
@@ -443,7 +443,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -443,7 +443,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_EXTRA_LINK_MATERIAL 358
#define EFFECT_EXTRA_LINK_MATERIAL 358
#define EFFECT_QP_ACT_IN_SET_TURN 359
#define EFFECT_QP_ACT_IN_SET_TURN 359
#define EFFECT_EXTRA_PENDULUM_SUMMON 360
#define EFFECT_EXTRA_PENDULUM_SUMMON 360
#define EFFECT_
IRON_WALL
361
#define EFFECT_
MATERIAL_LIMIT
361
#define EVENT_STARTUP 1000
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
#define EVENT_FLIP 1001
...
...
Classes/ocgcore/field.h
View file @
6bc19b69
...
@@ -273,6 +273,7 @@ struct processor {
...
@@ -273,6 +273,7 @@ struct processor {
card
*
limit_link_card
;
card
*
limit_link_card
;
int32
limit_link_minc
;
int32
limit_link_minc
;
int32
limit_link_maxc
;
int32
limit_link_maxc
;
uint8
not_material
;
uint8
attack_cancelable
;
uint8
attack_cancelable
;
uint8
attack_rollback
;
uint8
attack_rollback
;
uint8
effect_damage_step
;
uint8
effect_damage_step
;
...
...
Classes/ocgcore/libcard.cpp
View file @
6bc19b69
...
@@ -71,6 +71,8 @@ int32 scriptlib::card_get_fusion_code(lua_State *L) {
...
@@ -71,6 +71,8 @@ int32 scriptlib::card_get_fusion_code(lua_State *L) {
lua_pushinteger
(
L
,
otcode
);
lua_pushinteger
(
L
,
otcode
);
count
++
;
count
++
;
}
}
if
(
pcard
->
pduel
->
game_field
->
core
.
not_material
)
return
count
;
effect_set
eset
;
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_ADD_FUSION_CODE
,
&
eset
);
pcard
->
filter_effect
(
EFFECT_ADD_FUSION_CODE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
...
@@ -100,7 +102,7 @@ int32 scriptlib::card_is_fusion_code(lua_State *L) {
...
@@ -100,7 +102,7 @@ int32 scriptlib::card_is_fusion_code(lua_State *L) {
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
effect_set
eset
;
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_ADD_FUSION_CODE
,
&
eset
);
pcard
->
filter_effect
(
EFFECT_ADD_FUSION_CODE
,
&
eset
);
if
(
!
eset
.
size
())
if
(
!
eset
.
size
()
||
pcard
->
pduel
->
game_field
->
core
.
not_material
)
return
card_is_code
(
L
);
return
card_is_code
(
L
);
uint32
code1
=
pcard
->
get_code
();
uint32
code1
=
pcard
->
get_code
();
uint32
code2
=
pcard
->
get_another_code
();
uint32
code2
=
pcard
->
get_another_code
();
...
@@ -2799,7 +2801,10 @@ int32 scriptlib::card_check_fusion_material(lua_State *L) {
...
@@ -2799,7 +2801,10 @@ int32 scriptlib::card_check_fusion_material(lua_State *L) {
}
}
if
(
lua_gettop
(
L
)
>
3
)
if
(
lua_gettop
(
L
)
>
3
)
chkf
=
lua_tointeger
(
L
,
4
);
chkf
=
lua_tointeger
(
L
,
4
);
lua_pushboolean
(
L
,
pcard
->
fusion_check
(
pgroup
,
cg
,
chkf
));
uint8
not_material
=
FALSE
;
if
(
lua_gettop
(
L
)
>
4
)
not_material
=
lua_toboolean
(
L
,
5
);
lua_pushboolean
(
L
,
pcard
->
fusion_check
(
pgroup
,
cg
,
chkf
,
not_material
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_check_fusion_substitute
(
lua_State
*
L
)
{
int32
scriptlib
::
card_check_fusion_substitute
(
lua_State
*
L
)
{
...
...
Classes/ocgcore/libduel.cpp
View file @
6bc19b69
...
@@ -2826,15 +2826,18 @@ int32 scriptlib::duel_select_fusion_material(lua_State *L) {
...
@@ -2826,15 +2826,18 @@ int32 scriptlib::duel_select_fusion_material(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
card
*
cg
=
0
;
card
*
cg
=
0
;
uint32
chkf
=
PLAYER_NONE
;
uint32
chkf
=
PLAYER_NONE
;
uint8
not_material
=
FALSE
;
if
(
lua_gettop
(
L
)
>
3
&&
!
lua_isnil
(
L
,
4
))
{
if
(
lua_gettop
(
L
)
>
3
&&
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_CARD
,
4
);
check_param
(
L
,
PARAM_TYPE_CARD
,
4
);
cg
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
cg
=
*
(
card
**
)
lua_touserdata
(
L
,
4
);
}
}
if
(
lua_gettop
(
L
)
>
4
)
if
(
lua_gettop
(
L
)
>
4
)
chkf
=
lua_tointeger
(
L
,
5
);
chkf
=
lua_tointeger
(
L
,
5
);
if
(
lua_gettop
(
L
)
>
5
)
not_material
=
lua_toboolean
(
L
,
6
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
group
*
pgroup
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
pcard
->
fusion_select
(
playerid
,
pgroup
,
cg
,
chkf
);
pcard
->
fusion_select
(
playerid
,
pgroup
,
cg
,
chkf
,
not_material
);
duel
*
pduel
=
pcard
->
pduel
;
duel
*
pduel
=
pcard
->
pduel
;
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
;
...
...
Classes/ocgcore/processor.cpp
View file @
6bc19b69
...
@@ -590,12 +590,14 @@ int32 field::process() {
...
@@ -590,12 +590,14 @@ int32 field::process() {
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
core
.
not_material
=
it
->
arg2
;
core
.
sub_solving_event
.
push_back
(
e
);
core
.
sub_solving_event
.
push_back
(
e
);
pduel
->
lua
->
add_param
(
it
->
ptr1
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
it
->
ptr1
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
it
->
arg1
>>
16
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
it
->
arg1
>>
16
,
PARAM_TYPE_INT
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
it
->
peffect
,
0
,
it
->
arg1
&
0xffff
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
it
->
peffect
,
0
,
it
->
arg1
&
0xffff
,
0
);
it
->
step
++
;
it
->
step
++
;
}
else
{
}
else
{
core
.
not_material
=
0
;
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
}
}
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
...
...
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