Commit fe020efd authored by VanillaSalt's avatar VanillaSalt

fix EFFECT_REMOVE_BRAINWASHING

parent 800ecbbf
...@@ -1605,8 +1605,6 @@ void card::refresh_disable_status() { ...@@ -1605,8 +1605,6 @@ void card::refresh_disable_status() {
} }
uint8 card::refresh_control_status() { uint8 card::refresh_control_status() {
uint8 final = owner; uint8 final = owner;
if(pduel->game_field->core.remove_brainwashing && is_affected_by_effect(EFFECT_REMOVE_BRAINWASHING))
return final;
effect_set eset; effect_set eset;
filter_effect(EFFECT_SET_CONTROL, &eset); filter_effect(EFFECT_SET_CONTROL, &eset);
if(eset.size()) if(eset.size())
......
...@@ -5061,39 +5061,15 @@ int32 field::adjust_step(uint16 step) { ...@@ -5061,39 +5061,15 @@ int32 field::adjust_step(uint16 step) {
return FALSE; return FALSE;
} }
case 4: { case 4: {
//remove brainwashing
effect_set eset;
uint32 res = 0;
if(core.global_flag & GLOBALFLAG_BRAINWASHING_CHECK) {
filter_field_effect(EFFECT_REMOVE_BRAINWASHING, &eset, FALSE);
res = eset.size() ? TRUE : FALSE;
if(res) {
card* pcard;
for(uint8 p = 0; p < 2; ++p) {
for(uint8 i = 0; i < 5; ++i) {
pcard = player[p].list_mzone[i];
// remove EFFECT_SET_CONTROL
if(pcard && pcard->is_affected_by_effect(EFFECT_REMOVE_BRAINWASHING))
pcard->reset(EFFECT_SET_CONTROL, RESET_CODE);
}
}
}
core.remove_brainwashing = res;
}
return FALSE;
}
case 5: {
//1-5 control //1-5 control
card* pcard;
uint8 cur, ref;
core.control_adjust_set[0].clear(); core.control_adjust_set[0].clear();
core.control_adjust_set[1].clear(); core.control_adjust_set[1].clear();
for(uint8 p = 0; p < 2; ++p) { for(uint8 p = 0; p < 2; ++p) {
for(uint8 i = 0; i < 5; ++i) { for(uint8 i = 0; i < 5; ++i) {
pcard = player[p].list_mzone[i]; card* pcard = player[p].list_mzone[i];
if(!pcard) continue; if(!pcard) continue;
cur = pcard->current.controler; uint8 cur = pcard->current.controler;
ref = pcard->refresh_control_status(); uint8 ref = pcard->refresh_control_status();
if(cur != ref && pcard->is_capable_change_control()) { if(cur != ref && pcard->is_capable_change_control()) {
core.control_adjust_set[p].insert(pcard); core.control_adjust_set[p].insert(pcard);
} }
...@@ -5103,6 +5079,27 @@ int32 field::adjust_step(uint16 step) { ...@@ -5103,6 +5079,27 @@ int32 field::adjust_step(uint16 step) {
core.re_adjust = TRUE; core.re_adjust = TRUE;
add_process(PROCESSOR_CONTROL_ADJUST, 0, 0, 0, 0, 0); add_process(PROCESSOR_CONTROL_ADJUST, 0, 0, 0, 0, 0);
} }
return FALSE;
}
case 5: {
//remove brainwashing
if(core.global_flag & GLOBALFLAG_BRAINWASHING_CHECK) {
effect_set eset;
uint32 res = 0;
filter_field_effect(EFFECT_REMOVE_BRAINWASHING, &eset, FALSE);
res = eset.size() ? TRUE : FALSE;
if(res) {
for(uint8 p = 0; p < 2; ++p) {
for(uint8 i = 0; i < 5; ++i) {
card* pcard = player[p].list_mzone[i];
// remove EFFECT_SET_CONTROL
if(pcard && pcard->is_affected_by_effect(EFFECT_REMOVE_BRAINWASHING))
pcard->reset(EFFECT_SET_CONTROL, RESET_CODE);
}
}
}
core.remove_brainwashing = res;
}
core.units.begin()->step = 7; core.units.begin()->step = 7;
return FALSE; return FALSE;
} }
......
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