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
MobiusMei
ygopro
Commits
1d7b766f
Commit
1d7b766f
authored
Apr 22, 2014
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
ca7a6cf6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
232 additions
and
62 deletions
+232
-62
ocgcore/field.cpp
ocgcore/field.cpp
+22
-6
ocgcore/field.h
ocgcore/field.h
+3
-3
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+25
-10
ocgcore/operations.cpp
ocgcore/operations.cpp
+101
-34
ocgcore/processor.cpp
ocgcore/processor.cpp
+6
-1
script/c3171055.lua
script/c3171055.lua
+1
-1
script/c77783947.lua
script/c77783947.lua
+67
-0
script/utility.lua
script/utility.lua
+7
-7
No files found.
ocgcore/field.cpp
View file @
1d7b766f
...
@@ -1562,24 +1562,24 @@ void field::attack_all_target_check() {
...
@@ -1562,24 +1562,24 @@ void field::attack_all_target_check() {
if
(
!
peffect
->
check_value_condition
(
1
))
if
(
!
peffect
->
check_value_condition
(
1
))
core
.
attacker
->
attack_all_target
=
FALSE
;
core
.
attacker
->
attack_all_target
=
FALSE
;
}
}
int32
field
::
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
)
{
int32
field
::
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
card
*
tuner
;
card
*
tuner
;
if
(
core
.
global_flag
&
GLOBALFLAG_MUST_BE_SMATERIAL
)
{
if
(
core
.
global_flag
&
GLOBALFLAG_MUST_BE_SMATERIAL
)
{
effect_set
eset
;
effect_set
eset
;
filter_player_effect
(
pcard
->
current
.
controler
,
EFFECT_MUST_BE_SMATERIAL
,
&
eset
);
filter_player_effect
(
pcard
->
current
.
controler
,
EFFECT_MUST_BE_SMATERIAL
,
&
eset
);
if
(
eset
.
count
)
if
(
eset
.
count
)
return
check_tuner_material
(
pcard
,
eset
[
0
]
->
handler
,
findex1
,
findex2
,
min
,
max
,
mg
);
return
check_tuner_material
(
pcard
,
eset
[
0
]
->
handler
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
);
}
}
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
uint8
p
=
0
;
p
<
2
;
++
p
)
{
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
tuner
=
player
[
p
].
list_mzone
[
i
];
tuner
=
player
[
p
].
list_mzone
[
i
];
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
mg
))
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
smat
,
mg
))
return
TRUE
;
return
TRUE
;
}
}
}
}
return
FALSE
;
return
FALSE
;
}
}
int32
field
::
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
)
{
int32
field
::
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
effect
*
peffect
;
effect
*
peffect
;
if
(
tuner
&&
tuner
->
is_position
(
POS_FACEUP
)
&&
(
tuner
->
get_type
()
&
TYPE_TUNER
)
&&
tuner
->
is_can_be_synchro_material
(
pcard
))
{
if
(
tuner
&&
tuner
->
is_position
(
POS_FACEUP
)
&&
(
tuner
->
get_type
()
&
TYPE_TUNER
)
&&
tuner
->
is_can_be_synchro_material
(
pcard
))
{
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
...
@@ -1625,11 +1625,27 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -1625,11 +1625,27 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
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
();
if
(
lv
==
l1
)
{
lv
-=
l1
;
if
(
lv
<=
0
)
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
FALSE
;
return
FALSE
;
}
}
if
(
check_with_sum_limit
(
&
nsyn
,
lv
-
l1
,
0
,
1
,
min
,
max
))
{
if
(
smat
)
{
l
=
smat
->
get_synchro_level
(
pcard
);
l1
=
l
&
0xffff
;
lv
-=
l1
;
min
--
;
max
--
;
pduel
->
restore_assumes
();
if
(
lv
<=
0
)
{
if
(
lv
==
0
&&
min
==
0
)
return
TRUE
;
return
FALSE
;
}
if
(
max
==
0
)
return
FALSE
;
}
if
(
check_with_sum_limit
(
&
nsyn
,
lv
,
0
,
1
,
min
,
max
))
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
TRUE
;
return
TRUE
;
}
}
...
...
ocgcore/field.h
View file @
1d7b766f
...
@@ -359,8 +359,8 @@ public:
...
@@ -359,8 +359,8 @@ public:
int32
effect_replace_check
(
uint32
code
,
const
tevent
&
e
);
int32
effect_replace_check
(
uint32
code
,
const
tevent
&
e
);
int32
get_attack_target
(
card
*
pcard
,
card_vector
*
v
,
uint8
chain_attack
=
FALSE
);
int32
get_attack_target
(
card
*
pcard
,
card_vector
*
v
,
uint8
chain_attack
=
FALSE
);
void
attack_all_target_check
();
void
attack_all_target_check
();
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_with_sum_limit
(
card_vector
*
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
int32
check_with_sum_limit
(
card_vector
*
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
int32
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
min
,
int32
max
,
group
*
mg
);
int32
check_xyz_material
(
card
*
pcard
,
int32
findex
,
int32
min
,
int32
max
,
group
*
mg
);
...
@@ -475,7 +475,7 @@ public:
...
@@ -475,7 +475,7 @@ public:
int32
move_to_field
(
uint16
step
,
card
*
target
,
uint32
enable
,
uint32
ret
,
uint32
is_equip
);
int32
move_to_field
(
uint16
step
,
card
*
target
,
uint32
enable
,
uint32
ret
,
uint32
is_equip
);
int32
change_position
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint8
reason_player
,
uint32
enable
);
int32
change_position
(
uint16
step
,
group
*
targets
,
effect
*
reason_effect
,
uint8
reason_player
,
uint32
enable
);
int32
operation_replace
(
uint16
step
,
effect
*
replace_effect
,
group
*
targets
,
ptr
arg
,
ptr
replace_type
);
int32
operation_replace
(
uint16
step
,
effect
*
replace_effect
,
group
*
targets
,
ptr
arg
,
ptr
replace_type
);
int32
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
);
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
,
card
*
pcard
,
int32
min
,
int32
max
);
int32
select_xyz_material
(
int16
step
,
uint8
playerid
,
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_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
);
int32
select_tribute_cards
(
int16
step
,
uint8
playerid
,
uint8
cancelable
,
int32
min
,
int32
max
);
...
...
ocgcore/libduel.cpp
View file @
1d7b766f
...
@@ -2056,13 +2056,22 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
...
@@ -2056,13 +2056,22 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
4
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
4
);
int32
min
=
lua_tointeger
(
L
,
5
);
int32
min
=
lua_tointeger
(
L
,
5
);
int32
max
=
lua_tointeger
(
L
,
6
);
int32
max
=
lua_tointeger
(
L
,
6
);
card
*
smat
=
0
;
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
!
lua_isnil
(
L
,
7
))
if
(
!
lua_isnil
(
L
,
7
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
check_param
(
L
,
PARAM_TYPE_CARD
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
smat
=
*
(
card
**
)
lua_touserdata
(
L
,
7
);
}
if
(
lua_gettop
(
L
)
>=
8
)
{
if
(
!
lua_isnil
(
L
,
8
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
}
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
(
effect
*
)
mg
,
(
group
*
)
pcard
,
playerid
,
min
+
(
max
<<
16
));
if
(
mg
)
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
(
effect
*
)
mg
,
(
group
*
)
pcard
,
playerid
,
min
+
(
max
<<
16
));
else
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
(
effect
*
)
smat
,
(
group
*
)
pcard
,
playerid
+
0x10000
,
min
+
(
max
<<
16
));
lua_pushvalue
(
L
,
3
);
lua_pushvalue
(
L
,
3
);
lua_pushvalue
(
L
,
4
);
lua_pushvalue
(
L
,
4
);
return
lua_yield
(
L
,
2
);
return
lua_yield
(
L
,
2
);
...
@@ -2078,13 +2087,19 @@ int32 scriptlib::duel_check_synchro_material(lua_State *L) {
...
@@ -2078,13 +2087,19 @@ int32 scriptlib::duel_check_synchro_material(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
int32
min
=
lua_tointeger
(
L
,
4
);
int32
min
=
lua_tointeger
(
L
,
4
);
int32
max
=
lua_tointeger
(
L
,
5
);
int32
max
=
lua_tointeger
(
L
,
5
);
card
*
smat
=
0
;
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
{
if
(
lua_gettop
(
L
)
>=
6
)
{
if
(
!
lua_isnil
(
L
,
6
))
if
(
!
lua_isnil
(
L
,
6
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
);
check_param
(
L
,
PARAM_TYPE_CARD
,
6
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
smat
=
*
(
card
**
)
lua_touserdata
(
L
,
6
);
}
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
!
lua_isnil
(
L
,
7
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
}
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
,
mg
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
,
smat
,
mg
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_select_tuner_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_select_tuner_material
(
lua_State
*
L
)
{
...
@@ -2106,10 +2121,10 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
...
@@ -2106,10 +2121,10 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
8
)
{
if
(
lua_gettop
(
L
)
>=
8
)
{
if
(
!
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
,
mg
))
if
(
!
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
4
,
5
,
min
,
max
,
0
,
mg
))
return
0
;
return
0
;
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
clear
();
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
tuner
);
pduel
->
game_field
->
core
.
select_cards
.
push_back
(
tuner
);
...
@@ -2143,10 +2158,10 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
...
@@ -2143,10 +2158,10 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
group
*
mg
=
0
;
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
!
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
,
mg
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
3
,
4
,
min
,
max
,
0
,
mg
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_get_ritual_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_ritual_material
(
lua_State
*
L
)
{
...
...
ocgcore/operations.cpp
View file @
1d7b766f
...
@@ -3735,7 +3735,7 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar
...
@@ -3735,7 +3735,7 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
)
{
int32
field
::
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
...
@@ -3759,7 +3759,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3759,7 +3759,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
tuner
=
player
[
p
].
list_mzone
[
i
];
tuner
=
player
[
p
].
list_mzone
[
i
];
if
(
tuner
&&
tuner
->
is_position
(
POS_FACEUP
)
&&
(
tuner
->
get_type
()
&
TYPE_TUNER
)
&&
tuner
->
is_can_be_synchro_material
(
pcard
))
{
if
(
tuner
&&
tuner
->
is_position
(
POS_FACEUP
)
&&
(
tuner
->
get_type
()
&
TYPE_TUNER
)
&&
tuner
->
is_can_be_synchro_material
(
pcard
))
{
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
tuner
);
pcheck
->
get_value
(
tuner
);
...
@@ -3778,6 +3778,27 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3778,6 +3778,27 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
if
(
pduel
->
lua
->
check_condition
(
peffect
->
target
,
5
))
if
(
pduel
->
lua
->
check_condition
(
peffect
->
target
,
5
))
core
.
select_cards
.
push_back
(
tuner
);
core
.
select_cards
.
push_back
(
tuner
);
}
else
{
}
else
{
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l1
=
l
&
0xffff
;
//int32 l2 = l >> 16;
int32
lv
=
pcard
->
get_level
();
lv
-=
l1
;
if
(
lv
<=
0
)
continue
;
if
(
smat
)
{
l
=
smat
->
get_synchro_level
(
pcard
);
l1
=
l
&
0xffff
;
lv
-=
l1
;
min
--
;
max
--
;
if
(
lv
<=
0
)
{
if
(
lv
==
0
&&
min
==
0
)
core
.
select_cards
.
push_back
(
tuner
);
continue
;
}
if
(
max
==
0
)
continue
;
}
card_vector
nsyn
;
card_vector
nsyn
;
card
*
pm
;
card
*
pm
;
for
(
uint8
np
=
0
;
np
<
2
;
++
np
)
{
for
(
uint8
np
=
0
;
np
<
2
;
++
np
)
{
...
@@ -3795,13 +3816,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3795,13 +3816,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
}
}
}
}
}
}
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
if
(
check_with_sum_limit
(
&
nsyn
,
lv
,
0
,
1
,
min
,
max
))
int32
l1
=
l
&
0xffff
;
//int32 l2 = l >> 16;
int32
lv
=
pcard
->
get_level
();
if
(
lv
==
l1
)
continue
;
if
(
check_with_sum_limit
(
&
nsyn
,
lv
-
l1
,
0
,
1
,
min
,
max
))
core
.
select_cards
.
push_back
(
tuner
);
core
.
select_cards
.
push_back
(
tuner
);
}
}
}
}
...
@@ -3819,7 +3834,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3819,7 +3834,6 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
}
}
case
1
:
{
case
1
:
{
card
*
tuner
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
card
*
tuner
=
core
.
select_cards
[
returns
.
bvalue
[
1
]];
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
tuner
;
core
.
units
.
begin
()
->
ptarget
=
(
group
*
)
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
)))
{
...
@@ -3833,32 +3847,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3833,32 +3847,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
peffect
,
0
,
playerid
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
peffect
,
0
,
playerid
,
0
);
}
else
{
}
else
{
core
.
select_cards
.
clear
();
for
(
uint8
np
=
0
;
np
<
2
;
++
np
)
{
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pm
=
player
[
np
].
list_mzone
[
i
];
if
(
pm
&&
pm
!=
tuner
&&
pm
->
is_position
(
POS_FACEUP
)
&&
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
(
pcheck
)
pcheck
->
get_value
(
pm
);
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
continue
;
core
.
select_cards
.
push_back
(
pm
);
pm
->
operation_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l1
=
l
&
0xffff
;
//int32 l2 = l >> 16;
int32
lv
=
pcard
->
get_level
();
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
512
);
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
lv
-
l1
,
playerid
+
(
min
<<
16
)
+
(
max
<<
24
));
core
.
units
.
begin
()
->
step
=
2
;
core
.
units
.
begin
()
->
step
=
2
;
}
}
pduel
->
restore_assumes
();
return
FALSE
;
return
FALSE
;
}
}
case
2
:
{
case
2
:
{
...
@@ -3867,9 +3857,74 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3867,9 +3857,74 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
pgroup
->
container
=
core
.
synchro_materials
;
pgroup
->
container
=
core
.
synchro_materials
;
pgroup
->
container
.
insert
((
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pgroup
->
container
.
insert
((
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
restore_assumes
();
return
TRUE
;
return
TRUE
;
}
}
case
3
:
{
case
3
:
{
card
*
tuner
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l1
=
l
&
0xffff
;
//int32 l2 = l >> 16;
int32
lv
=
pcard
->
get_level
();
lv
-=
l1
;
if
(
smat
)
{
l
=
smat
->
get_synchro_level
(
pcard
);
l1
=
l
&
0xffff
;
lv
-=
l1
;
min
--
;
max
--
;
if
(
min
==
0
)
{
if
(
lv
==
0
||
max
==
0
)
core
.
units
.
begin
()
->
step
=
5
;
else
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
playerid
,
210
);
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
}
else
returns
.
ivalue
[
0
]
=
TRUE
;
return
FALSE
;
}
case
4
:
{
if
(
!
returns
.
ivalue
[
0
])
{
core
.
units
.
begin
()
->
step
=
5
;
return
FALSE
;
}
card
*
tuner
=
(
card
*
)
core
.
units
.
begin
()
->
ptarget
;
effect
*
pcheck
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_CHECK
);
int32
l
=
tuner
->
get_synchro_level
(
pcard
);
int32
l1
=
l
&
0xffff
;
//int32 l2 = l >> 16;
int32
lv
=
pcard
->
get_level
();
lv
-=
l1
;
if
(
smat
)
{
l
=
smat
->
get_synchro_level
(
pcard
);
l1
=
l
&
0xffff
;
lv
-=
l1
;
min
--
;
max
--
;
}
core
.
select_cards
.
clear
();
for
(
uint8
np
=
0
;
np
<
2
;
++
np
)
{
for
(
int32
i
=
0
;
i
<
5
;
++
i
)
{
card
*
pm
=
player
[
np
].
list_mzone
[
i
];
if
(
pm
&&
pm
!=
tuner
&&
pm
!=
smat
&&
pm
->
is_position
(
POS_FACEUP
)
&&
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
(
pcheck
)
pcheck
->
get_value
(
pm
);
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
continue
;
core
.
select_cards
.
push_back
(
pm
);
pm
->
operation_param
=
pm
->
get_synchro_level
(
pcard
);
}
}
}
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
HINT_SELECTMSG
);
pduel
->
write_buffer8
(
playerid
);
pduel
->
write_buffer32
(
512
);
add_process
(
PROCESSOR_SELECT_SUM
,
0
,
0
,
0
,
lv
,
playerid
+
(
min
<<
16
)
+
(
max
<<
24
));
return
FALSE
;
}
case
5
:
{
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
card
*
pcard
;
card
*
pcard
;
...
@@ -3878,7 +3933,19 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3878,7 +3933,19 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
pgroup
->
container
.
insert
(
pcard
);
pgroup
->
container
.
insert
(
pcard
);
}
}
pgroup
->
container
.
insert
((
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pgroup
->
container
.
insert
((
card
*
)
core
.
units
.
begin
()
->
ptarget
);
if
(
smat
)
pgroup
->
container
.
insert
(
smat
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
restore_assumes
();
return
TRUE
;
}
case
6
:
{
lua_pop
(
pduel
->
lua
->
current_state
,
2
);
group
*
pgroup
=
pduel
->
new_group
();
pgroup
->
container
.
insert
((
card
*
)
core
.
units
.
begin
()
->
ptarget
);
pgroup
->
container
.
insert
(
smat
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pgroup
,
PARAM_TYPE_GROUP
);
pduel
->
restore_assumes
();
return
TRUE
;
return
TRUE
;
}
}
}
}
...
...
ocgcore/processor.cpp
View file @
1d7b766f
...
@@ -765,7 +765,12 @@ int32 field::process() {
...
@@ -765,7 +765,12 @@ int32 field::process() {
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SELECT_SYNCHRO
:
{
case
PROCESSOR_SELECT_SYNCHRO
:
{
if
(
select_synchro_material
(
it
->
step
,
it
->
arg1
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
,
(
group
*
)
it
->
peffect
))
int32
ret
=
0
;
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
);
else
ret
=
select_synchro_material
(
it
->
step
,
it
->
arg1
&
0xffff
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
,
(
card
*
)
it
->
peffect
,
0
);
if
(
ret
)
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
core
.
units
.
begin
()
->
step
++
;
core
.
units
.
begin
()
->
step
++
;
...
...
script/c3171055.lua
View file @
1d7b766f
...
@@ -14,7 +14,7 @@ function c3171055.condition(e,tp,eg,ep,ev,re,r,rp)
...
@@ -14,7 +14,7 @@ function c3171055.condition(e,tp,eg,ep,ev,re,r,rp)
return
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
return
re
:
IsHasType
(
EFFECT_TYPE_ACTIVATE
)
end
end
function
c3171055
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
function
c3171055
.
target
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
return
end
if
chk
==
0
then
return
true
end
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
ep
,
LOCATION_DECK
,
0
,
nil
,
re
:
GetHandler
():
GetCode
())
local
g
=
Duel
.
GetMatchingGroup
(
Card
.
IsCode
,
ep
,
LOCATION_DECK
,
0
,
nil
,
re
:
GetHandler
():
GetCode
())
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
Duel
.
SetOperationInfo
(
0
,
CATEGORY_DESTROY
,
g
,
g
:
GetCount
(),
0
,
0
)
end
end
...
...
script/c77783947.lua
0 → 100644
View file @
1d7b766f
--竜星の極み
function
c77783947
.
initial_effect
(
c
)
--Activate
local
e1
=
Effect
.
CreateEffect
(
c
)
e1
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e1
:
SetCode
(
EVENT_FREE_CHAIN
)
c
:
RegisterEffect
(
e1
)
--must attack
local
e2
=
Effect
.
CreateEffect
(
c
)
e2
:
SetType
(
EFFECT_TYPE_FIELD
)
e2
:
SetCode
(
EFFECT_MUST_ATTACK
)
e2
:
SetRange
(
LOCATION_SZONE
)
e2
:
SetTargetRange
(
0
,
LOCATION_MZONE
)
c
:
RegisterEffect
(
e2
)
local
e3
=
Effect
.
CreateEffect
(
c
)
e3
:
SetType
(
EFFECT_TYPE_FIELD
)
e3
:
SetCode
(
EFFECT_CANNOT_EP
)
e3
:
SetProperty
(
EFFECT_FLAG_PLAYER_TARGET
)
e3
:
SetRange
(
LOCATION_SZONE
)
e3
:
SetTargetRange
(
0
,
1
)
e3
:
SetCondition
(
c77783947
.
becon
)
c
:
RegisterEffect
(
e3
)
--synchro effect
local
e4
=
Effect
.
CreateEffect
(
c
)
e4
:
SetCategory
(
CATEGORY_SPECIAL_SUMMON
)
e4
:
SetType
(
EFFECT_TYPE_ACTIVATE
)
e4
:
SetCode
(
EVENT_FREE_CHAIN
)
e4
:
SetHintTiming
(
0
,
TIMING_BATTLE_START
+
TIMING_BATTLE_END
)
e4
:
SetCondition
(
c77783947
.
sccon
)
e4
:
SetTarget
(
c77783947
.
sctg
)
e4
:
SetOperation
(
c77783947
.
scop
)
c
:
RegisterEffect
(
e4
)
end
function
c77783947
.
becon
(
e
)
return
Duel
.
IsExistingMatchingCard
(
Card
.
IsAttackable
,
e
:
GetHandlerPlayer
(),
0
,
LOCATION_MZONE
,
1
,
nil
)
end
function
c77783947
.
sccon
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
ph
=
Duel
.
GetCurrentPhase
()
return
ph
==
PHASE_MAIN1
or
ph
==
PHASE_BATTLE
or
ph
==
PHASE_MAIN2
end
function
c77783947
.
mfilter
(
c
)
return
c
:
IsFaceup
()
and
c
:
IsSetCard
(
0x9e
)
end
function
c77783947
.
cfilter
(
c
,
syn
)
return
syn
:
IsSynchroSummonable
(
c
)
end
function
c77783947
.
spfilter
(
c
,
mg
)
return
mg
:
IsExists
(
c77783947
.
cfilter
,
1
,
nil
,
c
)
end
function
c77783947
.
sctg
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
chk
)
if
chk
==
0
then
local
mg
=
Duel
.
GetMatchingGroup
(
c77783947
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
return
Duel
.
IsExistingMatchingCard
(
c77783947
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
1
,
nil
,
mg
)
end
Duel
.
SetOperationInfo
(
0
,
CATEGORY_SPECIAL_SUMMON
,
nil
,
1
,
tp
,
LOCATION_EXTRA
)
end
function
c77783947
.
scop
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
)
local
mg
=
Duel
.
GetMatchingGroup
(
c77783947
.
mfilter
,
tp
,
LOCATION_MZONE
,
0
,
nil
)
local
g
=
Duel
.
GetMatchingGroup
(
c77783947
.
spfilter
,
tp
,
LOCATION_EXTRA
,
0
,
nil
,
mg
)
if
g
:
GetCount
()
>
0
then
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SPSUMMON
)
local
sg
=
g
:
Select
(
tp
,
1
,
1
,
nil
)
Duel
.
Hint
(
HINT_SELECTMSG
,
tp
,
HINTMSG_SMATERIAL
)
local
tg
=
mg
:
FilterSelect
(
tp
,
c77783947
.
cfilter
,
1
,
1
,
nil
,
sg
:
GetFirst
())
Duel
.
SynchroSummon
(
tp
,
sg
:
GetFirst
(),
tg
:
GetFirst
())
end
end
script/utility.lua
View file @
1d7b766f
...
@@ -131,26 +131,26 @@ function Auxiliary.AddSynchroProcedure(c,f1,f2,ct)
...
@@ -131,26 +131,26 @@ function Auxiliary.AddSynchroProcedure(c,f1,f2,ct)
c
:
RegisterEffect
(
e1
)
c
:
RegisterEffect
(
e1
)
end
end
function
Auxiliary
.
SynCondition
(
f1
,
f2
,
minc
,
maxc
)
function
Auxiliary
.
SynCondition
(
f1
,
f2
,
minc
,
maxc
)
return
function
(
e
,
c
,
tuner
,
mg
)
return
function
(
e
,
c
,
smat
,
mg
)
if
c
==
nil
then
return
true
end
if
c
==
nil
then
return
true
end
local
ft
=
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
local
ct
=-
ft
local
ct
=-
ft
if
minc
<
ct
then
minc
=
ct
end
if
minc
<
ct
then
minc
=
ct
end
if
maxc
<
minc
then
return
false
end
if
maxc
<
minc
then
return
false
end
if
tuner
then
return
Duel
.
CheckTunerMaterial
(
c
,
tuner
,
f1
,
f2
,
minc
,
maxc
,
mg
)
end
if
smat
and
f1
(
smat
)
then
return
Duel
.
CheckTunerMaterial
(
c
,
smat
,
f1
,
f2
,
minc
,
maxc
,
mg
)
end
return
Duel
.
CheckSynchroMaterial
(
c
,
f1
,
f2
,
minc
,
maxc
,
mg
)
return
Duel
.
CheckSynchroMaterial
(
c
,
f1
,
f2
,
minc
,
maxc
,
smat
,
mg
)
end
end
end
end
function
Auxiliary
.
SynOperation
(
f1
,
f2
,
minc
,
maxc
)
function
Auxiliary
.
SynOperation
(
f1
,
f2
,
minc
,
maxc
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
tuner
,
mg
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
smat
,
mg
)
local
g
=
nil
local
g
=
nil
local
ft
=
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
local
ft
=
Duel
.
GetLocationCount
(
c
:
GetControler
(),
LOCATION_MZONE
)
local
ct
=-
ft
local
ct
=-
ft
if
minc
<
ct
then
minc
=
ct
end
if
minc
<
ct
then
minc
=
ct
end
if
tuner
then
if
smat
and
f1
(
smat
)
then
g
=
Duel
.
SelectTunerMaterial
(
c
:
GetControler
(),
c
,
tuner
,
f1
,
f2
,
minc
,
maxc
,
mg
)
g
=
Duel
.
SelectTunerMaterial
(
c
:
GetControler
(),
c
,
smat
,
f1
,
f2
,
minc
,
maxc
,
mg
)
else
else
g
=
Duel
.
SelectSynchroMaterial
(
c
:
GetControler
(),
c
,
f1
,
f2
,
minc
,
maxc
,
mg
)
g
=
Duel
.
SelectSynchroMaterial
(
c
:
GetControler
(),
c
,
f1
,
f2
,
minc
,
maxc
,
smat
,
mg
)
end
end
c
:
SetMaterial
(
g
)
c
:
SetMaterial
(
g
)
Duel
.
SendtoGrave
(
g
,
REASON_MATERIAL
+
REASON_SYNCHRO
)
Duel
.
SendtoGrave
(
g
,
REASON_MATERIAL
+
REASON_SYNCHRO
)
...
...
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