Commit 0a10e115 authored by mercury233's avatar mercury233

update OnSelectPlace, fix hint for SelectUnselect

parent edd7f02f
......@@ -2815,15 +2815,15 @@ namespace WindBot.Game.AI.Decks
return 0;
}
public override int OnSelectPlace(int cardId, int player, int location, int available)
public override int OnSelectPlace(int cardId, int player, CardLocation location, int available)
{
if (player == 0)
{
if (location == (int)CardLocation.SpellZone)
if (location == CardLocation.SpellZone)
{
// unfinished
}
else if (location == (int)CardLocation.MonsterZone)
else if (location == CardLocation.MonsterZone)
{
if(cardId == CardId.Linkuriboh)
{
......
......@@ -170,7 +170,7 @@ namespace WindBot.Game.AI
return -1;
}
public virtual int OnSelectPlace(int cardId, int player, int location, int available)
public virtual int OnSelectPlace(int cardId, int player, CardLocation location, int available)
{
// For overriding
return 0;
......
......@@ -479,7 +479,7 @@ namespace WindBot.Game
return 0; // Always select the first option.
}
public int OnSelectPlace(int cardId, int player, int location, int available)
public int OnSelectPlace(int cardId, int player, CardLocation location, int available)
{
int selector_selected = m_place;
m_place = 0;
......
......@@ -506,6 +506,7 @@ namespace WindBot.Game
_duel.Fields[1].BattlingMonster = null;
_duel.Fields[0].UnderAttack = false;
_duel.Fields[1].UnderAttack = false;
_select_hint = 0;
_ai.OnNewPhase();
}
......@@ -982,7 +983,6 @@ namespace WindBot.Game
}
IList<ClientCard> selected = func(cards, (finishable ? 0 : 1), 1, _select_hint, cancelable);
_select_hint = 0;
if (selected.Count == 0 && cancelable)
{
......@@ -1210,48 +1210,44 @@ namespace WindBot.Game
packet.ReadByte(); // min
int field = ~packet.ReadInt32();
const int LOCATION_MZONE = 0x4;
const int LOCATION_SZONE = 0x8;
const int LOCATION_PZONE = 0x200;
int player;
int location;
CardLocation location;
int filter;
if ((field & 0x7f) != 0)
{
player = 0;
location = LOCATION_MZONE;
location = CardLocation.MonsterZone;
filter = field & Zones.MonsterZones;
}
else if ((field & 0x1f00) != 0)
{
player = 0;
location = LOCATION_SZONE;
location = CardLocation.SpellZone;
filter = (field >> 8) & Zones.SpellZones;
}
else if ((field & 0xc000) != 0)
{
player = 0;
location = LOCATION_PZONE;
location = CardLocation.PendulumZone;
filter = (field >> 14) & Zones.PendulumZones;
}
else if ((field & 0x7f0000) != 0)
{
player = 1;
location = LOCATION_MZONE;
location = CardLocation.MonsterZone;
filter = (field >> 16) & Zones.MonsterZones;
}
else if ((field & 0x1f000000) != 0)
{
player = 1;
location = LOCATION_SZONE;
location = CardLocation.SpellZone;
filter = (field >> 24) & Zones.SpellZones;
}
else
{
player = 1;
location = LOCATION_PZONE;
location = CardLocation.PendulumZone;
filter = (field >> 30) & Zones.PendulumZones;
}
......@@ -1261,7 +1257,7 @@ namespace WindBot.Game
byte[] resp = new byte[3];
resp[0] = (byte)GetLocalPlayer(player);
if (location != LOCATION_PZONE)
if (location != CardLocation.PendulumZone)
{
resp[1] = (byte)location;
if ((selected & filter) > 0)
......@@ -1277,7 +1273,7 @@ namespace WindBot.Game
}
else
{
resp[1] = (byte)LOCATION_SZONE;
resp[1] = (byte)CardLocation.SpellZone;
if ((selected & filter) > 0)
filter &= selected;
......
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