Commit ed4e08c0 authored by mercury233's avatar mercury233 Committed by nanahira

fix select monster and spell zone at same time

parent 04681fcc
......@@ -3994,7 +3994,7 @@ public class Ocgcore : ServantWithCardDescription
min = r.ReadByte();
//TODO: can cancel
if (min == 0) min = 1;
int _field = ~r.ReadInt32();
uint _field = ~r.ReadUInt32();
if (Program.I().setting.setting.hand.value == true || Program.I().setting.setting.handm.value == true)
{
......@@ -4002,34 +4002,13 @@ public class Ocgcore : ServantWithCardDescription
for (int i = 0; i < min; i++)
{
byte[] resp = new byte[3];
bool pendulumZone = false;
int filter;
uint filter;
/*if ((field & 0x7f0000) != 0)
{
resp[0] = (byte)(1 - player);
resp[1] = 0x4;
filter = (field >> 16) & 0x7f;
}
else if ((field & 0x1f000000) != 0)
{
resp[0] = (byte)(1 - player);
resp[1] = 0x8;
filter = (field >> 24) & 0x1f;
}
else if ((field & 0xc0000000) != 0)
{
resp[0] = (byte)(1 - player);
resp[1] = 0x8;
filter = (field >> 30) & 0x3;
pendulumZone = true;
}*/
for (int j=0; j<2; j++)
{
resp = new byte[3];
pendulumZone = false;
filter = 0;
int field;
uint field;
if (j==0)
{
......@@ -4044,67 +4023,34 @@ public class Ocgcore : ServantWithCardDescription
if ((field & 0x7f) != 0)
{
resp[1] = 0x4;
resp[1] = (byte)CardLocation.MonsterZone;
filter = field & 0x7f;
}
else if ((field & 0x1f00) != 0)
for (int k = 0; k < 6; k++)
{
resp[1] = 0x8;
filter = (field >> 8) & 0x1f;
}
else if ((field & 0xc000) != 0)
if ((filter & (1u << k)) != 0)
{
resp[1] = 0x8;
filter = (field >> 14) & 0x3;
pendulumZone = true;
}
if (filter == 0)
continue;
if (!pendulumZone)
{
if ((filter & 0x4) != 0)
{
resp[2] = 2;
resp[2] = (byte)k;
createPlaceSelector(resp);
}
if ((filter & 0x2) != 0)
{
resp[2] = 1;
createPlaceSelector(resp);
}
if ((filter & 0x8) != 0)
{
resp[2] = 3;
createPlaceSelector(resp);
}
if ((filter & 0x1) != 0)
if ((field & 0x1f00) != 0)
{
resp[2] = 0;
createPlaceSelector(resp);
}
if ((filter & 0x10) != 0)
{
resp[2] = 4;
createPlaceSelector(resp);
}
if (resp[1] == 0x4)
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 8) & 0x1f;
for (int k = 0; k < 5; k++)
{
if ((filter & 0x20) != 0)
if ((filter & (1u << k)) != 0)
{
resp[2] = 5;
createPlaceSelector(resp);
}
if ((filter & 0x40) != 0)
{
resp[2] = 6;
resp[2] = (byte)k;
createPlaceSelector(resp);
}
}
}
else
if ((field & 0xc000) != 0)
{
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 14) & 0x3;
if ((filter & 0x2) != 0)
{
resp[2] = 7;
......@@ -4116,7 +4062,6 @@ public class Ocgcore : ServantWithCardDescription
createPlaceSelector(resp);
}
}
}
}
......@@ -4134,48 +4079,48 @@ public class Ocgcore : ServantWithCardDescription
}
else
{
int field = _field;
uint field = _field;
for (int i = 0; i < min; i++)
{
byte[] resp = new byte[3];
bool pendulumZone = false;
int filter;
uint filter;
if ((field & 0x7f0000) != 0)
{
resp[0] = (byte)(1 - player);
resp[1] = 0x4;
resp[1] = (byte)CardLocation.MonsterZone;
filter = (field >> 16) & 0x7f;
}
else if ((field & 0x1f000000) != 0)
{
resp[0] = (byte)(1 - player);
resp[1] = 0x8;
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 24) & 0x1f;
}
else if ((field & 0xc0000000) != 0)
{
resp[0] = (byte)(1 - player);
resp[1] = 0x8;
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 30) & 0x3;
pendulumZone = true;
}
else if ((field & 0x7f) != 0)
{
resp[0] = (byte)player;
resp[1] = 0x4;
resp[1] = (byte)CardLocation.MonsterZone;
filter = field & 0x7f;
}
else if ((field & 0x1f00) != 0)
{
resp[0] = (byte)player;
resp[1] = 0x8;
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 8) & 0x1f;
}
else
{
resp[0] = (byte)player;
resp[1] = 0x8;
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 14) & 0x3;
pendulumZone = true;
}
......@@ -4189,7 +4134,7 @@ public class Ocgcore : ServantWithCardDescription
else if ((filter & 0x10) != 0) resp[2] = 4;
else
{
if (resp[1] == 0x4)
if (resp[1] == (byte)CardLocation.MonsterZone)
{
if ((filter & 0x20) != 0) resp[2] = 5;
else if ((filter & 0x40) != 0) resp[2] = 6;
......
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