Example #1
0
        public override void SpawnMob()
        {
            int num = Globals.rand.Next(0, 100 + 1);

            Mob tempMob = null;
            int total   = 0;

            for (int i = 0; i < mobChoices.Count; i++)
            {
                total += mobChoices[i].rate;


                if (num < total)
                {
                    Type sType = Type.GetType("ShooterGame200." + mobChoices[i].mobStr, true);

                    tempMob = (Mob)(Activator.CreateInstance(sType, new Vector2(pos.X, pos.Y), new Vector2(1, 1), ownerId));

                    break;
                }
            }
            if (tempMob != null)
            {
                GameGlobals.PassMob(tempMob);
            }
        }
Example #2
0
        public override void Targeting(Vector2 OFFSET, Player ENEMY)
        {
            GameGlobals.PassEffect(new BlinkEffect(Globals.mouse.newMousePos - OFFSET, new Vector2(owner.dims.X, owner.dims.Y), 266));
            GameGlobals.PassEffect(new BlinkEffect(new Vector2(owner.pos.X, owner.pos.Y), new Vector2(owner.dims.X, owner.dims.Y), 266));

            owner.pos = new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET;

            active = false;
            done   = true;
        }
        public virtual void GetHit(AttackableObject ATTACKER, float DAMAGE)
        {
            health -= DAMAGE;
            if (health <= 0)
            {
                dead = true;

                GameGlobals.PassGold(new PlayerValuePacket(ATTACKER.ownerId, killValue));
            }
        }
Example #4
0
        public override void Targeting(Vector2 OFFSET, Player ENEMY)
        {
            if (Globals.mouse.LeftClickRelease())
            {
                targetEffect.done = true;

                GameGlobals.PassProjectile(new FlameWaveProjectile(Globals.mouse.newMousePos - OFFSET, owner, new Vector2(0, 0), 1500));

                done   = true;
                active = false;
            }
            else
            {
                targetEffect.pos = Globals.mouse.newMousePos - OFFSET;
            }
        }
Example #5
0
        public override void AI(Player ENEMY, SquareGrid GIRD)
        {
            if (ENEMY.hero != null && (Globals.GetDistance(pos, ENEMY.hero.pos) < attackRange * .9f || isAttacking))
            {
                isAttacking = true;
                attackTimer.UpdateTimer();

                if (attackTimer.Test())
                {
                    GameGlobals.PassProjectile(new AcidSplash(new Vector2(pos.X, pos.Y), this, new Vector2(ENEMY.hero.pos.X, ENEMY.hero.pos.Y)));


                    attackTimer.ResetToZero();
                    isAttacking = false;
                }
            }
            else
            {
                base.AI(ENEMY, GIRD);
            }
        }
Example #6
0
 public virtual void SpawnMob()
 {
     GameGlobals.PassMob(new Imp(new Vector2(pos.X, pos.Y), new Vector2(1, 1), ownerId));
 }
 public FlameWaveProjectile(Vector2 POS, AttackableObject OWNER, Vector2 TARGET, int MSEC)
     : base(POS, new Vector2(150, 150), OWNER, TARGET, MSEC)
 {
     GameGlobals.PassEffect(new FlameCircle(new Vector2(POS.X, POS.Y), new Vector2(dims.X, dims.Y), MSEC));
 }
Example #8
0
        public override void Update(Vector2 OFFSET, Player ENEMY, SquareGrid GRID)
        {
            bool checkScoll = false;

            if (Globals.keyboard.GetPress("A") && pos.X > -50)
            {
                pos        = new Vector2(pos.X - speed, pos.Y);
                checkScoll = true;
            }

            if (Globals.keyboard.GetPress("D") && pos.X < 1250)
            {
                pos        = new Vector2(pos.X + speed, pos.Y);
                checkScoll = true;
            }

            if (Globals.keyboard.GetPress("W") && pos.Y > -50)
            {
                pos        = new Vector2(pos.X, pos.Y - speed);
                checkScoll = true;
            }

            if (Globals.keyboard.GetPress("S") && pos.Y < 750)
            {
                pos        = new Vector2(pos.X, pos.Y + speed);
                checkScoll = true;
            }
            if (Globals.keyboard.GetSinglePress("D1"))
            {
                currentSkill        = skills[0];
                currentSkill.Active = true;
            }

            if (Globals.keyboard.GetSinglePress("D2"))
            {
                currentSkill        = skills[1];
                currentSkill.Active = true;
            }

            GameGlobals.CheckScroll(pos);

            if (checkScoll)
            {
                SetAnimationByName("Walk");
            }
            else
            {
                SetAnimationByName("Stand");
            }


            rot = Globals.RotateTowards(pos, new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET);

            if (currentSkill == null)
            {
                if (Globals.mouse.LeftClick())
                {
                    GameGlobals.PassProjectile(new Fireball(new Vector2(pos.X, pos.Y), this, new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET));
                }
            }
            else
            {
                currentSkill.Update(OFFSET, ENEMY);
                if (currentSkill.done)
                {
                    currentSkill.Reset();
                    currentSkill = null;
                }
            }


            base.Update(OFFSET, ENEMY, GRID);
        }