private void HandleGameFightTurnEndMessage(IAccount account, GameFightTurnEndMessage message) { Account.Character.Status = CharacterStatus.Fighting; lock (CheckLock) { if (message.ObjectId == Account.Character.Id) { var num4 = 0; var list = new List <int>(); IsFighterTurn = false; TotalLaunchBySpell.Clear(); TotalLaunchByCellBySpell.Clear(); for (var i = 0; i < DurationByEffect.Keys.Count; i++) { var durationPerEffect = DurationByEffect; num4 = DurationByEffect.Keys.ElementAtOrDefault(i); durationPerEffect[num4] = durationPerEffect[num4] - 1; if (DurationByEffect[DurationByEffect.Keys.ElementAtOrDefault(i)] <= 0) { list.Add(DurationByEffect.Keys.ElementAtOrDefault(i)); } } while (list.Count > 0) { DurationByEffect.Remove(list[0]); list.RemoveAt(0); } for (var i = 0; i < LastTurnLaunchBySpell.Keys.Count; i++) { var dictionary = LastTurnLaunchBySpell; num4 = LastTurnLaunchBySpell.Keys.ElementAtOrDefault(i); dictionary[num4] = dictionary[num4] - 1; if (LastTurnLaunchBySpell[LastTurnLaunchBySpell.Keys.ElementAtOrDefault(i)] <= 0) { list.Add(LastTurnLaunchBySpell.Keys.ElementAtOrDefault(i)); } } while (list.Count > 0) { LastTurnLaunchBySpell.Remove(list[0]); list.RemoveAt(0); } } } var fighter = (Fighter)GetFighter(message.ObjectId); if (fighter == null) { return; } fighter.ActionPoints = fighter.Stats.MaxActionPoints; fighter.MovementPoints = fighter.Stats.MaxMovementPoints; }
private void HandleGameFightJoinMessage(IAccount account, GameFightJoinMessage message) { lock (CheckLock) { Fighters.Clear(); Options.Clear(); TotalLaunchBySpell.Clear(); LastTurnLaunchBySpell.Clear(); TotalLaunchByCellBySpell.Clear(); DurationByEffect.Clear(); IsFightStarted = message.IsFightStarted; WaitForReady = !message.IsFightStarted && message.CanSayReady; } }
private void HandleGameFightEndMessage(IAccount account, GameFightEndMessage message) { Fighters.Clear(); Options.Clear(); TotalLaunchBySpell.Clear(); LastTurnLaunchBySpell.Clear(); TotalLaunchByCellBySpell.Clear(); DurationByEffect.Clear(); WaitForReady = false; IsFighterTurn = false; IsFightStarted = false; FightEnded?.Invoke(message); Account.Character.Status = CharacterStatus.None; }