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