Commit 7ed316b4 authored by VanillaSalt's avatar VanillaSalt

fix

parent f7212e86
...@@ -515,14 +515,16 @@ int32 card::get_attack() { ...@@ -515,14 +515,16 @@ int32 card::get_attack() {
int32 up_atk = 0, upc_atk = 0; int32 up_atk = 0, upc_atk = 0;
int32 swap_final = FALSE; int32 swap_final = FALSE;
effect_set eset; effect_set eset;
filter_effect(EFFECT_SWAP_AD, &eset, FALSE);
filter_effect(EFFECT_UPDATE_ATTACK, &eset, FALSE); filter_effect(EFFECT_UPDATE_ATTACK, &eset, FALSE);
filter_effect(EFFECT_SET_ATTACK, &eset, FALSE); filter_effect(EFFECT_SET_ATTACK, &eset, FALSE);
filter_effect(EFFECT_SET_ATTACK_FINAL, &eset, FALSE); filter_effect(EFFECT_SET_ATTACK_FINAL, &eset, FALSE);
filter_effect(EFFECT_SWAP_ATTACK_FINAL, &eset, FALSE); filter_effect(EFFECT_SWAP_ATTACK_FINAL, &eset, FALSE);
filter_effect(EFFECT_SWAP_BASE_AD, &eset, FALSE);
filter_effect(EFFECT_SET_BASE_ATTACK, &eset, FALSE); filter_effect(EFFECT_SET_BASE_ATTACK, &eset, FALSE);
if(!(data.type & TYPE_LINK)) {
filter_effect(EFFECT_SWAP_AD, &eset, FALSE);
filter_effect(EFFECT_SWAP_BASE_AD, &eset, FALSE);
filter_effect(EFFECT_SET_BASE_DEFENSE, &eset, FALSE); filter_effect(EFFECT_SET_BASE_DEFENSE, &eset, FALSE);
}
eset.sort(); eset.sort();
int32 rev = FALSE; int32 rev = FALSE;
if(is_affected_by_effect(EFFECT_REVERSE_UPDATE)) if(is_affected_by_effect(EFFECT_REVERSE_UPDATE))
...@@ -594,7 +596,6 @@ int32 card::get_attack() { ...@@ -594,7 +596,6 @@ int32 card::get_attack() {
swap_final = !swap_final; swap_final = !swap_final;
break; break;
case EFFECT_SWAP_BASE_AD: case EFFECT_SWAP_BASE_AD:
if(!(data.type & TYPE_LINK))
std::swap(batk, bdef); std::swap(batk, bdef);
break; break;
} }
...@@ -610,7 +611,7 @@ int32 card::get_attack() { ...@@ -610,7 +611,7 @@ int32 card::get_attack() {
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); temp.attack = effects_atk[i]->get_value(this);
if(temp.defense == -1) { if(temp.defense == -1) {
if(swap_final && !(data.type & TYPE_LINK)) { if(swap_final) {
temp.attack = get_defense(); temp.attack = get_defense();
} }
for(int32 i = 0; i < effects_atk_r.size(); ++i) { for(int32 i = 0; i < effects_atk_r.size(); ++i) {
...@@ -627,7 +628,9 @@ int32 card::get_attack() { ...@@ -627,7 +628,9 @@ int32 card::get_attack() {
return atk; return atk;
} }
int32 card::get_base_defense() { int32 card::get_base_defense() {
if((!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)) || (data.type & TYPE_LINK)) if(data.type & TYPE_LINK)
return 0;
if(!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER))
return 0; return 0;
if (current.location != LOCATION_MZONE || get_status(STATUS_SUMMONING | STATUS_SPSUMMON_STEP)) if (current.location != LOCATION_MZONE || get_status(STATUS_SUMMONING | STATUS_SPSUMMON_STEP))
return data.defense; return data.defense;
...@@ -826,7 +829,7 @@ int32 card::get_defense() { ...@@ -826,7 +829,7 @@ int32 card::get_defense() {
// 2. cards with current type TYPE_MONSTER or // 2. cards with current type TYPE_MONSTER or
// 3. cards with EFFECT_PRE_MONSTER // 3. cards with EFFECT_PRE_MONSTER
uint32 card::get_level() { uint32 card::get_level() {
if((data.type & TYPE_XYZ) || (data.type & TYPE_LINK) || (status & STATUS_NO_LEVEL) if((data.type & (TYPE_XYZ | TYPE_LINK)) || (status & STATUS_NO_LEVEL)
|| (!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER))) || (!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)))
return 0; return 0;
if(assume_type == ASSUME_LEVEL) if(assume_type == ASSUME_LEVEL)
...@@ -914,7 +917,7 @@ uint32 card::get_link() { ...@@ -914,7 +917,7 @@ uint32 card::get_link() {
return data.level; return data.level;
} }
uint32 card::get_synchro_level(card* pcard) { uint32 card::get_synchro_level(card* pcard) {
if((data.type & TYPE_XYZ) || (data.type & TYPE_LINK) || (status & STATUS_NO_LEVEL)) if((data.type & (TYPE_XYZ | TYPE_LINK)) || (status & STATUS_NO_LEVEL))
return 0; return 0;
uint32 lev; uint32 lev;
effect_set eset; effect_set eset;
...@@ -926,7 +929,7 @@ uint32 card::get_synchro_level(card* pcard) { ...@@ -926,7 +929,7 @@ uint32 card::get_synchro_level(card* pcard) {
return lev; return lev;
} }
uint32 card::get_ritual_level(card* pcard) { uint32 card::get_ritual_level(card* pcard) {
if((data.type & TYPE_XYZ) || (data.type & TYPE_LINK) || (status & STATUS_NO_LEVEL)) if((data.type & (TYPE_XYZ | TYPE_LINK)) || (status & STATUS_NO_LEVEL))
return 0; return 0;
uint32 lev; uint32 lev;
effect_set eset; effect_set eset;
...@@ -3102,7 +3105,9 @@ int32 card::is_capable_attack_announce(uint8 playerid) { ...@@ -3102,7 +3105,9 @@ int32 card::is_capable_attack_announce(uint8 playerid) {
return TRUE; return TRUE;
} }
int32 card::is_capable_change_position(uint8 playerid) { int32 card::is_capable_change_position(uint8 playerid) {
if(is_status(STATUS_SUMMON_TURN) || is_status(STATUS_FLIP_SUMMON_TURN) || is_status(STATUS_SPSUMMON_TURN) || is_status(STATUS_FORM_CHANGED)) if(get_status(STATUS_SUMMON_TURN | STATUS_FLIP_SUMMON_TURN | STATUS_SPSUMMON_TURN | STATUS_FORM_CHANGED))
return FALSE;
if(data.type & TYPE_LINK)
return FALSE; return FALSE;
if(announce_count > 0) if(announce_count > 0)
return FALSE; return FALSE;
...@@ -3190,7 +3195,7 @@ int32 card::is_can_be_fusion_material(card* fcard) { ...@@ -3190,7 +3195,7 @@ int32 card::is_can_be_fusion_material(card* fcard) {
return TRUE; return TRUE;
} }
int32 card::is_can_be_synchro_material(card* scard, card* tuner) { int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
if((data.type & TYPE_XYZ) || (data.type & TYPE_LINK)) if(data.type & (TYPE_XYZ | TYPE_LINK))
return FALSE; return FALSE;
if(!(get_type() & TYPE_MONSTER)) if(!(get_type() & TYPE_MONSTER))
return FALSE; return FALSE;
......
...@@ -414,7 +414,8 @@ public: ...@@ -414,7 +414,8 @@ public:
#define REASON_REPLACE 0x1000000 // #define REASON_REPLACE 0x1000000 //
#define REASON_DRAW 0x2000000 // #define REASON_DRAW 0x2000000 //
#define REASON_REDIRECT 0x4000000 // #define REASON_REDIRECT 0x4000000 //
#define REASON_LINK 0x8000000 // //#define REASON_REVEAL 0x8000000 //
#define REASON_LINK 0x10000000 //
//Summon Type //Summon Type
#define SUMMON_TYPE_NORMAL 0x10000000 #define SUMMON_TYPE_NORMAL 0x10000000
#define SUMMON_TYPE_ADVANCE 0x11000000 #define SUMMON_TYPE_ADVANCE 0x11000000
......
...@@ -4016,6 +4016,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec ...@@ -4016,6 +4016,7 @@ int32 field::change_position(uint16 step, group * targets, effect * reason_effec
uint8 opos = pcard->current.position; uint8 opos = pcard->current.position;
uint8 flag = pcard->position_param >> 16; uint8 flag = pcard->position_param >> 16;
if((pcard->current.location != LOCATION_MZONE && pcard->current.location != LOCATION_SZONE) if((pcard->current.location != LOCATION_MZONE && pcard->current.location != LOCATION_SZONE)
|| (pcard->data.type & TYPE_LINK)
|| pcard->get_status(STATUS_SUMMONING | STATUS_SPSUMMON_STEP) || pcard->get_status(STATUS_SUMMONING | STATUS_SPSUMMON_STEP)
|| !pcard->is_affect_by_effect(reason_effect) || npos == opos || !pcard->is_affect_by_effect(reason_effect) || npos == opos
|| (!(pcard->data.type & TYPE_TOKEN) && (opos & POS_FACEUP) && (npos & POS_FACEDOWN) && !pcard->is_capable_turn_set(reason_player)) || (!(pcard->data.type & TYPE_TOKEN) && (opos & POS_FACEUP) && (npos & POS_FACEDOWN) && !pcard->is_capable_turn_set(reason_player))
......
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