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
e1324596
Commit
e1324596
authored
Jun 16, 2017
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separate
parent
a17dc50e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
88 deletions
+57
-88
card.cpp
card.cpp
+51
-76
card.h
card.h
+2
-0
field.cpp
field.cpp
+4
-12
No files found.
card.cpp
View file @
e1324596
...
@@ -2665,6 +2665,33 @@ void card::get_unique_target(card_set* cset, int32 controler) {
...
@@ -2665,6 +2665,33 @@ void card::get_unique_target(card_set* cset, int32 controler) {
}
}
}
}
}
}
int32
card
::
check_cost_condition
(
int32
ecode
,
int32
playerid
)
{
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
ecode
,
&
eset
,
FALSE
);
filter_effect
(
ecode
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
3
))
return
FALSE
;
}
return
TRUE
;
}
int32
card
::
check_cost_condition
(
int32
ecode
,
int32
playerid
,
int32
sumtype
)
{
effect_set
eset
;
pduel
->
game_field
->
filter_player_effect
(
playerid
,
ecode
,
&
eset
,
FALSE
);
filter_effect
(
ecode
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
4
))
return
FALSE
;
}
return
TRUE
;
}
// check if this is a normal summonable card
// check if this is a normal summonable card
int32
card
::
is_summonable_card
()
{
int32
card
::
is_summonable_card
()
{
if
(
!
(
data
.
type
&
TYPE_MONSTER
))
if
(
!
(
data
.
type
&
TYPE_MONSTER
))
...
@@ -2755,16 +2782,9 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
...
@@ -2755,16 +2782,9 @@ int32 card::is_can_be_summoned(uint8 playerid, uint8 ignore_count, effect* peffe
if
(
is_status
(
STATUS_FORBIDDEN
))
if
(
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_SUMMON_COST
,
playerid
))
{
filter_effect
(
EFFECT_SUMMON_COST
,
&
eset
);
pduel
->
game_field
->
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
3
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
if
(
current
.
location
==
LOCATION_MZONE
)
{
if
(
current
.
location
==
LOCATION_MZONE
)
{
if
(
is_position
(
POS_FACEDOWN
)
if
(
is_position
(
POS_FACEDOWN
)
...
@@ -2868,16 +2888,9 @@ int32 card::is_can_be_flip_summoned(uint8 playerid) {
...
@@ -2868,16 +2888,9 @@ int32 card::is_can_be_flip_summoned(uint8 playerid) {
if
(
is_affected_by_effect
(
EFFECT_CANNOT_CHANGE_POSITION
))
if
(
is_affected_by_effect
(
EFFECT_CANNOT_CHANGE_POSITION
))
return
FALSE
;
return
FALSE
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_FLIPSUMMON_COST
,
playerid
))
{
filter_effect
(
EFFECT_FLIPSUMMON_COST
,
&
eset
);
pduel
->
game_field
->
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
3
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
TRUE
;
return
TRUE
;
...
@@ -2892,19 +2905,11 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
...
@@ -2892,19 +2905,11 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
if
(
is_status
(
STATUS_FORBIDDEN
))
if
(
is_status
(
STATUS_FORBIDDEN
))
return
FALSE
;
return
FALSE
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_SPSUMMON_COST
,
playerid
,
summon_type
))
{
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
pduel
->
game_field
->
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
summon_type
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
4
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
e
set
.
clear
()
;
e
ffect_set
eset
;
filter_spsummon_procedure
(
playerid
,
&
eset
,
summon_type
);
filter_spsummon_procedure
(
playerid
,
&
eset
,
summon_type
);
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pduel
->
game_field
->
core
.
limit_syn
=
0
;
pduel
->
game_field
->
core
.
limit_syn
=
0
;
...
@@ -2942,20 +2947,12 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
...
@@ -2942,20 +2947,12 @@ int32 card::is_can_be_special_summoned(effect* reason_effect, uint32 sumtype, ui
return
FALSE
;
return
FALSE
;
}
}
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_SPSUMMON_COST
,
sumplayer
,
sumtype
))
{
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
pduel
->
game_field
->
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
sumplayer
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
4
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
if
(
!
nocheck
)
{
if
(
!
nocheck
)
{
e
set
.
clear
()
;
e
ffect_set
eset
;
if
(
!
(
data
.
type
&
TYPE_MONSTER
))
{
if
(
!
(
data
.
type
&
TYPE_MONSTER
))
{
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
return
FALSE
;
...
@@ -2990,18 +2987,11 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect
...
@@ -2990,18 +2987,11 @@ int32 card::is_setable_mzone(uint8 playerid, uint8 ignore_count, effect* peffect
&&
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
))
return
FALSE
;
return
FALSE
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_MSET_COST
,
playerid
))
{
filter_effect
(
EFFECT_MSET_COST
,
&
eset
);
pduel
->
game_field
->
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
3
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
e
set
.
clear
()
;
e
ffect_set
eset
;
int32
res
=
filter_set_procedure
(
playerid
,
&
eset
,
ignore_count
,
min_tribute
,
zone
);
int32
res
=
filter_set_procedure
(
playerid
,
&
eset
,
ignore_count
,
min_tribute
,
zone
);
if
(
peffect
)
{
if
(
peffect
)
{
if
(
res
<
0
||
!
pduel
->
game_field
->
is_player_can_mset
(
peffect
->
get_value
(),
playerid
,
this
))
{
if
(
res
<
0
||
!
pduel
->
game_field
->
is_player_can_mset
(
peffect
->
get_value
(),
playerid
,
this
))
{
...
@@ -3029,16 +3019,9 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) {
...
@@ -3029,16 +3019,9 @@ int32 card::is_setable_szone(uint8 playerid, uint8 ignore_fd) {
if
(
!
pduel
->
game_field
->
is_player_can_sset
(
playerid
,
this
))
if
(
!
pduel
->
game_field
->
is_player_can_sset
(
playerid
,
this
))
return
FALSE
;
return
FALSE
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_SSET_COST
,
playerid
))
{
filter_effect
(
EFFECT_SSET_COST
,
&
eset
);
pduel
->
game_field
->
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
3
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
TRUE
;
return
TRUE
;
...
@@ -3293,17 +3276,9 @@ int32 card::is_capable_attack_announce(uint8 playerid) {
...
@@ -3293,17 +3276,9 @@ int32 card::is_capable_attack_announce(uint8 playerid) {
if
(
is_affected_by_effect
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
))
if
(
is_affected_by_effect
(
EFFECT_CANNOT_ATTACK_ANNOUNCE
))
return
FALSE
;
return
FALSE
;
pduel
->
game_field
->
save_lp_cost
();
pduel
->
game_field
->
save_lp_cost
();
effect_set
eset
;
if
(
!
check_cost_condition
(
EFFECT_ATTACK_COST
,
playerid
))
{
pduel
->
game_field
->
filter_player_effect
(
playerid
,
EFFECT_ATTACK_COST
,
&
eset
,
FALSE
);
pduel
->
game_field
->
restore_lp_cost
();
filter_effect
(
EFFECT_ATTACK_COST
,
&
eset
);
return
FALSE
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
this
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
3
))
{
pduel
->
game_field
->
restore_lp_cost
();
return
FALSE
;
}
}
}
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
TRUE
;
return
TRUE
;
...
...
card.h
View file @
e1324596
...
@@ -266,6 +266,8 @@ public:
...
@@ -266,6 +266,8 @@ public:
int32
check_unique_code
(
card
*
pcard
);
int32
check_unique_code
(
card
*
pcard
);
void
get_unique_target
(
card_set
*
cset
,
int32
controler
);
void
get_unique_target
(
card_set
*
cset
,
int32
controler
);
int32
check_cost_condition
(
int32
ecode
,
int32
playerid
);
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
*
peffect
);
int32
is_spsummonable
(
effect
*
peffect
);
...
...
field.cpp
View file @
e1324596
...
@@ -2915,22 +2915,14 @@ int32 field::is_player_can_spsummon(effect* peffect, uint32 sumtype, uint8 sumpo
...
@@ -2915,22 +2915,14 @@ int32 field::is_player_can_spsummon(effect* peffect, uint32 sumtype, uint8 sumpo
return
FALSE
;
return
FALSE
;
sumtype
|=
SUMMON_TYPE_SPECIAL
;
sumtype
|=
SUMMON_TYPE_SPECIAL
;
save_lp_cost
();
save_lp_cost
();
effect_set
eset
;
if
(
!
pcard
->
check_cost_condition
(
EFFECT_SPSUMMON_COST
,
playerid
,
sumtype
))
{
pcard
->
filter_effect
(
EFFECT_SPSUMMON_COST
,
&
eset
);
restore_lp_cost
();
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
return
FALSE
;
pduel
->
lua
->
add_param
(
eset
[
i
],
PARAM_TYPE_EFFECT
);
pduel
->
lua
->
add_param
(
pcard
,
PARAM_TYPE_CARD
);
pduel
->
lua
->
add_param
(
playerid
,
PARAM_TYPE_INT
);
pduel
->
lua
->
add_param
(
sumtype
,
PARAM_TYPE_INT
);
if
(
!
pduel
->
lua
->
check_condition
(
eset
[
i
]
->
cost
,
4
))
{
restore_lp_cost
();
return
FALSE
;
}
}
}
restore_lp_cost
();
restore_lp_cost
();
if
(
sumpos
&
POS_FACEDOWN
&&
is_player_affected_by_effect
(
playerid
,
EFFECT_DEVINE_LIGHT
))
if
(
sumpos
&
POS_FACEDOWN
&&
is_player_affected_by_effect
(
playerid
,
EFFECT_DEVINE_LIGHT
))
sumpos
=
(
sumpos
&
POS_FACEUP
)
|
(
sumpos
>>
1
);
sumpos
=
(
sumpos
&
POS_FACEUP
)
|
(
sumpos
>>
1
);
e
set
.
clear
()
;
e
ffect_set
eset
;
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SPECIAL_SUMMON
,
&
eset
);
filter_player_effect
(
playerid
,
EFFECT_CANNOT_SPECIAL_SUMMON
,
&
eset
);
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
if
(
!
eset
[
i
]
->
target
)
if
(
!
eset
[
i
]
->
target
)
...
...
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