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
d0fffc74
Commit
d0fffc74
authored
Apr 27, 2019
by
mycard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/purerosefallen/ygopro-core
into 2pick
parents
39ed882f
eb18a5c6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
32 deletions
+26
-32
card.cpp
card.cpp
+12
-30
effect.h
effect.h
+2
-2
field.cpp
field.cpp
+4
-0
operations.cpp
operations.cpp
+8
-0
No files found.
card.cpp
View file @
d0fffc74
...
...
@@ -550,7 +550,7 @@ int32 card::get_base_attack() {
if
(
swap
)
filter_effect
(
EFFECT_SET_BASE_DEFENSE
,
&
eset
,
FALSE
);
eset
.
sort
();
// calculate continous effects of this first
// calculate contin
u
ous effects of this first
for
(
int32
i
=
0
;
i
<
eset
.
size
();)
{
if
((
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
{
switch
(
eset
[
i
]
->
code
)
{
...
...
@@ -937,31 +937,22 @@ uint32 card::get_level() {
effect_set
effects
;
int32
level
=
data
.
level
;
temp
.
level
=
level
;
int32
up
=
0
,
upc
=
0
;
int32
up
=
0
;
filter_effect
(
EFFECT_UPDATE_LEVEL
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_CHANGE_LEVEL
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_CHANGE_LEVEL_FINAL
,
&
effects
);
filter_effect
(
EFFECT_CHANGE_LEVEL
,
&
effects
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
switch
(
effects
[
i
]
->
code
)
{
case
EFFECT_UPDATE_LEVEL
:
if
((
effects
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
effects
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
up
+=
effects
[
i
]
->
get_value
(
this
);
else
upc
+=
effects
[
i
]
->
get_value
(
this
);
break
;
case
EFFECT_CHANGE_LEVEL
:
level
=
effects
[
i
]
->
get_value
(
this
);
up
=
0
;
break
;
case
EFFECT_CHANGE_LEVEL_FINAL
:
level
=
effects
[
i
]
->
get_value
(
this
);
up
=
0
;
upc
=
0
;
break
;
}
temp
.
level
=
level
+
up
+
upc
;
temp
.
level
=
level
+
up
;
}
level
+=
up
+
upc
;
level
+=
up
;
if
(
level
<
1
&&
(
get_type
()
&
TYPE_MONSTER
))
level
=
1
;
temp
.
level
=
0xffffffff
;
...
...
@@ -979,31 +970,22 @@ uint32 card::get_rank() {
effect_set
effects
;
int32
rank
=
data
.
level
;
temp
.
level
=
rank
;
int32
up
=
0
,
upc
=
0
;
int32
up
=
0
;
filter_effect
(
EFFECT_UPDATE_RANK
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_CHANGE_RANK
,
&
effects
,
FALSE
);
filter_effect
(
EFFECT_CHANGE_RANK_FINAL
,
&
effects
);
filter_effect
(
EFFECT_CHANGE_RANK
,
&
effects
);
for
(
int32
i
=
0
;
i
<
effects
.
size
();
++
i
)
{
switch
(
effects
[
i
]
->
code
)
{
case
EFFECT_UPDATE_RANK
:
if
((
effects
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
effects
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
up
+=
effects
[
i
]
->
get_value
(
this
);
else
upc
+=
effects
[
i
]
->
get_value
(
this
);
break
;
case
EFFECT_CHANGE_RANK
:
rank
=
effects
[
i
]
->
get_value
(
this
);
up
=
0
;
break
;
case
EFFECT_CHANGE_RANK_FINAL
:
rank
=
effects
[
i
]
->
get_value
(
this
);
up
=
0
;
upc
=
0
;
break
;
}
temp
.
level
=
rank
+
up
+
upc
;
temp
.
level
=
rank
+
up
;
}
rank
+=
up
+
upc
;
rank
+=
up
;
if
(
rank
<
1
&&
(
get_type
()
&
TYPE_MONSTER
))
rank
=
1
;
temp
.
level
=
0xffffffff
;
...
...
@@ -2851,7 +2833,7 @@ effect* card::is_affected_by_effect(int32 code, card* target) {
}
return
0
;
}
// return the last control-changing continous effect
// return the last control-changing contin
u
ous effect
effect
*
card
::
check_control_effect
()
{
effect
*
ret_effect
=
0
;
for
(
auto
&
pcard
:
equiping_cards
)
{
...
...
effect.h
View file @
d0fffc74
...
...
@@ -426,8 +426,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_QP_ACT_IN_NTPHAND 311
#define EFFECT_MUST_BE_SMATERIAL 312
#define EFFECT_TO_GRAVE_REDIRECT_CB 313
#define EFFECT_CHANGE_LEVEL_FINAL 314
#define EFFECT_CHANGE_RANK_FINAL 315
//
#define EFFECT_CHANGE_LEVEL_FINAL 314
//
#define EFFECT_CHANGE_RANK_FINAL 315
#define EFFECT_MUST_BE_FMATERIAL 316
#define EFFECT_MUST_BE_XMATERIAL 317
#define EFFECT_MUST_BE_LMATERIAL 318
...
...
field.cpp
View file @
d0fffc74
...
...
@@ -2459,6 +2459,8 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
card_set
linked_cards
;
if
(
ct
<=
0
)
{
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_EXTRA_TOMAIN_KOISHI
)
||
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_TOMAIN_KOISHI
))
linked_zone
=
0x7f
;
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
,
LOCATION_MZONE
);
if
(
linked_cards
.
find
(
tuner
)
!=
linked_cards
.
end
())
ct
++
;
...
...
@@ -2755,6 +2757,8 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
if
(
ct
<=
0
)
{
int32
ft
=
ct
;
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_EXTRA_TOMAIN_KOISHI
)
||
scard
->
is_affected_by_effect
(
EFFECT_EXTRA_TOMAIN_KOISHI
))
linked_zone
=
0x7f
;
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
,
LOCATION_MZONE
);
for
(
auto
cit
=
core
.
xmaterial_lst
.
begin
();
cit
!=
core
.
xmaterial_lst
.
end
();
++
cit
)
{
card
*
pcard
=
cit
->
second
;
...
...
operations.cpp
View file @
d0fffc74
...
...
@@ -5106,6 +5106,8 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
}
card_set
linked_cards
;
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_EXTRA_TOMAIN_KOISHI
)
||
pcard
->
is_affected_by_effect
(
EFFECT_EXTRA_TOMAIN_KOISHI
))
linked_zone
=
0x7f
;
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
,
LOCATION_MZONE
);
if
(
linked_cards
.
find
(
tuner
)
!=
linked_cards
.
end
())
ct
++
;
...
...
@@ -5334,6 +5336,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
card_set
linked_cards
;
if
(
ct
<=
0
)
{
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_EXTRA_TOMAIN_KOISHI
)
||
scard
->
is_affected_by_effect
(
EFFECT_EXTRA_TOMAIN_KOISHI
))
linked_zone
=
0x7f
;
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
,
LOCATION_MZONE
);
}
for
(
auto
&
pcard
:
core
.
operated_set
)
{
...
...
@@ -5419,6 +5423,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
}
card_set
linked_cards
;
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_EXTRA_TOMAIN_KOISHI
)
||
scard
->
is_affected_by_effect
(
EFFECT_EXTRA_TOMAIN_KOISHI
))
linked_zone
=
0x7f
;
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
,
LOCATION_MZONE
);
int32
ft
=
ct
+
std
::
count_if
(
core
.
operated_set
.
begin
(),
core
.
operated_set
.
end
(),
[
=
](
card
*
pcard
)
{
return
linked_cards
.
find
(
pcard
)
!=
linked_cards
.
end
();
});
...
...
@@ -5602,6 +5608,8 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
return
FALSE
;
card_set
linked_cards
;
uint32
linked_zone
=
core
.
duel_rule
>=
4
?
get_linked_zone
(
playerid
)
|
(
1u
<<
5
)
|
(
1u
<<
6
)
:
0x1f
;
if
(
is_player_affected_by_effect
(
playerid
,
EFFECT_EXTRA_TOMAIN_KOISHI
)
||
scard
->
is_affected_by_effect
(
EFFECT_EXTRA_TOMAIN_KOISHI
))
linked_zone
=
0x7f
;
get_cards_in_zone
(
&
linked_cards
,
linked_zone
,
playerid
,
LOCATION_MZONE
);
int32
ft
=
ct
+
std
::
count_if
(
core
.
operated_set
.
begin
(),
core
.
operated_set
.
end
(),
[
=
](
card
*
pcard
)
{
return
linked_cards
.
find
(
pcard
)
!=
linked_cards
.
end
();
});
...
...
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