Exemplo n.º 1
0
        public async Task Scouter(IUser user)
        {
            var JEmb = new JEmbed();

            JEmb.Author.Name = $"{user.Username}'s Power Level";
            JEmb.ColorStripe = Funcs.GetColour(user, Context.Guild);
            JEmb.Description = Convert.ToString(DBFuncs.GetPowerLVL(user));

            await Context.Channel.SendMessageAsync("", embed : JEmb.Build());
        }
Exemplo n.º 2
0
        public async Task Attack(IUser user)
        {
            DBUser attacker = DBFuncs.FindDBUser(Context.User);
            DBUser target   = DBFuncs.FindDBUser(user);

            if (target.Location == Context.Channel.Id)
            {
                await Context.Channel.SendMessageAsync($"{Context.User.Mention} attacks {user.Mention} with a power of {DBFuncs.GetPowerLVL(Context.User)}.");

                await target.Hurt(Context.Channel, DBFuncs.GetPowerLVL(Context.User));
            }
            else
            {
                await Context.Channel.SendMessageAsync("That person is not here.");
            }
        }
Exemplo n.º 3
0
        public async Task Train()
        {
            List <DBNPC>  inLocation = new List <DBNPC>();
            List <DBUser> here       = new List <DBUser>();

            foreach (DBNPC npc in NPCList.NPCs)
            {
                if (Context.Channel.Id == npc.Location)
                {
                    inLocation.Add(npc);
                }
            }

            foreach (DBUser user in Bot.sess.Players)
            {
                string location = DBFuncs.GetAttribute("LOCATION", user.User);
                if (location != "null")
                {
                    if (Context.Channel.Id == Convert.ToUInt64(location) && user.User.Id != Context.User.Id)
                    {
                        here.Add(user);
                    }
                }
            }

            var JEmb = new JEmbed();

            JEmb.Description = "People in area:";

            if (inLocation.Count > 0 || here.Count > 0)
            {
                foreach (DBNPC npc in inLocation)
                {
                    JEmb.Fields.Add(new JEmbedField(x =>
                    {
                        x.Header = npc.Name + " [NPC]";
                        x.Text   = $"Power Level: ~{npc.Power_Level}";
                    }));
                }

                foreach (DBUser user in here)
                {
                    JEmb.Fields.Add(new JEmbedField(x =>
                    {
                        x.Header = user.User.Username + " [PLAYER]";
                        x.Text   = $"Power Level: ~{DBFuncs.GetPowerLVL(user.User)}";
                    }));
                }

                JEmb.ColorStripe = Funcs.GetColour(Context.User, Context.Guild);
                JEmb.Footer.Text = "Type 'db!train [name]' to request to train with them!";
            }
            else
            {
                JEmb.Fields.Add(new JEmbedField(x =>
                {
                    x.Header = "None";
                    x.Text   = "There seems to be no one here.. Check another area.";
                }));
            }

            await Context.Channel.SendMessageAsync("", embed : JEmb.Build());
        }