public static void HandleSwapPositions(GameFightPlacementSwapPositionsRequestMessage message, WorldClient client) { var requested = client.Character.FighterInstance.Fight.GetFighter(message.requestedId); if (requested != null) { requested.SwapPosition(client.Character.FighterInstance); } }
public static void HandleGameFightPlacementSwapPositionsRequest(GameFightPlacementSwapPositionsRequestMessage message, WorldClient client) { if (client.Character.Fighting && !client.Character.FighterMaster.IsReady && !client.Character.FighterMaster.Fight.Started) { var target = client.Character.FighterMaster.Fight.GetFighter((int)message.requestedId); if (target.CellId == message.cellId) { target.PlacementSwap(client.Character.FighterMaster); } } }
public static void HandleSwapPositions(GameFightPlacementSwapPositionsRequestMessage message, WorldClient client) { var requested = client.Character.FighterInstance.Fight.GetFighter(message.requestedId); if (requested != null) { requested.SwapPosition(client.Character.FighterInstance); } }
public static void HandleGameFightPlacementSwapPositionsRequestMessage(WorldClient client, GameFightPlacementSwapPositionsRequestMessage message) { if (!client.Character.IsFighting()) { return; } if (client.Character.Fighter.Position.Cell.Id != message.cellId) { var cell = client.Character.Fight.Map.Cells[message.cellId]; var target = client.Character.Fighter.Team.GetOneFighter(cell) as CharacterFighter; if (target == null) { return; } if (client.Character.Fighter.IsTeamLeader()) { client.Character.Fighter.SwapPrePlacement(target); } else { var swapRequest = new SwapRequest(client.Character, target.Character); swapRequest.Open(); } } }