Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
83bfe169
Commit
83bfe169
authored
May 16, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
8af795c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
32 deletions
+24
-32
ocgcore/card.cpp
ocgcore/card.cpp
+24
-32
No files found.
ocgcore/card.cpp
View file @
83bfe169
...
...
@@ -404,6 +404,7 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
if
(
is_affected_by_effect
(
EFFECT_REVERSE_UPDATE
))
rev
=
TRUE
;
effect_set
effects_atk
,
effects_def
;
int32
swap_final
=
FALSE
;
for
(
int32
i
=
0
;
i
<
eset
.
size
();
++
i
)
{
switch
(
eset
[
i
]
->
code
)
{
case
EFFECT_UPDATE_ATTACK
:
...
...
@@ -461,14 +462,17 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
effects_def
.
add_item
(
eset
[
i
]);
break
;
case
EFFECT_SWAP_AD
:
int32
a
=
base_atk
+
up_atk
+
upc_atk
;
int32
d
=
base_def
+
up_def
+
upc_def
;
base_atk
=
d
;
up_atk
=
0
;
upc_atk
=
0
;
base_def
=
a
;
up_def
=
0
;
upc_def
=
0
;
if
((
eset
[
i
]
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
(
eset
[
i
]
->
flag
&
EFFECT_FLAG_SINGLE_RANGE
))
{
int32
a
=
base_atk
+
up_atk
+
upc_atk
;
int32
d
=
base_def
+
up_def
+
upc_def
;
base_atk
=
d
;
up_atk
=
0
;
upc_atk
=
0
;
base_def
=
a
;
up_def
=
0
;
upc_def
=
0
;
}
else
swap_final
=
!
swap_final
;
break
;
}
if
(
!
rev
)
{
...
...
@@ -479,36 +483,24 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
temp
.
defence
=
base_def
-
up_def
-
upc_def
;
}
}
if
(
swap_final
)
{
int32
atk
=
temp
.
attack
;
int32
def
=
temp
.
defence
;
temp
.
attack
=
def
;
temp
.
defence
=
atk
;
}
if
(
patk
)
{
int32
final
=
-
1
,
atk
;
for
(
int32
i
=
0
;
i
<
effects_atk
.
size
();
++
i
)
{
final
=
effects_atk
[
i
]
->
get_value
(
this
);
temp
.
attack
=
final
;
}
if
(
final
==
-
1
)
{
if
(
!
rev
)
atk
=
base_atk
+
up_atk
+
upc_atk
;
else
atk
=
base_atk
-
up_atk
-
upc_atk
;
}
else
atk
=
final
;
for
(
int32
i
=
0
;
i
<
effects_atk
.
size
();
++
i
)
temp
.
attack
=
effects_atk
[
i
]
->
get_value
(
this
);
int32
atk
=
temp
.
attack
;
if
(
atk
<
0
)
atk
=
0
;
*
patk
=
atk
;
}
if
(
pdef
)
{
int32
final
=
-
1
,
def
;
for
(
int32
i
=
0
;
i
<
effects_def
.
size
();
++
i
)
{
final
=
effects_def
[
i
]
->
get_value
(
this
);
temp
.
defence
=
final
;
}
if
(
final
==
-
1
)
{
if
(
!
rev
)
def
=
base_def
+
up_def
+
upc_def
;
else
def
=
base_def
-
up_def
-
upc_def
;
}
else
def
=
final
;
for
(
int32
i
=
0
;
i
<
effects_def
.
size
();
++
i
)
temp
.
defence
=
effects_def
[
i
]
->
get_value
(
this
);
int32
def
=
temp
.
defence
;
if
(
def
<
0
)
def
=
0
;
*
pdef
=
def
;
...
...
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