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
09230d32
Commit
09230d32
authored
Jul 15, 2020
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update check with sum equal
cannot select unnecessary opval==0
parent
5418965e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
26 deletions
+26
-26
field.cpp
field.cpp
+14
-14
field.h
field.h
+2
-2
libgroup.cpp
libgroup.cpp
+2
-2
operations.cpp
operations.cpp
+3
-3
playerop.cpp
playerop.cpp
+5
-5
No files found.
field.cpp
View file @
09230d32
...
@@ -2512,7 +2512,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2512,7 +2512,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
ct
++
;
ct
++
;
}
}
if
(
min
==
0
)
{
if
(
min
==
0
)
{
if
(
ct
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
{
if
(
ct
>
0
&&
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
TRUE
;
return
TRUE
;
}
}
...
@@ -2592,7 +2592,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -2592,7 +2592,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
}
}
int32
field
::
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
)
{
int32
field
::
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
)
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SCRAP_CHIMERA
))
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_SCRAP_CHIMERA
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -2604,7 +2604,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
...
@@ -2604,7 +2604,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
break
;
break
;
}
}
if
(
!
pscrap
)
{
if
(
!
pscrap
)
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -2615,7 +2615,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
...
@@ -2615,7 +2615,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
nsyn_filtered
.
push_back
(
pm
);
nsyn_filtered
.
push_back
(
pm
);
}
}
if
(
nsyn_filtered
.
size
()
==
nsyn
.
size
())
{
if
(
nsyn_filtered
.
size
()
==
nsyn
.
size
())
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
return
TRUE
;
}
}
}
else
{
}
else
{
...
@@ -2624,7 +2624,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
...
@@ -2624,7 +2624,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
if
(
pscrap
->
get_value
(
nsyn
[
i
]))
if
(
pscrap
->
get_value
(
nsyn
[
i
]))
mfiltered
=
false
;
mfiltered
=
false
;
}
}
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
return
TRUE
;
}
}
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
mcount
;
++
i
)
{
...
@@ -2637,7 +2637,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
...
@@ -2637,7 +2637,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
if
(
!
pm
->
is_affected_by_effect
(
EFFECT_SCRAP_CHIMERA
))
if
(
!
pm
->
is_affected_by_effect
(
EFFECT_SCRAP_CHIMERA
))
nsyn_removed
.
push_back
(
pm
);
nsyn_removed
.
push_back
(
pm
);
}
}
if
(
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
return
TRUE
;
return
TRUE
;
}
}
}
}
...
@@ -2678,34 +2678,34 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
...
@@ -2678,34 +2678,34 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
)
{
int32
field
::
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
,
int32
opmin
)
{
if
(
count
>
max
)
if
(
count
>
max
)
return
FALSE
;
return
FALSE
;
while
(
index
<
(
int32
)
mats
.
size
())
{
while
(
index
<
(
int32
)
mats
.
size
())
{
int32
op1
=
mats
[
index
]
->
sum_param
&
0xffff
;
int32
op1
=
mats
[
index
]
->
sum_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum_param
>>
16
)
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum_param
>>
16
)
&
0xffff
;
if
((
op1
==
acc
||
op2
==
acc
)
&&
count
>=
min
)
if
((
(
op1
==
acc
&&
acc
+
opmin
>
op1
)
||
(
op2
&&
op2
==
acc
&&
acc
+
opmin
>
op2
)
)
&&
count
>=
min
)
return
TRUE
;
return
TRUE
;
index
++
;
index
++
;
if
(
acc
>
op1
&&
check_with_sum_limit
(
mats
,
acc
-
op1
,
index
,
count
+
1
,
min
,
max
))
if
(
acc
>
op1
&&
check_with_sum_limit
(
mats
,
acc
-
op1
,
index
,
count
+
1
,
min
,
max
,
std
::
min
(
opmin
,
op1
)
))
return
TRUE
;
return
TRUE
;
if
(
op2
&&
acc
>
op2
&&
check_with_sum_limit
(
mats
,
acc
-
op2
,
index
,
count
+
1
,
min
,
max
))
if
(
op2
&&
acc
>
op2
&&
check_with_sum_limit
(
mats
,
acc
-
op2
,
index
,
count
+
1
,
min
,
max
,
std
::
min
(
opmin
,
op2
)
))
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
}
}
int32
field
::
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
)
{
int32
field
::
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
opmin
,
int32
must_count
)
{
if
(
acc
==
0
)
if
(
acc
==
0
)
return
index
==
must_count
&&
0
>=
min
&&
0
<=
max
;
return
index
==
must_count
&&
0
>=
min
&&
0
<=
max
;
if
(
index
==
must_count
)
if
(
index
==
must_count
)
return
check_with_sum_limit
(
mats
,
acc
,
index
,
1
,
min
,
max
);
return
check_with_sum_limit
(
mats
,
acc
,
index
,
1
,
min
,
max
,
opmin
);
if
(
index
>=
(
int32
)
mats
.
size
())
if
(
index
>=
(
int32
)
mats
.
size
())
return
FALSE
;
return
FALSE
;
int32
op1
=
mats
[
index
]
->
sum_param
&
0xffff
;
int32
op1
=
mats
[
index
]
->
sum_param
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum_param
>>
16
)
&
0xffff
;
int32
op2
=
(
mats
[
index
]
->
sum_param
>>
16
)
&
0xffff
;
if
(
acc
>=
op1
&&
check_with_sum_limit_m
(
mats
,
acc
-
op1
,
index
+
1
,
min
,
max
,
must_count
))
if
(
acc
>=
op1
&&
check_with_sum_limit_m
(
mats
,
acc
-
op1
,
index
+
1
,
min
,
max
,
std
::
min
(
opmin
,
op1
),
must_count
))
return
TRUE
;
return
TRUE
;
if
(
op2
&&
acc
>=
op2
&&
check_with_sum_limit_m
(
mats
,
acc
-
op2
,
index
+
1
,
min
,
max
,
must_count
))
if
(
op2
&&
acc
>=
op2
&&
check_with_sum_limit_m
(
mats
,
acc
-
op2
,
index
+
1
,
min
,
max
,
std
::
min
(
opmin
,
op2
),
must_count
))
return
TRUE
;
return
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
...
...
field.h
View file @
09230d32
...
@@ -447,8 +447,8 @@ public:
...
@@ -447,8 +447,8 @@ public:
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
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
,
uint32
pos
=
0x1
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
,
int32
opmin
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
opmin
,
int32
must_count
);
static
int32
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
);
static
int32
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
);
static
int32
check_with_sum_greater_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
,
int32
must_count
);
static
int32
check_with_sum_greater_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
,
int32
must_count
);
int32
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
lv
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
lv
,
int32
min
,
int32
max
,
group
*
mg
);
...
...
libgroup.cpp
View file @
09230d32
...
@@ -416,7 +416,7 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
...
@@ -416,7 +416,7 @@ int32 scriptlib::group_check_with_sum_equal(lua_State *L) {
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
for
(
auto
&
pcard
:
cv
)
for
(
auto
&
pcard
:
cv
)
pcard
->
sum_param
=
pduel
->
lua
->
get_operation_value
(
pcard
,
2
,
extraargs
);
pcard
->
sum_param
=
pduel
->
lua
->
get_operation_value
(
pcard
,
2
,
extraargs
);
lua_pushboolean
(
L
,
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
mcount
));
lua_pushboolean
(
L
,
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
0xffff
,
mcount
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
group_select_with_sum_equal
(
lua_State
*
L
)
{
int32
scriptlib
::
group_select_with_sum_equal
(
lua_State
*
L
)
{
...
@@ -447,7 +447,7 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
...
@@ -447,7 +447,7 @@ int32 scriptlib::group_select_with_sum_equal(lua_State *L) {
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
cv
.
insert
(
cv
.
end
(),
pduel
->
game_field
->
core
.
select_cards
.
begin
(),
pduel
->
game_field
->
core
.
select_cards
.
end
());
for
(
auto
&
pcard
:
cv
)
for
(
auto
&
pcard
:
cv
)
pcard
->
sum_param
=
pduel
->
lua
->
get_operation_value
(
pcard
,
3
,
extraargs
);
pcard
->
sum_param
=
pduel
->
lua
->
get_operation_value
(
pcard
,
3
,
extraargs
);
if
(
!
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
mcount
))
{
if
(
!
field
::
check_with_sum_limit_m
(
cv
,
acc
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
pduel
->
game_field
->
core
.
must_select_cards
.
clear
();
group
*
empty_group
=
pduel
->
new_group
();
group
*
empty_group
=
pduel
->
new_group
();
interpreter
::
group2value
(
L
,
empty_group
);
interpreter
::
group2value
(
L
,
empty_group
);
...
...
operations.cpp
View file @
09230d32
...
@@ -5242,7 +5242,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5242,7 +5242,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
nsyn
.
push_back
(
smat
);
nsyn
.
push_back
(
smat
);
tuner
->
sum_param
=
tuner
->
get_synchro_level
(
pcard
);
tuner
->
sum_param
=
tuner
->
get_synchro_level
(
pcard
);
smat
->
sum_param
=
smat
->
get_synchro_level
(
pcard
);
smat
->
sum_param
=
smat
->
get_synchro_level
(
pcard
);
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
2
))
if
(
check_with_sum_limit_m
(
nsyn
,
lv
,
0
,
0
,
0
,
0xffff
,
2
))
core
.
units
.
begin
()
->
step
=
8
;
core
.
units
.
begin
()
->
step
=
8
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -5416,8 +5416,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -5416,8 +5416,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
if
(
nsyn
[
i
]
->
is_affected_by_effect
(
EFFECT_SCRAP_CHIMERA
))
if
(
nsyn
[
i
]
->
is_affected_by_effect
(
EFFECT_SCRAP_CHIMERA
))
mremoved
=
false
;
mremoved
=
false
;
}
}
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
mfiltered
&&
check_with_sum_limit_m
(
nsyn_filtered
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
if
(
mremoved
&&
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
mcount
))
{
if
(
mremoved
&&
check_with_sum_limit_m
(
nsyn_removed
,
lv
,
0
,
min
,
max
,
0xffff
,
mcount
))
{
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
peffect
->
description
);
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
peffect
->
description
);
core
.
units
.
begin
()
->
step
=
9
;
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
return
FALSE
;
...
...
playerop.cpp
View file @
09230d32
...
@@ -599,15 +599,15 @@ int32 field::select_counter(uint16 step, uint8 playerid, uint16 countertype, uin
...
@@ -599,15 +599,15 @@ int32 field::select_counter(uint16 step, uint8 playerid, uint16 countertype, uin
}
}
return
TRUE
;
return
TRUE
;
}
}
static
int32
select_sum_check1
(
const
int32
*
oparam
,
int32
size
,
int32
index
,
int32
acc
)
{
static
int32
select_sum_check1
(
const
int32
*
oparam
,
int32
size
,
int32
index
,
int32
acc
,
int32
opmin
)
{
if
(
acc
==
0
||
index
==
size
)
if
(
acc
==
0
||
index
==
size
)
return
FALSE
;
return
FALSE
;
int32
o1
=
oparam
[
index
]
&
0xffff
;
int32
o1
=
oparam
[
index
]
&
0xffff
;
int32
o2
=
oparam
[
index
]
>>
16
;
int32
o2
=
oparam
[
index
]
>>
16
;
if
(
index
==
size
-
1
)
if
(
index
==
size
-
1
)
return
acc
==
o1
||
acc
==
o2
;
return
(
acc
==
o1
&&
acc
+
opmin
>
o1
)
||
(
o2
&&
acc
==
o2
&&
acc
+
opmin
>
o2
)
;
return
(
acc
>
o1
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o1
))
return
(
acc
>
o1
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o1
,
std
::
min
(
o1
,
opmin
)
))
||
(
o2
>
0
&&
acc
>
o2
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o2
));
||
(
o2
>
0
&&
acc
>
o2
&&
select_sum_check1
(
oparam
,
size
,
index
+
1
,
acc
-
o2
,
std
::
min
(
o2
,
opmin
)
));
}
}
int32
field
::
select_with_sum_limit
(
int16
step
,
uint8
playerid
,
int32
acc
,
int32
min
,
int32
max
)
{
int32
field
::
select_with_sum_limit
(
int16
step
,
uint8
playerid
,
int32
acc
,
int32
min
,
int32
max
)
{
if
(
step
==
0
)
{
if
(
step
==
0
)
{
...
@@ -664,7 +664,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
...
@@ -664,7 +664,7 @@ int32 field::select_with_sum_limit(int16 step, uint8 playerid, int32 acc, int32
c
[
v
]
=
1
;
c
[
v
]
=
1
;
oparam
[
i
]
=
core
.
select_cards
[
v
]
->
sum_param
;
oparam
[
i
]
=
core
.
select_cards
[
v
]
->
sum_param
;
}
}
if
(
!
select_sum_check1
(
oparam
,
returns
.
bvalue
[
0
],
0
,
acc
))
{
if
(
!
select_sum_check1
(
oparam
,
returns
.
bvalue
[
0
],
0
,
acc
,
0xffff
))
{
pduel
->
write_buffer8
(
MSG_RETRY
);
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
return
FALSE
;
}
}
...
...
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