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
5c25c803
Commit
5c25c803
authored
Dec 31, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add EFFECT_TUNE_MAGICIAN_X
parent
ccbe898d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
8 deletions
+104
-8
effect.h
effect.h
+1
-0
field.cpp
field.cpp
+39
-1
field.h
field.h
+1
-0
operations.cpp
operations.cpp
+63
-7
No files found.
effect.h
View file @
5c25c803
...
...
@@ -363,6 +363,7 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_NONTUNER 244
#define EFFECT_OVERLAY_REMOVE_REPLACE 245
#define EFFECT_SCRAP_CHIMERA 246
#define EFFECT_TUNE_MAGICIAN_X 247
#define EFFECT_PRE_MONSTER 250
#define EFFECT_MATERIAL_CHECK 251
#define EFFECT_DISABLE_FIELD 260
...
...
field.cpp
View file @
5c25c803
...
...
@@ -2273,7 +2273,45 @@ int32 field::check_with_sum_greater_limit_m(const card_vector& mats, int32 acc,
}
int32
field
::
check_xyz_material
(
card
*
scard
,
int32
findex
,
int32
lv
,
int32
min
,
int32
max
,
group
*
mg
)
{
get_xyz_material
(
scard
,
findex
,
lv
,
max
,
mg
);
return
(
int32
)
core
.
xmaterial_lst
.
size
()
>=
min
;
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
return
(
int32
)
core
.
xmaterial_lst
.
size
()
>=
min
;
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat
;
effect
*
peffect
=
0
;
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
);
if
(
plimit
)
peffect
=
plimit
;
else
mat
.
insert
(
*
cit
);
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat
.
size
());
auto
iter
=
mat
.
lower_bound
(
maxc
);
std
::
size_t
size
=
std
::
distance
(
iter
,
mat
.
end
());
if
((
int32
)
size
>=
min
)
return
TRUE
;
}
else
{
if
((
int32
)
mat
.
size
()
>=
min
)
return
TRUE
;
}
if
(
!
peffect
)
return
FALSE
;
mat
.
clear
();
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
if
(
!
peffect
->
get_value
(
cit
->
second
))
mat
.
insert
(
*
cit
);
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat
.
size
());
auto
iter
=
mat
.
lower_bound
(
maxc
);
std
::
size_t
size
=
std
::
distance
(
iter
,
mat
.
end
());
if
((
int32
)
size
>=
min
)
return
TRUE
;
}
else
{
if
((
int32
)
mat
.
size
()
>=
min
)
return
TRUE
;
}
return
FALSE
;
}
int32
field
::
is_player_can_draw
(
uint8
playerid
)
{
return
!
is_player_affected_by_effect
(
playerid
,
EFFECT_CANNOT_DRAW
);
...
...
field.h
View file @
5c25c803
...
...
@@ -611,6 +611,7 @@ public:
#define GLOBALFLAG_XMAT_COUNT_LIMIT 0x80
#define GLOBALFLAG_SELF_TOGRAVE 0x100
#define GLOBALFLAG_SPSUMMON_ONCE 0x200
#define GLOBALFLAG_TUNE_MAGICIAN 0x400
//
#define PROCESSOR_NONE 0
#define PROCESSOR_WAITING 0x10000
...
...
operations.cpp
View file @
5c25c803
...
...
@@ -4590,6 +4590,62 @@ 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
)
{
switch
(
step
)
{
case
0
:
{
if
(
!
(
core
.
global_flag
&
GLOBALFLAG_TUNE_MAGICIAN
))
{
core
.
units
.
begin
()
->
step
=
1
;
return
FALSE
;
}
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>
mat1
,
mat2
;
effect
*
peffect
=
0
;
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
);
if
(
plimit
)
peffect
=
plimit
;
else
mat1
.
insert
(
*
cit
);
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat1
.
size
());
auto
iter
=
mat1
.
lower_bound
(
maxc
);
mat1
.
erase
(
mat1
.
begin
(),
iter
);
}
if
(
peffect
)
{
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
if
(
!
peffect
->
get_value
(
cit
->
second
))
mat2
.
insert
(
*
cit
);
}
if
(
core
.
global_flag
&
GLOBALFLAG_XMAT_COUNT_LIMIT
)
{
int32
maxc
=
std
::
min
(
max
,
(
int32
)
mat2
.
size
());
auto
iter
=
mat2
.
lower_bound
(
maxc
);
mat2
.
erase
(
mat2
.
begin
(),
iter
);
}
}
if
(
mat2
.
size
()
==
core
.
xmaterial_lst
.
size
())
{
core
.
units
.
begin
()
->
step
=
1
;
}
else
if
((
int32
)
mat1
.
size
()
<
min
)
{
core
.
xmaterial_lst
.
swap
(
mat2
);
core
.
units
.
begin
()
->
step
=
1
;
}
else
if
((
int32
)
mat2
.
size
()
<
min
)
{
core
.
xmaterial_lst
.
swap
(
mat1
);
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
:
{
auto
ptr
=
(
std
::
multimap
<
int32
,
card
*
,
std
::
greater
<
int32
>
>*
)
core
.
units
.
begin
()
->
ptr1
;
if
(
!
returns
.
ivalue
[
0
])
core
.
xmaterial_lst
.
swap
(
ptr
[
0
]);
else
core
.
xmaterial_lst
.
swap
(
ptr
[
1
]);
delete
[]
ptr
;
return
FALSE
;
}
case
2
:
{
int
maxv
=
0
;
if
(
core
.
xmaterial_lst
.
size
())
maxv
=
core
.
xmaterial_lst
.
begin
()
->
first
;
...
...
@@ -4603,10 +4659,10 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
pduel
->
write_buffer32
(
513
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
min
+
(
max
<<
16
));
}
else
core
.
units
.
begin
()
->
step
=
1
;
core
.
units
.
begin
()
->
step
=
3
;
return
FALSE
;
}
case
1
:
{
case
3
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
return
TRUE
;
...
...
@@ -4619,7 +4675,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
return
TRUE
;
}
case
2
:
{
case
4
:
{
core
.
operated_set
.
clear
();
core
.
select_cards
.
clear
();
for
(
auto
iter
=
core
.
xmaterial_lst
.
begin
();
iter
!=
core
.
xmaterial_lst
.
end
();
++
iter
)
...
...
@@ -4631,7 +4687,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
));
return
FALSE
;
}
case
3
:
{
case
5
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
pduel
->
lua
->
add_param
((
void
*
)
0
,
PARAM_TYPE_GROUP
);
return
TRUE
;
...
...
@@ -4666,7 +4722,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
returns
.
ivalue
[
0
]
=
1
;
return
FALSE
;
}
case
4
:
{
case
6
:
{
if
(
!
returns
.
ivalue
[
0
])
{
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
...
...
@@ -4686,11 +4742,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
));
else
{
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
playerid
,
min
+
(
min
<<
16
));
core
.
units
.
begin
()
->
step
=
2
;
core
.
units
.
begin
()
->
step
=
4
;
}
return
FALSE
;
}
case
5
:
{
case
7
:
{
group
*
pgroup
=
pduel
->
new_group
(
core
.
operated_set
);
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
...
...
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