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
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-core
Commits
6f3d6507
Commit
6f3d6507
authored
Apr 17, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tribute summon
parent
f33afa5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
59 deletions
+92
-59
field.cpp
field.cpp
+12
-1
operations.cpp
operations.cpp
+80
-58
No files found.
field.cpp
View file @
6f3d6507
...
@@ -2627,12 +2627,23 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
...
@@ -2627,12 +2627,23 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
return
FALSE
;
return
FALSE
;
int32
s
;
int32
s
;
if
(
toplayer
==
pcard
->
current
.
controler
)
{
if
(
toplayer
==
pcard
->
current
.
controler
)
{
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
);
if
(
ct
<=
0
)
{
if
(
max
<=
0
)
return
FALSE
;
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
if
((
*
it
)
->
current
.
sequence
<
5
)
ct
++
;
}
if
(
ct
<=
0
)
return
FALSE
;
}
s
=
release_list
.
size
();
s
=
release_list
.
size
();
max
-=
(
int32
)
ex_list
.
size
();
max
-=
(
int32
)
ex_list
.
size
();
}
else
{
}
else
{
s
=
ex_list
.
size
();
s
=
ex_list
.
size
();
}
}
int32
fcount
=
get_
useable_count
(
toplayer
,
LOCATION_MZONE
,
pcard
->
current
.
controler
,
LOCATION_REASON_TOFIELD
);
int32
fcount
=
get_
mzone_limit
(
toplayer
,
pcard
->
current
.
controler
,
LOCATION_REASON_TOFIELD
);
if
(
s
<
-
fcount
+
1
)
if
(
s
<
-
fcount
+
1
)
return
FALSE
;
return
FALSE
;
if
(
max
<
0
)
if
(
max
<
0
)
...
...
operations.cpp
View file @
6f3d6507
...
@@ -975,45 +975,19 @@ int32 field::swap_control(uint16 step, effect* reason_effect, uint8 reason_playe
...
@@ -975,45 +975,19 @@ int32 field::swap_control(uint16 step, effect* reason_effect, uint8 reason_playe
if
(
!
pcard
->
is_affect_by_effect
(
reason_effect
))
if
(
!
pcard
->
is_affect_by_effect
(
reason_effect
))
return
FALSE
;
return
FALSE
;
}
}
int32
max
=
5
;
int32
ct
=
get_useable_count
(
p1
,
LOCATION_MZONE
,
reason_player
,
LOCATION_REASON_CONTROL
);
effect_set
eset
;
for
(
auto
cit
=
targets1
->
container
.
begin
();
cit
!=
targets1
->
container
.
end
();
++
cit
)
{
filter_player_effect
(
p1
,
EFFECT_MAX_MZONE
,
&
eset
);
if
((
*
cit
)
->
current
.
sequence
>=
5
)
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
ct
--
;
pduel
->
lua
->
add_param
(
p1
,
PARAM_TYPE_INT
);
}
pduel
->
lua
->
add_param
(
reason_player
,
PARAM_TYPE_INT
);
if
(
ct
<
0
)
pduel
->
lua
->
add_param
(
LOCATION_REASON_CONTROL
,
PARAM_TYPE_INT
);
int32
v
=
eset
[
i
]
->
get_value
(
3
);
if
(
max
>
v
)
max
=
v
;
}
std
::
set
<
card
*>
cset
;
cset
.
insert
(
targets1
->
container
.
begin
(),
targets1
->
container
.
end
());
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
p1
].
list_mzone
[
i
];
if
(
pcard
)
cset
.
insert
(
pcard
);
}
if
((
int32
)
cset
.
size
()
>
max
)
return
FALSE
;
return
FALSE
;
max
=
5
;
ct
=
get_useable_count
(
p2
,
LOCATION_MZONE
,
reason_player
,
LOCATION_REASON_CONTROL
);
eset
.
clear
();
for
(
auto
cit
=
targets2
->
container
.
begin
();
cit
!=
targets2
->
container
.
end
();
++
cit
)
{
filter_player_effect
(
p2
,
EFFECT_MAX_MZONE
,
&
eset
);
if
((
*
cit
)
->
current
.
sequence
>=
5
)
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
ct
--
;
pduel
->
lua
->
add_param
(
p2
,
PARAM_TYPE_INT
);
}
pduel
->
lua
->
add_param
(
reason_player
,
PARAM_TYPE_INT
);
if
(
ct
<
0
)
pduel
->
lua
->
add_param
(
LOCATION_REASON_CONTROL
,
PARAM_TYPE_INT
);
int32
v
=
eset
[
i
]
->
get_value
(
3
);
if
(
max
>
v
)
max
=
v
;
}
cset
.
clear
();
cset
.
insert
(
targets2
->
container
.
begin
(),
targets2
->
container
.
end
());
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pcard
=
player
[
p2
].
list_mzone
[
i
];
if
(
pcard
)
cset
.
insert
(
pcard
);
}
if
((
int32
)
cset
.
size
()
>
max
)
return
FALSE
;
return
FALSE
;
for
(
auto
cit
=
targets1
->
container
.
begin
();
cit
!=
targets1
->
container
.
end
();
++
cit
)
{
for
(
auto
cit
=
targets1
->
container
.
begin
();
cit
!=
targets1
->
container
.
end
();
++
cit
)
{
card
*
pcard
=
*
cit
;
card
*
pcard
=
*
cit
;
...
@@ -5145,8 +5119,57 @@ int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field,
...
@@ -5145,8 +5119,57 @@ 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
)
{
int32
field
::
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
core
.
operated_set
.
clear
();
int32
ct
=
get_tofield_count
(
playerid
,
LOCATION_MZONE
);
if
(
ct
>
0
)
{
returns
.
ivalue
[
0
]
=
TRUE
;
core
.
units
.
begin
()
->
step
=
1
;
return
FALSE
;
}
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
{
if
((
*
cit
)
->
current
.
sequence
<
5
)
core
.
select_cards
.
push_back
(
*
cit
);
}
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
if
(
core
.
release_cards_ex
.
empty
()
&&
core
.
release_cards_ex_sum
.
empty
()
&&
core
.
release_cards
.
size
()
==
core
.
select_cards
.
size
())
{
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
1
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
core
.
operated_set
.
insert
(
pcard
);
auto
it
=
std
::
find
(
core
.
release_cards
.
begin
(),
core
.
release_cards
.
end
(),
pcard
);
core
.
release_cards
.
erase
(
it
);
if
(
min
<=
(
int32
)
pcard
->
release_param
)
{
if
(
max
>
1
&&
(
!
core
.
release_cards
.
empty
()
||
!
core
.
release_cards_ex
.
empty
()
||
!
core
.
release_cards_ex_sum
.
empty
()))
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
else
core
.
units
.
begin
()
->
step
=
8
;
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
}
case
2
:
{
if
(
!
returns
.
ivalue
[
0
])
{
core
.
units
.
begin
()
->
step
=
8
;
return
FALSE
;
}
if
(
!
core
.
operated_set
.
empty
())
{
min
-=
(
*
core
.
operated_set
.
begin
())
->
release_param
;
max
--
;
}
if
(
core
.
release_cards_ex
.
size
()
+
core
.
release_cards_ex_sum
.
size
()
==
0
if
(
core
.
release_cards_ex
.
size
()
+
core
.
release_cards_ex_sum
.
size
()
==
0
||
(
get_
useable_count
(
playerid
,
LOCATION_MZONE
,
playerid
,
LOCATION_REASON_TOFIELD
)
<=
0
&&
min
<
2
))
{
||
(
get_
mzone_limit
(
playerid
,
playerid
,
LOCATION_REASON_TOFIELD
)
<=
0
&&
min
<
2
))
{
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
core
.
select_cards
.
push_back
(
*
cit
);
core
.
select_cards
.
push_back
(
*
cit
);
...
@@ -5155,7 +5178,8 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5155,7 +5178,8 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
pduel
->
write_buffer32
(
500
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
return
TRUE
;
core
.
units
.
begin
()
->
step
=
7
;
return
FALSE
;
}
}
if
(
core
.
release_cards_ex
.
size
()
>=
(
uint32
)
max
)
{
if
(
core
.
release_cards_ex
.
size
()
>=
(
uint32
)
max
)
{
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
...
@@ -5166,9 +5190,9 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5166,9 +5190,9 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
500
);
pduel
->
write_buffer32
(
500
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
return
TRUE
;
core
.
units
.
begin
()
->
step
=
7
;
return
FALSE
;
}
}
core
.
operated_set
.
clear
();
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
int32
rmax
=
0
;
int32
rmax
=
0
;
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
release_cards
.
begin
();
cit
!=
core
.
release_cards
.
end
();
++
cit
)
...
@@ -5183,12 +5207,12 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5183,12 +5207,12 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
}
else
if
(
!
core
.
release_cards_ex_sum
.
empty
())
}
else
if
(
!
core
.
release_cards_ex_sum
.
empty
())
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
92
);
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
92
);
else
else
core
.
units
.
begin
()
->
step
=
2
;
core
.
units
.
begin
()
->
step
=
4
;
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
3
:
{
if
(
!
returns
.
ivalue
[
0
])
{
if
(
!
returns
.
ivalue
[
0
])
{
core
.
units
.
begin
()
->
step
=
2
;
core
.
units
.
begin
()
->
step
=
4
;
return
FALSE
;
return
FALSE
;
}
}
if
(
core
.
temp_var
[
0
]
==
0
)
if
(
core
.
temp_var
[
0
]
==
0
)
...
@@ -5205,17 +5229,15 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5205,17 +5229,15 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
0x10001
);
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
0x10001
);
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
4
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
{
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
card
*
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
core
.
operated_set
.
insert
(
pcard
);
core
.
operated_set
.
insert
(
pcard
);
core
.
units
.
begin
()
->
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE_SUM
);
core
.
units
.
begin
()
->
peffect
=
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_RELEASE_SUM
);
}
return
FALSE
;
return
FALSE
;
}
}
case
3
:
{
case
5
:
{
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
for
(
auto
cit
=
core
.
release_cards_ex
.
begin
();
cit
!=
core
.
release_cards_ex
.
end
();
++
cit
)
core
.
select_cards
.
push_back
(
*
cit
);
core
.
select_cards
.
push_back
(
*
cit
);
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
MSG_HINT
);
...
@@ -5225,7 +5247,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5225,7 +5247,7 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
core
.
release_cards_ex
.
size
()
<<
16
)
+
core
.
release_cards_ex
.
size
());
add_process
(
PROCESSOR_SELECT_CARD
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
core
.
release_cards_ex
.
size
()
<<
16
)
+
core
.
release_cards_ex
.
size
());
return
FALSE
;
return
FALSE
;
}
}
case
4
:
{
case
6
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
...
@@ -5241,14 +5263,14 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5241,14 +5263,14 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
if
(
max
>
0
&&
!
core
.
release_cards
.
empty
())
if
(
max
>
0
&&
!
core
.
release_cards
.
empty
())
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
else
else
core
.
units
.
begin
()
->
step
=
6
;
core
.
units
.
begin
()
->
step
=
8
;
}
else
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
case
5
:
{
case
7
:
{
if
(
!
returns
.
ivalue
[
0
])
{
if
(
!
returns
.
ivalue
[
0
])
{
core
.
units
.
begin
()
->
step
=
6
;
core
.
units
.
begin
()
->
step
=
8
;
return
FALSE
;
return
FALSE
;
}
}
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
...
@@ -5261,14 +5283,14 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
...
@@ -5261,14 +5283,14 @@ int32 field::select_tribute_cards(int16 step, uint8 playerid, uint8 cancelable,
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
add_process
(
PROCESSOR_SELECT_TRIBUTE_P
,
0
,
0
,
0
,
((
uint32
)
cancelable
<<
16
)
+
playerid
,
(
max
<<
16
)
+
min
);
return
FALSE
;
return
FALSE
;
}
}
case
6
:
{
case
8
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
if
(
returns
.
ivalue
[
0
]
==
-
1
)
return
TRUE
;
return
TRUE
;
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
for
(
int32
i
=
0
;
i
<
returns
.
bvalue
[
0
];
++
i
)
core
.
operated_set
.
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
core
.
operated_set
.
insert
(
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]]);
return
FALSE
;
return
FALSE
;
}
}
case
7
:
{
case
9
:
{
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
returns
.
bvalue
[
0
]
=
core
.
operated_set
.
size
();
returns
.
bvalue
[
0
]
=
core
.
operated_set
.
size
();
int32
i
=
0
;
int32
i
=
0
;
...
...
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