Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
Commits
4dfc0d2e
Commit
4dfc0d2e
authored
Apr 23, 2014
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
47530d68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
43 deletions
+39
-43
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+12
-18
ocgcore/operations.cpp
ocgcore/operations.cpp
+26
-24
ocgcore/processor.cpp
ocgcore/processor.cpp
+1
-1
No files found.
ocgcore/libduel.cpp
View file @
4dfc0d2e
...
@@ -2058,14 +2058,12 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
...
@@ -2058,14 +2058,12 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
int32
max
=
lua_tointeger
(
L
,
6
);
int32
max
=
lua_tointeger
(
L
,
6
);
card
*
smat
=
0
;
card
*
smat
=
0
;
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
lua_gettop
(
L
)
>=
7
&&
!
lua_isnil
(
L
,
7
))
{
if
(
!
lua_isnil
(
L
,
7
))
check_param
(
L
,
PARAM_TYPE_CARD
,
7
);
check_param
(
L
,
PARAM_TYPE_CARD
,
7
);
smat
=
*
(
card
**
)
lua_touserdata
(
L
,
7
);
smat
=
*
(
card
**
)
lua_touserdata
(
L
,
7
);
}
}
if
(
lua_gettop
(
L
)
>=
8
)
{
if
(
lua_gettop
(
L
)
>=
8
&&
!
lua_isnil
(
L
,
8
))
{
if
(
!
lua_isnil
(
L
,
8
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
}
}
if
(
mg
)
if
(
mg
)
...
@@ -2089,14 +2087,12 @@ int32 scriptlib::duel_check_synchro_material(lua_State *L) {
...
@@ -2089,14 +2087,12 @@ int32 scriptlib::duel_check_synchro_material(lua_State *L) {
int32
max
=
lua_tointeger
(
L
,
5
);
int32
max
=
lua_tointeger
(
L
,
5
);
card
*
smat
=
0
;
card
*
smat
=
0
;
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
{
if
(
lua_gettop
(
L
)
>=
6
&&
!
lua_isnil
(
L
,
6
))
{
if
(
!
lua_isnil
(
L
,
6
))
check_param
(
L
,
PARAM_TYPE_CARD
,
6
);
check_param
(
L
,
PARAM_TYPE_CARD
,
6
);
smat
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
smat
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
}
}
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
lua_gettop
(
L
)
>=
7
&&
!
lua_isnil
(
L
,
7
))
{
if
(
!
lua_isnil
(
L
,
7
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
}
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
,
smat
,
mg
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
,
smat
,
mg
));
...
@@ -2119,9 +2115,8 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
...
@@ -2119,9 +2115,8 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
int32
min
=
lua_tointeger
(
L
,
6
);
int32
min
=
lua_tointeger
(
L
,
6
);
int32
max
=
lua_tointeger
(
L
,
7
);
int32
max
=
lua_tointeger
(
L
,
7
);
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
8
)
{
if
(
lua_gettop
(
L
)
>=
8
&&
!
lua_isnil
(
L
,
8
))
{
if
(
!
lua_isnil
(
L
,
8
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
}
}
if
(
!
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
4
,
5
,
min
,
max
,
0
,
mg
))
if
(
!
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
4
,
5
,
min
,
max
,
0
,
mg
))
...
@@ -2156,9 +2151,8 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
...
@@ -2156,9 +2151,8 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
int32
min
=
lua_tointeger
(
L
,
5
);
int32
min
=
lua_tointeger
(
L
,
5
);
int32
max
=
lua_tointeger
(
L
,
6
);
int32
max
=
lua_tointeger
(
L
,
6
);
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
lua_gettop
(
L
)
>=
7
&&
!
lua_isnil
(
L
,
7
))
{
if
(
!
lua_isnil
(
L
,
7
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
}
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
3
,
4
,
min
,
max
,
0
,
mg
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
3
,
4
,
min
,
max
,
0
,
mg
));
...
...
ocgcore/operations.cpp
View file @
4dfc0d2e
...
@@ -3836,7 +3836,10 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -3836,7 +3836,10 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
}
}
case
1
:
{
case
1
:
{
card
*
tuner
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
card
*
tuner
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
tuner
;
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
if
(
pcheck
)
pcheck
->
get_value
(
tuner
);
core
.
limit_tuner
=
tuner
;
effect
*
peffect
;
effect
*
peffect
;
if
((
peffect
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL_CUSTOM
,
pcard
)))
{
if
((
peffect
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL_CUSTOM
,
pcard
)))
{
if
(
!
peffect
->
operation
)
if
(
!
peffect
->
operation
)
...
@@ -3857,36 +3860,33 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -3857,36 +3860,33 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
pgroup
->
container
=
core
.
synchro_materials
;
pgroup
->
container
=
core
.
synchro_materials
;
pgroup
->
container
.
insert
(
(
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
core
.
limit_tuner
=
0
;
return
TRUE
;
return
TRUE
;
}
}
case
3
:
{
case
3
:
{
card
*
tuner
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
if
(
!
smat
)
{
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
returns
.
ivalue
[
0
]
=
TRUE
;
if
(
pcheck
)
return
FALSE
;
pcheck
->
get_value
(
tuner
);
}
card
*
tuner
=
core
.
limit_tuner
;
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l1
=
l
&
0xffff
;
int32
l1
=
l
&
0xffff
;
//int32 l2 = l >> 16;
//int32 l2 = l >> 16;
int32
lv
=
pcard
->
get_level
();
int32
lv
=
pcard
->
get_level
();
lv
-=
l1
;
lv
-=
l1
;
if
(
smat
)
{
l
=
smat
->
get_synchro_level
(
pcard
);
if
(
pcheck
)
l1
=
l
&
0xffff
;
pcheck
->
get_value
(
smat
);
lv
-=
l1
;
l
=
smat
->
get_synchro_level
(
pcard
);
min
--
;
l1
=
l
&
0xffff
;
max
--
;
lv
-=
l1
;
if
(
min
==
0
)
{
min
--
;
if
(
lv
==
0
||
max
==
0
)
max
--
;
core
.
units
.
begin
()
->
step
=
5
;
if
(
min
==
0
)
{
else
if
(
lv
==
0
||
max
==
0
)
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
core
.
units
.
begin
()
->
step
=
5
;
else
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
}
else
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
return
FALSE
;
...
@@ -3896,7 +3896,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -3896,7 +3896,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
core
.
units
.
begin
()
->
step
=
5
;
core
.
units
.
begin
()
->
step
=
5
;
return
FALSE
;
return
FALSE
;
}
}
card
*
tuner
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
card
*
tuner
=
core
.
limit_tuner
;
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l1
=
l
&
0xffff
;
int32
l1
=
l
&
0xffff
;
...
@@ -3939,20 +3939,22 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
...
@@ -3939,20 +3939,22 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
pcard
=
core
.
select_cards
[
returns
.
bvalue
[
i
+
1
]];
pgroup
->
container
.
insert
(
pcard
);
pgroup
->
container
.
insert
(
pcard
);
}
}
pgroup
->
container
.
insert
(
(
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
if
(
smat
)
if
(
smat
)
pgroup
->
container
.
insert
(
smat
);
pgroup
->
container
.
insert
(
smat
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
core
.
limit_tuner
=
0
;
return
TRUE
;
return
TRUE
;
}
}
case
6
:
{
case
6
:
{
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
pgroup
->
container
.
insert
(
(
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pgroup
->
container
.
insert
(
core
.
limit_tuner
);
pgroup
->
container
.
insert
(
smat
);
pgroup
->
container
.
insert
(
smat
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
core
.
limit_tuner
=
0
;
return
TRUE
;
return
TRUE
;
}
}
}
}
...
...
ocgcore/processor.cpp
View file @
4dfc0d2e
...
@@ -765,7 +765,7 @@ int32 field::process() {
...
@@ -765,7 +765,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SELECT_SYNCHRO
:
{
case
PROCESSOR_SELECT_SYNCHRO
:
{
int32
ret
=
0
;
int32
ret
=
TRUE
;
if
(
!
(
it
->
arg1
>>
16
))
if
(
!
(
it
->
arg1
>>
16
))
ret
=
select_synchro_material
(
it
->
step
,
it
->
arg1
&
0xffff
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
,
0
,
(
group
*
)
it
->
peffect
);
ret
=
select_synchro_material
(
it
->
step
,
it
->
arg1
&
0xffff
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
,
0
,
(
group
*
)
it
->
peffect
);
else
else
...
...
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