Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
17038291
Commit
17038291
authored
Nov 11, 2017
by
Momobako
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updc
parent
7fc5949f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
26 deletions
+169
-26
ocgcore/effect.h
ocgcore/effect.h
+3
-0
ocgcore/field.cpp
ocgcore/field.cpp
+52
-4
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+2
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+112
-22
No files found.
ocgcore/effect.h
View file @
17038291
...
@@ -402,6 +402,9 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
...
@@ -402,6 +402,9 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_TO_GRAVE_REDIRECT_CB 313
#define EFFECT_TO_GRAVE_REDIRECT_CB 313
#define EFFECT_CHANGE_LEVEL_FINAL 314
#define EFFECT_CHANGE_LEVEL_FINAL 314
#define EFFECT_CHANGE_RANK_FINAL 315
#define EFFECT_CHANGE_RANK_FINAL 315
#define EFFECT_MUST_BE_FMATERIAL 316
#define EFFECT_MUST_BE_XMATERIAL 317
#define EFFECT_MUST_BE_LMATERIAL 318
#define EFFECT_SPSUMMON_PROC_G 320
#define EFFECT_SPSUMMON_PROC_G 320
#define EFFECT_SPSUMMON_COUNT_LIMIT 330
#define EFFECT_SPSUMMON_COUNT_LIMIT 330
#define EFFECT_LEFT_SPSUMMON_COUNT 331
#define EFFECT_LEFT_SPSUMMON_COUNT 331
...
...
ocgcore/field.cpp
View file @
17038291
...
@@ -2836,15 +2836,60 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
...
@@ -2836,15 +2836,60 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
if
(
ft
<=
0
)
if
(
ft
<=
0
)
return
FALSE
;
return
FALSE
;
}
}
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_MUST_BE_XMATERIAL
,
&
eset
);
card_set
mcset
;
for
(
int
i
=
0
;
i
<
eset
.
size
();
++
i
)
mcset
.
insert
(
eset
[
i
]
->
handler
);
int32
mct
=
mcset
.
size
();
if
(
mct
>
0
)
{
if
(
ct
==
0
&&
std
::
none_of
(
mcset
.
begin
(),
mcset
.
end
(),
[
=
](
card
*
pcard
)
{
return
linked_cards
.
find
(
pcard
)
!=
linked_cards
.
end
();
}))
mct
++
;
if
(
mct
>
max
)
return
FALSE
;
}
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
{
if
(
std
::
any_of
(
mcset
.
begin
(),
mcset
.
end
(),
[
=
](
card
*
pcard
)
{
return
std
::
find_if
(
core
.
xmaterial_lst
.
begin
(),
core
.
xmaterial_lst
.
end
(),
[
=
](
const
std
::
pair
<
int32
,
card
*>&
v
)
{
return
v
.
second
==
pcard
;
})
==
core
.
xmaterial_lst
.
end
();
}))
return
FALSE
;
return
(
int32
)
core
.
xmaterial_lst
.
size
()
>=
min
;
return
(
int32
)
core
.
xmaterial_lst
.
size
()
>=
min
;
}
for
(
auto
mit
=
mcset
.
begin
();
mit
!=
mcset
.
end
();
++
mit
)
{
card
*
pcard
=
*
mit
;
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
if
(
peffect
)
{
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();)
{
if
(
pcard
!=
cit
->
second
&&
peffect
->
get_value
(
cit
->
second
))
cit
=
core
.
xmaterial_lst
.
erase
(
cit
);
else
++
cit
;
}
}
}
for
(
auto
cit
=
mcset
.
begin
();
cit
!=
mcset
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
auto
it
=
std
::
find_if
(
core
.
xmaterial_lst
.
begin
(),
core
.
xmaterial_lst
.
end
(),
[
=
](
const
std
::
pair
<
int32
,
card
*>&
v
)
{
return
v
.
second
==
pcard
;
});
if
(
it
==
core
.
xmaterial_lst
.
end
())
return
FALSE
;
if
(
min
<
it
->
first
)
min
=
it
->
first
;
core
.
xmaterial_lst
.
erase
(
it
);
}
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
)
cit
->
second
->
sum_param
=
0
;
cit
->
second
->
sum_param
=
0
;
int32
digit
=
1
;
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
();)
{
card
*
pcard
=
cit
->
second
;
card
*
pcard
=
cit
->
second
;
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_TUNE_MAGICIAN_X
);
if
(
peffect
)
{
if
(
peffect
)
{
if
(
std
::
any_of
(
mcset
.
begin
(),
mcset
.
end
(),
[
=
](
card
*
mcard
)
{
return
!!
peffect
->
get_value
(
mcard
);
}))
{
cit
=
core
.
xmaterial_lst
.
erase
(
cit
);
continue
;
}
digit
<<=
1
;
digit
<<=
1
;
for
(
auto
mit
=
core
.
xmaterial_lst
.
begin
();
mit
!=
core
.
xmaterial_lst
.
end
();
++
mit
)
{
for
(
auto
mit
=
core
.
xmaterial_lst
.
begin
();
mit
!=
core
.
xmaterial_lst
.
end
();
++
mit
)
{
if
(
!
peffect
->
get_value
(
mit
->
second
))
if
(
!
peffect
->
get_value
(
mit
->
second
))
...
@@ -2853,7 +2898,10 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
...
@@ -2853,7 +2898,10 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
pcard
->
sum_param
|=
digit
;
pcard
->
sum_param
|=
digit
;
}
else
}
else
pcard
->
sum_param
|=
1
;
pcard
->
sum_param
|=
1
;
++
cit
;
}
}
ct
+=
std
::
count_if
(
mcset
.
begin
(),
mcset
.
end
(),
[
=
](
card
*
pcard
)
{
return
linked_cards
.
find
(
pcard
)
!=
linked_cards
.
end
();
});
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat
;
for
(
int32
icheck
=
1
;
icheck
<=
digit
;
icheck
<<=
1
)
{
for
(
int32
icheck
=
1
;
icheck
<=
digit
;
icheck
<<=
1
)
{
mat
.
clear
();
mat
.
clear
();
...
@@ -2862,7 +2910,7 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
...
@@ -2862,7 +2910,7 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
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
()
+
mct
);
auto
iter
=
mat
.
lower_bound
(
maxc
);
auto
iter
=
mat
.
lower_bound
(
maxc
);
mat
.
erase
(
mat
.
begin
(),
iter
);
mat
.
erase
(
mat
.
begin
(),
iter
);
}
}
...
@@ -2876,7 +2924,7 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
...
@@ -2876,7 +2924,7 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
if
(
ft
<=
0
)
if
(
ft
<=
0
)
continue
;
continue
;
}
}
if
((
int32
)
mat
.
size
()
>=
min
)
if
((
int32
)
mat
.
size
()
+
mct
>=
min
)
return
TRUE
;
return
TRUE
;
}
}
return
FALSE
;
return
FALSE
;
...
...
ocgcore/libduel.cpp
View file @
17038291
...
@@ -2881,6 +2881,8 @@ int32 scriptlib::duel_select_xyz_material(lua_State *L) {
...
@@ -2881,6 +2881,8 @@ int32 scriptlib::duel_select_xyz_material(lua_State *L) {
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
}
duel
*
pduel
=
scard
->
pduel
;
duel
*
pduel
=
scard
->
pduel
;
if
(
!
pduel
->
game_field
->
check_xyz_material
(
scard
,
findex
,
lv
,
minc
,
maxc
,
mg
))
return
0
;
pduel
->
game_field
->
get_xyz_material
(
scard
,
findex
,
lv
,
maxc
,
mg
);
pduel
->
game_field
->
get_xyz_material
(
scard
,
findex
,
lv
,
maxc
,
mg
);
scard
->
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_XMATERIAL
,
0
,
0
,
(
group
*
)
scard
,
playerid
+
(
lv
<<
16
),
minc
+
(
maxc
<<
16
));
scard
->
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_XMATERIAL
,
0
,
0
,
(
group
*
)
scard
,
playerid
+
(
lv
<<
16
),
minc
+
(
maxc
<<
16
));
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
...
...
ocgcore/operations.cpp
View file @
17038291
This diff is collapsed.
Click to expand it.
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