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
e7506e43
Commit
e7506e43
authored
Mar 09, 2018
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4e220a6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
138 deletions
+22
-138
field.cpp
field.cpp
+16
-20
operations.cpp
operations.cpp
+3
-115
playerop.cpp
playerop.cpp
+3
-3
No files found.
field.cpp
View file @
e7506e43
...
...
@@ -1671,14 +1671,14 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
pcard
->
release_param
=
2
;
else
pcard
->
release_param
=
1
;
if
(
ex
||
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
ex_list
)
ex_list
->
insert
(
pcard
);
rcount
+=
pcard
->
release_param
;
}
else
if
(
ex_tribute
.
find
(
pcard
)
!=
ex_tribute
.
end
())
{
if
(
ex
||
ex_tribute
.
find
(
pcard
)
!=
ex_tribute
.
end
())
{
if
(
release_list
)
release_list
->
insert
(
pcard
);
rcount
+=
pcard
->
release_param
;
}
else
if
(
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE
))
{
if
(
ex_list
)
ex_list
->
insert
(
pcard
);
rcount
+=
pcard
->
release_param
;
}
else
{
effect
*
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE_SUM
);
if
(
!
peffect
||
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
peffect
->
count_limit
==
0
))
...
...
@@ -2755,23 +2755,19 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
return
FALSE
;
zone
&=
0x1f
;
int32
s
=
0
;
if
(
toplayer
==
sumplayer
)
{
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
sumplayer
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
ct
<=
0
&&
max
<=
0
)
return
FALSE
;
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
if
((
*
it
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
it
)
->
current
.
controler
==
sumplayer
)
{
s
++
;
if
((
zone
>>
(
*
it
)
->
current
.
sequence
)
&
1
)
ct
++
;
}
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
sumplayer
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
ct
<=
0
&&
max
<=
0
)
return
FALSE
;
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
if
((
*
it
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
it
)
->
current
.
controler
==
toplayer
)
{
s
++
;
if
((
zone
>>
(
*
it
)
->
current
.
sequence
)
&
1
)
ct
++
;
}
if
(
ct
<=
0
)
return
FALSE
;
max
-=
(
int32
)
ex_list
.
size
();
}
else
{
s
=
ex_list
.
size
();
}
if
(
ct
<=
0
)
return
FALSE
;
max
-=
(
int32
)
ex_list
.
size
();
int32
fcount
=
get_mzone_limit
(
toplayer
,
sumplayer
,
LOCATION_REASON_TOFIELD
);
if
(
s
<
-
fcount
+
1
)
return
FALSE
;
...
...
operations.cpp
View file @
e7506e43
...
...
@@ -5597,13 +5597,9 @@ int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field,
int32
field
::
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint8
toplayer
,
uint32
zone
)
{
switch
(
step
)
{
case
0
:
{
if
(
toplayer
!=
playerid
)
{
core
.
units
.
begin
()
->
step
=
19
;
return
FALSE
;
}
core
.
operated_set
.
clear
();
zone
&=
0x1f
;
int32
ct
=
get_tofield_count
(
playerid
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
,
zone
);
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
ct
>
0
)
{
returns
.
ivalue
[
0
]
=
TRUE
;
core
.
units
.
begin
()
->
step
=
1
;
...
...
@@ -5612,7 +5608,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
int32
rmax
=
0
;
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
{
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
cit
)
->
current
.
controler
==
playerid
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
))
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
cit
)
->
current
.
controler
==
toplayer
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
))
core
.
select_cards
.
push_back
(
*
cit
);
else
rmax
+=
(
*
cit
)
->
release_param
;
...
...
@@ -5655,7 +5651,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
core
.
units
.
begin
()
->
step
=
8
;
return
FALSE
;
}
int32
fcount
=
get_mzone_limit
(
playerid
,
playerid
,
LOCATION_REASON_TOFIELD
);
int32
fcount
=
get_mzone_limit
(
toplayer
,
playerid
,
LOCATION_REASON_TOFIELD
);
if
(
!
core
.
operated_set
.
empty
())
{
min
-=
(
*
core
.
operated_set
.
begin
())
->
release_param
;
max
--
;
...
...
@@ -5799,114 +5795,6 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
peffect
->
dec_count
();
return
TRUE
;
}
case
20
:
{
core
.
operated_set
.
clear
();
zone
&=
0x1f
;
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
,
zone
);
if
(
ct
>
0
)
{
returns
.
ivalue
[
0
]
=
TRUE
;
core
.
units
.
begin
()
->
step
=
21
;
return
FALSE
;
}
int32
rmax
=
0
;
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
{
if
((
*
cit
)
->
current
.
location
==
LOCATION_MZONE
&&
(
*
cit
)
->
current
.
controler
==
playerid
&&
((
zone
>>
(
*
cit
)
->
current
.
sequence
)
&
1
))
core
.
select_cards
.
push_back
(
*
cit
);
else
rmax
+=
(
*
cit
)
->
release_param
;
}
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
if
(
core
.
release_cards
.
empty
()
&&
min
>
rmax
)
{
if
(
rmax
>
0
)
{
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
core
.
select_cards
.
push_back
(
*
cit
);
}
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
return
TRUE
;
}
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
0x10001
);
return
FALSE
;
}
case
21
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
core
.
operated_set
.
insert
(
pcard
);
core
.
release_cards_ex
.
erase
(
pcard
);
if
(
min
<=
(
int32
)
pcard
->
release_param
)
{
if
(
max
>
1
&&
(
!
core
.
release_cards_ex
.
empty
()
||
!
core
.
release_cards
.
empty
()))
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
else
core
.
units
.
begin
()
->
step
=
24
;
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
}
case
22
:
{
if
(
!
returns
.
ivalue
[
0
])
{
core
.
units
.
begin
()
->
step
=
24
;
return
FALSE
;
}
int32
fcount
=
get_mzone_limit
(
toplayer
,
playerid
,
LOCATION_REASON_TOFIELD
);
if
(
!
core
.
operated_set
.
empty
())
{
min
-=
(
*
core
.
operated_set
.
begin
())
->
release_param
;
max
--
;
fcount
++
;
}
min
=
min
>
0
?
min
:
0
;
max
=
max
>
0
?
max
:
0
;
core
.
units
.
begin
()
->
arg2
=
(
max
<<
16
)
+
min
;
if
(
core
.
release_cards
.
size
()
==
0
||
(
fcount
<=
0
&&
min
<
2
))
{
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
core
.
select_cards
.
push_back
(
*
cit
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
core
.
units
.
begin
()
->
step
=
23
;
return
FALSE
;
}
return
FALSE
;
}
case
23
:
{
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
core
.
select_cards
.
push_back
(
*
cit
);
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
core
.
select_cards
.
push_back
(
*
cit
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
return
FALSE
;
}
case
24
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
core
.
operated_set
.
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
return
FALSE
;
}
case
25
:
{
core
.
select_cards
.
clear
();
returns
.
bvalue
[
0
]
=
core
.
operated_set
.
size
();
int32
i
=
0
;
for
(
auto
cit
=
core
.
operated_set
.
begin
();
cit
!=
core
.
operated_set
.
end
();
++
cit
,
++
i
)
{
core
.
select_cards
.
push_back
(
*
cit
);
returns
.
bvalue
[
i
+
1
]
=
i
;
}
return
TRUE
;
}
}
return
TRUE
;
}
...
...
playerop.cpp
View file @
e7506e43
...
...
@@ -490,10 +490,10 @@ int32 field::select_tribute(uint16 step, uint8 playerid, uint8 cancelable, uint8
pduel
->
write_buffer8
(
MSG_RETRY
);
return
FALSE
;
}
uint8
m
=
core
.
select_cards
.
size
(),
v
=
0
,
tt
=
0
;
uint8
m
=
core
.
select_cards
.
size
(),
tt
=
0
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
v
=
returns
.
bvalue
[
i
+
1
];
if
(
v
<
0
||
v
>=
m
||
v
>=
6
||
c
[
v
])
{
int8
v
=
returns
.
bvalue
[
i
+
1
];
if
(
v
<
0
||
v
>=
m
||
c
[
v
])
{
pduel
->
write_buffer8
(
MSG_RETRY
);
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