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
570a29eb
Commit
570a29eb
authored
Mar 15, 2023
by
Chen Bill
Committed by
GitHub
Mar 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add EFFECT_FLAG2_REPEAT_UPDATE (#487)
parent
b6d8b0e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
card.cpp
card.cpp
+17
-2
effect.h
effect.h
+1
-1
No files found.
card.cpp
View file @
570a29eb
...
...
@@ -625,6 +625,7 @@ std::pair<int32, int32> card::get_atk_def() {
effect_set
eset
;
effect_set
effects_atk_final
,
effects_atk_wicked
,
effects_atk_option
;
effect_set
effects_def_final
,
effects_def_wicked
,
effects_def_option
;
effect_set
effects_repeat_update_atk
,
effects_repeat_update_def
;
int32
batk
=
data
.
attack
;
if
(
batk
<
0
)
batk
=
0
;
...
...
@@ -678,7 +679,9 @@ std::pair<int32, int32> card::get_atk_def() {
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
switch
(
eset
[
i
]
->
code
)
{
case
EFFECT_UPDATE_ATTACK
:
if
((
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
if
(
eset
[
i
]
->
is_flag
(
EFFECT_FLAG2_REPEAT_UPDATE
))
effects_repeat_update_atk
.
add_item
(
eset
[
i
]);
else
if
((
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
up_atk
+=
eset
[
i
]
->
get_value
(
this
);
else
upc_atk
+=
eset
[
i
]
->
get_value
(
this
);
...
...
@@ -709,7 +712,9 @@ std::pair<int32, int32> card::get_atk_def() {
break
;
// def
case
EFFECT_UPDATE_DEFENSE
:
if
((
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
if
(
eset
[
i
]
->
is_flag
(
EFFECT_FLAG2_REPEAT_UPDATE
))
effects_repeat_update_def
.
add_item
(
eset
[
i
]);
else
if
((
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
eset
[
i
]
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
))
up_def
+=
eset
[
i
]
->
get_value
(
this
);
else
upc_def
+=
eset
[
i
]
->
get_value
(
this
);
...
...
@@ -755,6 +760,16 @@ std::pair<int32, int32> card::get_atk_def() {
if
(
temp
.
defense
<
0
)
temp
.
defense
=
0
;
}
for
(
int32
i
=
0
;
i
<
effects_repeat_update_atk
.
size
();
++
i
)
{
temp
.
attack
+=
effects_repeat_update_atk
[
i
]
->
get_value
(
this
);
if
(
temp
.
attack
<
0
)
temp
.
attack
=
0
;
}
for
(
int32
i
=
0
;
i
<
effects_repeat_update_def
.
size
();
++
i
)
{
temp
.
defense
+=
effects_repeat_update_def
[
i
]
->
get_value
(
this
);
if
(
temp
.
defense
<
0
)
temp
.
defense
=
0
;
}
for
(
int32
i
=
0
;
i
<
effects_atk_final
.
size
();
++
i
)
{
atk
=
effects_atk_final
[
i
]
->
get_value
(
this
);
if
(
atk
<
0
)
...
...
effect.h
View file @
570a29eb
...
...
@@ -204,7 +204,7 @@ enum effect_flag : uint32 {
EFFECT_FLAG_IMMEDIATELY_APPLY
=
0x80000000
,
};
enum
effect_flag2
:
uint32
{
// EFFECT_FLAG2_MILLENNIUM_RESTRICT
= 0x0001,
EFFECT_FLAG2_REPEAT_UPDATE
=
0x0001
,
EFFECT_FLAG2_COF
=
0x0002
,
EFFECT_FLAG2_WICKED
=
0x0004
,
EFFECT_FLAG2_OPTION
=
0x0008
,
...
...
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