Commit 33cad6e7 authored by mercury233's avatar mercury233

fix select monster and spell zone at same time

parent e30e62d2
......@@ -3971,7 +3971,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)
{
......@@ -3979,34 +3979,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)
{
......@@ -4021,67 +4000,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)
{
resp[1] = 0x8;
filter = (field >> 8) & 0x1f;
}
else if ((field & 0xc000) != 0)
{
resp[1] = 0x8;
filter = (field >> 14) & 0x3;
pendulumZone = true;
}
if (filter == 0)
continue;
if (!pendulumZone)
{
if ((filter & 0x4) != 0)
{
resp[2] = 2;
createPlaceSelector(resp);
}
if ((filter & 0x2) != 0)
{
resp[2] = 1;
createPlaceSelector(resp);
}
if ((filter & 0x8) != 0)
for (int k = 0; k < 6; k++)
{
resp[2] = 3;
createPlaceSelector(resp);
}
if ((filter & 0x1) != 0)
{
resp[2] = 0;
createPlaceSelector(resp);
}
if ((filter & 0x10) != 0)
{
resp[2] = 4;
createPlaceSelector(resp);
}
if (resp[1] == 0x4)
{
if ((filter & 0x20) != 0)
if ((filter & (1u << k)) != 0)
{
resp[2] = 5;
resp[2] = (byte)k;
createPlaceSelector(resp);
}
if ((filter & 0x40) != 0)
}
}
if ((field & 0x1f00) != 0)
{
resp[1] = (byte)CardLocation.SpellZone;
filter = (field >> 8) & 0x1f;
for (int k = 0; k < 5; k++)
{
if ((filter & (1u << k)) != 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;
......@@ -4093,7 +4039,6 @@ public class Ocgcore : ServantWithCardDescription
createPlaceSelector(resp);
}
}
}
}
......@@ -4111,48 +4056,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;
}
......@@ -4166,7 +4111,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