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
a42373cd
Commit
a42373cd
authored
Mar 20, 2023
by
Chrono-Genex
Committed by
GitHub
Mar 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update EFFECT_EXTRA_SYNCHRO_MATERIAL (#491)
parent
326801c1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
72 additions
and
27 deletions
+72
-27
card.cpp
card.cpp
+13
-2
effect.h
effect.h
+1
-1
field.cpp
field.cpp
+37
-12
field.h
field.h
+1
-0
libduel.cpp
libduel.cpp
+12
-0
operations.cpp
operations.cpp
+7
-12
scriptlib.h
scriptlib.h
+1
-0
No files found.
card.cpp
View file @
a42373cd
...
@@ -3891,8 +3891,6 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
...
@@ -3891,8 +3891,6 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
return
FALSE
;
return
FALSE
;
if
(
!
(
get_synchro_type
()
&
TYPE_MONSTER
))
if
(
!
(
get_synchro_type
()
&
TYPE_MONSTER
))
return
FALSE
;
return
FALSE
;
if
(
scard
&&
current
.
location
==
LOCATION_MZONE
&&
current
.
controler
!=
scard
->
current
.
controler
&&
!
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL
))
return
FALSE
;
if
(
is_status
(
STATUS_FORBIDDEN
))
if
(
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
//special fix for scrap chimera, not perfect yet
//special fix for scrap chimera, not perfect yet
...
@@ -3905,6 +3903,19 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
...
@@ -3905,6 +3903,19 @@ int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
if
(
eset
[
i
]
->
get_value
(
scard
))
if
(
eset
[
i
]
->
get_value
(
scard
))
return
FALSE
;
return
FALSE
;
if
(
scard
&&
!
(
current
.
location
==
LOCATION_MZONE
&&
current
.
controler
==
scard
->
current
.
controler
))
{
eset
.
clear
();
filter_effect
(
EFFECT_EXTRA_SYNCHRO_MATERIAL
,
&
eset
);
if
(
eset
.
size
())
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
!
eset
[
i
]
->
check_count_limit
(
scard
->
current
.
controler
))
continue
;
if
(
eset
[
i
]
->
get_value
(
scard
))
return
TRUE
;
}
return
FALSE
;
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_can_be_ritual_material
(
card
*
scard
)
{
int32
card
::
is_can_be_ritual_material
(
card
*
scard
)
{
...
...
effect.h
View file @
a42373cd
...
@@ -383,7 +383,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -383,7 +383,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_TOSS_DICE_REPLACE 221
#define EFFECT_TOSS_DICE_REPLACE 221
#define EFFECT_FUSION_MATERIAL 230
#define EFFECT_FUSION_MATERIAL 230
#define EFFECT_CHAIN_MATERIAL 231
#define EFFECT_CHAIN_MATERIAL 231
#define EFFECT_
SYNCHRO_MATERIAL
232
#define EFFECT_
EXTRA_SYNCHRO_MATERIAL
232
#define EFFECT_XYZ_MATERIAL 233
#define EFFECT_XYZ_MATERIAL 233
#define EFFECT_FUSION_SUBSTITUTE 234
#define EFFECT_FUSION_SUBSTITUTE 234
#define EFFECT_CANNOT_BE_FUSION_MATERIAL 235
#define EFFECT_CANNOT_BE_FUSION_MATERIAL 235
...
...
field.cpp
View file @
a42373cd
...
@@ -2507,6 +2507,36 @@ int32 field::check_must_material(group* mg, uint8 playerid, uint32 limit) {
...
@@ -2507,6 +2507,36 @@ int32 field::check_must_material(group* mg, uint8 playerid, uint32 limit) {
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
void
field
::
get_synchro_material
(
uint8
playerid
,
card_set
*
material
,
effect
*
ptuner
)
{
if
(
ptuner
&&
ptuner
->
value
)
{
int32
location
=
ptuner
->
value
;
if
(
location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
material
->
insert
(
pcard
);
}
}
if
(
location
&
LOCATION_HAND
)
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
if
(
pcard
)
material
->
insert
(
pcard
);
}
}
}
else
{
for
(
auto
&
pcard
:
player
[
playerid
].
list_mzone
)
{
if
(
pcard
)
material
->
insert
(
pcard
);
}
for
(
auto
&
pcard
:
player
[
1
-
playerid
].
list_mzone
)
{
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_SYNCHRO_MATERIAL
))
material
->
insert
(
pcard
);
}
for
(
auto
&
pcard
:
player
[
playerid
].
list_hand
)
{
if
(
pcard
&&
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_SYNCHRO_MATERIAL
))
material
->
insert
(
pcard
);
}
}
}
int32
field
::
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
int32
field
::
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
if
(
mg
)
{
if
(
mg
)
{
for
(
auto
&
tuner
:
mg
->
container
)
{
for
(
auto
&
tuner
:
mg
->
container
)
{
...
@@ -2514,11 +2544,11 @@ int32 field::check_synchro_material(card* pcard, int32 findex1, int32 findex2, i
...
@@ -2514,11 +2544,11 @@ int32 field::check_synchro_material(card* pcard, int32 findex1, int32 findex2, i
return
TRUE
;
return
TRUE
;
}
}
}
else
{
}
else
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
card_set
material
;
for
(
auto
&
tuner
:
player
[
p
].
list_mzone
)
{
get_synchro_material
(
pcard
->
current
.
controler
,
&
material
);
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
for
(
auto
&
tuner
:
material
)
{
return
TRUE
;
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
}
return
TRUE
;
}
}
}
}
return
FALSE
;
return
FALSE
;
...
@@ -2691,13 +2721,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2691,13 +2721,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
else
{
}
else
{
card_vector
cv
;
card_set
cv
;
if
(
location
&
LOCATION_MZONE
)
{
get_synchro_material
(
playerid
,
&
cv
,
ptuner
);
cv
.
insert
(
cv
.
end
(),
player
[
0
].
list_mzone
.
begin
(),
player
[
0
].
list_mzone
.
end
());
cv
.
insert
(
cv
.
end
(),
player
[
1
].
list_mzone
.
begin
(),
player
[
1
].
list_mzone
.
end
());
}
if
(
location
&
LOCATION_HAND
)
cv
.
insert
(
cv
.
end
(),
player
[
playerid
].
list_hand
.
begin
(),
player
[
playerid
].
list_hand
.
end
());
for
(
auto
&
pm
:
cv
)
{
for
(
auto
&
pm
:
cv
)
{
if
(
!
pm
||
pm
==
tuner
||
pm
==
smat
||
must_list
.
find
(
pm
)
!=
must_list
.
end
()
||
!
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
if
(
!
pm
||
pm
==
tuner
||
pm
==
smat
||
must_list
.
find
(
pm
)
!=
must_list
.
end
()
||
!
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
continue
;
continue
;
...
...
field.h
View file @
a42373cd
...
@@ -480,6 +480,7 @@ public:
...
@@ -480,6 +480,7 @@ public:
void
attack_all_target_check
();
void
attack_all_target_check
();
int32
get_must_material_list
(
uint8
playerid
,
uint32
limit
,
card_set
*
must_list
);
int32
get_must_material_list
(
uint8
playerid
,
uint32
limit
,
card_set
*
must_list
);
int32
check_must_material
(
group
*
mg
,
uint8
playerid
,
uint32
limit
);
int32
check_must_material
(
group
*
mg
,
uint8
playerid
,
uint32
limit
);
void
get_synchro_material
(
uint8
playerid
,
card_set
*
material
,
effect
*
ptuner
=
0
);
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
...
...
libduel.cpp
View file @
a42373cd
...
@@ -3028,6 +3028,17 @@ int32 scriptlib::duel_set_synchro_material(lua_State *L) {
...
@@ -3028,6 +3028,17 @@ int32 scriptlib::duel_set_synchro_material(lua_State *L) {
pduel
->
game_field
->
core
.
synchro_materials
=
pgroup
->
container
;
pduel
->
game_field
->
core
.
synchro_materials
=
pgroup
->
container
;
return
0
;
return
0
;
}
}
int32
scriptlib
::
duel_get_synchro_material
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
(
int32
)
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
group
*
pgroup
=
pduel
->
new_group
();
pduel
->
game_field
->
get_synchro_material
(
playerid
,
&
pgroup
->
container
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
}
int32
scriptlib
::
duel_select_synchro_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_select_synchro_material
(
lua_State
*
L
)
{
check_param_count
(
L
,
6
);
check_param_count
(
L
,
6
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
...
@@ -4746,6 +4757,7 @@ static const struct luaL_Reg duellib[] = {
...
@@ -4746,6 +4757,7 @@ static const struct luaL_Reg duellib[] = {
{
"SelectFusionMaterial"
,
scriptlib
::
duel_select_fusion_material
},
{
"SelectFusionMaterial"
,
scriptlib
::
duel_select_fusion_material
},
{
"SetFusionMaterial"
,
scriptlib
::
duel_set_fusion_material
},
{
"SetFusionMaterial"
,
scriptlib
::
duel_set_fusion_material
},
{
"SetSynchroMaterial"
,
scriptlib
::
duel_set_synchro_material
},
{
"SetSynchroMaterial"
,
scriptlib
::
duel_set_synchro_material
},
{
"GetSynchroMaterial"
,
scriptlib
::
duel_get_synchro_material
},
{
"SelectSynchroMaterial"
,
scriptlib
::
duel_select_synchro_material
},
{
"SelectSynchroMaterial"
,
scriptlib
::
duel_select_synchro_material
},
{
"CheckSynchroMaterial"
,
scriptlib
::
duel_check_synchro_material
},
{
"CheckSynchroMaterial"
,
scriptlib
::
duel_check_synchro_material
},
{
"SelectTunerMaterial"
,
scriptlib
::
duel_select_tuner_material
},
{
"SelectTunerMaterial"
,
scriptlib
::
duel_select_tuner_material
},
...
...
operations.cpp
View file @
a42373cd
...
@@ -5196,11 +5196,11 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5196,11 +5196,11 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
core
.
select_cards
.
push_back
(
pm
);
core
.
select_cards
.
push_back
(
pm
);
}
}
}
else
{
}
else
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
card_set
material
;
for
(
auto
&
tuner
:
player
[
p
].
list_mzone
)
{
get_synchro_material
(
playerid
,
&
material
);
if
(
check_tuner_material
(
pcard
,
tuner
,
-
3
,
-
2
,
min
,
max
,
smat
,
mg
))
for
(
auto
&
tuner
:
material
)
{
core
.
select_cards
.
push_back
(
tuner
);
if
(
check_tuner_material
(
pcard
,
tuner
,
-
3
,
-
2
,
min
,
max
,
smat
,
mg
))
}
core
.
select_cards
.
push_back
(
tuner
);
}
}
}
}
if
(
core
.
select_cards
.
size
()
==
0
)
if
(
core
.
select_cards
.
size
()
==
0
)
...
@@ -5342,13 +5342,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5342,13 +5342,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
else
{
}
else
{
card_vector
cv
;
card_set
cv
;
if
(
location
&
LOCATION_MZONE
)
{
get_synchro_material
(
playerid
,
&
cv
,
ptuner
);
cv
.
insert
(
cv
.
end
(),
player
[
0
].
list_mzone
.
begin
(),
player
[
0
].
list_mzone
.
end
());
cv
.
insert
(
cv
.
end
(),
player
[
1
].
list_mzone
.
begin
(),
player
[
1
].
list_mzone
.
end
());
}
if
(
location
&
LOCATION_HAND
)
cv
.
insert
(
cv
.
end
(),
player
[
playerid
].
list_hand
.
begin
(),
player
[
playerid
].
list_hand
.
end
());
for
(
auto
&
pm
:
cv
)
{
for
(
auto
&
pm
:
cv
)
{
if
(
!
pm
||
pm
==
tuner
||
pm
==
smat
||
must_list
.
find
(
pm
)
!=
must_list
.
end
()
||
!
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
if
(
!
pm
||
pm
==
tuner
||
pm
==
smat
||
must_list
.
find
(
pm
)
!=
must_list
.
end
()
||
!
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
continue
;
continue
;
...
...
scriptlib.h
View file @
a42373cd
...
@@ -522,6 +522,7 @@ public:
...
@@ -522,6 +522,7 @@ public:
static
int32
duel_select_fusion_material
(
lua_State
*
L
);
static
int32
duel_select_fusion_material
(
lua_State
*
L
);
static
int32
duel_set_fusion_material
(
lua_State
*
L
);
static
int32
duel_set_fusion_material
(
lua_State
*
L
);
static
int32
duel_set_synchro_material
(
lua_State
*
L
);
static
int32
duel_set_synchro_material
(
lua_State
*
L
);
static
int32
duel_get_synchro_material
(
lua_State
*
L
);
static
int32
duel_select_synchro_material
(
lua_State
*
L
);
static
int32
duel_select_synchro_material
(
lua_State
*
L
);
static
int32
duel_check_synchro_material
(
lua_State
*
L
);
static
int32
duel_check_synchro_material
(
lua_State
*
L
);
static
int32
duel_select_tuner_material
(
lua_State
*
L
);
static
int32
duel_select_tuner_material
(
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