Пример #1
0
        public async Task BeginEncounter(CommandContext c)
        {
            await c.TriggerTypingAsync();

            string encounterId;
            var    canSpawn = EncounterManager.TrySpawnEncounterForUser(c.Member, out encounterId);

            if (!canSpawn)
            {
                if (encounterId != null)
                {
                    await c.RespondAsync(embed : DiscordEmbedUtils.MakeEmbed(text: $"You're already in the encounter **{EncounterManager.GetEncounter( encounterId ).title}**! Get back there!", author: c.Member));
                }
                else
                {
                    await c.RespondAsync(embed : DiscordEmbedUtils.MakeEmbed(text: $"You searched but nothing interesting seems to be happening at the moment...", author: c.Member));
                }
            }
            else
            {
                if (encounterId != null)
                {
                    await EncounterManager.SpawnEncounter(c.Channel, c.User, encounterId);
                }
                else
                {
                    await c.RespondAsync(embed : DiscordEmbedUtils.MakeEmbed(text: $"You searched but nothing interesting seems to be happening at the moment...", author: c.Member));
                }
            }
        }
Пример #2
0
        internal void Execute(DiscordChannel channel, DiscordUser user)
        {
            if (encounterId != null)
            {
                EncounterManager.SpawnEncounter(channel, user, encounterId);
                return;
            }

            if (loot != null)
            {
                ExperienceManager.GiveExpAndNotifyAsync(channel, user, loot.experience);
            }
        }
Пример #3
0
        public async Task BeginEncounter(CommandContext c)
        {
            await c.TriggerTypingAsync();

            var encounter = EncounterManager.TrySpawnEncounterForUser(c.Member);

            if (encounter != null)
            {
                await EncounterManager.SpawnEncounter(c.Channel, c.User, encounter);
            }
            else
            {
                await c.RespondAsync(embed : DiscordEmbedUtils.MakeEmbed(text: $"**{c.Member.DisplayName}** searched but nothing interesting seems to be happening at the moment..."));
            }
        }
Пример #4
0
        internal void Execute(DiscordChannel channel, DiscordUser user)
        {
            if (encounter != null)
            {
                EncounterManager.SpawnEncounter(channel, user, encounter);
                return;
            }

            var resTitle = title;
            var resText  = text;

            if (loot != null)
            {
                ExperienceManager.GiveExpAsync(channel, user, loot.experience);

                if (resTitle == null)
                {
                    resTitle = "Loot Get!";
                }
                resText = string.Format("{0}\n{1}", resText, $"You gained {loot.experience} experience from this encounter.");
            }

            channel.SendMessageAsync(embed: DiscordEmbedUtils.MakeEmbed(showTitle ? resTitle : null, resText, author: user));
        }