Esempio n. 1
0
        public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
        {
            Vector2 corrected = Vector2.Add(position, new Vector2(16, 16));

            for (int x = 0; x < 4; x++)
            {
                Fireball projectile = new Fireball(corrected, 0, this, 1, 0);
                Vector2  direction  = MovementManager.getNormalizedVector(projectile.position, circleFire(x));
                projectile.setDestination(direction, circleFire(x));
                projectile.LoadContent(content);
                projMan.proj.Add(projectile);
            }
        }
Esempio n. 2
0
        public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
        {
            attackSound(content);
            Vector2    corrected  = Vector2.Add(position, new Vector2(16, 16));
            Projectile projectile = new Arrow(corrected, 100, target, 100, 0);

            projectile.damage = this.damage;
            Vector2 direction = MovementManager.getNormalizedVector(projectile.position, target.position);

            projectile.setDestination(direction, target.position);
            projectile.LoadContent(content);
            projMan.proj.Add(projectile);
        }
Esempio n. 3
0
        public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
        {
            //attackSound(content);
            Vector2    corrected  = Vector2.Add(position, new Vector2(16, 16));
            Projectile projectile = new Rocktile(corrected, 100, target, 100, 0);
            Vector2    direction  = MovementManager.getNormalizedVector(projectile.position, target.position);

            projectile.setDestination(direction, target.position);
            projectile.LoadContent(content);
            projMan.proj.Add(projectile);
            this.animateState = "attack";
            this.animateTime  = 0;
        }
Esempio n. 4
0
        //  TyDo: Create a new projectile that deals less damage than an arrow, but for now just make it the fireball
        //  Attack the target (not homing). Create a new object projectile sent in the direction of target
        //  The new attack code
        public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
        {
            this.soundEffect = content.Load <SoundEffect>("fireball.wav");
            soundEffect.Play();
            Vector2    corrected  = Vector2.Add(position, new Vector2(16, 16));
            Projectile projectile = new Iceball(corrected, 0, target, 1, 0);
            Vector2    direction  = MovementManager.getNormalizedVector(projectile.position, target.position);

            projectile.setDestination(direction, target.position);
            projectile.LoadContent(content);
            projMan.proj.Add(projectile);
            this.animateState = "attack";
            this.animateTime  = 0;
        }
Esempio n. 5
0
        //  On skill key press, conjur a fireball and send it to target location
        //  TyNote: Create a fireball unit and set destination to target location (not homing). Dies on first collision or at end of path.
        //  TyDo: Fireball has a life timer
        //  TyDo: Make this a spell. For now, it's implemented as the autoattack
        public void fireball(ProjectileManager projMan, ContentManager content, GameObject target, Vector2 destination)
        {
            Fireball fireballTest = null;

            if (!fireballTimer.Enabled)
            {
                fireballTimer.Start();
                fireballTest = new Fireball(this.position, 10, target, 1, 0);
                this.myArrow = fireballTest;
                Vector2 direction = MovementManager.getNormalizedVector(this.position, destination);
                fireballTest.setDestination(direction, destination);
                fireballTest.LoadContent(content);
                projMan.proj.Add(fireballTest);
                this.animateState = "attack";
                this.animateTime  = 0;
            }
        }
Esempio n. 6
0
        //  The new attack code
        public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
        {
            //if (!rapidFireTimer.Enabled)
            //{
            //    specialAttack = false;
            //    attackSpeed = 180;
            //}
            attackSound(content);
            Vector2    corrected  = Vector2.Add(position, new Vector2(16, 16));
            Projectile projectile = new Arrow(corrected, 100, target, 100, 0);

            myArrow = projectile;
            Vector2 direction = MovementManager.getNormalizedVector(projectile.position, target.position);

            projectile.setDestination(direction, target.position);
            projectile.LoadContent(content);
            projMan.proj.Add(projectile);
            this.animateState = "attack";
            this.animateTime  = 0;
        }