Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
            {
                label1.Text = "Digite um nome";
                return;
            }

            Personagem pwersonagem = personagem;
            string     nom4e       = textBox1.Text;
            LoadOrSave Save        = new LoadOrSave();

            Save.WriteToJsonFile <Personagem>(@"C:\Users\Mateus.Storalli\Downloads\Jogo\Save\" + nom4e + ".txt", pwersonagem);
            nom4e       = null;
            label1.Text = "Salvo";
            JsonConverter.WriteJson <Personagem>(@"C:\Users\Mateus.Storalli\Downloads\Jogo\Save\" + nom4e + ".json", personagem);
        }
Exemplo n.º 2
0
        public Form2(Personagem personagem)
        {
            DoubleBuffered  = true;
            player          = new WindowsMediaPlayer();
            this.personagem = personagem;
            InitializeComponent();
            tempo = new System.Windows.Forms.Timer();
            tempo.Start();
            tempo.Tick     += GainGold;
            label3.Text     = personagem.def().ToString();
            label2.Text     = personagem.atk().ToString();
            label4.Text     = personagem.vida().ToString();
            this.KeyPreview = true;
            KeyDown        += Form2_KeyPress;

            player.URL = @"C:\Users\mateu\Desktop\jenni\Vindsvept-TheFae.mp3";
            player.controls.play();
        }
Exemplo n.º 3
0
        public RinguePVPFind(Personagem personagem)
        {
            // server = new MongoClient(
            //     "mongodb+srv://mateus383:<210164>@servercluster-siuh7.mongodb.net/test?retryWrites=true&w=majority"
            //     );
            //
            // database = server.GetDatabase("test");

            InitializeComponent();
            this.personagem = personagem;


            Thread ac = new Thread(ab);

            ac.Start();
            StartServer();
            monster        = new Monster(personagem);
            suaVida.Text   = personagem.vida().ToString();
            VidaEnemy.Text = monster.vida().ToString();
        }
Exemplo n.º 4
0
        public RinguePVP(Personagem personagem)
        {
            InitializeComponent();
            DoubleBuffered = true;
            // server = new MongoClient(
            //     "mongodb+srv://mateus383:<210164>@servercluster-siuh7.mongodb.net/test?retryWrites=true&w=majority"
            //     );
            //
            // database = server.GetDatabase("test");
            this.personagem = personagem;

            MouseHover += (obj, evt) =>
            {
                MouseMove += (object a, MouseEventArgs ab) =>
                {
                    if (!con)
                    {
                        return;
                    }
                    byte[] buffer = personagem.mousepvp(ab.Location.Y, ab.Location.X);
                    clientSocket.BeginSend(buffer, 0, buffer.Length, SocketFlags.None, SendCallback, null);
                };
            };
        }
Exemplo n.º 5
0
 public FormSaving(Personagem personagem)
 {
     InitializeComponent();
     this.personagem = personagem;
 }
Exemplo n.º 6
0
 public Ringue(Personagem personagem, TcpClient tcpClient)
 {
 }
Exemplo n.º 7
0
        public Inventario(Personagem personagem)
        {
            InitializeComponent();
            this.personagem      = personagem;
            Ataque.Text          = personagem.Atk1.ToString();
            Defesa.Text          = personagem.Def1.ToString();
            VidaeVidaMaxima.Text = personagem.Vida1.ToString() + " / " + personagem.VidaMaxima1.ToString();
            Critical.Text        = personagem.ChanceCritico2.ToString();
            itens = personagem.itens1;
            if (personagem.MaoDireita1)
            {
                addPictureBox((short)bracodireito.Top, (short)bracodireito.Left,
                              (short)bracodireito.Height, (short)bracodireito.Width,
                              personagem.MaoDireitaEquipe1.url);
            }

            if (personagem.MaoEsquerda1)
            {
                addPictureBox((short)bracoesquerdo.Top, (short)bracoesquerdo.Left,
                              (short)bracoesquerdo.Height, (short)bracoesquerdo.Width,
                              personagem.MaoEsquerdaEquipe1.url);
            }

            if (personagem.Capacete1)
            {
                addPictureBox((short)capacete.Top, (short)capacete.Left,
                              (short)capacete.Height, (short)capacete.Width,
                              personagem.CapaceteEquipe1.url);
            }

            if (personagem.Bota1)
            {
                addPictureBox((short)bota.Top, (short)bota.Left,
                              (short)bota.Height, (short)bota.Width,
                              personagem.BotaEquipe1.url);
            }

            if (personagem.Armadura1)
            {
                addPictureBox((short)armor.Top, (short)armor.Left,
                              (short)armor.Height, (short)armor.Width,
                              personagem.ArmaduraEquipe1.url);
            }


            int acrescentatop  = 0;
            int acrescentaleft = 0;
            int i = 0;

            foreach (Itens item in itens)
            {
                Image      image = Image.FromFile(item.url);
                PictureBox pic   = new PictureBox();
                Label      label = new Label();
                pic.Image       = image;
                pic.Name        = item.nome;
                pic.Height      = 41;
                pic.Width       = 41;
                pic.BackColor   = (Color) new ColorConverter().ConvertFromInvariantString("#858ba1");
                pic.BorderStyle = BorderStyle.FixedSingle;
                pic.Cursor      = Cursors.Hand;
                pic.SizeMode    = PictureBoxSizeMode.StretchImage;
                label.Width     = 41;
                label.Height    = 41;
                label.BackColor = (Color) new ColorConverter().ConvertFromInvariantString("#858ba1");
                label.Text      = item.Gold1.ToString();
                Font font = new Font("Britannic Bold", 11.25F);
                label.Font      = font;
                label.ForeColor = Color.Gold;
                label.Top       = 118 + acrescentatop;
                label.Left      = 529;
                pic.Top         = 48 + acrescentatop;
                pic.Left        = 389 + acrescentaleft;
                acrescentaleft  = acrescentaleft + 41;
                if (acrescentaleft >= 410)
                {
                    acrescentatop  = acrescentatop + 41;
                    acrescentaleft = 41;
                    pic.Left       = 389;
                    pic.Top        = 48 + acrescentatop;
                }
                Controls.Add(label);
                this.Controls.Add(pic);
                pic.DoubleClick += (sender, EventArgs) =>
                {
                    Pic_DoubleClick(sender, EventArgs, item);
                };
                pic.BringToFront();

                i++;
                if (i == 36)
                {
                    break;
                }
            }
            while (i < 36)
            {
                PictureBox picVazia = new PictureBox();


                picVazia.Top         = 48 + acrescentatop;
                picVazia.Left        = 389 + acrescentaleft;
                picVazia.Height      = 41;
                picVazia.Width       = 41;
                picVazia.BackColor   = (Color) new ColorConverter().ConvertFromInvariantString("#858ba1");
                picVazia.SizeMode    = PictureBoxSizeMode.StretchImage;
                picVazia.BorderStyle = BorderStyle.FixedSingle;
                picVazia.Cursor      = Cursors.Hand;
                acrescentaleft       = acrescentaleft + 41;
                if (acrescentaleft >= 410)
                {
                    acrescentatop  = acrescentatop + 41;
                    acrescentaleft = 41;
                    picVazia.Left  = 389;
                    picVazia.Top   = 48 + acrescentatop;
                }
                Controls.Add(picVazia);
                picVazia.BringToFront();
                i++;
            }
        }