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
00cd847b
Commit
00cd847b
authored
Jul 13, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
3011093f
a59178f3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
39 deletions
+52
-39
card.cpp
card.cpp
+3
-15
effect.cpp
effect.cpp
+2
-0
field.cpp
field.cpp
+11
-8
libcard.cpp
libcard.cpp
+35
-15
operations.cpp
operations.cpp
+1
-1
No files found.
card.cpp
View file @
00cd847b
...
...
@@ -2217,9 +2217,8 @@ int32 card::get_counter(uint16 countertype) {
void
card
::
set_material
(
card_set
*
materials
)
{
if
(
!
materials
)
{
material_cards
.
clear
();
return
;
}
material_cards
=
*
materials
;
}
else
material_cards
=
*
materials
;
for
(
auto
&
pcard
:
material_cards
)
pcard
->
current
.
reason_card
=
this
;
effect_set
eset
;
...
...
@@ -2845,7 +2844,7 @@ void card::get_unique_target(card_set* cset, int32 controler, card* icard) {
const
auto
&
player
=
pduel
->
game_field
->
player
[
controler
^
p
];
if
(
unique_location
&
LOCATION_MZONE
)
{
for
(
auto
&
pcard
:
player
.
list_mzone
)
{
if
(
pcard
&&
(
pcard
!=
icard
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
get_status
(
STATUS_
BATTLE_DESTROYED
|
STATUS_
SPSUMMON_STEP
)
if
(
pcard
&&
(
pcard
!=
icard
)
&&
pcard
->
is_position
(
POS_FACEUP
)
&&
!
pcard
->
get_status
(
STATUS_SPSUMMON_STEP
)
&&
check_unique_code
(
pcard
))
cset
->
insert
(
pcard
);
}
...
...
@@ -3119,17 +3118,6 @@ int32 card::is_special_summonable(uint8 playerid, uint32 summon_type) {
}
effect_set
eset
;
filter_spsummon_procedure
(
playerid
,
&
eset
,
summon_type
);
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pduel
->
game_field
->
core
.
limit_syn
=
0
;
pduel
->
game_field
->
core
.
limit_syn_minc
=
0
;
pduel
->
game_field
->
core
.
limit_syn_maxc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_minc
=
0
;
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
0
;
pduel
->
game_field
->
core
.
limit_link
=
0
;
pduel
->
game_field
->
core
.
limit_link_card
=
0
;
pduel
->
game_field
->
core
.
limit_link_minc
=
0
;
pduel
->
game_field
->
core
.
limit_link_maxc
=
0
;
pduel
->
game_field
->
restore_lp_cost
();
return
eset
.
size
();
}
...
...
effect.cpp
View file @
00cd847b
...
...
@@ -456,6 +456,8 @@ int32 effect::is_target(card* pcard) {
if
(
!
is_flag
(
EFFECT_FLAG_IGNORE_RANGE
))
{
if
(
pcard
->
get_status
(
STATUS_SUMMONING
|
STATUS_SUMMON_DISABLED
|
STATUS_ACTIVATE_DISABLED
|
STATUS_SPSUMMON_STEP
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
return
FALSE
;
if
(
is_flag
(
EFFECT_FLAG_ABSOLUTE_TARGET
))
{
if
(
pcard
->
current
.
controler
==
0
)
{
if
(
!
pcard
->
current
.
is_location
(
s_range
))
...
...
field.cpp
View file @
00cd847b
...
...
@@ -1319,7 +1319,8 @@ void field::filter_field_effect(uint32 code, effect_set* eset, uint8 sort) {
eset
->
sort
();
}
void
field
::
filter_affected_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIONS
)
||
!
(
peffect
->
type
&
EFFECT_TYPE_FIELD
)
||
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
|
EFFECT_FLAG_SPSUM_PARAM
))
return
;
uint8
self
=
peffect
->
get_handler_player
();
if
(
self
==
PLAYER_NONE
)
...
...
@@ -1352,7 +1353,7 @@ void field::filter_affected_cards(effect* peffect, card_set* cset) {
}
}
void
field
::
filter_inrange_cards
(
effect
*
peffect
,
card_set
*
cset
)
{
if
(
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
))
if
(
peffect
->
is_flag
(
EFFECT_FLAG_PLAYER_TARGET
|
EFFECT_FLAG_SPSUM_PARAM
))
return
;
uint8
self
=
peffect
->
get_handler_player
();
if
(
self
==
PLAYER_NONE
)
...
...
@@ -1933,13 +1934,13 @@ void field::adjust_disable_check_list() {
effects
.
disable_check_list
.
pop_front
();
effects
.
disable_check_set
.
erase
(
checking
);
checked
.
insert
(
checking
);
if
(
checking
->
is_status
(
STATUS_TO_ENABLE
|
STATUS_TO_DISABLE
))
if
(
checking
->
is_status
(
STATUS_TO_ENABLE
|
STATUS_TO_DISABLE
))
// prevent loop
continue
;
int32
pre_disable
=
checking
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
);
checking
->
refresh_disable_status
();
int32
new_disable
=
checking
->
get_status
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
);
if
(
pre_disable
!=
new_disable
&&
checking
->
is_status
(
STATUS_EFFECT_ENABLED
))
{
checking
->
filter_disable_related_cards
();
checking
->
filter_disable_related_cards
();
// change effects.disable_check_list
if
(
pre_disable
)
checking
->
set_status
(
STATUS_TO_ENABLE
,
TRUE
);
else
...
...
@@ -2456,10 +2457,12 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
if
(
ptuner
)
{
if
(
ptuner
->
value
)
location
=
ptuner
->
value
;
if
(
ptuner
->
s_range
&&
ptuner
->
s_range
>
min
)
min
=
ptuner
->
s_range
;
if
(
ptuner
->
o_range
&&
ptuner
->
o_range
<
max
)
max
=
ptuner
->
o_range
;
if
(
ptuner
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
ptuner
->
s_range
&&
ptuner
->
s_range
>
min
)
min
=
ptuner
->
s_range
;
if
(
ptuner
->
o_range
&&
ptuner
->
o_range
<
max
)
max
=
ptuner
->
o_range
;
}
if
(
min
>
max
)
{
pduel
->
restore_assumes
();
return
FALSE
;
...
...
libcard.cpp
View file @
00cd847b
...
...
@@ -1569,10 +1569,12 @@ int32 scriptlib::card_get_tuner_limit(lua_State *L) {
lua_pushnil
(
L
);
uint16
min
=
0
;
uint16
max
=
99
;
if
(
peffect
->
s_range
&&
peffect
->
s_range
>
min
)
min
=
peffect
->
s_range
;
if
(
peffect
->
o_range
&&
peffect
->
o_range
<
max
)
max
=
peffect
->
o_range
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
peffect
->
s_range
&&
peffect
->
s_range
>
min
)
min
=
peffect
->
s_range
;
if
(
peffect
->
o_range
&&
peffect
->
o_range
<
max
)
max
=
peffect
->
o_range
;
}
lua_pushinteger
(
L
,
min
);
lua_pushinteger
(
L
,
max
);
return
5
;
...
...
@@ -1594,10 +1596,12 @@ int32 scriptlib::card_get_hand_synchro(lua_State *L) {
lua_pushnil
(
L
);
uint16
min
=
0
;
uint16
max
=
99
;
if
(
peffect
->
s_range
&&
peffect
->
s_range
>
min
)
min
=
peffect
->
s_range
;
if
(
peffect
->
o_range
&&
peffect
->
o_range
<
max
)
max
=
peffect
->
o_range
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
peffect
->
s_range
&&
peffect
->
s_range
>
min
)
min
=
peffect
->
s_range
;
if
(
peffect
->
o_range
&&
peffect
->
o_range
<
max
)
max
=
peffect
->
o_range
;
}
lua_pushinteger
(
L
,
min
);
lua_pushinteger
(
L
,
max
);
return
4
;
...
...
@@ -1611,10 +1615,12 @@ int32 scriptlib::card_get_hand_synchro(lua_State *L) {
lua_pushnil
(
L
);
uint16
min
=
0
;
uint16
max
=
99
;
if
(
peffect
->
s_range
&&
peffect
->
s_range
>
min
)
min
=
peffect
->
s_range
;
if
(
peffect
->
o_range
&&
peffect
->
o_range
<
max
)
max
=
peffect
->
o_range
;
if
(
peffect
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
))
{
if
(
peffect
->
s_range
&&
peffect
->
s_range
>
min
)
min
=
peffect
->
s_range
;
if
(
peffect
->
o_range
&&
peffect
->
o_range
<
max
)
max
=
peffect
->
o_range
;
}
lua_pushinteger
(
L
,
min
);
lua_pushinteger
(
L
,
max
);
return
4
;
...
...
@@ -2031,7 +2037,12 @@ int32 scriptlib::card_is_synchro_summonable(lua_State *L) {
pcard
->
pduel
->
game_field
->
core
.
limit_syn
=
mg
;
pcard
->
pduel
->
game_field
->
core
.
limit_syn_minc
=
minc
;
pcard
->
pduel
->
game_field
->
core
.
limit_syn_maxc
=
maxc
;
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_SYNCHRO
));
int32
res
=
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_SYNCHRO
);
pcard
->
pduel
->
game_field
->
core
.
limit_tuner
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_syn
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_syn_minc
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_syn_maxc
=
0
;
lua_pushboolean
(
L
,
res
);
return
1
;
}
int32
scriptlib
::
card_is_xyz_summonable
(
lua_State
*
L
)
{
...
...
@@ -2057,7 +2068,11 @@ int32 scriptlib::card_is_xyz_summonable(lua_State *L) {
pcard
->
pduel
->
game_field
->
core
.
limit_xyz
=
materials
;
pcard
->
pduel
->
game_field
->
core
.
limit_xyz_minc
=
minc
;
pcard
->
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
maxc
;
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_XYZ
));
int32
res
=
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_XYZ
);
pcard
->
pduel
->
game_field
->
core
.
limit_xyz
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_xyz_minc
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_xyz_maxc
=
0
;
lua_pushboolean
(
L
,
res
);
return
1
;
}
int32
scriptlib
::
card_is_link_summonable
(
lua_State
*
L
)
{
...
...
@@ -2091,7 +2106,12 @@ int32 scriptlib::card_is_link_summonable(lua_State *L) {
pcard
->
pduel
->
game_field
->
core
.
limit_link_card
=
lcard
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_minc
=
minc
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_maxc
=
maxc
;
lua_pushboolean
(
L
,
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_LINK
));
int32
res
=
pcard
->
is_special_summonable
(
p
,
SUMMON_TYPE_LINK
);
pcard
->
pduel
->
game_field
->
core
.
limit_link
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_card
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_minc
=
0
;
pcard
->
pduel
->
game_field
->
core
.
limit_link_maxc
=
0
;
lua_pushboolean
(
L
,
res
);
return
1
;
}
int32
scriptlib
::
card_is_can_be_summoned
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
00cd847b
...
...
@@ -5213,7 +5213,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
case
3
:
{
card
*
tuner
=
core
.
limit_tuner
;
effect
*
ptuner
=
tuner
->
is_affected_by_effect
(
EFFECT_TUNER_MATERIAL_LIMIT
);
if
(
ptuner
)
{
if
(
ptuner
&&
ptuner
->
is_flag
(
EFFECT_FLAG_SPSUM_PARAM
)
)
{
if
(
ptuner
->
s_range
&&
ptuner
->
s_range
>
min
)
min
=
ptuner
->
s_range
;
if
(
ptuner
->
o_range
&&
ptuner
->
o_range
<
max
)
...
...
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