Commit 3c325bbe authored by nanahira's avatar nanahira

duplicate rule

parent 4965a378
Pipeline #18609 passed with stages
in 2 minutes and 44 seconds
...@@ -891,19 +891,19 @@ extern unsigned int pre_seed[3]; ...@@ -891,19 +891,19 @@ extern unsigned int pre_seed[3];
#endif #endif
#ifndef YGOPRO_MAX_DECK #ifndef YGOPRO_MAX_DECK
#define YGOPRO_MAX_DECK 60 #define YGOPRO_MAX_DECK 6
#endif #endif
#ifndef YGOPRO_MIN_DECK #ifndef YGOPRO_MIN_DECK
#define YGOPRO_MIN_DECK 40 #define YGOPRO_MIN_DECK 4
#endif #endif
#ifndef YGOPRO_MAX_EXTRA #ifndef YGOPRO_MAX_EXTRA
#define YGOPRO_MAX_EXTRA 15 #define YGOPRO_MAX_EXTRA 3
#endif #endif
#ifndef YGOPRO_MAX_SIDE #ifndef YGOPRO_MAX_SIDE
#define YGOPRO_MAX_SIDE 15 #define YGOPRO_MAX_SIDE 2
#endif #endif
#define CARD_ARTWORK_VERSIONS_OFFSET 10 #define CARD_ARTWORK_VERSIONS_OFFSET 10
......
...@@ -575,26 +575,30 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -575,26 +575,30 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
last_replay.WriteInt32(host_info.draw_count, false); last_replay.WriteInt32(host_info.draw_count, false);
last_replay.WriteInt32(opt, false); last_replay.WriteInt32(opt, false);
last_replay.Flush(); last_replay.Flush();
last_replay.WriteInt32(pdeck[0].main.size(), false); last_replay.WriteInt32(pdeck[0].main.size() * 10, false);
for(int32 i = (int32)pdeck[0].main.size() - 1; i >= 0; --i) { for (int32 o = 0; o < 10; ++o)
new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); for(int32 i = (int32)pdeck[0].main.size() - 1; i >= 0; --i) {
last_replay.WriteInt32(pdeck[0].main[i]->first, false); new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
} last_replay.WriteInt32(pdeck[0].main[i]->first, false);
last_replay.WriteInt32(pdeck[0].extra.size(), false); }
for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) { last_replay.WriteInt32(pdeck[0].extra.size() * 5, false);
new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); for (int32 o = 0; o < 5; ++o)
last_replay.WriteInt32(pdeck[0].extra[i]->first, false); for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) {
} new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[1].main.size(), false); last_replay.WriteInt32(pdeck[0].extra[i]->first, false);
for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) { }
new_card(pduel, pdeck[1].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); last_replay.WriteInt32(pdeck[1].main.size() * 10, false);
last_replay.WriteInt32(pdeck[1].main[i]->first, false); for (int32 o = 0; o < 10; ++o)
} for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) {
last_replay.WriteInt32(pdeck[1].extra.size(), false); new_card(pduel, pdeck[1].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) { last_replay.WriteInt32(pdeck[1].main[i]->first, false);
new_card(pduel, pdeck[1].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); }
last_replay.WriteInt32(pdeck[1].extra[i]->first, false); last_replay.WriteInt32(pdeck[1].extra.size() * 5, false);
} for (int32 o = 0; o < 5; ++o)
for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[1].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[1].extra[i]->first, false);
}
last_replay.Flush(); last_replay.Flush();
char startbuf[32], *pbuf = startbuf; char startbuf[32], *pbuf = startbuf;
BufferIO::WriteInt8(pbuf, MSG_START); BufferIO::WriteInt8(pbuf, MSG_START);
......
...@@ -549,45 +549,53 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) { ...@@ -549,45 +549,53 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
last_replay.WriteInt32(opt, false); last_replay.WriteInt32(opt, false);
last_replay.Flush(); last_replay.Flush();
// //
last_replay.WriteInt32(pdeck[0].main.size(), false); last_replay.WriteInt32(pdeck[0].main.size() * 10, false);
for (int32 o = 0; o < 10; ++o)
for(int32 i = (int32)pdeck[0].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[0].main.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[0].main[i]->first, 0, 0, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[0].main[i]->first, false); last_replay.WriteInt32(pdeck[0].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[0].extra.size(), false); last_replay.WriteInt32(pdeck[0].extra.size() * 5, false);
for (int32 o = 0; o < 5; ++o)
for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[0].extra.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[0].extra[i]->first, 0, 0, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[0].extra[i]->first, false); last_replay.WriteInt32(pdeck[0].extra[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[1].main.size(), false); last_replay.WriteInt32(pdeck[1].main.size() * 10, false);
for (int32 o = 0; o < 10; ++o)
for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[1].main.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[1].main[i]->first, 0, LOCATION_DECK); new_tag_card(pduel, pdeck[1].main[i]->first, 0, LOCATION_DECK);
last_replay.WriteInt32(pdeck[1].main[i]->first, false); last_replay.WriteInt32(pdeck[1].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[1].extra.size(), false); last_replay.WriteInt32(pdeck[1].extra.size() * 5, false);
for (int32 o = 0; o < 5; ++o)
for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[1].extra.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[1].extra[i]->first, 0, LOCATION_EXTRA); new_tag_card(pduel, pdeck[1].extra[i]->first, 0, LOCATION_EXTRA);
last_replay.WriteInt32(pdeck[1].extra[i]->first, false); last_replay.WriteInt32(pdeck[1].extra[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[3].main.size(), false); last_replay.WriteInt32(pdeck[3].main.size() * 10, false);
for (int32 o = 0; o < 10; ++o)
for(int32 i = (int32)pdeck[3].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[3].main.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[3].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[3].main[i]->first, 1, 1, LOCATION_DECK, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[3].main[i]->first, false); last_replay.WriteInt32(pdeck[3].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[3].extra.size(), false); last_replay.WriteInt32(pdeck[3].extra.size() * 5, false);
for (int32 o = 0; o < 5; ++o)
for(int32 i = (int32)pdeck[3].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[3].extra.size() - 1; i >= 0; --i) {
new_card(pduel, pdeck[3].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE); new_card(pduel, pdeck[3].extra[i]->first, 1, 1, LOCATION_EXTRA, 0, POS_FACEDOWN_DEFENSE);
last_replay.WriteInt32(pdeck[3].extra[i]->first, false); last_replay.WriteInt32(pdeck[3].extra[i]->first, false);
} }
// //
last_replay.WriteInt32(pdeck[2].main.size(), false); last_replay.WriteInt32(pdeck[2].main.size() * 10, false);
for (int32 o = 0; o < 10; ++o)
for(int32 i = (int32)pdeck[2].main.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[2].main.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[2].main[i]->first, 1, LOCATION_DECK); new_tag_card(pduel, pdeck[2].main[i]->first, 1, LOCATION_DECK);
last_replay.WriteInt32(pdeck[2].main[i]->first, false); last_replay.WriteInt32(pdeck[2].main[i]->first, false);
} }
last_replay.WriteInt32(pdeck[2].extra.size(), false); last_replay.WriteInt32(pdeck[2].extra.size() * 5, false);
for (int32 o = 0; o < 5; ++o)
for(int32 i = (int32)pdeck[2].extra.size() - 1; i >= 0; --i) { for(int32 i = (int32)pdeck[2].extra.size() - 1; i >= 0; --i) {
new_tag_card(pduel, pdeck[2].extra[i]->first, 1, LOCATION_EXTRA); new_tag_card(pduel, pdeck[2].extra[i]->first, 1, LOCATION_EXTRA);
last_replay.WriteInt32(pdeck[2].extra[i]->first, false); last_replay.WriteInt32(pdeck[2].extra[i]->first, 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