Example #1
0
        static void Main(string[] args)
        {
            // Init Mage Gandalf
            Magus gandalf = new Magus(5);

            gandalf.Attack();
            gandalf.CastASpell();
            gandalf.Fly();

            // Init Sorcier Saroumane
            Wizard saroumane = new Wizard(6);

            saroumane.Attack();
            saroumane.CastASpell();

            // Init Sorcier Radagast
            Wizard radagast = new Wizard(5);

            radagast.Attack();
            radagast.CastASpell();

            // Init Chevelier Aragorn
            Knight aragorn = new Knight(3);

            aragorn.Attack();

            List <Character> characters = new List <Character>();

            characters.Add(gandalf);
            characters.Add(saroumane);
            characters.Add(aragorn);

            foreach (Character character in characters)
            {
                character.Attack();
            }

            Console.WriteLine("///// CREATION DE GUILDE /////");
            Guild <Wizard> wizardGuild = new Guild <Wizard>();

            wizardGuild.Add(saroumane);
            wizardGuild.Add(radagast);

            Console.WriteLine("///// ATTAQUE MASSIVE DE LA GUILDE DES SORCIERS /////");
            wizardGuild.MassiveAttack();
            Console.WriteLine("///// FIN ATTAQUE MASSIVE DE LA GUILDE DES SORCIERS /////");


            Console.ReadKey();
        }
Example #2
0
        public async Task OnGuildJoin(SocketGuild guild)
        {
            if (!Guild.Exists(guild))
            {
                Guild.Add(guild);
            }
            EmbedAuthorBuilder author = new EmbedAuthorBuilder()
            {
                Name    = guild.Name,
                IconUrl = guild.IconUrl
            };
            EmbedBuilder embed = new EmbedBuilder()
            {
                Author = author,
                Color  = new Color(0, 255, 0),
            };

            embed.Description = $"Hi I'm Fred the G. Cactus. Thank you for adding me to this server.\n" +
                                $"For a list of commands type /help.\n" +
                                $"**Note:** Keep in mind the music commands and some of the moderation commands can only be done in the offical server for the bot which is https://discord.gg/kcWBBBj \n" +
                                $"Also the PR2 commands are based off a game which can be played at https://jiggmin2.com/games/platform-racing-2/ and the forums are located at https://jiggmin2.com/forums/ \n" +
                                $"Thanks again for adding me to this server.";
            try
            {
                await guild.DefaultChannel.SendMessageAsync("", false, embed.Build());
            }
            catch (Discord.Net.HttpException)
            {
                //ignore
            }
        }