Commit 2c82a438 authored by sidschingis's avatar sidschingis

change synchro check

synchro material group can now include cards from outside of the field
parent 31e251ac
...@@ -1641,12 +1641,27 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32 ...@@ -1641,12 +1641,27 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
} }
card_vector nsyn; card_vector nsyn;
card* pm; card* pm;
if (mg) {
for (auto cit = mg->container.begin(); cit != mg->container.end(); ++cit) {
pm=*cit;
if(pm && pm != tuner && pm != smat && pm->is_can_be_synchro_material(pcard, tuner)) {
if(pcheck)
pcheck->get_value(pm);
if(!pduel->lua->check_matching(pm, findex2, 0))
continue;
nsyn.push_back(pm);
pm->operation_param = pm->get_synchro_level(pcard);
}
}
if(check_with_sum_limit(&nsyn, lv, 0, 1, min, max)) {
pduel->restore_assumes();
return TRUE;
}
} else {
for(uint8 p = 0; p < 2; ++p) { for(uint8 p = 0; p < 2; ++p) {
for(int32 i = 0; i < 5; ++i) { for(int32 i = 0; i < 5; ++i) {
pm = player[p].list_mzone[i]; pm = player[p].list_mzone[i];
if(pm && pm != tuner && pm != smat && pm->is_position(POS_FACEUP) && pm->is_can_be_synchro_material(pcard, tuner)) { if(pm && pm != tuner && pm != smat && pm->is_position(POS_FACEUP) && pm->is_can_be_synchro_material(pcard, tuner)) {
if(mg && !mg->has_card(pm))
continue;
if(pcheck) if(pcheck)
pcheck->get_value(pm); pcheck->get_value(pm);
if(!pduel->lua->check_matching(pm, findex2, 0)) if(!pduel->lua->check_matching(pm, findex2, 0))
...@@ -1662,6 +1677,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32 ...@@ -1662,6 +1677,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
} }
} }
} }
}
pduel->restore_assumes(); pduel->restore_assumes();
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