Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
YGOPRO-520DIY
ygopro
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
Show 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) {
...
@@ -404,6 +404,7 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
if (is_affected_by_effect(EFFECT_REVERSE_UPDATE))
if (is_affected_by_effect(EFFECT_REVERSE_UPDATE))
rev = TRUE;
rev = TRUE;
effect_set effects_atk, effects_def;
effect_set effects_atk, effects_def;
int32 swap_final = FALSE;
for (int32 i = 0; i < eset.size(); ++i) {
for (int32 i = 0; i < eset.size(); ++i) {
switch (eset[i]->code) {
switch (eset[i]->code) {
case EFFECT_UPDATE_ATTACK:
case EFFECT_UPDATE_ATTACK:
...
@@ -461,6 +462,7 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
...
@@ -461,6 +462,7 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
effects_def.add_item(eset[i]);
effects_def.add_item(eset[i]);
break;
break;
case EFFECT_SWAP_AD:
case EFFECT_SWAP_AD:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
int32 a = base_atk + up_atk + upc_atk;
int32 a = base_atk + up_atk + upc_atk;
int32 d = base_def + up_def + upc_def;
int32 d = base_def + up_def + upc_def;
base_atk = d;
base_atk = d;
...
@@ -469,6 +471,8 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
...
@@ -469,6 +471,8 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
base_def = a;
base_def = a;
up_def = 0;
up_def = 0;
upc_def = 0;
upc_def = 0;
} else
swap_final = !swap_final;
break;
break;
}
}
if (!rev) {
if (!rev) {
...
@@ -479,36 +483,24 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
...
@@ -479,36 +483,24 @@ void card::calc_attack_defence(int32 *patk, int32 *pdef) {
temp.defence = base_def - up_def - upc_def;
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) {
if (patk) {
int32
final
=
-
1
,
atk
;
for (int32 i = 0; i < effects_atk.size(); ++i)
for
(
int32
i
=
0
;
i
<
effects_atk
.
size
();
++
i
)
{
temp.attack = effects_atk[i]->get_value(this);
final
=
effects_atk
[
i
]
->
get_value
(
this
);
int32 atk = temp.attack;
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
;
if (atk < 0)
if (atk < 0)
atk = 0;
atk = 0;
*patk = atk;
*patk = atk;
}
}
if (pdef) {
if (pdef) {
int32
final
=
-
1
,
def
;
for (int32 i = 0; i < effects_def.size(); ++i)
for
(
int32
i
=
0
;
i
<
effects_def
.
size
();
++
i
)
{
temp.defence = effects_def[i]->get_value(this);
final
=
effects_def
[
i
]
->
get_value
(
this
);
int32 def = temp.defence;
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
;
if (def < 0)
if (def < 0)
def = 0;
def = 0;
*pdef = def;
*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