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
5c76006c
Commit
5c76006c
authored
Jun 25, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up field::check_tuner_material
parent
e9edc2c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
30 deletions
+18
-30
field.cpp
field.cpp
+18
-30
No files found.
field.cpp
View file @
5c76006c
...
@@ -2571,27 +2571,23 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2571,27 +2571,23 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
}
}
int32
playerid
=
pcard
->
current
.
controler
;
int32
playerid
=
pcard
->
current
.
controler
;
card_set
must_list
;
card_set
must_list
;
int32
mct
=
get_must_material_list
(
playerid
,
EFFECT_MUST_BE_SMATERIAL
,
&
must_list
);
get_must_material_list
(
playerid
,
EFFECT_MUST_BE_SMATERIAL
,
&
must_list
);
auto
tit
=
must_list
.
find
(
tuner
);
must_list
.
erase
(
tuner
);
if
(
tit
!=
must_list
.
end
())
{
int32
location_count
=
get_spsummonable_count
(
pcard
,
playerid
);
--
mct
;
must_list
.
erase
(
tit
);
}
int32
ct
=
get_spsummonable_count
(
pcard
,
playerid
);
card_set
handover_zone_cards
;
card_set
handover_zone_cards
;
if
(
c
t
<=
0
)
{
if
(
location_coun
t
<=
0
)
{
uint32
must_use_zone_flag
=
0
;
uint32
must_use_zone_flag
=
0
;
filter_must_use_mzone
(
playerid
,
playerid
,
LOCATION_REASON_TOFIELD
,
pcard
,
&
must_use_zone_flag
);
filter_must_use_mzone
(
playerid
,
playerid
,
LOCATION_REASON_TOFIELD
,
pcard
,
&
must_use_zone_flag
);
uint32
handover_zone
=
get_rule_zone_fromex
(
playerid
,
pcard
)
&
~
must_use_zone_flag
;
uint32
handover_zone
=
get_rule_zone_fromex
(
playerid
,
pcard
)
&
~
must_use_zone_flag
;
get_cards_in_zone
(
&
handover_zone_cards
,
handover_zone
,
playerid
,
LOCATION_MZONE
);
get_cards_in_zone
(
&
handover_zone_cards
,
handover_zone
,
playerid
,
LOCATION_MZONE
);
if
(
handover_zone_cards
.
find
(
tuner
)
!=
handover_zone_cards
.
end
())
if
(
handover_zone_cards
.
find
(
tuner
)
!=
handover_zone_cards
.
end
())
++
c
t
;
++
location_coun
t
;
}
}
int32
location
=
LOCATION_MZONE
;
int32
location
=
LOCATION_MZONE
;
effect
*
tuner_limit
=
tuner
->
is_affected_by_effect
(
EFFECT_TUNER_MATERIAL_LIMIT
);
effect
*
tuner_limit
=
tuner
->
is_affected_by_effect
(
EFFECT_TUNER_MATERIAL_LIMIT
);
if
(
tuner_limit
)
{
if
(
tuner_limit
)
{
if
(
tuner_limit
->
value
)
if
(
tuner_limit
->
get_integer_value
()
)
location
=
tuner_limit
->
value
;
location
=
tuner_limit
->
get_integer_value
()
;
if
(
tuner_limit
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
tuner_limit
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
tuner_limit
->
s_range
&&
tuner_limit
->
s_range
>
min
)
if
(
tuner_limit
->
s_range
&&
tuner_limit
->
s_range
>
min
)
min
=
tuner_limit
->
s_range
;
min
=
tuner_limit
->
s_range
;
...
@@ -2645,7 +2641,7 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2645,7 +2641,7 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
return
FALSE
;
return
FALSE
;
}
}
}
}
if
(
tuner_limit
->
value
&&
!
(
smat
->
current
.
location
&
location
))
{
if
(
tuner_limit
->
get_integer_value
()
&&
!
((
uint32
)
smat
->
current
.
location
&
tuner_limit
->
get_integer_value
()
))
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2655,19 +2651,13 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2655,19 +2651,13 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
nsyn
.
push_back
(
smat
);
nsyn
.
push_back
(
smat
);
smat
->
sum_param
=
smat
->
get_synchro_level
(
pcard
);
smat
->
sum_param
=
smat
->
get_synchro_level
(
pcard
);
++
mcount
;
++
mcount
;
if
(
mct
>
0
)
{
must_list
.
erase
(
smat
);
auto
sit
=
must_list
.
find
(
smat
);
if
(
location_count
<=
0
)
{
if
(
sit
!=
must_list
.
end
())
{
--
mct
;
must_list
.
erase
(
sit
);
}
}
if
(
ct
<=
0
)
{
if
(
handover_zone_cards
.
find
(
smat
)
!=
handover_zone_cards
.
end
())
if
(
handover_zone_cards
.
find
(
smat
)
!=
handover_zone_cards
.
end
())
++
c
t
;
++
location_coun
t
;
}
}
if
(
min
==
0
)
{
if
(
min
==
0
)
{
if
(
c
t
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
{
if
(
location_coun
t
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
TRUE
;
return
TRUE
;
}
}
...
@@ -2677,10 +2667,8 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2677,10 +2667,8 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
}
}
}
}
}
}
if
(
m
ct
>
0
)
{
if
(
m
ust_list
.
size
()
)
{
for
(
auto
&
mcard
:
must_list
)
{
for
(
auto
&
mcard
:
must_list
)
{
if
(
mcard
==
tuner
||
mcard
==
smat
)
continue
;
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
mcard
);
pcheck
->
get_value
(
mcard
);
if
((
mcard
->
current
.
location
==
LOCATION_MZONE
&&
!
mcard
->
is_position
(
POS_FACEUP
))
||
!
mcard
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
((
mcard
->
current
.
location
==
LOCATION_MZONE
&&
!
mcard
->
is_position
(
POS_FACEUP
))
||
!
mcard
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
...
@@ -2726,7 +2714,7 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2726,7 +2714,7 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
if
(
!
pduel
->
lua
->
get_function_value
(
tuner_limit
->
target
,
2
))
if
(
!
pduel
->
lua
->
get_function_value
(
tuner_limit
->
target
,
2
))
continue
;
continue
;
}
}
if
(
tuner_limit
->
value
&&
!
(
pm
->
current
.
location
&
location
))
if
(
tuner_limit
->
get_integer_value
()
&&
!
((
uint32
)
pm
->
current
.
location
&
tuner_limit
->
get_integer_value
()
))
continue
;
continue
;
}
}
if
(
pcheck
)
if
(
pcheck
)
...
@@ -2742,9 +2730,9 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2742,9 +2730,9 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
else
{
}
else
{
card_set
cv
;
card_set
material_set
;
get_synchro_material
(
playerid
,
&
cv
,
tuner_limit
);
get_synchro_material
(
playerid
,
&
material_set
,
tuner_limit
);
for
(
auto
&
pm
:
cv
)
{
for
(
auto
&
pm
:
material_set
)
{
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
;
if
(
tuner_limit
&&
tuner_limit
->
target
)
{
if
(
tuner_limit
&&
tuner_limit
->
target
)
{
...
@@ -2766,7 +2754,7 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
...
@@ -2766,7 +2754,7 @@ int32 field::check_tuner_material(lua_State* L, card* pcard, card* tuner, int32
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
pm
->
sum_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
}
if
(
c
t
>
0
)
{
if
(
location_coun
t
>
0
)
{
int32
ret
=
check_other_synchro_material
(
nsyn
,
lv
,
min
,
max
,
mcount
);
int32
ret
=
check_other_synchro_material
(
nsyn
,
lv
,
min
,
max
,
mcount
);
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
ret
;
return
ret
;
...
...
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