Commit 0283bb6d authored by mercury233's avatar mercury233

update

parent 16deeda4
...@@ -708,11 +708,7 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui ...@@ -708,11 +708,7 @@ int32 field::get_spsummonable_count_fromex_rule4(card* pcard, uint8 playerid, ui
if(!is_location_useable(playerid, LOCATION_MZONE, 6)) if(!is_location_useable(playerid, LOCATION_MZONE, 6))
flag |= 1u << 6; flag |= 1u << 6;
} }
uint32 linked_zone = 0; uint32 linked_zone = get_rule_zone_fromex(playerid, pcard);
if(core.duel_rule >= 5 && pcard && (pcard->get_type() & TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ) && pcard->is_position(POS_FACEDOWN))
linked_zone = 0x7f007f;
else
linked_zone = get_linked_zone(playerid) | (1u << 5) | (1u << 6);
flag = flag | ~zone | ~linked_zone; flag = flag | ~zone | ~linked_zone;
if(list) if(list)
*list = flag & 0x7f; *list = flag & 0x7f;
...@@ -777,13 +773,14 @@ uint32 field::get_linked_zone(int32 playerid) { ...@@ -777,13 +773,14 @@ uint32 field::get_linked_zone(int32 playerid) {
} }
return zones; return zones;
} }
uint32 field::get_fsx_zone_fromex_rule5(int32 playerid) { uint32 field::get_rule_zone_fromex(int32 playerid, card* pcard) {
if(core.duel_rule <= 3) { if(core.duel_rule >= 4) {
return 0x1f; if(core.duel_rule >= 5 && pcard && pcard->is_position(POS_FACEDOWN) && (pcard->data.type & TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ))
} else if(core.duel_rule == 4) { return 0x7f;
return get_linked_zone(playerid) | (1u << 5) | (1u << 6); else
return get_linked_zone(playerid) | (1u << 5) | (1u << 6);
} else { } else {
return 0x7f; return 0x1f;
} }
} }
void field::get_linked_cards(uint8 self, uint8 s, uint8 o, card_set* cset) { void field::get_linked_cards(uint8 self, uint8 s, uint8 o, card_set* cset) {
...@@ -2408,7 +2405,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32 ...@@ -2408,7 +2405,7 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
int32 ct = get_spsummonable_count(pcard, playerid); int32 ct = get_spsummonable_count(pcard, playerid);
card_set linked_cards; card_set linked_cards;
if(ct <= 0) { if(ct <= 0) {
uint32 linked_zone = get_fsx_zone_fromex_rule5(playerid); uint32 linked_zone = get_rule_zone_fromex(playerid, pcard);
get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE); get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE);
if(linked_cards.find(tuner) != linked_cards.end()) if(linked_cards.find(tuner) != linked_cards.end())
ct++; ct++;
...@@ -2704,7 +2701,7 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min, ...@@ -2704,7 +2701,7 @@ int32 field::check_xyz_material(card* scard, int32 findex, int32 lv, int32 min,
card_set linked_cards; card_set linked_cards;
if(ct <= 0) { if(ct <= 0) {
int32 ft = ct; int32 ft = ct;
uint32 linked_zone = get_fsx_zone_fromex_rule5(playerid); uint32 linked_zone = get_rule_zone_fromex(playerid, scard);
get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE); get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE);
for(auto cit = core.xmaterial_lst.begin(); cit != core.xmaterial_lst.end(); ++cit) { for(auto cit = core.xmaterial_lst.begin(); cit != core.xmaterial_lst.end(); ++cit) {
card* pcard = cit->second; card* pcard = cit->second;
......
...@@ -378,7 +378,7 @@ public: ...@@ -378,7 +378,7 @@ public:
int32 get_mzone_limit(uint8 playerid, uint8 uplayer, uint32 reason); int32 get_mzone_limit(uint8 playerid, uint8 uplayer, uint32 reason);
int32 get_szone_limit(uint8 playerid, uint8 uplayer, uint32 reason); int32 get_szone_limit(uint8 playerid, uint8 uplayer, uint32 reason);
uint32 get_linked_zone(int32 playerid); uint32 get_linked_zone(int32 playerid);
uint32 get_fsx_zone_fromex_rule5(int32 playerid); uint32 get_rule_zone_fromex(int32 playerid, card* pcard);
void get_linked_cards(uint8 self, uint8 s, uint8 o, card_set* cset); void get_linked_cards(uint8 self, uint8 s, uint8 o, card_set* cset);
int32 check_extra_link(int32 playerid); int32 check_extra_link(int32 playerid);
int32 check_extra_link(int32 playerid, card* pcard, int32 sequence); int32 check_extra_link(int32 playerid, card* pcard, int32 sequence);
......
...@@ -5167,7 +5167,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in ...@@ -5167,7 +5167,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
return FALSE; return FALSE;
} }
card_set linked_cards; card_set linked_cards;
uint32 linked_zone = get_zone_fromex_rule5(playerid); uint32 linked_zone = get_rule_zone_fromex(playerid, pcard);
get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE); get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE);
if(linked_cards.find(tuner) != linked_cards.end()) if(linked_cards.find(tuner) != linked_cards.end())
ct++; ct++;
...@@ -5395,7 +5395,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc ...@@ -5395,7 +5395,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
int32 ct = get_spsummonable_count(scard, playerid); int32 ct = get_spsummonable_count(scard, playerid);
card_set linked_cards; card_set linked_cards;
if(ct <= 0) { if(ct <= 0) {
uint32 linked_zone = get_zone_fromex_rule5(playerid); uint32 linked_zone = get_rule_zone_fromex(playerid, scard);
get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE); get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE);
} }
for(auto& pcard : core.operated_set) { for(auto& pcard : core.operated_set) {
...@@ -5480,7 +5480,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc ...@@ -5480,7 +5480,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
return FALSE; return FALSE;
} }
card_set linked_cards; card_set linked_cards;
uint32 linked_zone = get_zone_fromex_rule5(playerid); uint32 linked_zone = get_rule_zone_fromex(playerid, scard);
get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE); get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE);
int32 ft = ct + std::count_if(core.operated_set.begin(), core.operated_set.end(), int32 ft = ct + std::count_if(core.operated_set.begin(), core.operated_set.end(),
[=](card* pcard) { return linked_cards.find(pcard) != linked_cards.end(); }); [=](card* pcard) { return linked_cards.find(pcard) != linked_cards.end(); });
...@@ -5663,7 +5663,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc ...@@ -5663,7 +5663,7 @@ int32 field::select_xyz_material(int16 step, uint8 playerid, uint32 lv, card* sc
if(ct > 0) if(ct > 0)
return FALSE; return FALSE;
card_set linked_cards; card_set linked_cards;
uint32 linked_zone = get_zone_fromex_rule5(playerid); uint32 linked_zone = get_rule_zone_fromex(playerid, scard);
get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE); get_cards_in_zone(&linked_cards, linked_zone, playerid, LOCATION_MZONE);
int32 ft = ct + std::count_if(core.operated_set.begin(), core.operated_set.end(), int32 ft = ct + std::count_if(core.operated_set.begin(), core.operated_set.end(),
[=](card* pcard) { return linked_cards.find(pcard) != linked_cards.end(); }); [=](card* pcard) { return linked_cards.find(pcard) != linked_cards.end(); });
......
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