예제 #1
0
        public Weapon(Player owner, Keys shootKey, float damage, float coolDownTime)
        {
            // You know the deal: this.<variable> = variable;
            // ------------------------------------------------
            this.owner = owner;
            this.damage = damage;
            this.shootKey = shootKey;
            this.coolDownTime = coolDownTime;
            coolDownTimeTicks = coolDownTime;

            SetBulletTexture();

            OnTrigger += OnFire;
        }
예제 #2
0
        public Bullet(Player owner, float angle, Texture2D texture, float speed = 10f, float r = 1, float g = 1, float b = 1)
            : base(owner.Position)
        {
            this.texture = texture;
            this.owner = owner;
            this.angle = angle;
            pos += owner.GunOffset;
            dir = owner.Direction;
            this.speed = speed;

            sprite = new Image(texture);
            width = sprite.Width;
            height = sprite.Height;
            flipped = owner.Flipped;

            Origin = new Vector2(width / 2, height / 2);

            tint = new Color(r, g, b);

            homing = owner.Tracking;
        }
예제 #3
0
 /// <summary>
 /// Called when the OnTrigger event is triggered
 /// </summary>
 /// <param name="sender">Owner of the weapon</param>
 /// <param name="e">Leave null for now</param>
 protected abstract void OnFire(Player sender, EventArgs e);
 public GatlingGun(Player owner, Keys shootKey)
     : base(owner, shootKey, 5f, 50f)
 {
 }
 protected override void OnFire(Player sender, EventArgs e)
 {
     SoundManager.MissileLaunchInstance.Play();
     Shoot();
 }
예제 #6
0
 public Pistol(Player owner, Keys shootKey)
     : base(owner, shootKey, 10f, 350f)
 {
 }
예제 #7
0
 public override void StartEffect(Entities.Player sender, EventArgs e)
 {
     sender.EquippedWeapon = new MissileLauncher(sender, sender.ShootKey);
 }
예제 #8
0
 public override void StartEffect(Entities.Player sender, EventArgs e)
 {
     sender.SuperSpeed = true;
 }
예제 #9
0
 public override void EndEffect(Entities.Player sender, EventArgs e)
 {
     sender.SuperSpeed = false;
 }
예제 #10
0
 public abstract void StartEffect(Player sender, EventArgs e);
예제 #11
0
        public virtual void Update(GameTime gametime)
        {
            if (!destroyMe && !active)
            {
                foreach (Player p in GameplayState.Players)
                {
                    if (p.Bounds.Intersects(Bounds))
                    {
                        duration = 0;
                        active = true;
                        owner = p;
                        OnEffectStart(owner, null);
                        SoundManager.PowerUpInstance.Play();
                    }
                }
            }
            if (active)
            {
                duration += (float)gametime.ElapsedGameTime.Milliseconds;

            }
            if (duration >= MAXDURATION)
            {
                OneEffectEnd(owner, null);
                destroyMe = true;
            }
        }
예제 #12
0
 public abstract void EndEffect(Player sender, EventArgs e);
예제 #13
0
 protected override void OnFire(Player sender, EventArgs e)
 {
     laser.IsActive = true;
 }
예제 #14
0
 public LaserGun(Player owner, Keys shootKey)
     : base(owner, shootKey, 5f, 10f)
 {
     laser = new Laser(owner, owner.Position);
 }
예제 #15
0
 public Laser(Player owner, Vector2 pos)
     : base(pos)
 {
     this.owner = owner;
     angle = owner.Angle;
 }
예제 #16
0
 public override void StartEffect(Entities.Player sender, EventArgs e)
 {
     sender.Health += 100;
 }
예제 #17
0
 public Shotgun(Player owner, Keys shootKey)
     : base(owner, shootKey, 30f, 600f)
 {
 }
예제 #18
0
 public override void EndEffect(Entities.Player sender, EventArgs e)
 {
     return;
 }
예제 #19
0
 protected override void OnFire(Player sender, EventArgs e)
 {
     SoundManager.PistolShotInstance.Play();
     Shoot();
 }
 public MissileLauncher(Player owner, Keys shootKey)
     : base(owner, shootKey, 70f, 500F)
 {
 }
예제 #21
0
 public override void EndEffect(Entities.Player sender, EventArgs e)
 {
     sender.EquippedWeapon = new Pistol(sender, sender.ShootKey);
 }
예제 #22
0
 public Bullet(Player owner, Texture2D texture)
     : this(owner, owner.Angle, texture)
 {
 }