Esempio n. 1
0
 public static void NPC_6_OnAction(Geral x)
 {
     if (Interacoes.Falar(x, "Use este item para ganhar a batalha"))
     {
         Interacoes.DarItem(x, 3);
     }
 }
Esempio n. 2
0
        public override void OnStart()
        {
            menu    = true;
            submenu = turno = finish = false;

            foreach (Playable x in x1.ToList())
            {
                F.BloquearMov(x, true);
                Interacoes.Andar(x, 2, 200);
            }

            foreach (Playable x in x2.ToList())
            {
                F.BloquearMov(x, true);
                Interacoes.Andar(x, 3, 200);
            }
        }
Esempio n. 3
0
        public static void TelaPrincipal()
        {
            V.window.SetView(V.view);
            foreach (Playable x in x1.ToList())
            {
                F.DesenharShape(x.x - 50 + (x.imgWidth / 2), x.y - x.imgHeight + x.height - 50, 100, 10, 19, 19, 19, 230);
                F.DesenharShape(x.x - 50 + (x.imgWidth / 2), x.y - x.imgHeight + x.height - 50, (100 / x.vida_) * x.vidaA, 10, 000, 255, 000, 230);

                F.DesenharShape(x.x - 50 + (x.imgWidth / 2), x.y - x.imgHeight + x.height - 65, 100, 10, 19, 19, 19, 230);
                F.DesenharShape(x.x - 50 + (x.imgWidth / 2), x.y - x.imgHeight + x.height - 65, (100 / x.energia_) * x.energiaA, 10, 255, 255, 000, 230);
            }

            foreach (Playable x in x2.ToList())
            {
                F.DesenharShape(x.x - 50 + (x.imgWidth / 2), x.y - x.imgHeight + x.height - 30, 100, 15, 19, 19, 19, 230);
                F.DesenharShape(x.x - 50 + (x.imgWidth / 2), x.y - x.imgHeight + x.height - 30, (100 / x.vida_) * x.vidaA, 15, 000, 255, 000, 230);
            }


            V.window.SetView(V.hud);

            F.DesenharShape(10, Screen.height - 200, Screen.width - 20, 190, 210, 210, 210, 230);
            F.DesenharShape(230, Screen.height - 190, Screen.width - 250, 170, 19, 19, 19, 255);

            HeroiAtacar();
            InimigoAtacar();

            int qtdX1 = 0, qtdX2 = 0;

            foreach (Playable x in x1.ToList())
            {
                if (x.vidaA <= 0)
                {
                    qtdX1++;
                }
            }

            foreach (Playable x in x2.ToList())
            {
                if (x.vidaA <= 0)
                {
                    x.OnDie();
                    x2.Remove(x);
                    qtdX2++;
                }
            }

            if (qtdX1 >= x1.Count() && !finish)
            {
                finish = true;
            }

            if (qtdX2 >= x2.Count() && !finish)
            {
                finish = true;
                foreach (Playable x in x1.ToList())
                {
                    Interacoes.Andar(x, 3, 200);
                }
            }
        }
Esempio n. 4
0
        public override void Draw()
        {
            if (vidas <= 0)
            {
                OnDie();
            }
            else
            {
                foreach (Geral o in V.objetos.ToList())
                {
                    if (o != this && o.vidas > 0 && !(o.GetType().Name == "Player"))
                    {
                        F.ColideBloco(this, o, true);
                    }
                }

                if (PlayState.state == 2)
                {
                    F.MovePersonagem(this);
                }

                Interacoes.Movimentar(this);

                int sprite = this.name == "player1" ? 0 : (this.name == "player2" ? 1 : 2);

                V.img[0].Texture = V.IMG_CAT[0][sprite];

                V.img[0].Position    = new Vector2f(x, y);
                V.img[0].TextureRect = new IntRect(0, 0, (int)width, (int)height);

                V.window.Draw(V.img[0]);

                if ((F.Key("return") && this.name == "player2") || (F.Key("space") && this.name == "player1"))
                {
                    if (!F.TeclaDesativada("bullet_" + this.name) && PlayState.state == 2)
                    {
                        if (this.vidas == 1 || this.vidas == 4)
                        {
                            V.bullets.Add(new Bullet(this.x + 11, this.y - 4, this.forca, 0, 0, sprite));
                        }

                        else if (this.vidas == 2 || this.vidas == 5)
                        {
                            V.bullets.Add(new Bullet(this.x + 22, this.y - 4, this.forca, 0, 0, sprite));
                            V.bullets.Add(new Bullet(this.x, this.y - 4, this.forca, 0, 0, sprite));
                        }

                        if (this.vidas == 3 || this.vidas == 6)
                        {
                            V.bullets.Add(new Bullet(this.x + 22, this.y - 4, this.forca, 1, 0, sprite));
                            V.bullets.Add(new Bullet(this.x + 11, this.y - 4, this.forca, 0, 0, sprite));
                            V.bullets.Add(new Bullet(this.x, this.y - 4, this.forca, 2, 0, sprite));
                        }

                        F.DesativarTecla("bullet_" + this.name, this.vidas <= 3 ? 500 : 250);
                    }
                }

                if (this.name != "player1" && this.name != "player2" && PlayState.state == 2)
                {
                    if (this.y + this.height < 128)
                    {
                        V.objetos.RemoveAt(V.objetos.IndexOf(this));
                    }

                    if (!F.TeclaDesativada("bullet_" + this.name) && PlayState.state == 2)
                    {
                        V.bullets.Add(new Bullet(this.x + 22, this.y - 4, this.forca, 0, 0, sprite));
                        V.bullets.Add(new Bullet(this.x, this.y - 4, this.forca, 0, 0, sprite));

                        F.DesativarTecla("bullet_" + this.name, 1000);
                    }

                    this.y -= 2;
                }
            }
        }
Esempio n. 5
0
        public override void Draw()
        {
            if (this.x + this.width < 0 || this.x > Screen.width || this.y > Screen.height + 128)
            {
                this.Destroy();
            }

            if (vidas <= 0)
            {
                OnDie();
            }
            else
            {
                if (PlayState.state == 2)
                {
                    switch (protocolo)
                    {
                    case 0:

                        switch (this.protocolo_state)
                        {
                        case 0:

                            this.y += this.speed;
                            if (this.y == 228)
                            {
                                this.protocolo_state++; F.DesativarTecla("protocolo_state_" + this.id, 3000);
                            }

                            break;

                        case 1:

                            if (!F.TeclaDesativada("protocolo_state_" + this.id))
                            {
                                this.y += this.speed;
                            }

                            break;
                        }

                        break;

                    case 1:

                        if (this.y < 228 || this.x + this.width / 2 == Screen.width * 0.75f)
                        {
                            this.y += this.speed;
                        }
                        if (this.y == 228 && this.x + this.width / 2 < Screen.width * 0.75f)
                        {
                            this.x += this.speed;
                        }

                        break;

                    case 2:

                        if (this.y < 228 || this.x + this.width / 2 == Screen.width * 0.25f)
                        {
                            this.y += this.speed;
                        }
                        if (this.y == 228 && this.x + this.width / 2 > Screen.width * 0.25f)
                        {
                            this.x -= this.speed;
                        }

                        break;

                    case 3:

                        this.x += (this.y < 128 ? 0 : this.speed);
                        this.y += (this.y < 528 ? this.speed : 0);

                        break;

                    case 4:

                        this.x -= (this.y < 128 ? 0 : this.speed);
                        this.y += (this.y < 528 ? this.speed : 0);

                        break;
                    }

                    if (!F.TeclaDesativada("bullet_e" + this.id) && PlayState.state == 2)
                    {
                        if (this.vidas == 1 || this.vidas == 4)
                        {
                            V.bullets.Add(new Bullet(this.x + 11, this.y + this.height + 4, this.forca, 0, 1, this.sprite));
                        }

                        else if (this.vidas == 2 || this.vidas == 5)
                        {
                            V.bullets.Add(new Bullet(this.x + 22, this.y + this.height + 4, this.forca, 0, 1, this.sprite));
                            V.bullets.Add(new Bullet(this.x, this.y + this.height + 4, this.forca, 0, 1, this.sprite));
                        }

                        if (this.vidas == 3 || this.vidas == 6)
                        {
                            V.bullets.Add(new Bullet(this.x + 22, this.y + this.height + 4, this.forca, 1, 1, this.sprite));
                            V.bullets.Add(new Bullet(this.x + 11, this.y + this.height + 4, this.forca, 0, 1, this.sprite));
                            V.bullets.Add(new Bullet(this.x, this.y + this.height + 4, this.forca, 2, 1, this.sprite));
                        }

                        F.DesativarTecla("bullet_e" + this.id, 1000);
                    }

                    Interacoes.Movimentar(this);
                }

                V.img[0].Texture     = V.IMG_CAT[3][sprite];
                V.img[0].TextureRect = new IntRect(0, 0, (int)width, (int)height);
                V.img[0].Position    = new Vector2f(x, y);
                V.window.Draw(V.img[0]);
            }
        }
Esempio n. 6
0
 public static void NPC_7_OnAction(Geral x)
 {
     Interacoes.Falar(x, "Eu sou max, é um prazer te conhecer :D");
 }
Esempio n. 7
0
 public static void NPC_5_OnAction(Geral x)
 {
     Interacoes.Falar(x, "Boa sorte em sua jornada!");
 }