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
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
nanahira
ygopro-core
Commits
3e0f081b
Commit
3e0f081b
authored
Jun 08, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
71d322a4
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
242 additions
and
149 deletions
+242
-149
card.cpp
card.cpp
+67
-40
card.h
card.h
+4
-3
field.cpp
field.cpp
+6
-5
field.h
field.h
+4
-4
libcard.cpp
libcard.cpp
+5
-2
libduel.cpp
libduel.cpp
+9
-3
operations.cpp
operations.cpp
+144
-89
processor.cpp
processor.cpp
+3
-3
No files found.
card.cpp
View file @
3e0f081b
...
@@ -2257,23 +2257,12 @@ void card::filter_disable_related_cards() {
...
@@ -2257,23 +2257,12 @@ void card::filter_disable_related_cards() {
// -1 = this has a EFFECT_LIMIT_SUMMON_PROC, at least 1 available
// -1 = this has a EFFECT_LIMIT_SUMMON_PROC, at least 1 available
// 0 = no EFFECT_LIMIT_SUMMON_PROC, and ordinary summon ia not available
// 0 = no EFFECT_LIMIT_SUMMON_PROC, and ordinary summon ia not available
// 1 = no EFFECT_LIMIT_SUMMON_PROC, and ordinary summon ia available
// 1 = no EFFECT_LIMIT_SUMMON_PROC, and ordinary summon ia available
int32
card
::
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint8
ignore_count
,
uint8
min_tribute
)
{
int32
card
::
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
effect_set
eset
;
effect_set
eset
;
uint8
toplayer
;
filter_effect
(
EFFECT_LIMIT_SUMMON_PROC
,
&
eset
);
filter_effect
(
EFFECT_LIMIT_SUMMON_PROC
,
&
eset
);
if
(
eset
.
size
())
{
if
(
eset
.
size
())
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
check_summon_procedure
(
eset
[
i
],
playerid
,
ignore_count
,
min_tribute
,
zone
))
if
(
eset
[
i
]
->
o_range
==
0
)
toplayer
=
playerid
;
else
toplayer
=
1
-
playerid
;
}
else
toplayer
=
playerid
;
// the script will check min_tribute, Duel.CheckTribute()
if
(
eset
[
i
]
->
check_count_limit
(
playerid
)
&&
is_summonable
(
eset
[
i
],
min_tribute
)
&&
!
pduel
->
game_field
->
check_unique_onfield
(
this
,
toplayer
,
LOCATION_MZONE
)
&&
pduel
->
game_field
->
is_player_can_summon
(
eset
[
i
]
->
get_value
(
this
),
playerid
,
this
))
peset
->
add_item
(
eset
[
i
]);
peset
->
add_item
(
eset
[
i
]);
}
}
if
(
peset
->
size
())
if
(
peset
->
size
())
...
@@ -2283,17 +2272,7 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
...
@@ -2283,17 +2272,7 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
eset
.
clear
();
eset
.
clear
();
filter_effect
(
EFFECT_SUMMON_PROC
,
&
eset
);
filter_effect
(
EFFECT_SUMMON_PROC
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
check_summon_procedure
(
eset
[
i
],
playerid
,
ignore_count
,
min_tribute
,
zone
))
if
(
eset
[
i
]
->
o_range
==
0
)
toplayer
=
playerid
;
else
toplayer
=
1
-
playerid
;
}
else
toplayer
=
playerid
;
if
(
eset
[
i
]
->
check_count_limit
(
playerid
)
&&
is_summonable
(
eset
[
i
],
min_tribute
)
&&
!
pduel
->
game_field
->
check_unique_onfield
(
this
,
toplayer
,
LOCATION_MZONE
)
&&
pduel
->
game_field
->
is_player_can_summon
(
eset
[
i
]
->
get_value
(
this
),
playerid
,
this
))
peset
->
add_item
(
eset
[
i
]);
peset
->
add_item
(
eset
[
i
]);
}
}
// ordinary summon
// ordinary summon
...
@@ -2302,14 +2281,70 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
...
@@ -2302,14 +2281,70 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
if
(
pduel
->
game_field
->
check_unique_onfield
(
this
,
playerid
,
LOCATION_MZONE
))
if
(
pduel
->
game_field
->
check_unique_onfield
(
this
,
playerid
,
LOCATION_MZONE
))
return
FALSE
;
return
FALSE
;
int32
rcount
=
get_summon_tribute_count
();
int32
rcount
=
get_summon_tribute_count
();
int32
min
=
rcount
&
0xffff
,
max
=
(
rcount
>>
16
)
&
0xffff
;
int32
min
=
rcount
&
0xffff
;
int32
max
=
(
rcount
>>
16
)
&
0xffff
;
if
(
!
pduel
->
game_field
->
is_player_can_summon
(
SUMMON_TYPE_ADVANCE
,
playerid
,
this
))
if
(
!
pduel
->
game_field
->
is_player_can_summon
(
SUMMON_TYPE_ADVANCE
,
playerid
,
this
))
max
=
0
;
max
=
0
;
if
(
min
<
min_tribute
)
if
(
min
<
min_tribute
)
min
=
min_tribute
;
min
=
min_tribute
;
if
(
max
<
min
)
if
(
max
<
min
)
return
FALSE
;
return
FALSE
;
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
);
eset
.
clear
();
filter_effect
(
EFFECT_SUMMON_PROC
,
&
eset
);
if
(
!
ignore_count
&&
!
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]
&&
pduel
->
game_field
->
core
.
summon_count
[
playerid
]
>=
pduel
->
game_field
->
get_summon_count_limit
(
playerid
))
{
effect_set
eset
;
filter_effect
(
EFFECT_EXTRA_SUMMON_COUNT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
int32
val
=
eset
[
i
]
->
get_value
();
int32
new_min
=
val
&
0xff
;
int32
new_zone
=
(
val
>>
16
)
&
0x1f
;
if
(
new_min
<
min
)
new_min
=
min
;
if
(
new_zone
)
new_zone
&=
zone
;
else
new_zone
=
zone
;
if
(
pduel
->
game_field
->
check_tribute
(
this
,
new_min
,
max
,
0
,
current
.
controler
,
new_zone
))
return
TRUE
;
}
}
else
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
);
return
FALSE
;
}
int32
card
::
check_summon_procedure
(
effect
*
peffect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
if
(
!
peffect
->
check_count_limit
(
playerid
))
return
FALSE
;
if
(
!
pduel
->
game_field
->
is_player_can_summon
(
peffect
->
get_value
(
this
),
playerid
,
this
))
return
FALSE
;
uint8
toplayer
=
playerid
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
peffect
->
o_range
)
toplayer
=
1
-
playerid
;
}
if
(
pduel
->
game_field
->
check_unique_onfield
(
this
,
toplayer
,
LOCATION_MZONE
))
return
FALSE
;
// the script will check min_tribute, Duel.CheckTribute()
if
(
!
ignore_count
&&
!
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]
&&
pduel
->
game_field
->
core
.
summon_count
[
playerid
]
>=
pduel
->
game_field
->
get_summon_count_limit
(
playerid
))
{
effect_set
eset
;
filter_effect
(
EFFECT_EXTRA_SUMMON_COUNT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
int32
val
=
eset
[
i
]
->
get_value
();
int32
new_min_tribute
=
val
&
0xff
;
int32
new_zone
=
(
val
>>
16
)
&
0x1f
;
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
new_min_tribute
=
min_tribute
;
if
(
new_zone
)
new_zone
&=
zone
;
else
new_zone
=
zone
;
if
(
is_summonable
(
peffect
,
new_min_tribute
,
new_zone
))
return
TRUE
;
}
}
else
return
is_summonable
(
peffect
,
min_tribute
,
zone
);
return
FALSE
;
}
}
// put all set procedures except ordinay set in peset (see is_can_be_summoned())
// put all set procedures except ordinay set in peset (see is_can_be_summoned())
int32
card
::
filter_set_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint8
ignore_count
,
uint8
min_tribute
)
{
int32
card
::
filter_set_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint8
ignore_count
,
uint8
min_tribute
)
{
...
@@ -2628,7 +2663,7 @@ int32 card::is_spsummonable(effect* peffect) {
...
@@ -2628,7 +2663,7 @@ int32 card::is_spsummonable(effect* peffect) {
return
result
;
return
result
;
}
}
// check the condition of summon/set procedure peffect
// check the condition of summon/set procedure peffect
int32
card
::
is_summonable
(
effect
*
peffect
,
uint8
min_tribute
)
{
int32
card
::
is_summonable
(
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
)
{
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
effect
*
oreason
=
pduel
->
game_field
->
core
.
reason_effect
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
uint8
op
=
pduel
->
game_field
->
core
.
reason_player
;
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
pduel
->
game_field
->
core
.
reason_effect
=
peffect
;
...
@@ -2638,7 +2673,8 @@ int32 card::is_summonable(effect* peffect, uint8 min_tribute) {
...
@@ -2638,7 +2673,8 @@ int32 card::is_summonable(effect* peffect, uint8 min_tribute) {
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
);
pduel
->
lua
->
add_param
(
min_tribute
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
min_tribute
,
PARAM_TYPE_INT
);
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
3
))
pduel
->
lua
->
add_param
(
zone
,
PARAM_TYPE_INT
);
if
(
pduel
->
lua
->
check_condition
(
peffect
->
condition
,
4
))
result
=
TRUE
;
result
=
TRUE
;
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
pduel
->
game_field
->
core
.
reason_effect
=
oreason
;
...
@@ -2650,7 +2686,7 @@ int32 card::is_summonable(effect* peffect, uint8 min_tribute) {
...
@@ -2650,7 +2686,7 @@ int32 card::is_summonable(effect* peffect, uint8 min_tribute) {
// peffect: effects that change the ordinary summon procedure (c80921533)
// peffect: effects that change the ordinary summon procedure (c80921533)
// min_tribute: the limit of min tribute number by EFFECT_EXTRA_SUMMON_COUNT
// min_tribute: the limit of min tribute number by EFFECT_EXTRA_SUMMON_COUNT
// return: whether playerid can summon this or not
// return: whether playerid can summon this or not
int32
card
::
is_can_be_summoned
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
)
{
int32
card
::
is_can_be_summoned
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
)
{
if
(
!
is_summonable_card
())
if
(
!
is_summonable_card
())
return
FALSE
;
return
FALSE
;
if
(
!
ignore_count
&&
(
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]
||
!
is_affected_by_effect
(
EFFECT_EXTRA_SUMMON_COUNT
))
if
(
!
ignore_count
&&
(
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]
||
!
is_affected_by_effect
(
EFFECT_EXTRA_SUMMON_COUNT
))
...
@@ -2684,22 +2720,13 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
...
@@ -2684,22 +2720,13 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
return
FALSE
;
}
}
if
(
!
ignore_count
&&
!
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]
&&
pduel
->
game_field
->
core
.
summon_count
[
playerid
]
>=
pduel
->
game_field
->
get_summon_count_limit
(
playerid
))
{
effect
*
pextra
=
is_affected_by_effect
(
EFFECT_EXTRA_SUMMON_COUNT
);
if
(
pextra
&&
!
pextra
->
is_flag
(
EFFECT_FLAG_FUNC_VALUE
))
{
int32
count
=
pextra
->
get_value
();
if
((
int32
)
min_tribute
<
count
)
min_tribute
=
count
;
}
}
effect_set
proc
;
effect_set
proc
;
int32
res
=
filter_summon_procedure
(
playerid
,
&
proc
,
ignore_count
,
min_tribute
);
int32
res
=
filter_summon_procedure
(
playerid
,
&
proc
,
ignore_count
,
min_tribute
,
zone
);
if
(
peffect
)
{
if
(
peffect
)
{
if
(
res
<
0
||
!
pduel
->
game_field
->
is_player_can_summon
(
peffect
->
get_value
(),
playerid
,
this
))
{
if
(
res
<
0
||
!
pduel
->
game_field
->
is_player_can_summon
(
peffect
->
get_value
(),
playerid
,
this
))
{
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
return
FALSE
;
}
}
}
else
{
}
else
{
if
(
!
proc
.
size
()
&&
(
!
res
||
res
==
-
2
))
{
if
(
!
proc
.
size
()
&&
(
!
res
||
res
==
-
2
))
{
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
...
...
card.h
View file @
3e0f081b
...
@@ -250,7 +250,8 @@ public:
...
@@ -250,7 +250,8 @@ public:
void
filter_single_continuous_effect
(
int32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_single_continuous_effect
(
int32
code
,
effect_set
*
eset
,
uint8
sort
=
TRUE
);
void
filter_immune_effect
();
void
filter_immune_effect
();
void
filter_disable_related_cards
();
void
filter_disable_related_cards
();
int32
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
);
int32
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_summon_procedure
(
effect
*
peffect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
filter_set_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
);
int32
filter_set_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
);
void
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint32
summon_type
);
void
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint32
summon_type
);
void
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
eset
);
void
filter_spsummon_procedure_g
(
uint8
playerid
,
effect_set
*
eset
);
...
@@ -266,8 +267,8 @@ public:
...
@@ -266,8 +267,8 @@ public:
int32
is_summonable_card
();
int32
is_summonable_card
();
int32
is_fusion_summonable_card
(
uint32
summon_type
);
int32
is_fusion_summonable_card
(
uint32
summon_type
);
int32
is_spsummonable
(
effect
*
peffect
);
int32
is_spsummonable
(
effect
*
peffect
);
int32
is_summonable
(
effect
*
peffect
,
uint8
min_tribute
);
int32
is_summonable
(
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_can_be_summoned
(
uint8
playerid
,
uint8
ingore_count
,
effect
*
peffect
,
uint8
min_tribute
);
int32
is_can_be_summoned
(
uint8
playerid
,
uint8
ingore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
get_summon_tribute_count
();
int32
get_summon_tribute_count
();
int32
get_set_tribute_count
();
int32
get_set_tribute_count
();
int32
is_can_be_flip_summoned
(
uint8
playerid
);
int32
is_can_be_flip_summoned
(
uint8
playerid
);
...
...
field.cpp
View file @
3e0f081b
...
@@ -1609,9 +1609,9 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
...
@@ -1609,9 +1609,9 @@ int32 field::get_summon_release_list(card* target, card_set* release_list, card_
int32
field
::
get_summon_count_limit
(
uint8
playerid
)
{
int32
field
::
get_summon_count_limit
(
uint8
playerid
)
{
effect_set
eset
;
effect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_SET_SUMMON_COUNT_LIMIT
,
&
eset
);
filter_player_effect
(
playerid
,
EFFECT_SET_SUMMON_COUNT_LIMIT
,
&
eset
);
int32
count
=
1
,
c
;
int32
count
=
1
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
c
=
eset
[
i
]
->
get_value
();
int32
c
=
eset
[
i
]
->
get_value
();
if
(
c
>
count
)
if
(
c
>
count
)
count
=
c
;
count
=
c
;
}
}
...
@@ -2623,7 +2623,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
...
@@ -2623,7 +2623,7 @@ int32 field::check_other_synchro_material(const card_vector& nsyn, int32 lv, int
}
}
return
FALSE
;
return
FALSE
;
}
}
int32
field
::
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
)
{
int32
field
::
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
)
{
int32
ex
=
FALSE
;
int32
ex
=
FALSE
;
if
(
toplayer
==
1
-
pcard
->
current
.
controler
)
if
(
toplayer
==
1
-
pcard
->
current
.
controler
)
ex
=
TRUE
;
ex
=
TRUE
;
...
@@ -2633,14 +2633,15 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
...
@@ -2633,14 +2633,15 @@ int32 field::check_tribute(card* pcard, int32 min, int32 max, group* mg, uint8 t
max
=
m
;
max
=
m
;
if
(
min
>
max
)
if
(
min
>
max
)
return
FALSE
;
return
FALSE
;
zone
&=
0x1f
;
int32
s
;
int32
s
;
if
(
toplayer
==
pcard
->
current
.
controler
)
{
if
(
toplayer
==
pcard
->
current
.
controler
)
{
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
);
int32
ct
=
get_tofield_count
(
toplayer
,
LOCATION_MZONE
,
zone
);
if
(
ct
<=
0
)
{
if
(
ct
<=
0
)
{
if
(
max
<=
0
)
if
(
max
<=
0
)
return
FALSE
;
return
FALSE
;
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
for
(
auto
it
=
release_list
.
begin
();
it
!=
release_list
.
end
();
++
it
)
{
if
((
*
it
)
->
current
.
sequence
<
5
)
if
((
zone
>>
(
*
it
)
->
current
.
sequence
)
&
1
)
ct
++
;
ct
++
;
}
}
if
(
ct
<=
0
)
if
(
ct
<=
0
)
...
...
field.h
View file @
3e0f081b
...
@@ -413,7 +413,7 @@ public:
...
@@ -413,7 +413,7 @@ public:
int32
check_synchro_material
(
card
*
pcard
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
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
,
card
*
smat
,
group
*
mg
);
int32
check_tuner_material
(
card
*
pcard
,
card
*
tuner
,
int32
findex1
,
int32
findex2
,
int32
min
,
int32
max
,
card
*
smat
,
group
*
mg
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
int32
check_other_synchro_material
(
const
card_vector
&
nsyn
,
int32
lv
,
int32
min
,
int32
max
,
int32
mcount
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
);
int32
check_tribute
(
card
*
pcard
,
int32
min
,
int32
max
,
group
*
mg
,
uint8
toplayer
,
uint32
zone
=
0x1f
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
static
int32
check_with_sum_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
count
,
int32
min
,
int32
max
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
);
static
int32
check_with_sum_limit_m
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
min
,
int32
max
,
int32
must_count
);
static
int32
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
);
static
int32
check_with_sum_greater_limit
(
const
card_vector
&
mats
,
int32
acc
,
int32
index
,
int32
opmin
);
...
@@ -498,7 +498,7 @@ public:
...
@@ -498,7 +498,7 @@ public:
void
draw
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
count
);
void
draw
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
count
);
void
damage
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
card
*
reason_card
,
uint32
playerid
,
uint32
amount
,
uint32
is_step
=
FALSE
);
void
damage
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
card
*
reason_card
,
uint32
playerid
,
uint32
amount
,
uint32
is_step
=
FALSE
);
void
recover
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
amount
,
uint32
is_step
=
FALSE
);
void
recover
(
effect
*
reason_effect
,
uint32
reason
,
uint32
reason_player
,
uint32
playerid
,
uint32
amount
,
uint32
is_step
=
FALSE
);
void
summon
(
uint32
sumplayer
,
card
*
target
,
effect
*
proc
,
uint32
ignore_count
,
uint32
min_tribute
);
void
summon
(
uint32
sumplayer
,
card
*
target
,
effect
*
proc
,
uint32
ignore_count
,
uint32
min_tribute
,
uint32
zone
=
0x1f
);
void
special_summon_rule
(
uint32
sumplayer
,
card
*
target
,
uint32
summon_type
);
void
special_summon_rule
(
uint32
sumplayer
,
card
*
target
,
uint32
summon_type
);
void
special_summon
(
card_set
*
target
,
uint32
sumtype
,
uint32
sumplayer
,
uint32
playerid
,
uint32
nocheck
,
uint32
nolimit
,
uint32
positions
,
uint32
zone
);
void
special_summon
(
card_set
*
target
,
uint32
sumtype
,
uint32
sumplayer
,
uint32
playerid
,
uint32
nocheck
,
uint32
nolimit
,
uint32
positions
,
uint32
zone
);
void
special_summon_step
(
card
*
target
,
uint32
sumtype
,
uint32
sumplayer
,
uint32
playerid
,
uint32
nocheck
,
uint32
nolimit
,
uint32
positions
,
uint32
zone
);
void
special_summon_step
(
card
*
target
,
uint32
sumtype
,
uint32
sumplayer
,
uint32
playerid
,
uint32
nocheck
,
uint32
nolimit
,
uint32
positions
,
uint32
zone
);
...
@@ -523,7 +523,7 @@ public:
...
@@ -523,7 +523,7 @@ public:
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
count
);
int32
draw
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
count
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
reason_card
,
uint8
playerid
,
uint32
amount
,
uint32
is_step
);
int32
damage
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
card
*
reason_card
,
uint8
playerid
,
uint32
amount
,
uint32
is_step
);
int32
recover
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
amount
,
uint32
is_step
);
int32
recover
(
uint16
step
,
effect
*
reason_effect
,
uint32
reason
,
uint8
reason_player
,
uint8
playerid
,
uint32
amount
,
uint32
is_step
);
int32
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
);
int32
summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
flip_summon
(
uint16
step
,
uint8
sumplayer
,
card
*
target
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
);
int32
mset
(
uint16
step
,
uint8
setplayer
,
card
*
ptarget
,
effect
*
proc
,
uint8
ignore_count
,
uint8
min_tribute
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
);
int32
sset
(
uint16
step
,
uint8
setplayer
,
uint8
toplayer
,
card
*
ptarget
);
...
@@ -544,7 +544,7 @@ public:
...
@@ -544,7 +544,7 @@ public:
int32
select_synchro_material
(
int16
step
,
uint8
playerid
,
card
*
pcard
,
int32
min
,
int32
max
,
card
*
smat
,
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
,
uint32
lv
,
card
*
pcard
,
int32
min
,
int32
max
);
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_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
,
uint32
zone
);
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
);
int32
toss_dice
(
uint16
step
,
effect
*
reason_effect
,
uint8
reason_player
,
uint8
playerid
,
uint8
count1
,
uint8
count2
);
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
);
int32
rock_paper_scissors
(
uint16
step
,
uint8
repeat
);
...
...
libcard.cpp
View file @
3e0f081b
...
@@ -1519,9 +1519,12 @@ int32 scriptlib::card_is_can_be_summoned(lua_State *L) {
...
@@ -1519,9 +1519,12 @@ int32 scriptlib::card_is_can_be_summoned(lua_State *L) {
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
3
);
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
3
);
}
}
uint32
minc
=
0
;
uint32
minc
=
0
;
if
(
lua_gettop
(
L
)
>
3
)
if
(
lua_gettop
(
L
)
>
=
4
)
minc
=
lua_tointeger
(
L
,
4
);
minc
=
lua_tointeger
(
L
,
4
);
lua_pushboolean
(
L
,
pcard
->
is_can_be_summoned
(
p
,
ign
,
peffect
,
minc
));
uint32
zone
=
0x1f
;
if
(
lua_gettop
(
L
)
>=
5
)
zone
=
lua_tointeger
(
L
,
5
);
lua_pushboolean
(
L
,
pcard
->
is_can_be_summoned
(
p
,
ign
,
peffect
,
minc
,
zone
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
card_is_can_be_special_summoned
(
lua_State
*
L
)
{
int32
scriptlib
::
card_is_can_be_special_summoned
(
lua_State
*
L
)
{
...
...
libduel.cpp
View file @
3e0f081b
...
@@ -225,11 +225,14 @@ int32 scriptlib::duel_summon(lua_State *L) {
...
@@ -225,11 +225,14 @@ int32 scriptlib::duel_summon(lua_State *L) {
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
2
);
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
uint32
ignore_count
=
lua_toboolean
(
L
,
3
);
uint32
min_tribute
=
0
;
uint32
min_tribute
=
0
;
if
(
lua_gettop
(
L
)
>
4
)
if
(
lua_gettop
(
L
)
>
=
5
)
min_tribute
=
lua_tointeger
(
L
,
5
);
min_tribute
=
lua_tointeger
(
L
,
5
);
uint32
zone
=
0
;
if
(
lua_gettop
(
L
)
>=
6
)
zone
=
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
pcard
->
pduel
;
duel
*
pduel
=
pcard
->
pduel
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
core
.
summon_cancelable
=
FALSE
;
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
);
pduel
->
game_field
->
summon
(
playerid
,
pcard
,
peffect
,
ignore_count
,
min_tribute
,
zone
);
return
lua_yield
(
L
,
0
);
return
lua_yield
(
L
,
0
);
}
}
int32
scriptlib
::
duel_special_summon_rule
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_special_summon_rule
(
lua_State
*
L
)
{
...
@@ -2171,8 +2174,11 @@ int32 scriptlib::duel_check_tribute(lua_State *L) {
...
@@ -2171,8 +2174,11 @@ int32 scriptlib::duel_check_tribute(lua_State *L) {
uint8
toplayer
=
target
->
current
.
controler
;
uint8
toplayer
=
target
->
current
.
controler
;
if
(
lua_gettop
(
L
)
>=
5
&&
!
lua_isnil
(
L
,
5
))
if
(
lua_gettop
(
L
)
>=
5
&&
!
lua_isnil
(
L
,
5
))
toplayer
=
lua_tointeger
(
L
,
5
);
toplayer
=
lua_tointeger
(
L
,
5
);
uint32
zone
=
0x1f
;
if
(
lua_gettop
(
L
)
>=
6
&&
!
lua_isnil
(
L
,
6
))
zone
=
lua_tointeger
(
L
,
6
);
duel
*
pduel
=
target
->
pduel
;
duel
*
pduel
=
target
->
pduel
;
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tribute
(
target
,
min
,
max
,
mg
,
toplayer
));
lua_pushboolean
(
L
,
pduel
->
game_field
->
check_tribute
(
target
,
min
,
max
,
mg
,
toplayer
,
zone
));
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_select_tribute
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_select_tribute
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
3e0f081b
This diff is collapsed.
Click to expand it.
processor.cpp
View file @
3e0f081b
...
@@ -195,7 +195,7 @@ int32 field::process() {
...
@@ -195,7 +195,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SELECT_TRIBUTE
:
{
case
PROCESSOR_SELECT_TRIBUTE
:
{
if
(
select_tribute_cards
(
it
->
step
,
it
->
arg1
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg2
)
&
0xff
,
(
it
->
arg2
>>
16
)
&
0xff
))
if
(
select_tribute_cards
(
it
->
step
,
it
->
arg1
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg2
)
&
0xff
,
(
it
->
arg2
>>
16
)
&
0xff
,
it
->
arg3
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
it
->
step
++
;
it
->
step
++
;
...
@@ -352,7 +352,7 @@ int32 field::process() {
...
@@ -352,7 +352,7 @@ int32 field::process() {
return
pduel
->
bufferlen
;
return
pduel
->
bufferlen
;
}
}
case
PROCESSOR_SUMMON_RULE
:
{
case
PROCESSOR_SUMMON_RULE
:
{
if
(
summon
(
it
->
step
,
it
->
arg1
&
0xff
,
(
card
*
)
it
->
ptarget
,
it
->
peffect
,
(
it
->
arg1
>>
8
)
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
))
if
(
summon
(
it
->
step
,
it
->
arg1
&
0xff
,
(
card
*
)
it
->
ptarget
,
it
->
peffect
,
(
it
->
arg1
>>
8
)
&
0xff
,
(
it
->
arg1
>>
16
)
&
0xff
,
(
it
->
arg1
>>
24
)
&
0xff
))
core
.
units
.
pop_front
();
core
.
units
.
pop_front
();
else
else
it
->
step
++
;
it
->
step
++
;
...
@@ -703,7 +703,7 @@ int32 field::process() {
...
@@ -703,7 +703,7 @@ int32 field::process() {
}
}
case
PROCESSOR_SELECT_TRIBUTE_S
:
{
case
PROCESSOR_SELECT_TRIBUTE_S
:
{
if
(
it
->
step
==
0
)
{
if
(
it
->
step
==
0
)
{
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
it
->
peffect
,
it
->
ptarget
,
it
->
arg1
,
it
->
arg2
);
add_process
(
PROCESSOR_SELECT_TRIBUTE
,
0
,
it
->
peffect
,
it
->
ptarget
,
it
->
arg1
,
it
->
arg2
,
it
->
arg3
);
it
->
step
++
;
it
->
step
++
;
}
else
{
}
else
{
group
*
pgroup
=
pduel
->
new_group
();
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