Exemplo n.º 1
0
        public void MultiBullet()
        {
            MouseState mousestate = Mouse.GetState();

            GameGlobal.PassProjectiles(new Fireball(new Vector2(pos.X, pos.Y), new Vector2(35, 35), false, this.pos, new Vector2(mousestate.X + cursor.pos.X, mousestate.Y + cursor.pos.Y)));
            GameGlobal.PassProjectiles(new Fireball(new Vector2(pos.X, pos.Y), new Vector2(35, 35), false, this.pos, new Vector2(mousestate.X + cursor.pos.X + 50, mousestate.Y + cursor.pos.Y + 50)));
            GameGlobal.PassProjectiles(new Fireball(new Vector2(pos.X, pos.Y), new Vector2(35, 35), false, this.pos, new Vector2(mousestate.X + cursor.pos.X - 50, mousestate.Y + cursor.pos.Y - 50)));
        }
Exemplo n.º 2
0
        public override void Update(Vector2 OFFSET)
        {
            KeyboardState keystate   = Keyboard.GetState();
            MouseState    mousestate = Mouse.GetState();

            #region Hero Movement & Skill
            if ((keystate.IsKeyDown(Keys.A) || keystate.IsKeyDown(Keys.Left)) && !isdead && !triggergotohell && isstunned == false)
            {
                if (GameGlobal.herotouchscreen(this))
                {
                    pos        = new Vector2(pos.X - speed, pos.Y);
                    cursor.pos = new Vector2(cursor.pos.X - speed, cursor.pos.Y);
                }
                else
                {
                    if (life > 0)
                    {
                        triggergotohell = true;
                    }
                }
            }
            if ((keystate.IsKeyDown(Keys.D) || keystate.IsKeyDown(Keys.Right)) && !isdead && !triggergotohell && isstunned == false)
            {
                if (GameGlobal.herotouchscreen(this))
                {
                    pos        = new Vector2(pos.X + speed, pos.Y);
                    cursor.pos = new Vector2(cursor.pos.X + speed, cursor.pos.Y);
                }
                else
                {
                    if (life > 0)
                    {
                        triggergotohell = true;
                    }
                }
            }
            if ((keystate.IsKeyDown(Keys.W) || keystate.IsKeyDown(Keys.Up)) && !isdead && !triggergotohell && isstunned == false)
            {
                if (GameGlobal.herotouchscreen(this))
                {
                    pos        = new Vector2(pos.X, pos.Y - speed);
                    cursor.pos = new Vector2(cursor.pos.X, cursor.pos.Y - speed);
                }
                else
                {
                    if (life > 0)
                    {
                        triggergotohell = true;
                    }
                }
            }
            if ((keystate.IsKeyDown(Keys.S) || keystate.IsKeyDown(Keys.Down)) && !isdead && !triggergotohell && isstunned == false)
            {
                if (GameGlobal.herotouchscreen(this))
                {
                    pos        = new Vector2(pos.X, pos.Y + speed);
                    cursor.pos = new Vector2(cursor.pos.X, cursor.pos.Y + speed);
                }
                else
                {
                    if (life > 0)
                    {
                        triggergotohell = true;
                    }
                }
            }
            if (keystate.IsKeyDown(Keys.Space) && !isdead && !triggergotohell && isstunned == false)
            {
                Swift();
            }
            if (triggeredSwift)
            {
                SwiftEffect();
                timeSwift -= 2.5f;
                if (timeSwift <= 0)
                {
                    triggeredSwift = false;
                    //  /=2
                    if (GameGlobal.gametimepassed < 2000)
                    {
                        speed = 5;
                    }
                    if (2000 <= GameGlobal.gametimepassed && GameGlobal.gametimepassed < 7500)
                    {
                        speed = 6;
                    }
                    if (7500 <= GameGlobal.gametimepassed)
                    {
                        speed = 8;
                    }
                }
            }
            if (keystate.IsKeyDown(Keys.F))
            {
                GameGlobal.triggerNuclear();
            }
            #endregion

            rot = Global.RotateTowards(pos, new Vector2(mousestate.X + cursor.pos.X, mousestate.Y + cursor.pos.Y));

            if (mousestate.LeftButton == ButtonState.Pressed)
            {
                if (isdead == false)
                {
                    if (!IsCrit(critchance))
                    {
                        if (GameGlobal.triggerboostatkspeed)
                        {
                            MultiBullet();
                        }
                        else
                        {
                            GameGlobal.PassProjectiles(new Fireball(pos, new Vector2(35, 35), false, this.pos, new Vector2(mousestate.X + cursor.pos.X, mousestate.Y + cursor.pos.Y)));
                        }
                    }
                    else
                    {
                        GameGlobal.PassProjectiles(new Fireball(pos, new Vector2(70, 70), true, this.pos, new Vector2(mousestate.X + cursor.pos.X, mousestate.Y + cursor.pos.Y)));
                    }
                }
            }

            #region Buff
            TriggerHealing();
            TriggerExtraHealth();
            TriggerExtraCrit();
            TriggerExtraLife();
            UnrealAttack = 35 + GameGlobal.extradamage;
            #endregion

            if (IsDeadYet(currenthealth))
            {
                if (life > 0)
                {
                    triggergotohell = true;
                }
            }
            if (DeadEffect())
            {
                Dead();
                Respawn();
            }

            if (2000 == GameGlobal.gametimepassed)
            {
                speed = 6;
            }
            if (7500 == GameGlobal.gametimepassed)
            {
                speed = 8;
            }

            base.Update(OFFSET);
        }