Beispiel #1
0
        public void Update(FighterStatsListMessage message)
        {
            PlayedFighter?.Update(message.Stats);

            if (PlayedFighter != null)
            {
                _account.Game.Character.Stats.MaxLifePoints = (uint)PlayedFighter?.MaxLifePoints;
                _account.Game.Character.Stats.LifePoints    = (uint)PlayedFighter?.LifePoints;
            }

            FighterStatsUpdated?.Invoke();
        }
Beispiel #2
0
        public static void HandleGameActionFightNoSpellCastMessage(Bot bot, GameActionFightNoSpellCastMessage message)
        {
            if (bot == null || bot.Character == null || bot.Character.Fight == null)
            {
                logger.Error("Fight is not properly initialized.");
                return; // Can't handle the message
            }
            PlayedFighter fighter = bot.Character.Fighter;

            if (fighter != null)
            {
                fighter.Update(message);
            }
        }
Beispiel #3
0
        public void Update(GameActionFightDispellableEffectMessage message)
        {
            if (message.Effect is FightTemporaryBoostStateEffect ftbse)
            {
                if (ftbse.TargetId == PlayedFighter?.ContextualId)
                {
                    if (_effectsDurations.ContainsKey(ftbse.StateId))
                    {
                        _effectsDurations.Remove(ftbse.StateId);
                    }

                    //_account.Logger.LogWarning("", $"Added state{ftbse.StateId} for {ftbse.TurnDuration} turns.");
                    _effectsDurations.Add(ftbse.StateId, ftbse.TurnDuration);
                }
            }
            else if (message.Effect is FightTemporaryBoostEffect ftbe)
            {
                if (ftbe.TargetId == PlayedFighter?.ContextualId)
                {
                    PlayedFighter.Update(message.ActionId, ftbe);
                }
            }
        }