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
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-core
Commits
b166d934
Commit
b166d934
authored
May 19, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
a1a9faef
12ec3a46
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
162 additions
and
100 deletions
+162
-100
card.cpp
card.cpp
+45
-49
card.h
card.h
+9
-9
field.cpp
field.cpp
+9
-4
field.h
field.h
+3
-2
operations.cpp
operations.cpp
+95
-33
processor.cpp
processor.cpp
+1
-3
No files found.
card.cpp
View file @
b166d934
...
@@ -2494,15 +2494,15 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
...
@@ -2494,15 +2494,15 @@ int32 card::filter_summon_procedure(uint8 playerid, effect_set* peset, uint8 ign
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
);
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
);
return
FALSE
;
return
FALSE
;
}
}
int32
card
::
check_summon_procedure
(
effect
*
p
effect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
int32
card
::
check_summon_procedure
(
effect
*
p
roc
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
if
(
!
p
effect
->
check_count_limit
(
playerid
))
if
(
!
p
roc
->
check_count_limit
(
playerid
))
return
FALSE
;
return
FALSE
;
uint8
toplayer
=
playerid
;
uint8
toplayer
=
playerid
;
if
(
p
effect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
p
roc
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
p
effect
->
o_range
)
if
(
p
roc
->
o_range
)
toplayer
=
1
-
playerid
;
toplayer
=
1
-
playerid
;
}
}
if
(
!
pduel
->
game_field
->
is_player_can_summon
(
p
effect
->
get_value
(
this
),
playerid
,
this
,
toplayer
))
if
(
!
pduel
->
game_field
->
is_player_can_summon
(
p
roc
->
get_value
(
this
),
playerid
,
this
,
toplayer
))
return
FALSE
;
return
FALSE
;
if
(
pduel
->
game_field
->
check_unique_onfield
(
this
,
toplayer
,
LOCATION_MZONE
))
if
(
pduel
->
game_field
->
check_unique_onfield
(
this
,
toplayer
,
LOCATION_MZONE
))
return
FALSE
;
return
FALSE
;
...
@@ -2520,11 +2520,11 @@ int32 card::check_summon_procedure(effect* peffect, uint8 playerid, uint8 ignore
...
@@ -2520,11 +2520,11 @@ int32 card::check_summon_procedure(effect* peffect, uint8 playerid, uint8 ignore
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
new_min_tribute
=
min_tribute
;
new_min_tribute
=
min_tribute
;
new_zone
&=
zone
;
new_zone
&=
zone
;
if
(
is_summonable
(
p
effect
,
new_min_tribute
,
new_zone
,
releasable
))
if
(
is_summonable
(
p
roc
,
new_min_tribute
,
new_zone
,
releasable
))
return
TRUE
;
return
TRUE
;
}
}
}
else
}
else
return
is_summonable
(
p
effect
,
min_tribute
,
zone
);
return
is_summonable
(
p
roc
,
min_tribute
,
zone
);
return
FALSE
;
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())
...
@@ -2577,15 +2577,15 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
...
@@ -2577,15 +2577,15 @@ int32 card::filter_set_procedure(uint8 playerid, effect_set* peset, uint8 ignore
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
,
0xff00ff
,
POS_FACEDOWN_DEFENSE
);
return
pduel
->
game_field
->
check_tribute
(
this
,
min
,
max
,
0
,
current
.
controler
,
zone
,
0xff00ff
,
POS_FACEDOWN_DEFENSE
);
return
FALSE
;
return
FALSE
;
}
}
int32
card
::
check_set_procedure
(
effect
*
p
effect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
int32
card
::
check_set_procedure
(
effect
*
p
roc
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
)
{
if
(
!
p
effect
->
check_count_limit
(
playerid
))
if
(
!
p
roc
->
check_count_limit
(
playerid
))
return
FALSE
;
return
FALSE
;
uint8
toplayer
=
playerid
;
uint8
toplayer
=
playerid
;
if
(
p
effect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
p
roc
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
p
effect
->
o_range
)
if
(
p
roc
->
o_range
)
toplayer
=
1
-
playerid
;
toplayer
=
1
-
playerid
;
}
}
if
(
!
pduel
->
game_field
->
is_player_can_mset
(
p
effect
->
get_value
(
this
),
playerid
,
this
,
toplayer
))
if
(
!
pduel
->
game_field
->
is_player_can_mset
(
p
roc
->
get_value
(
this
),
playerid
,
this
,
toplayer
))
return
FALSE
;
return
FALSE
;
if
(
!
ignore_count
&&
!
pduel
->
game_field
->
core
.
extra_summon
[
playerid
]
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
))
{
&&
pduel
->
game_field
->
core
.
summon_count
[
playerid
]
>=
pduel
->
game_field
->
get_summon_count_limit
(
playerid
))
{
...
@@ -2600,11 +2600,11 @@ int32 card::check_set_procedure(effect* peffect, uint8 playerid, uint8 ignore_co
...
@@ -2600,11 +2600,11 @@ int32 card::check_set_procedure(effect* peffect, uint8 playerid, uint8 ignore_co
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
new_min_tribute
=
min_tribute
;
new_min_tribute
=
min_tribute
;
new_zone
&=
zone
;
new_zone
&=
zone
;
if
(
is_summonable
(
p
effect
,
new_min_tribute
,
new_zone
,
releasable
))
if
(
is_summonable
(
p
roc
,
new_min_tribute
,
new_zone
,
releasable
))
return
TRUE
;
return
TRUE
;
}
}
}
else
}
else
return
is_summonable
(
p
effect
,
min_tribute
,
zone
);
return
is_summonable
(
p
roc
,
min_tribute
,
zone
);
return
FALSE
;
return
FALSE
;
}
}
void
card
::
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint32
summon_type
)
{
void
card
::
filter_spsummon_procedure
(
uint8
playerid
,
effect_set
*
peset
,
uint32
summon_type
)
{
...
@@ -2923,14 +2923,13 @@ int32 card::is_fusion_summonable_card(uint32 summon_type) {
...
@@ -2923,14 +2923,13 @@ int32 card::is_fusion_summonable_card(uint32 summon_type) {
}
}
return
TRUE
;
return
TRUE
;
}
}
// check the condition of sp_summon procedure peffect
int32
card
::
is_spsummonable
(
effect
*
proc
)
{
int32
card
::
is_spsummonable
(
effect
*
peffect
)
{
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
=
p
effect
;
pduel
->
game_field
->
core
.
reason_effect
=
p
roc
;
pduel
->
game_field
->
core
.
reason_player
=
this
->
current
.
controler
;
pduel
->
game_field
->
core
.
reason_player
=
this
->
current
.
controler
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
p
roc
,
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
||
pduel
->
game_field
->
core
.
limit_syn
)
{
if
(
pduel
->
game_field
->
core
.
limit_tuner
||
pduel
->
game_field
->
core
.
limit_syn
)
{
...
@@ -2942,7 +2941,7 @@ int32 card::is_spsummonable(effect* peffect) {
...
@@ -2942,7 +2941,7 @@ int32 card::is_spsummonable(effect* peffect) {
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_syn_maxc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_syn_maxc
,
PARAM_TYPE_INT
);
param_count
=
6
;
param_count
=
6
;
}
}
if
(
pduel
->
lua
->
check_condition
(
p
effect
->
condition
,
param_count
))
if
(
pduel
->
lua
->
check_condition
(
p
roc
->
condition
,
param_count
))
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
);
...
@@ -2952,7 +2951,7 @@ int32 card::is_spsummonable(effect* peffect) {
...
@@ -2952,7 +2951,7 @@ int32 card::is_spsummonable(effect* peffect) {
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_xyz_maxc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_xyz_maxc
,
PARAM_TYPE_INT
);
param_count
=
5
;
param_count
=
5
;
}
}
if
(
pduel
->
lua
->
check_condition
(
p
effect
->
condition
,
param_count
))
if
(
pduel
->
lua
->
check_condition
(
p
roc
->
condition
,
param_count
))
result
=
TRUE
;
result
=
TRUE
;
}
else
if
(
pduel
->
game_field
->
core
.
limit_link
||
pduel
->
game_field
->
core
.
limit_link_card
)
{
}
else
if
(
pduel
->
game_field
->
core
.
limit_link
||
pduel
->
game_field
->
core
.
limit_link_card
)
{
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link
,
PARAM_TYPE_GROUP
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link
,
PARAM_TYPE_GROUP
);
...
@@ -2963,10 +2962,10 @@ int32 card::is_spsummonable(effect* peffect) {
...
@@ -2963,10 +2962,10 @@ int32 card::is_spsummonable(effect* peffect) {
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link_maxc
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
pduel
->
game_field
->
core
.
limit_link_maxc
,
PARAM_TYPE_INT
);
param_count
=
6
;
param_count
=
6
;
}
}
if
(
pduel
->
lua
->
check_condition
(
p
effect
->
condition
,
param_count
))
if
(
pduel
->
lua
->
check_condition
(
p
roc
->
condition
,
param_count
))
result
=
TRUE
;
result
=
TRUE
;
}
else
{
}
else
{
if
(
pduel
->
lua
->
check_condition
(
p
effect
->
condition
,
2
))
if
(
pduel
->
lua
->
check_condition
(
p
roc
->
condition
,
2
))
result
=
TRUE
;
result
=
TRUE
;
}
}
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
...
@@ -2974,22 +2973,21 @@ int32 card::is_spsummonable(effect* peffect) {
...
@@ -2974,22 +2973,21 @@ int32 card::is_spsummonable(effect* peffect) {
pduel
->
game_field
->
core
.
reason_player
=
op
;
pduel
->
game_field
->
core
.
reason_player
=
op
;
return
result
;
return
result
;
}
}
// check the condition of summon/set procedure peffect
int32
card
::
is_summonable
(
effect
*
proc
,
uint8
min_tribute
,
uint32
zone
,
uint32
releasable
)
{
int32
card
::
is_summonable
(
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
,
uint32
releasable
)
{
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
=
p
effect
;
pduel
->
game_field
->
core
.
reason_effect
=
p
roc
;
pduel
->
game_field
->
core
.
reason_player
=
this
->
current
.
controler
;
pduel
->
game_field
->
core
.
reason_player
=
this
->
current
.
controler
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
uint32
result
=
FALSE
;
uint32
result
=
FALSE
;
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
p
roc
,
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
);
pduel
->
lua
->
add_param
(
zone
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
zone
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
releasable
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
releasable
,
PARAM_TYPE_INT
);
pduel
->
game_field
->
core
.
limit_extra_summon_zone
=
zone
;
pduel
->
game_field
->
core
.
limit_extra_summon_zone
=
zone
;
pduel
->
game_field
->
core
.
limit_extra_summon_releasable
=
releasable
;
pduel
->
game_field
->
core
.
limit_extra_summon_releasable
=
releasable
;
if
(
pduel
->
lua
->
check_condition
(
p
effect
->
condition
,
5
))
if
(
pduel
->
lua
->
check_condition
(
p
roc
->
condition
,
5
))
result
=
TRUE
;
result
=
TRUE
;
pduel
->
game_field
->
core
.
limit_extra_summon_zone
=
0
;
pduel
->
game_field
->
core
.
limit_extra_summon_zone
=
0
;
pduel
->
game_field
->
core
.
limit_extra_summon_releasable
=
0
;
pduel
->
game_field
->
core
.
limit_extra_summon_releasable
=
0
;
...
@@ -3206,7 +3204,6 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
...
@@ -3206,7 +3204,6 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
TRUE
;
return
TRUE
;
}
}
// if this does not have a set set procedure, it will check ordinary set (see is_can_be_summoned())
int32
card
::
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
)
{
int32
card
::
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
)
{
if
(
!
is_summonable_card
())
if
(
!
is_summonable_card
())
return
FALSE
;
return
FALSE
;
...
@@ -3259,13 +3256,12 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) {
...
@@ -3259,13 +3256,12 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) {
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
TRUE
;
return
TRUE
;
}
}
// return: this is affected by peffect or not
int32
card
::
is_affect_by_effect
(
effect
*
reason_effect
)
{
int32
card
::
is_affect_by_effect
(
effect
*
peffect
)
{
if
(
is_status
(
STATUS_SUMMONING
)
&&
reason_effect
->
code
!=
EFFECT_CANNOT_DISABLE_SUMMON
&&
reason_effect
->
code
!=
EFFECT_CANNOT_DISABLE_SPSUMMON
)
if
(
is_status
(
STATUS_SUMMONING
)
&&
peffect
->
code
!=
EFFECT_CANNOT_DISABLE_SUMMON
&&
peffect
->
code
!=
EFFECT_CANNOT_DISABLE_SPSUMMON
)
return
FALSE
;
return
FALSE
;
if
(
!
peffect
||
p
effect
->
is_flag
(
EFFECT_FLAG_IGNORE_IMMUNE
))
if
(
!
reason_effect
||
reason_
effect
->
is_flag
(
EFFECT_FLAG_IGNORE_IMMUNE
))
return
TRUE
;
return
TRUE
;
if
(
p
effect
->
is_immuned
(
this
))
if
(
reason_
effect
->
is_immuned
(
this
))
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
...
@@ -3281,13 +3277,13 @@ int32 card::is_destructable_by_battle(card * pcard) {
...
@@ -3281,13 +3277,13 @@ int32 card::is_destructable_by_battle(card * pcard) {
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
effect
*
card
::
check_indestructable_by_effect
(
effect
*
p
effect
,
uint8
playerid
)
{
effect
*
card
::
check_indestructable_by_effect
(
effect
*
reason_
effect
,
uint8
playerid
)
{
if
(
!
p
effect
)
if
(
!
reason_
effect
)
return
0
;
return
0
;
effect_set
eset
;
effect_set
eset
;
filter_effect
(
EFFECT_INDESTRUCTABLE_EFFECT
,
&
eset
);
filter_effect
(
EFFECT_INDESTRUCTABLE_EFFECT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
if
(
eset
[
i
]
->
check_value_condition
(
3
))
...
@@ -3295,16 +3291,16 @@ effect* card::check_indestructable_by_effect(effect* peffect, uint8 playerid) {
...
@@ -3295,16 +3291,16 @@ effect* card::check_indestructable_by_effect(effect* peffect, uint8 playerid) {
}
}
return
0
;
return
0
;
}
}
int32
card
::
is_destructable_by_effect
(
effect
*
p
effect
,
uint8
playerid
)
{
int32
card
::
is_destructable_by_effect
(
effect
*
reason_
effect
,
uint8
playerid
)
{
if
(
!
is_affect_by_effect
(
p
effect
))
if
(
!
is_affect_by_effect
(
reason_
effect
))
return
FALSE
;
return
FALSE
;
if
(
check_indestructable_by_effect
(
p
effect
,
playerid
))
if
(
check_indestructable_by_effect
(
reason_
effect
,
playerid
))
return
FALSE
;
return
FALSE
;
effect_set
eset
;
effect_set
eset
;
eset
.
clear
();
eset
.
clear
();
filter_effect
(
EFFECT_INDESTRUCTABLE
,
&
eset
);
filter_effect
(
EFFECT_INDESTRUCTABLE
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
...
@@ -3318,7 +3314,7 @@ int32 card::is_destructable_by_effect(effect* peffect, uint8 playerid) {
...
@@ -3318,7 +3314,7 @@ int32 card::is_destructable_by_effect(effect* peffect, uint8 playerid) {
if
(
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
(
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
))
{
if
(
eset
[
i
]
->
count_limit
==
0
)
if
(
eset
[
i
]
->
count_limit
==
0
)
continue
;
continue
;
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
if
(
eset
[
i
]
->
check_value_condition
(
3
))
{
...
@@ -3326,7 +3322,7 @@ int32 card::is_destructable_by_effect(effect* peffect, uint8 playerid) {
...
@@ -3326,7 +3322,7 @@ int32 card::is_destructable_by_effect(effect* peffect, uint8 playerid) {
break
;
break
;
}
}
}
else
{
}
else
{
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
REASON_EFFECT
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
int32
ct
;
int32
ct
;
...
@@ -3408,13 +3404,13 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
...
@@ -3408,13 +3404,13 @@ int32 card::is_releasable_by_nonsummon(uint8 playerid) {
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_releasable_by_effect
(
uint8
playerid
,
effect
*
p
effect
)
{
int32
card
::
is_releasable_by_effect
(
uint8
playerid
,
effect
*
reason_
effect
)
{
if
(
!
p
effect
)
if
(
!
reason_
effect
)
return
TRUE
;
return
TRUE
;
effect_set
eset
;
effect_set
eset
;
filter_effect
(
EFFECT_UNRELEASABLE_EFFECT
,
&
eset
);
filter_effect
(
EFFECT_UNRELEASABLE_EFFECT
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
if
(
eset
[
i
]
->
check_value_condition
(
3
))
if
(
eset
[
i
]
->
check_value_condition
(
3
))
...
@@ -3643,21 +3639,21 @@ int32 card::is_capable_be_battle_target(card* pcard) {
...
@@ -3643,21 +3639,21 @@ int32 card::is_capable_be_battle_target(card* pcard) {
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
int32
card
::
is_capable_be_effect_target
(
effect
*
p
effect
,
uint8
playerid
)
{
int32
card
::
is_capable_be_effect_target
(
effect
*
reason_
effect
,
uint8
playerid
)
{
if
(
is_status
(
STATUS_SUMMONING
)
||
is_status
(
STATUS_BATTLE_DESTROYED
))
if
(
is_status
(
STATUS_SUMMONING
)
||
is_status
(
STATUS_BATTLE_DESTROYED
))
return
FALSE
;
return
FALSE
;
effect_set
eset
;
effect_set
eset
;
filter_effect
(
EFFECT_CANNOT_BE_EFFECT_TARGET
,
&
eset
);
filter_effect
(
EFFECT_CANNOT_BE_EFFECT_TARGET
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
eset
[
i
]
->
get_value
(
p
effect
,
1
))
if
(
eset
[
i
]
->
get_value
(
reason_
effect
,
1
))
return
FALSE
;
return
FALSE
;
}
}
eset
.
clear
();
eset
.
clear
();
p
effect
->
get_handler
()
->
filter_effect
(
EFFECT_CANNOT_SELECT_EFFECT_TARGET
,
&
eset
);
reason_
effect
->
get_handler
()
->
filter_effect
(
EFFECT_CANNOT_SELECT_EFFECT_TARGET
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
if
(
eset
[
i
]
->
get_value
(
p
effect
,
1
))
if
(
eset
[
i
]
->
get_value
(
reason_
effect
,
1
))
return
FALSE
;
return
FALSE
;
}
}
return
TRUE
;
return
TRUE
;
...
...
card.h
View file @
b166d934
...
@@ -289,9 +289,9 @@ public:
...
@@ -289,9 +289,9 @@ public:
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
,
uint32
zone
);
int32
filter_summon_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_summon_procedure
(
effect
*
p
effect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_summon_procedure
(
effect
*
p
roc
,
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
,
uint32
zone
);
int32
filter_set_procedure
(
uint8
playerid
,
effect_set
*
eset
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_set_procedure
(
effect
*
p
effect
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
int32
check_set_procedure
(
effect
*
p
roc
,
uint8
playerid
,
uint8
ignore_count
,
uint8
min_tribute
,
uint32
zone
);
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
);
effect
*
is_affected_by_effect
(
int32
code
);
effect
*
is_affected_by_effect
(
int32
code
);
...
@@ -307,8 +307,8 @@ public:
...
@@ -307,8 +307,8 @@ public:
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
);
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
);
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
*
p
effect
);
int32
is_spsummonable
(
effect
*
p
roc
);
int32
is_summonable
(
effect
*
p
effect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
);
int32
is_summonable
(
effect
*
p
roc
,
uint8
min_tribute
,
uint32
zone
=
0x1f
,
uint32
releasable
=
0xff00ff
);
int32
is_can_be_summoned
(
uint8
playerid
,
uint8
ingore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
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
();
...
@@ -317,16 +317,16 @@ public:
...
@@ -317,16 +317,16 @@ public:
int32
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
);
int32
is_can_be_special_summoned
(
effect
*
reason_effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
sumplayer
,
uint8
toplayer
,
uint8
nocheck
,
uint8
nolimit
,
uint32
zone
);
int32
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_setable_mzone
(
uint8
playerid
,
uint8
ignore_count
,
effect
*
peffect
,
uint8
min_tribute
,
uint32
zone
=
0x1f
);
int32
is_setable_szone
(
uint8
playerid
,
uint8
ignore_fd
=
0
);
int32
is_setable_szone
(
uint8
playerid
,
uint8
ignore_fd
=
0
);
int32
is_affect_by_effect
(
effect
*
p
effect
);
int32
is_affect_by_effect
(
effect
*
reason_
effect
);
int32
is_destructable
();
int32
is_destructable
();
int32
is_destructable_by_battle
(
card
*
pcard
);
int32
is_destructable_by_battle
(
card
*
pcard
);
effect
*
check_indestructable_by_effect
(
effect
*
p
effect
,
uint8
playerid
);
effect
*
check_indestructable_by_effect
(
effect
*
reason_
effect
,
uint8
playerid
);
int32
is_destructable_by_effect
(
effect
*
p
effect
,
uint8
playerid
);
int32
is_destructable_by_effect
(
effect
*
reason_
effect
,
uint8
playerid
);
int32
is_removeable
(
uint8
playerid
,
uint8
pos
,
uint32
reason
);
int32
is_removeable
(
uint8
playerid
,
uint8
pos
,
uint32
reason
);
int32
is_removeable_as_cost
(
uint8
playerid
,
uint8
pos
);
int32
is_removeable_as_cost
(
uint8
playerid
,
uint8
pos
);
int32
is_releasable_by_summon
(
uint8
playerid
,
card
*
pcard
);
int32
is_releasable_by_summon
(
uint8
playerid
,
card
*
pcard
);
int32
is_releasable_by_nonsummon
(
uint8
playerid
);
int32
is_releasable_by_nonsummon
(
uint8
playerid
);
int32
is_releasable_by_effect
(
uint8
playerid
,
effect
*
p
effect
);
int32
is_releasable_by_effect
(
uint8
playerid
,
effect
*
reason_
effect
);
int32
is_capable_send_to_grave
(
uint8
playerid
);
int32
is_capable_send_to_grave
(
uint8
playerid
);
int32
is_capable_send_to_hand
(
uint8
playerid
);
int32
is_capable_send_to_hand
(
uint8
playerid
);
int32
is_capable_send_to_deck
(
uint8
playerid
);
int32
is_capable_send_to_deck
(
uint8
playerid
);
...
@@ -343,7 +343,7 @@ public:
...
@@ -343,7 +343,7 @@ public:
int32
is_capable_change_control
();
int32
is_capable_change_control
();
int32
is_control_can_be_changed
(
int32
ignore_mzone
,
uint32
zone
);
int32
is_control_can_be_changed
(
int32
ignore_mzone
,
uint32
zone
);
int32
is_capable_be_battle_target
(
card
*
pcard
);
int32
is_capable_be_battle_target
(
card
*
pcard
);
int32
is_capable_be_effect_target
(
effect
*
p
effect
,
uint8
playerid
);
int32
is_capable_be_effect_target
(
effect
*
reason_
effect
,
uint8
playerid
);
int32
is_capable_overlay
(
uint8
playerid
);
int32
is_capable_overlay
(
uint8
playerid
);
int32
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
);
int32
is_can_be_fusion_material
(
card
*
fcard
,
uint32
summon_type
);
int32
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
=
0
);
int32
is_can_be_synchro_material
(
card
*
scard
,
card
*
tuner
=
0
);
...
...
field.cpp
View file @
b166d934
...
@@ -1263,6 +1263,11 @@ void field::remove_oath_effect(effect* reason_effect) {
...
@@ -1263,6 +1263,11 @@ void field::remove_oath_effect(effect* reason_effect) {
}
}
}
}
}
}
void
field
::
release_oath_relation
(
effect
*
reason_effect
)
{
for
(
auto
&
oeit
:
effects
.
oath
)
if
(
oeit
.
second
==
reason_effect
)
oeit
.
second
=
0
;
}
void
field
::
reset_phase
(
uint32
phase
)
{
void
field
::
reset_phase
(
uint32
phase
)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
for
(
auto
eit
=
effects
.
pheff
.
begin
();
eit
!=
effects
.
pheff
.
end
();)
{
auto
rm
=
eit
++
;
auto
rm
=
eit
++
;
...
@@ -2865,7 +2870,7 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
...
@@ -2865,7 +2870,7 @@ int32 field::is_player_can_discard_deck_as_cost(uint8 playerid, int32 count) {
}
}
return
TRUE
;
return
TRUE
;
}
}
int32
field
::
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
p
effect
,
uint32
reason
)
{
int32
field
::
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
reason_
effect
,
uint32
reason
)
{
if
(
pcard
->
current
.
location
!=
LOCATION_HAND
)
if
(
pcard
->
current
.
location
!=
LOCATION_HAND
)
return
FALSE
;
return
FALSE
;
effect_set
eset
;
effect_set
eset
;
...
@@ -2875,7 +2880,7 @@ int32 field::is_player_can_discard_hand(uint8 playerid, card * pcard, effect * p
...
@@ -2875,7 +2880,7 @@ int32 field::is_player_can_discard_hand(uint8 playerid, card * pcard, effect * p
return
FALSE
;
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
reason
,
PARAM_TYPE_INT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
4
))
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
4
))
return
FALSE
;
return
FALSE
;
...
@@ -2951,7 +2956,7 @@ int32 field::is_player_can_spsummon(uint8 playerid) {
...
@@ -2951,7 +2956,7 @@ int32 field::is_player_can_spsummon(uint8 playerid) {
}
}
return
is_player_can_spsummon_count
(
playerid
,
1
);
return
is_player_can_spsummon_count
(
playerid
,
1
);
}
}
int32
field
::
is_player_can_spsummon
(
effect
*
p
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
)
{
int32
field
::
is_player_can_spsummon
(
effect
*
reason_
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
)
{
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SPECIAL_SUMMON
))
if
(
pcard
->
is_affected_by_effect
(
EFFECT_CANNOT_SPECIAL_SUMMON
))
return
FALSE
;
return
FALSE
;
if
(
pcard
->
is_status
(
STATUS_FORBIDDEN
))
if
(
pcard
->
is_status
(
STATUS_FORBIDDEN
))
...
@@ -2982,7 +2987,7 @@ int32 field::is_player_can_spsummon(effect* peffect, uint32 sumtype, uint8 sumpo
...
@@ -2982,7 +2987,7 @@ int32 field::is_player_can_spsummon(effect* peffect, uint32 sumtype, uint8 sumpo
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumpos
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumpos
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
toplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
toplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
p
effect
,
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
reason_
effect
,
PARAM_TYPE_EFFECT
);
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
7
))
if
(
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
target
,
7
))
return
FALSE
;
return
FALSE
;
}
}
...
...
field.h
View file @
b166d934
...
@@ -391,6 +391,7 @@ public:
...
@@ -391,6 +391,7 @@ public:
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
add_effect
(
effect
*
peffect
,
uint8
owner_player
=
2
);
void
remove_effect
(
effect
*
peffect
);
void
remove_effect
(
effect
*
peffect
);
void
remove_oath_effect
(
effect
*
reason_effect
);
void
remove_oath_effect
(
effect
*
reason_effect
);
void
release_oath_relation
(
effect
*
reason_effect
);
void
reset_phase
(
uint32
phase
);
void
reset_phase
(
uint32
phase
);
void
reset_chain
();
void
reset_chain
();
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
void
add_effect_code
(
uint32
code
,
uint32
playerid
);
...
@@ -455,13 +456,13 @@ public:
...
@@ -455,13 +456,13 @@ public:
int32
is_player_can_draw
(
uint8
playerid
);
int32
is_player_can_draw
(
uint8
playerid
);
int32
is_player_can_discard_deck
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_deck
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_deck_as_cost
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_deck_as_cost
(
uint8
playerid
,
int32
count
);
int32
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
p
effect
,
uint32
reason
);
int32
is_player_can_discard_hand
(
uint8
playerid
,
card
*
pcard
,
effect
*
reason_
effect
,
uint32
reason
);
int32
is_player_can_action
(
uint8
playerid
,
uint32
actionlimit
);
int32
is_player_can_action
(
uint8
playerid
,
uint32
actionlimit
);
int32
is_player_can_summon
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_summon
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_mset
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_mset
(
uint32
sumtype
,
uint8
playerid
,
card
*
pcard
,
uint8
toplayer
);
int32
is_player_can_sset
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_sset
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_spsummon
(
uint8
playerid
);
int32
is_player_can_spsummon
(
uint8
playerid
);
int32
is_player_can_spsummon
(
effect
*
p
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
);
int32
is_player_can_spsummon
(
effect
*
reason_
effect
,
uint32
sumtype
,
uint8
sumpos
,
uint8
playerid
,
uint8
toplayer
,
card
*
pcard
);
int32
is_player_can_flipsummon
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_flipsummon
(
uint8
playerid
,
card
*
pcard
);
int32
is_player_can_spsummon_monster
(
uint8
playerid
,
uint8
toplayer
,
uint8
sumpos
,
uint32
sumtype
,
card_data
*
pdata
);
int32
is_player_can_spsummon_monster
(
uint8
playerid
,
uint8
toplayer
,
uint8
sumpos
,
uint32
sumtype
,
card_data
*
pdata
);
int32
is_player_can_spsummon_count
(
uint8
playerid
,
uint32
count
);
int32
is_player_can_spsummon_count
(
uint8
playerid
,
uint32
count
);
...
...
operations.cpp
View file @
b166d934
...
@@ -1603,8 +1603,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1603,8 +1603,8 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
core
.
units
.
begin
()
->
ptr1
=
0
;
core
.
units
.
begin
()
->
ptr1
=
0
;
return
FALSE
;
return
FALSE
;
}
}
effect
*
p
effect
=
core
.
select_effects
[
returns
.
ivalue
[
0
]];
effect
*
p
roc
=
core
.
select_effects
[
returns
.
ivalue
[
0
]];
core
.
units
.
begin
()
->
peffect
=
p
effect
;
core
.
units
.
begin
()
->
peffect
=
p
roc
;
core
.
select_effects
.
clear
();
core
.
select_effects
.
clear
();
core
.
select_options
.
clear
();
core
.
select_options
.
clear
();
if
(
ignore_count
||
core
.
summon_count
[
sumplayer
]
<
get_summon_count_limit
(
sumplayer
))
{
if
(
ignore_count
||
core
.
summon_count
[
sumplayer
]
<
get_summon_count_limit
(
sumplayer
))
{
...
@@ -1619,10 +1619,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1619,10 +1619,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
int32
new_zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0x1f
;
int32
new_zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0x1f
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
+
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
+
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
new_zone
&=
zone
;
new_zone
&=
zone
;
if
(
p
effect
)
{
if
(
p
roc
)
{
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
new_min_tribute
=
min_tribute
;
new_min_tribute
=
min_tribute
;
if
(
!
target
->
is_summonable
(
p
effect
,
new_min_tribute
,
new_zone
,
releasable
))
if
(
!
target
->
is_summonable
(
p
roc
,
new_min_tribute
,
new_zone
,
releasable
))
continue
;
continue
;
}
else
{
}
else
{
int32
rcount
=
target
->
get_summon_tribute_count
();
int32
rcount
=
target
->
get_summon_tribute_count
();
...
@@ -1733,12 +1733,17 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1733,12 +1733,17 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
}
}
effect_set
eset
;
effect_set
eset
;
target
->
filter_effect
(
EFFECT_SUMMON_COST
,
&
eset
);
target
->
filter_effect
(
EFFECT_SUMMON_COST
,
&
eset
);
if
(
eset
.
size
())
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
}
}
}
}
effect_set
*
peset
=
new
effect_set
;
*
peset
=
std
::
move
(
eset
);
core
.
units
.
begin
()
->
ptr2
=
peset
;
}
return
FALSE
;
return
FALSE
;
}
}
case
5
:
{
case
5
:
{
...
@@ -1957,6 +1962,12 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1957,6 +1962,12 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
dec_effect_code
(
proc
->
count_code
,
sumplayer
);
dec_effect_code
(
proc
->
count_code
,
sumplayer
);
}
}
}
}
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr2
)
{
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
remove_oath_effect
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr2
=
0
;
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
adjust_instant
();
adjust_instant
();
...
@@ -1965,9 +1976,13 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
...
@@ -1965,9 +1976,13 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
}
}
case
15
:
{
case
15
:
{
if
(
proc
)
{
if
(
proc
)
{
for
(
auto
&
oeit
:
effects
.
oath
)
release_oath_relation
(
proc
);
if
(
oeit
.
second
==
proc
)
}
oeit
.
second
=
0
;
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr2
)
{
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
release_oath_relation
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr2
=
0
;
}
}
target
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
target
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
target
->
set_status
(
STATUS_SUMMON_TURN
,
TRUE
);
target
->
set_status
(
STATUS_SUMMON_TURN
,
TRUE
);
...
@@ -2018,12 +2033,17 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2018,12 +2033,17 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
return
TRUE
;
return
TRUE
;
effect_set
eset
;
effect_set
eset
;
target
->
filter_effect
(
EFFECT_FLIPSUMMON_COST
,
&
eset
);
target
->
filter_effect
(
EFFECT_FLIPSUMMON_COST
,
&
eset
);
if
(
eset
.
size
())
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
}
}
}
}
effect_set
*
peset
=
new
effect_set
;
*
peset
=
std
::
move
(
eset
);
core
.
units
.
begin
()
->
ptr1
=
peset
;
}
return
FALSE
;
return
FALSE
;
}
}
case
1
:
{
case
1
:
{
...
@@ -2048,12 +2068,24 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
...
@@ -2048,12 +2068,24 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
case
2
:
{
case
2
:
{
if
(
target
->
is_status
(
STATUS_SUMMONING
))
if
(
target
->
is_status
(
STATUS_SUMMONING
))
return
FALSE
;
return
FALSE
;
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr1
)
{
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
remove_oath_effect
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
return
TRUE
;
return
TRUE
;
}
}
case
3
:
{
case
3
:
{
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr1
)
{
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
release_oath_relation
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
target
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
target
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
target
->
enable_field_effect
(
true
);
target
->
enable_field_effect
(
true
);
if
(
target
->
is_status
(
STATUS_DISABLED
))
if
(
target
->
is_status
(
STATUS_DISABLED
))
...
@@ -2139,8 +2171,8 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
...
@@ -2139,8 +2171,8 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
core
.
units
.
begin
()
->
ptr1
=
0
;
core
.
units
.
begin
()
->
ptr1
=
0
;
return
FALSE
;
return
FALSE
;
}
}
effect
*
p
effect
=
core
.
select_effects
[
returns
.
ivalue
[
0
]];
effect
*
p
roc
=
core
.
select_effects
[
returns
.
ivalue
[
0
]];
core
.
units
.
begin
()
->
peffect
=
p
effect
;
core
.
units
.
begin
()
->
peffect
=
p
roc
;
core
.
select_effects
.
clear
();
core
.
select_effects
.
clear
();
core
.
select_options
.
clear
();
core
.
select_options
.
clear
();
if
(
ignore_count
||
core
.
summon_count
[
setplayer
]
<
get_summon_count_limit
(
setplayer
))
{
if
(
ignore_count
||
core
.
summon_count
[
setplayer
]
<
get_summon_count_limit
(
setplayer
))
{
...
@@ -2155,10 +2187,10 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
...
@@ -2155,10 +2187,10 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint
int32
new_zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0x1f
;
int32
new_zone
=
retval
.
size
()
>
1
?
retval
[
1
]
:
0x1f
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
+
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
int32
releasable
=
retval
.
size
()
>
2
?
(
retval
[
2
]
<
0
?
0xff00ff
+
retval
[
2
]
:
retval
[
2
])
:
0xff00ff
;
new_zone
&=
zone
;
new_zone
&=
zone
;
if
(
p
effect
)
{
if
(
p
roc
)
{
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
if
(
new_min_tribute
<
(
int32
)
min_tribute
)
new_min_tribute
=
min_tribute
;
new_min_tribute
=
min_tribute
;
if
(
!
target
->
is_summonable
(
p
effect
,
new_min_tribute
,
new_zone
,
releasable
))
if
(
!
target
->
is_summonable
(
p
roc
,
new_min_tribute
,
new_zone
,
releasable
))
continue
;
continue
;
}
else
{
}
else
{
int32
rcount
=
target
->
get_set_tribute_count
();
int32
rcount
=
target
->
get_set_tribute_count
();
...
@@ -2677,12 +2709,17 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2677,12 +2709,17 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return
TRUE
;
return
TRUE
;
effect_set
eset
;
effect_set
eset
;
target
->
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
target
->
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
if
(
eset
.
size
())
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
}
}
}
}
effect_set
*
peset
=
new
effect_set
;
*
peset
=
std
::
move
(
eset
);
core
.
units
.
begin
()
->
ptr1
=
peset
;
}
return
FALSE
;
return
FALSE
;
}
}
case
3
:
{
case
3
:
{
...
@@ -2824,6 +2861,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2824,6 +2861,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
if
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
(
peffect
->
count_code
&
EFFECT_COUNT_CODE_OATH
))
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
(
peffect
->
count_code
&
EFFECT_COUNT_CODE_OATH
))
{
dec_effect_code
(
peffect
->
count_code
,
sumplayer
);
dec_effect_code
(
peffect
->
count_code
,
sumplayer
);
}
}
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr1
)
{
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
remove_oath_effect
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
target
->
current
.
location
==
LOCATION_MZONE
)
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
send_to
(
target
,
0
,
REASON_RULE
,
sumplayer
,
sumplayer
,
LOCATION_GRAVE
,
0
,
0
);
adjust_instant
();
adjust_instant
();
...
@@ -2831,9 +2874,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2831,9 +2874,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return
TRUE
;
return
TRUE
;
}
}
case
15
:
{
case
15
:
{
for
(
auto
&
oeit
:
effects
.
oath
)
release_oath_relation
(
core
.
units
.
begin
()
->
peffect
);
if
(
oeit
.
second
==
core
.
units
.
begin
()
->
peffect
)
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr1
)
{
oeit
.
second
=
0
;
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
release_oath_relation
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
target
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
target
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
target
->
set_status
(
STATUS_PROC_COMPLETE
|
STATUS_SPSUMMON_TURN
,
TRUE
);
target
->
set_status
(
STATUS_PROC_COMPLETE
|
STATUS_SPSUMMON_TURN
,
TRUE
);
target
->
enable_field_effect
(
true
);
target
->
enable_field_effect
(
true
);
...
@@ -2902,12 +2949,17 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -2902,12 +2949,17 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
}
}
effect_set
eset
;
effect_set
eset
;
pcard
->
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
pcard
->
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
if
(
eset
.
size
())
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
eset
[
i
]
->
operation
)
{
if
(
eset
[
i
]
->
operation
)
{
core
.
sub_solving_event
.
push_back
(
nil_event
);
core
.
sub_solving_event
.
push_back
(
nil_event
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
add_process
(
PROCESSOR_EXECUTE_OPERATION
,
0
,
eset
[
i
],
0
,
sumplayer
,
0
);
}
}
}
}
effect_set
*
peset
=
new
effect_set
;
*
peset
=
std
::
move
(
eset
);
core
.
units
.
begin
()
->
ptr1
=
peset
;
}
}
}
return
FALSE
;
return
FALSE
;
}
}
...
@@ -3000,6 +3052,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -3000,6 +3052,12 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
if
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
(
peffect
->
count_code
&
EFFECT_COUNT_CODE_OATH
))
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_COUNT_LIMIT
)
&&
(
peffect
->
count_code
&
EFFECT_COUNT_CODE_OATH
))
{
dec_effect_code
(
peffect
->
count_code
,
sumplayer
);
dec_effect_code
(
peffect
->
count_code
,
sumplayer
);
}
}
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr1
)
{
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
remove_oath_effect
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
FALSE
,
0
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -3007,9 +3065,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
...
@@ -3007,9 +3065,13 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
}
}
case
27
:
{
case
27
:
{
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
group
*
pgroup
=
core
.
units
.
begin
()
->
ptarget
;
for
(
auto
&
oeit
:
effects
.
oath
)
release_oath_relation
(
core
.
units
.
begin
()
->
peffect
);
if
(
oeit
.
second
==
core
.
units
.
begin
()
->
peffect
)
if
(
effect_set
*
peset
=
(
effect_set
*
)
core
.
units
.
begin
()
->
ptr1
)
{
oeit
.
second
=
0
;
for
(
int32
i
=
0
;
i
<
peset
->
size
();
++
i
)
release_oath_relation
(
peset
->
at
(
i
));
delete
peset
;
core
.
units
.
begin
()
->
ptr1
=
0
;
}
for
(
auto
&
pcard
:
pgroup
->
container
)
{
for
(
auto
&
pcard
:
pgroup
->
container
)
{
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SUMMONING
,
FALSE
);
pcard
->
set_status
(
STATUS_SPSUMMON_TURN
,
TRUE
);
pcard
->
set_status
(
STATUS_SPSUMMON_TURN
,
TRUE
);
...
...
processor.cpp
View file @
b166d934
...
@@ -4290,9 +4290,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
...
@@ -4290,9 +4290,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core
.
units
.
begin
()
->
step
=
9
;
core
.
units
.
begin
()
->
step
=
9
;
return
FALSE
;
return
FALSE
;
}
}
for
(
auto
&
oeit
:
effects
.
oath
)
release_oath_relation
(
peffect
);
if
(
oeit
.
second
==
peffect
)
oeit
.
second
=
0
;
break_effect
();
break_effect
();
core
.
chain_solving
=
TRUE
;
core
.
chain_solving
=
TRUE
;
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
raise_event
((
card
*
)
0
,
EVENT_CHAIN_SOLVING
,
peffect
,
0
,
cait
->
triggering_player
,
cait
->
triggering_player
,
cait
->
chain_count
);
...
...
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