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
d60a2384
Commit
d60a2384
authored
Apr 21, 2014
by
Fluorohydride
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
synchro material limit
parent
acc238b6
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
86 additions
and
25 deletions
+86
-25
ocgcore/card.cpp
ocgcore/card.cpp
+4
-2
ocgcore/effect.h
ocgcore/effect.h
+1
-0
ocgcore/field.cpp
ocgcore/field.cpp
+8
-5
ocgcore/field.h
ocgcore/field.h
+4
-3
ocgcore/group.h
ocgcore/group.h
+4
-0
ocgcore/libcard.cpp
ocgcore/libcard.cpp
+8
-0
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+38
-5
ocgcore/operations.cpp
ocgcore/operations.cpp
+11
-3
ocgcore/processor.cpp
ocgcore/processor.cpp
+1
-1
script/constant.lua
script/constant.lua
+1
-0
script/utility.lua
script/utility.lua
+6
-6
No files found.
ocgcore/card.cpp
View file @
d60a2384
...
@@ -1646,9 +1646,10 @@ int32 card::is_summonable(effect* peffect) {
...
@@ -1646,9 +1646,10 @@ int32 card::is_summonable(effect* peffect) {
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
peffect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
uint32
result
=
FALSE
;
uint32
result
=
FALSE
;
if
(
pduel
->
game_field
->
core
.
limit_tuner
)
{
if
(
pduel
->
game_field
->
core
.
limit_tuner
||
pduel
->
game_field
->
core
.
limit_syn
)
{
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_tuner
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_tuner
,
PARAM_TYPE_CARD
);
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
3
))
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_syn
,
PARAM_TYPE_GROUP
);
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
4
))
result
=
TRUE
;
result
=
TRUE
;
}
else
if
(
pduel
->
game_field
->
core
.
limit_xyz
)
{
}
else
if
(
pduel
->
game_field
->
core
.
limit_xyz
)
{
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_xyz
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_xyz
,
PARAM_TYPE_GROUP
);
...
@@ -1821,6 +1822,7 @@ int32 card::is_special_summonable(uint8 playerid) {
...
@@ -1821,6 +1822,7 @@ int32 card::is_special_summonable(uint8 playerid) {
filter_spsummon_procedure
(
playerid
,
&
eset
);
filter_spsummon_procedure
(
playerid
,
&
eset
);
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pduel
->
game_field
->
core
.
limit_syn
=
0
;
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
eset
.
count
;
return
eset
.
count
;
}
}
...
...
ocgcore/effect.h
View file @
d60a2384
...
@@ -337,6 +337,7 @@ public:
...
@@ -337,6 +337,7 @@ public:
#define EFFECT_NONTUNER 244
#define EFFECT_NONTUNER 244
#define EFFECT_OVERLAY_REMOVE_REPLACE 245
#define EFFECT_OVERLAY_REMOVE_REPLACE 245
#define EFFECT_SCRAP_CHIMERA 246
#define EFFECT_SCRAP_CHIMERA 246
#define EFFECT_XMAT_COUNT_LIMIT 247
#define EFFECT_SPSUM_EFFECT_ACTIVATED 250
#define EFFECT_SPSUM_EFFECT_ACTIVATED 250
#define EFFECT_MATERIAL_CHECK 251
#define EFFECT_MATERIAL_CHECK 251
#define EFFECT_DISABLE_FIELD 260
#define EFFECT_DISABLE_FIELD 260
...
...
ocgcore/field.cpp
View file @
d60a2384
...
@@ -73,6 +73,7 @@ field::field(duel* pduel) {
...
@@ -73,6 +73,7 @@ field::field(duel* pduel) {
core
.
check_level
=
0
;
core
.
check_level
=
0
;
core
.
limit_tuner
=
0
;
core
.
limit_tuner
=
0
;
core
.
limit_xyz
=
0
;
core
.
limit_xyz
=
0
;
core
.
limit_syn
=
0
;
core
.
duel_options
=
0
;
core
.
duel_options
=
0
;
core
.
attacker
=
0
;
core
.
attacker
=
0
;
core
.
attack_target
=
0
;
core
.
attack_target
=
0
;
...
@@ -1541,30 +1542,30 @@ void field::attack_all_target_check() {
...
@@ -1541,30 +1542,30 @@ 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
)
{
int32
field
::
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
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
);
return
check_tuner_material
(
pcard
,
eset
[
0
]
->
handler
,
findex1
,
findex2
,
min
,
max
,
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
))
if
(
check_tuner_material
(
pcard
,
tuner
,
findex1
,
findex2
,
min
,
max
,
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
)
{
int32
field
::
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
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
);
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
tuner
);
pcheck
->
get_value
(
tuner
);
if
(
!
pduel
->
lua
->
check_matching
(
tuner
,
findex1
,
0
))
{
if
(
(
mg
&&
!
mg
->
has_card
(
tuner
))
||
!
pduel
->
lua
->
check_matching
(
tuner
,
findex1
,
0
))
{
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1588,6 +1589,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
...
@@ -1588,6 +1589,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
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
)
{
pm
=
player
[
p
].
list_mzone
[
i
];
pm
=
player
[
p
].
list_mzone
[
i
];
if
(
mg
&&
!
mg
->
has_card
(
pm
))
continue
;
if
(
pm
&&
pm
!=
tuner
&&
pm
->
is_position
(
POS_FACEUP
)
&&
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
(
pm
&&
pm
!=
tuner
&&
pm
->
is_position
(
POS_FACEUP
)
&&
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
pm
);
pcheck
->
get_value
(
pm
);
...
...
ocgcore/field.h
View file @
d60a2384
...
@@ -234,6 +234,7 @@ struct processor {
...
@@ -234,6 +234,7 @@ struct processor {
card
*
sub_attack_target
;
card
*
sub_attack_target
;
card
*
limit_tuner
;
card
*
limit_tuner
;
group
*
limit_xyz
;
group
*
limit_xyz
;
group
*
limit_syn
;
uint8
attack_cancelable
;
uint8
attack_cancelable
;
uint8
effect_damage_step
;
uint8
effect_damage_step
;
int32
battle_damage
[
2
];
int32
battle_damage
[
2
];
...
@@ -357,8 +358,8 @@ public:
...
@@ -357,8 +358,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
);
int32
check_synchro_material
(
card
*
pcard
,
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
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
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
is_player_can_draw
(
uint8
playerid
);
int32
is_player_can_draw
(
uint8
playerid
);
...
@@ -472,7 +473,7 @@ public:
...
@@ -472,7 +473,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
);
int32
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
);
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
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
);
int32
toss_coin
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count
);
...
...
ocgcore/group.h
View file @
d60a2384
...
@@ -25,6 +25,10 @@ public:
...
@@ -25,6 +25,10 @@ public:
card_set
::
iterator
it
;
card_set
::
iterator
it
;
uint32
is_readonly
;
uint32
is_readonly
;
inline
bool
has_card
(
card
*
c
)
{
return
container
.
find
(
c
)
!=
container
.
end
();
}
group
();
group
();
~
group
();
~
group
();
};
};
...
...
ocgcore/libcard.cpp
View file @
d60a2384
...
@@ -1132,12 +1132,20 @@ int32 scriptlib::card_is_synchro_summonable(lua_State *L) {
...
@@ -1132,12 +1132,20 @@ int32 scriptlib::card_is_synchro_summonable(lua_State *L) {
if
(
!
(
pcard
->
data
.
type
&
TYPE_SYNCHRO
))
if
(
!
(
pcard
->
data
.
type
&
TYPE_SYNCHRO
))
return
0
;
return
0
;
card
*
tuner
=
0
;
card
*
tuner
=
0
;
group
*
mg
=
0
;
if
(
!
lua_isnil
(
L
,
2
))
{
if
(
!
lua_isnil
(
L
,
2
))
{
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
tuner
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
tuner
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
}
}
if
(
lua_gettop
(
L
)
>=
3
)
{
if
(
!
lua_isnil
(
L
,
3
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
3
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
3
);
}
}
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
uint32
p
=
pcard
->
pduel
->
game_field
->
core
.
reason_player
;
pcard
->
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pcard
->
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pcard
->
pduel
->
game_field
->
core
.
limit_xyz
=
mg
;
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
));
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
));
return
1
;
return
1
;
}
}
...
...
ocgcore/libduel.cpp
View file @
d60a2384
...
@@ -245,8 +245,16 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
...
@@ -245,8 +245,16 @@ int32 scriptlib::duel_synchro_summon(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
check_param
(
L
,
PARAM_TYPE_CARD
,
3
);
tuner
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
tuner
=
*
(
card
**
)
lua_touserdata
(
L
,
3
);
}
}
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
4
)
{
if
(
!
lua_isnil
(
L
,
4
))
{
check_param
(
L
,
PARAM_TYPE_GROUP
,
4
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
4
);
}
}
duel
*
pduel
=
pcard
->
pduel
;
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pduel
->
game_field
->
core
.
limit_tuner
=
tuner
;
pduel
->
game_field
->
core
.
limit_syn
=
mg
;
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
);
pduel
->
game_field
->
special_summon_rule
(
playerid
,
pcard
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
...
@@ -2048,7 +2056,13 @@ int32 scriptlib::duel_select_synchro_material(lua_State *L) {
...
@@ -2048,7 +2056,13 @@ 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
);
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
0
,
(
group
*
)
pcard
,
playerid
,
min
+
(
max
<<
16
));
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
7
)
{
if
(
!
lua_isnil
(
L
,
7
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
7
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
7
);
}
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
0
,
(
effect
*
)
mg
,
(
group
*
)
pcard
,
playerid
,
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
);
...
@@ -2064,7 +2078,13 @@ int32 scriptlib::duel_check_synchro_material(lua_State *L) {
...
@@ -2064,7 +2078,13 @@ 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
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
));
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
{
if
(
!
lua_isnil
(
L
,
6
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
6
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
6
);
}
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_synchro_material
(
pcard
,
2
,
3
,
min
,
max
,
mg
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_select_tuner_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_select_tuner_material
(
lua_State
*
L
)
{
...
@@ -2083,12 +2103,18 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
...
@@ -2083,12 +2103,18 @@ int32 scriptlib::duel_select_tuner_material(lua_State *L) {
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
5
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
5
);
int32
min
=
lua_tointeger
(
L
,
6
);
int32
min
=
lua_tointeger
(
L
,
6
);
int32
max
=
lua_tointeger
(
L
,
7
);
int32
max
=
lua_tointeger
(
L
,
7
);
if
(
!
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
4
,
5
,
min
,
max
))
group
*
mg
=
0
;
if
(
lua_gettop
(
L
)
>=
8
)
{
if
(
!
lua_isnil
(
L
,
8
))
check_param
(
L
,
PARAM_TYPE_GROUP
,
8
);
mg
=
*
(
group
**
)
lua_touserdata
(
L
,
8
);
}
if
(
!
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
4
,
5
,
min
,
max
,
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
);
pduel
->
game_field
->
returns
.
bvalue
[
1
]
=
0
;
pduel
->
game_field
->
returns
.
bvalue
[
1
]
=
0
;
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
1
,
0
,
(
group
*
)
pcard
,
playerid
,
min
+
(
max
<<
16
));
pduel
->
game_field
->
add_process
(
PROCESSOR_SELECT_SYNCHRO
,
1
,
(
effect
*
)
mg
,
(
group
*
)
pcard
,
playerid
,
min
+
(
max
<<
16
));
lua_pushvalue
(
L
,
4
);
lua_pushvalue
(
L
,
4
);
lua_pushvalue
(
L
,
5
);
lua_pushvalue
(
L
,
5
);
return
lua_yield
(
L
,
2
);
return
lua_yield
(
L
,
2
);
...
@@ -2114,7 +2140,13 @@ int32 scriptlib::duel_check_tuner_material(lua_State *L) {
...
@@ -2114,7 +2140,13 @@ int32 scriptlib::duel_check_tuner_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
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tuner_material
(
pcard
,
tuner
,
3
,
4
,
min
,
max
));
group
*
mg
=
0
;
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_tuner_material
(
pcard
,
tuner
,
3
,
4
,
min
,
max
,
mg
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_get_ritual_material
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_get_ritual_material
(
lua_State
*
L
)
{
...
@@ -2367,6 +2399,7 @@ int32 scriptlib::duel_get_xyz_material(lua_State *L) {
...
@@ -2367,6 +2399,7 @@ int32 scriptlib::duel_get_xyz_material(lua_State *L) {
card
*
scard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
card
*
scard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
duel
*
pduel
=
scard
->
pduel
;
duel
*
pduel
=
scard
->
pduel
;
group
*
pgroup
=
pduel
->
new_group
();
group
*
pgroup
=
pduel
->
new_group
();
group
*
mgroup
=
pduel
->
new_group
();
pduel
->
game_field
->
get_xyz_material
(
scard
,
&
pgroup
->
container
);
pduel
->
game_field
->
get_xyz_material
(
scard
,
&
pgroup
->
container
);
interpreter
::
group2value
(
L
,
pgroup
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
return
1
;
...
...
ocgcore/operations.cpp
View file @
d60a2384
...
@@ -1931,10 +1931,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
...
@@ -1931,10 +1931,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
target
->
material_cards
.
clear
();
target
->
material_cards
.
clear
();
card
*
tuner
=
core
.
limit_tuner
;
card
*
tuner
=
core
.
limit_tuner
;
group
*
materials
=
core
.
limit_xyz
;
group
*
materials
=
core
.
limit_xyz
;
group
*
syn
=
core
.
limit_syn
;
target
->
filter_spsummon_procedure
(
sumplayer
,
&
eset
);
target
->
filter_spsummon_procedure
(
sumplayer
,
&
eset
);
target
->
filter_spsummon_procedure_g
(
sumplayer
,
&
eset
);
target
->
filter_spsummon_procedure_g
(
sumplayer
,
&
eset
);
core
.
limit_tuner
=
tuner
;
core
.
limit_tuner
=
tuner
;
core
.
limit_xyz
=
materials
;
core
.
limit_xyz
=
materials
;
core
.
limit_syn
=
syn
;
if
(
!
eset
.
count
)
if
(
!
eset
.
count
)
return
TRUE
;
return
TRUE
;
core
.
select_effects
.
clear
();
core
.
select_effects
.
clear
();
...
@@ -1959,9 +1961,11 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
...
@@ -1959,9 +1961,11 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
target
->
summon_type
=
(
peffect
->
get_value
(
target
)
&
0xfffffff
)
|
SUMMON_TYPE_SPECIAL
;
target
->
summon_type
=
(
peffect
->
get_value
(
target
)
&
0xfffffff
)
|
SUMMON_TYPE_SPECIAL
;
if
(
peffect
->
operation
)
{
if
(
peffect
->
operation
)
{
pduel
->
lua
->
add_param
(
target
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
target
,
PARAM_TYPE_CARD
);
if
(
core
.
limit_tuner
)
{
if
(
core
.
limit_tuner
||
core
.
limit_syn
)
{
pduel
->
lua
->
add_param
(
core
.
limit_tuner
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
core
.
limit_tuner
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
core
.
limit_syn
,
PARAM_TYPE_GROUP
);
core
.
limit_tuner
=
0
;
core
.
limit_tuner
=
0
;
core
.
limit_syn
=
0
;
}
}
if
(
core
.
limit_xyz
)
{
if
(
core
.
limit_xyz
)
{
pduel
->
lua
->
add_param
(
core
.
limit_xyz
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
core
.
limit_xyz
,
PARAM_TYPE_GROUP
);
...
@@ -3731,14 +3735,14 @@ int32 field::operation_replace(uint16 step, effect * replace_effect, group * tar
...
@@ -3731,14 +3735,14 @@ 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
)
{
int32
field
::
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
)
{
switch
(
step
)
{
switch
(
step
)
{
case
0
:
{
case
0
:
{
core
.
select_cards
.
clear
();
core
.
select_cards
.
clear
();
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
&&
(
!
mg
||
mg
->
has_card
(
eset
[
0
]
->
handler
))
)
{
core
.
select_cards
.
push_back
(
eset
[
0
]
->
handler
);
core
.
select_cards
.
push_back
(
eset
[
0
]
->
handler
);
pduel
->
restore_assumes
();
pduel
->
restore_assumes
();
pduel
->
write_buffer8
(
MSG_HINT
);
pduel
->
write_buffer8
(
MSG_HINT
);
...
@@ -3759,6 +3763,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3759,6 +3763,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
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
);
if
(
mg
&&
!
mg
->
has_card
(
tuner
))
continue
;
if
(
!
pduel
->
lua
->
check_matching
(
tuner
,
-
2
,
0
))
if
(
!
pduel
->
lua
->
check_matching
(
tuner
,
-
2
,
0
))
continue
;
continue
;
if
((
peffect
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL_CUSTOM
,
pcard
)))
{
if
((
peffect
=
tuner
->
is_affected_by_effect
(
EFFECT_SYNCHRO_MATERIAL_CUSTOM
,
pcard
)))
{
...
@@ -3780,6 +3786,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
...
@@ -3780,6 +3786,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card * pcard, i
if
(
pm
&&
pm
!=
tuner
&&
pm
->
is_position
(
POS_FACEUP
)
&&
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
(
pm
&&
pm
!=
tuner
&&
pm
->
is_position
(
POS_FACEUP
)
&&
pm
->
is_can_be_synchro_material
(
pcard
,
tuner
))
{
if
(
pcheck
)
if
(
pcheck
)
pcheck
->
get_value
(
pm
);
pcheck
->
get_value
(
pm
);
if
(
mg
&&
!
mg
->
has_card
(
pm
))
continue
;
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
if
(
!
pduel
->
lua
->
check_matching
(
pm
,
-
1
,
0
))
continue
;
continue
;
nsyn
.
push_back
(
pm
);
nsyn
.
push_back
(
pm
);
...
...
ocgcore/processor.cpp
View file @
d60a2384
...
@@ -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
:
{
if
(
select_synchro_material
(
it
->
step
,
it
->
arg1
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
))
if
(
select_synchro_material
(
it
->
step
,
it
->
arg1
,
(
card
*
)
it
->
ptarget
,
it
->
arg2
&
0xffff
,
it
->
arg2
>>
16
,
(
group
*
)
it
->
peffect
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
core
.
units
.
begin
()
->
step
++
;
core
.
units
.
begin
()
->
step
++
;
...
...
script/constant.lua
View file @
d60a2384
...
@@ -429,6 +429,7 @@ EFFECT_EXTRA_RITUAL_MATERIAL =243
...
@@ -429,6 +429,7 @@ EFFECT_EXTRA_RITUAL_MATERIAL =243
EFFECT_NONTUNER
=
244
EFFECT_NONTUNER
=
244
EFFECT_OVERLAY_REMOVE_REPLACE
=
245
EFFECT_OVERLAY_REMOVE_REPLACE
=
245
EFFECT_SCRAP_CHIMERA
=
246
EFFECT_SCRAP_CHIMERA
=
246
EFFECT_XMAT_COUNT_LIMIT
=
247
EFFECT_SPSUM_EFFECT_ACTIVATED
=
250
EFFECT_SPSUM_EFFECT_ACTIVATED
=
250
EFFECT_MATERIAL_CHECK
=
251
EFFECT_MATERIAL_CHECK
=
251
EFFECT_DISABLE_FIELD
=
260
EFFECT_DISABLE_FIELD
=
260
...
...
script/utility.lua
View file @
d60a2384
...
@@ -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
)
return
function
(
e
,
c
,
tuner
,
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
)
end
if
tuner
then
return
Duel
.
CheckTunerMaterial
(
c
,
tuner
,
f1
,
f2
,
minc
,
maxc
,
mg
)
end
return
Duel
.
CheckSynchroMaterial
(
c
,
f1
,
f2
,
minc
,
maxc
)
return
Duel
.
CheckSynchroMaterial
(
c
,
f1
,
f2
,
minc
,
maxc
,
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
)
return
function
(
e
,
tp
,
eg
,
ep
,
ev
,
re
,
r
,
rp
,
c
,
tuner
,
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
tuner
then
g
=
Duel
.
SelectTunerMaterial
(
c
:
GetControler
(),
c
,
tuner
,
f1
,
f2
,
minc
,
maxc
)
g
=
Duel
.
SelectTunerMaterial
(
c
:
GetControler
(),
c
,
tuner
,
f1
,
f2
,
minc
,
maxc
,
mg
)
else
else
g
=
Duel
.
SelectSynchroMaterial
(
c
:
GetControler
(),
c
,
f1
,
f2
,
minc
,
maxc
)
g
=
Duel
.
SelectSynchroMaterial
(
c
:
GetControler
(),
c
,
f1
,
f2
,
minc
,
maxc
,
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