Commit c4836739 authored by VanillaSalt's avatar VanillaSalt

fix get_attack/defense

parent f524c6bf
......@@ -480,6 +480,7 @@ int32 card::get_attack() {
int32 bdef = data.defense;
if(bdef < 0)
bdef = 0;
temp.base_attack = batk;
temp.attack = batk;
int32 atk = -1;
int32 up_atk = 0, upc_atk = 0;
......@@ -505,6 +506,7 @@ int32 card::get_attack() {
batk = eset[i]->get_value(this);
if(batk < 0)
batk = 0;
temp.base_attack = batk;
eset.remove_item(i);
continue;
case EFFECT_SET_BASE_DEFENSE:
......@@ -566,6 +568,7 @@ int32 card::get_attack() {
std::swap(batk, bdef);
break;
}
temp.base_attack = batk;
if(!rev) {
temp.attack = ((atk < 0) ? batk : atk) + up_atk + upc_atk;
} else {
......@@ -589,6 +592,7 @@ int32 card::get_attack() {
atk = temp.attack;
if(atk < 0)
atk = 0;
temp.base_attack = -1;
temp.attack = -1;
return atk;
}
......@@ -669,6 +673,7 @@ int32 card::get_defense() {
int32 bdef = data.defense;
if(bdef < 0)
bdef = 0;
temp.base_defense = bdef;
temp.defense = bdef;
int32 def = -1;
int32 up_def = 0, upc_def = 0;
......@@ -700,6 +705,7 @@ int32 card::get_defense() {
bdef = eset[i]->get_value(this);
if(bdef < 0)
bdef = 0;
temp.base_defense = bdef;
eset.remove_item(i);
continue;
}
......@@ -755,6 +761,7 @@ int32 card::get_defense() {
std::swap(batk, bdef);
break;
}
temp.base_defense = bdef;
if(!rev) {
temp.defense = ((def < 0) ? bdef : def) + up_def + upc_def;
} else {
......@@ -778,6 +785,7 @@ int32 card::get_defense() {
def = temp.defense;
if(def < 0)
def = 0;
temp.base_defense = -1;
temp.defense = -1;
return def;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment