Exemple #1
0
        public MoveLogBox MoveTo(string destination, string direction = null)
        {
            var currentLocation = LocationsStatics.LocationList.GetLocation.First(l => l.dbName == this.Location);
            var nextLocation    = LocationsStatics.LocationList.GetLocation.First(l => l.dbName == destination);

            var leavingMessage  = this.GetFullName() + " left toward " + nextLocation.Name;
            var enteringMessage = this.GetFullName() + " entered from " + currentLocation.Name;

            var playerLog = direction == null ? $"You moved from <b>{currentLocation.Name}</b> to <b>{nextLocation.Name}</b>." : $"You moved <b>{direction}</b>.";

            var sneakLevel = this.CalculateSneakLevel();

            if (sneakLevel > 0)
            {
                playerLog += $" (Concealment lvl <b>{sneakLevel}</b>)";
            }

            this.Location = destination;
            AddLog(playerLog, false);
            var movementCost = PvPStatics.LocationMoveCost - MoveActionPointDiscount;

            if (movementCost > 0)
            {
                this.ActionPoints -= movementCost;
            }
            this.User.AddStat(StatsProcedures.Stat__TimesMoved, 1);
            this.LastActionTimestamp = DateTime.UtcNow;

            // set location of all owned items/pets to this to blank so they don't appear on the ground
            foreach (var item in this.Items)
            {
                item.SetLocation(String.Empty);
            }

            var logBox = new MoveLogBox();

            logBox.SourceLocationLog      = leavingMessage;
            logBox.DestinationLocationLog = enteringMessage;
            logBox.PlayerLog        = playerLog;
            logBox.ConcealmentLevel = sneakLevel;
            return(logBox);
        }
Exemple #2
0
        public MoveLogBox MoveToAsAnimal(string destination)
        {
            var currentLocation = LocationsStatics.LocationList.GetLocation.First(l => l.dbName == this.Location);
            var nextLocation    = LocationsStatics.LocationList.GetLocation.First(l => l.dbName == destination);

            this.Location = nextLocation.dbName;
            this.Item.SetLocation(nextLocation.dbName);

            var leavingMessage  = this.GetFullName() + " (feral) left toward " + nextLocation.Name;
            var enteringMessage = this.GetFullName() + " (feral) entered from " + currentLocation.Name;

            var playerLog = $"You moved from <b>{currentLocation.Name}</b> to <b>{nextLocation.Name}</b>.";

            AddLog(playerLog, false);
            this.User.AddStat(StatsProcedures.Stat__TimesMoved, 1);
            this.LastActionTimestamp = DateTime.UtcNow;

            var logBox = new MoveLogBox();

            logBox.SourceLocationLog      = leavingMessage;
            logBox.DestinationLocationLog = enteringMessage;
            logBox.PlayerLog = playerLog;
            return(logBox);
        }