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
e769c948
Commit
e769c948
authored
Oct 14, 2017
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updc
parent
8901ba22
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
13 deletions
+128
-13
ocgcore/field.h
ocgcore/field.h
+1
-1
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+8
-3
ocgcore/operations.cpp
ocgcore/operations.cpp
+117
-7
ocgcore/processor.cpp
ocgcore/processor.cpp
+2
-2
No files found.
ocgcore/field.h
View file @
e769c948
...
...
@@ -563,7 +563,7 @@ public:
int32
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
select_xyz_material
(
int16
step
,
uint8
playerid
,
uint32
lv
,
card
*
pcard
,
int32
min
,
int32
max
);
int32
select_release_cards
(
int16
step
,
uint8
playerid
,
uint8
check_field
,
uint8
cancelable
,
int32
min
,
int32
max
);
int32
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint32
zone
);
int32
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint
8
toplayer
,
uint
32
zone
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
);
int32
toss_dice
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count1
,
uint8
count2
);
int32
rock_paper_scissors
(
uint16
step
,
uint8
repeat
);
...
...
ocgcore/libduel.cpp
View file @
e769c948
...
...
@@ -2431,16 +2431,21 @@ int32 scriptlib::duel_select_tribute(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_GROUP
,
5
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
5
);
}
uint
32
ex
=
0
;
uint
8
toplayer
=
playerid
;
if
(
lua_gettop
(
L
)
>=
6
)
ex
=
lua_toboolean
(
L
,
6
);
toplayer
=
lua_tointeger
(
L
,
6
);
if
(
toplayer
!=
0
&&
toplayer
!=
1
)
return
0
;
uint32
ex
=
FALSE
;
if
(
toplayer
!=
playerid
)
ex
=
TRUE
;
uint32
zone
=
0x1f
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
pduel
->
game_field
->
core
.
release_cards
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex
.
clear
();
pduel
->
game_field
->
core
.
release_cards_ex_sum
.
clear
();
pduel
->
game_field
->
get_summon_release_list
(
target
,
&
pduel
->
game_field
->
core
.
release_cards
,
&
pduel
->
game_field
->
core
.
release_cards_ex
,
&
pduel
->
game_field
->
core
.
release_cards_ex_sum
,
mg
,
ex
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_TRIBUTE_S
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
,
zone
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_TRIBUTE_S
,
0
,
0
,
0
,
playerid
,
(
max
<<
16
)
+
min
,
toplayer
,
zone
);
return
lua_yield
(
L
,
0
);
}
/**
...
...
ocgcore/operations.cpp
View file @
e769c948
...
...
@@ -1609,7 +1609,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
}
else
{
int32
ct
=
get_tofield_count
(
sumplayer
,
LOCATION_MZONE
,
zone
);
int32
fcount
=
get_mzone_limit
(
sumplayer
,
sumplayer
,
LOCATION_REASON_TOFIELD
);
if
(
min
==
0
&&
ct
>
0
)
{
if
(
min
==
0
&&
ct
>
0
&&
fcount
>
0
)
{
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
sumplayer
,
90
);
core
.
units
.
begin
()
->
arg2
=
required
;
}
else
{
...
...
@@ -1617,7 +1617,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
min
=
-
fcount
+
1
;
required
=
min
+
(
max
<<
16
);
}
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
zone
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
sumplayer
,
zone
);
core
.
units
.
begin
()
->
step
=
3
;
}
}
...
...
@@ -1629,7 +1629,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
returns
.
bvalue
[
0
]
=
0
;
else
{
int32
required
=
1
+
core
.
units
.
begin
()
->
arg2
;
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
zone
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
sumplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
sumplayer
,
zone
);
}
return
FALSE
;
}
...
...
@@ -2159,7 +2159,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
}
else
{
int32
ct
=
get_tofield_count
(
setplayer
,
LOCATION_MZONE
,
zone
);
int32
fcount
=
get_mzone_limit
(
setplayer
,
setplayer
,
LOCATION_REASON_TOFIELD
);
if
(
min
==
0
&&
ct
>
0
)
{
if
(
min
==
0
&&
ct
>
0
&&
fcount
>
0
)
{
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
setplayer
,
90
);
core
.
units
.
begin
()
->
arg2
=
required
;
}
else
{
...
...
@@ -2167,7 +2167,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
min
=
-
fcount
+
1
;
required
=
min
+
(
max
<<
16
);
}
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
setplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
zone
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
setplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
setplayer
,
zone
);
core
.
units
.
begin
()
->
step
=
3
;
}
}
...
...
@@ -2179,7 +2179,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
returns
.
bvalue
[
0
]
=
0
;
else
{
int32
required
=
1
+
core
.
units
.
begin
()
->
arg2
;
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
setplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
zone
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
0
,
0
,
setplayer
+
((
uint32
)
core
.
summon_cancelable
<<
16
),
required
,
setplayer
,
zone
);
}
return
FALSE
;
}
...
...
@@ -5444,9 +5444,13 @@ int32 field::select_release_cards(int16 step, uint8 playerid, uint8 check_field,
}
return
TRUE
;
}
int32
field
::
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint32
zone
)
{
int32
field
::
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
,
uint
8
toplayer
,
uint
32
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
,
zone
);
...
...
@@ -5641,6 +5645,112 @@ 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
,
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
((
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
++
;
}
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
;
}
...
...
ocgcore/processor.cpp
View file @
e769c948
...
...
@@ -204,7 +204,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
}
case
PROCESSOR_SELECT_TRIBUTE
:
{
if
(
select_tribute_cards
(
it
->
step
,
it
->
arg1
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg2
)
&
0xff
,
(
it
->
arg2
>>
16
)
&
0xff
,
it
->
arg3
))
if
(
select_tribute_cards
(
it
->
step
,
it
->
arg1
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg2
)
&
0xff
,
(
it
->
arg2
>>
16
)
&
0xff
,
it
->
arg3
,
it
->
arg4
))
core
.
units
.
pop_front
();
else
it
->
step
++
;
...
...
@@ -739,7 +739,7 @@ int32 field::process() {
}
case
PROCESSOR_SELECT_TRIBUTE_S
:
{
if
(
it
->
step
==
0
)
{
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
it
->
peffect
,
it
->
ptarget
,
it
->
arg1
,
it
->
arg2
,
it
->
arg3
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
it
->
peffect
,
it
->
ptarget
,
it
->
arg1
,
it
->
arg2
,
it
->
arg3
,
it
->
arg4
);
it
->
step
++
;
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
...
...
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