Ejemplo n.º 1
0
        public bool Run(params object[] args)
        {
            NWPlayer player = NWPlayer.Wrap(_.GetFirstPC());

            while (player.IsValid)
            {
                if (!player.IsDM)
                {
                    _effectTracker.ProcessPCEffects(player);

                    PlayerCharacter entity = _db.PlayerCharacters.SingleOrDefault(x => x.PlayerID == player.GlobalID);

                    if (entity != null)
                    {
                        _food.RunHungerCycle(player, entity);
                        HandleRegenerationTick(player, entity);
                        HandleManaRegenerationTick(player, entity);

                        _db.SaveChanges();
                    }
                }

                player = NWPlayer.Wrap(_.GetNextPC());
            }

            SaveCharacters();
            _customEffect.OnModuleHeartbeat();

            _item.OnModuleHeartbeat();

            return(true);
        }