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
b01eeed3
Commit
b01eeed3
authored
Jan 01, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3f8322ce
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
84 deletions
+135
-84
field.cpp
field.cpp
+30
-33
operations.cpp
operations.cpp
+105
-51
No files found.
field.cpp
View file @
b01eeed3
...
@@ -2275,42 +2275,39 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
...
@@ -2275,42 +2275,39 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
get_xyz_material
(
scard
,
findex
,
lv
,
max
,
mg
);
get_xyz_material
(
scard
,
findex
,
lv
,
max
,
mg
);
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
return
(
int32
)
core
.
xmaterial_lst
.
size
()
>=
min
;
return
(
int32
)
core
.
xmaterial_lst
.
size
()
>=
min
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat
;
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
effect
*
peffect
=
0
;
cit
->
second
->
sum_param
=
0
;
int32
digit
=
1
;
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
effect
*
plimit
=
cit
->
second
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
card
*
pcard
=
cit
->
second
;
if
(
plimit
)
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
peffect
=
plimit
;
if
(
peffect
)
{
else
digit
<<=
1
;
mat
.
insert
(
*
cit
);
for
(
auto
mit
=
core
.
xmaterial_lst
.
begin
();
mit
!=
core
.
xmaterial_lst
.
end
();
++
mit
)
{
}
if
(
!
peffect
->
get_value
(
mit
->
second
))
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
mit
->
second
->
sum_param
|=
digit
;
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat
.
size
());
}
auto
iter
=
mat
.
lower_bound
(
maxc
);
pcard
->
sum_param
|=
digit
;
std
::
size_t
size
=
std
::
distance
(
iter
,
mat
.
end
());
}
else
if
((
int32
)
size
>=
min
)
pcard
->
sum_param
|=
1
;
return
TRUE
;
}
else
{
if
((
int32
)
mat
.
size
()
>=
min
)
return
TRUE
;
}
}
if
(
!
peffect
)
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat
;
return
FALSE
;
for
(
int32
icheck
=
1
;
icheck
<=
digit
;
icheck
<<=
1
)
{
mat
.
clear
();
mat
.
clear
();
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
if
(
!
peffect
->
get_value
(
cit
->
second
)
)
if
(
cit
->
second
->
sum_param
&
icheck
)
mat
.
insert
(
*
cit
);
mat
.
insert
(
*
cit
);
}
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat
.
size
());
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat
.
size
());
auto
iter
=
mat
.
lower_bound
(
maxc
);
auto
iter
=
mat
.
lower_bound
(
maxc
);
std
::
size_t
size
=
std
::
distance
(
iter
,
mat
.
end
());
if
((
int32
)
std
::
distance
(
iter
,
mat
.
end
())
>=
min
)
if
((
int32
)
size
>=
min
)
return
TRUE
;
return
TRUE
;
}
else
{
}
else
{
if
((
int32
)
mat
.
size
()
>=
min
)
if
((
int32
)
mat
.
size
()
>=
min
)
return
TRUE
;
return
TRUE
;
}
}
}
return
FALSE
;
return
FALSE
;
}
}
int32
field
::
is_player_can_draw
(
uint8
playerid
)
{
int32
field
::
is_player_can_draw
(
uint8
playerid
)
{
...
...
operations.cpp
View file @
b01eeed3
...
@@ -4590,62 +4590,59 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -4590,62 +4590,59 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
int32
field
::
select_xyz_material
(
int16
step
,
uint8
playerid
,
uint32
lv
,
card
*
scard
,
int32
min
,
int32
max
)
{
int32
field
::
select_xyz_material
(
int16
step
,
uint8
playerid
,
uint32
lv
,
card
*
scard
,
int32
min
,
int32
max
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
{
core
.
operated_set
.
clear
();
core
.
units
.
begin
()
->
step
=
1
;
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
return
FALSE
;
return
FALSE
;
}
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat1
,
mat2
;
cit
->
second
->
sum_param
=
0
;
effect
*
peffect
=
0
;
int32
digit
=
1
;
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
effect
*
plimit
=
cit
->
second
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
card
*
pcard
=
cit
->
second
;
if
(
plimit
)
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
peffect
=
plimit
;
if
(
peffect
)
{
else
digit
<<=
1
;
mat1
.
insert
(
*
cit
);
for
(
auto
mit
=
core
.
xmaterial_lst
.
begin
();
mit
!=
core
.
xmaterial_lst
.
end
();
++
mit
)
{
if
(
!
peffect
->
get_value
(
mit
->
second
))
mit
->
second
->
sum_param
|=
digit
;
}
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
pcard
->
sum_param
|=
digit
;
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat1
.
size
());
}
else
auto
iter
=
mat1
.
lower_bound
(
maxc
);
pcard
->
sum_param
|=
1
;
mat1
.
erase
(
mat1
.
begin
(),
iter
);
}
}
if
(
peffect
)
{
int32
selectable
=
0
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat
;
for
(
int32
icheck
=
1
;
icheck
<=
digit
;
icheck
<<=
1
)
{
mat
.
clear
();
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
if
(
!
peffect
->
get_value
(
cit
->
second
)
)
if
(
cit
->
second
->
sum_param
&
icheck
)
mat
2
.
insert
(
*
cit
);
mat
.
insert
(
*
cit
);
}
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat2
.
size
());
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat
.
size
());
auto
iter
=
mat2
.
lower_bound
(
maxc
);
auto
iter
=
mat
.
lower_bound
(
maxc
);
mat2
.
erase
(
mat2
.
begin
(),
iter
);
if
((
int32
)
std
::
distance
(
iter
,
mat
.
end
())
>=
min
)
selectable
|=
icheck
;
}
else
{
if
((
int32
)
mat
.
size
()
>=
min
)
selectable
|=
icheck
;
}
}
}
}
if
(
mat2
.
size
()
==
core
.
xmaterial_lst
.
size
())
{
int32
acc
=
selectable
;
core
.
units
.
begin
()
->
step
=
1
;
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();)
{
}
else
if
((
int32
)
mat1
.
size
()
<
min
)
{
if
(
!
(
cit
->
second
->
sum_param
&
selectable
))
core
.
xmaterial_lst
.
swap
(
mat2
);
cit
=
core
.
xmaterial_lst
.
erase
(
cit
);
core
.
units
.
begin
()
->
step
=
1
;
else
{
}
else
if
((
int32
)
mat2
.
size
()
<
min
)
{
acc
&=
cit
->
second
->
sum_param
;
core
.
xmaterial_lst
.
swap
(
mat1
);
++
cit
;
core
.
units
.
begin
()
->
step
=
1
;
}
else
{
auto
ptr
=
new
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
[
2
];
ptr
[
0
].
swap
(
mat1
);
ptr
[
1
].
swap
(
mat2
);
core
.
units
.
begin
()
->
ptr1
=
ptr
;
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
peffect
->
description
);
}
}
return
FALSE
;
}
}
case
1
:
{
if
(
acc
)
auto
ptr
=
(
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>*
)
core
.
units
.
begin
()
->
ptr1
;
return
FALSE
;
if
(
!
returns
.
ivalue
[
0
])
core
.
units
.
begin
()
->
arg3
=
selectable
;
core
.
xmaterial_lst
.
swap
(
ptr
[
0
]);
core
.
units
.
begin
()
->
step
=
9
;
else
core
.
xmaterial_lst
.
swap
(
ptr
[
1
]);
delete
[]
ptr
;
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
1
:
{
int
maxv
=
0
;
int
maxv
=
0
;
if
(
core
.
xmaterial_lst
.
size
())
if
(
core
.
xmaterial_lst
.
size
())
maxv
=
core
.
xmaterial_lst
.
begin
()
->
first
;
maxv
=
core
.
xmaterial_lst
.
begin
()
->
first
;
...
@@ -4659,10 +4656,10 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
...
@@ -4659,10 +4656,10 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
pduel
->
write_buffer32
(
513
);
pduel
->
write_buffer32
(
513
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
min
+
(
max
<<
16
));
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
min
+
(
max
<<
16
));
}
else
}
else
core
.
units
.
begin
()
->
step
=
3
;
core
.
units
.
begin
()
->
step
=
2
;
return
FALSE
;
return
FALSE
;
}
}
case
3
:
{
case
2
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
return
TRUE
;
return
TRUE
;
...
@@ -4675,7 +4672,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
...
@@ -4675,7 +4672,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
return
TRUE
;
return
TRUE
;
}
}
case
4
:
{
case
3
:
{
core
.
operated_set
.
clear
();
core
.
operated_set
.
clear
();
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
++
iter
)
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
++
iter
)
...
@@ -4687,7 +4684,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
...
@@ -4687,7 +4684,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
min
+
(
min
<<
16
));
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
min
+
(
min
<<
16
));
return
FALSE
;
return
FALSE
;
}
}
case
5
:
{
case
4
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
return
TRUE
;
return
TRUE
;
...
@@ -4722,7 +4719,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
...
@@ -4722,7 +4719,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
returns
.
ivalue
[
0
]
=
1
;
returns
.
ivalue
[
0
]
=
1
;
return
FALSE
;
return
FALSE
;
}
}
case
6
:
{
case
5
:
{
if
(
!
returns
.
ivalue
[
0
])
{
if
(
!
returns
.
ivalue
[
0
])
{
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
...
@@ -4742,11 +4739,11 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
...
@@ -4742,11 +4739,11 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
max
<<
16
));
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
max
<<
16
));
else
{
else
{
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
min
<<
16
));
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
min
<<
16
));
core
.
units
.
begin
()
->
step
=
4
;
core
.
units
.
begin
()
->
step
=
3
;
}
}
return
FALSE
;
return
FALSE
;
}
}
case
7
:
{
case
6
:
{
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
...
@@ -4755,6 +4752,63 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
...
@@ -4755,6 +4752,63 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
return
TRUE
;
return
TRUE
;
}
}
case
10
:
{
core
.
select_cards
.
clear
();
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
++
iter
)
core
.
select_cards
.
push_back
(
iter
->
second
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
513
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
0x10001
);
return
FALSE
;
}
case
11
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
return
TRUE
;
}
int32
pv
=
0
;
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
core
.
operated_set
.
insert
(
pcard
);
int32
selectable
=
core
.
units
.
begin
()
->
arg3
&
pcard
->
sum_param
;
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();)
{
if
(
iter
->
second
==
pcard
)
{
pv
=
iter
->
first
;
iter
=
core
.
xmaterial_lst
.
erase
(
iter
);
}
else
if
(
!
(
iter
->
second
->
sum_param
&
selectable
))
iter
=
core
.
xmaterial_lst
.
erase
(
iter
);
else
++
iter
;
}
max
--
;
if
(
max
==
0
||
core
.
xmaterial_lst
.
size
()
==
0
)
{
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
return
TRUE
;
}
if
(
min
>
0
)
min
--
;
if
((
int32
)
core
.
operated_set
.
size
()
<
pv
)
min
=
pv
-
core
.
operated_set
.
size
();
core
.
units
.
begin
()
->
arg2
=
min
+
(
max
<<
16
);
core
.
units
.
begin
()
->
arg3
=
selectable
;
if
(
min
==
0
)
{
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
93
);
return
FALSE
;
}
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
}
case
12
:
{
if
(
!
returns
.
ivalue
[
0
])
{
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
return
TRUE
;
}
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
}
}
}
return
TRUE
;
return
TRUE
;
}
}
...
...
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