public static string TeleportToDungeon(Player player, int meanness, Random rand = null)
        {
            if (!PlayerProcedures.CheckAllowedInDungeon(player, out _))
            {
                return(null);
            }

            var lastAttackTimeAgo = Math.Abs(DateTime.UtcNow.Subtract(player.GetLastCombatTimestamp()).TotalMinutes);

            if (lastAttackTimeAgo < TurnTimesStatics.GetMinutesSinceLastCombatBeforeQuestingOrDuelling())
            {
                return(null);
            }

            var location = LocationsStatics.GetRandomLocation_InDungeon();

            rand = rand ?? new Random();

            if (!Teleport(player, location, rand.Next(2) == 0))
            {
                return(null);
            }

            if (meanness % 2 == 1)
            {
                ResetCombatTimer(player);
            }

            if (meanness >= 2)
            {
                CharacterPrankProcedures.GiveEffect(player, JokeShopProcedures.ROOT_EFFECT);
            }

            return("You feel the room start to shake and shimmer, parts of the shop fading away as it is pulled between realms.  The shelves rattle ever more violently and you try and take shelter under the counter.  But the shop has other ideas and the floor gives way, leaving you tumbling through the air just as the store flickers out of this plane.  That's the last thing you remember.  Nursing a headache, with a bleary blink of your eyes your surroundings slowly come into focus.  You've landed in the deepest depths of the dungeon!");
        }
        public static string TeleportToBar(Player player, bool root, Random rand = null)
        {
            // Not all getaways can be clean..
            string bar = "tavern_counter";

            rand = rand ?? new Random();

            if (!Teleport(player, bar, true))
            {
                return(null);
            }

            if (root)
            {
                CharacterPrankProcedures.GiveEffect(player, JokeShopProcedures.ROOT_EFFECT);
            }
            else
            {
                CharacterPrankProcedures.ApplyLocalCurse(player, bar, rand);
            }

            return("You've been looking around the shop for a while now and are starting to get thirsty.  Something within the shop knows it too, and very quickly you find yourself in the bar!");
        }
        public static string TeleportToOverworld(Player player, bool root, bool curse, Random rand = null)
        {
            rand = rand ?? new Random();
            var location = LocationsStatics.GetRandomLocationNotInDungeonOr(LocationsStatics.JOKE_SHOP);

            if (!Teleport(player, location, rand.Next(2) == 0))
            {
                return(null);
            }

            if (root)
            {
                CharacterPrankProcedures.GiveEffect(player, JokeShopProcedures.ROOT_EFFECT);
                root = EffectProcedures.PlayerHasActiveEffect(player.Id, JokeShopProcedures.ROOT_EFFECT);
            }

            if (curse && !root)
            {
                CharacterPrankProcedures.ApplyLocalCurse(player, location, rand);
            }

            return($"All of a sudden the Joke Shop spits you out and you find yourself in {LocationsStatics.GetConnectionName(location)}!");
        }
 private static string GiveEffect(Player victim, JokeShopActionViewModel input, int effectSourceId)
 {
     return(CharacterPrankProcedures.GiveEffect(victim, effectSourceId, duration: input.EffectDuration, cooldown: input.EffectCooldown));
 }