Exemple #1
0
        public override SpecialWeapon GetWeapon()
        {
            GhostCast ghost = new GhostCast();

            ghost.SetCard(FactionCard.GetFactionUnitCard("Vampire"));
            return(ghost);
        }
        public override void Update(GameTime gameTime)
        {
            GlowAlpha -= gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
            if (GlowAlpha < 0)
            {
                GlowAlpha = 0;
            }

            if (!ParentBox.ParentShip.Attacking)
            {
                if (ParentBox.ParentShip.getSmallBombs() > 0)
                {
                    IconAlpha += gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
                    if (IconAlpha > 1)
                    {
                        IconAlpha = 1;
                    }
                    if (ParentBox.ParentShip.getSmallBombs() != OldBombs)
                    {
                        OldBombs  = ParentBox.ParentShip.getSmallBombs();
                        GlowAlpha = 1;
                    }
                }
                else
                {
                    IconAlpha -= gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * IconAlpha;
                    if (IconAlpha < 0.2f)
                    {
                        IconAlpha = 0.2f;
                    }
                }
            }
            else
            {
                if (ParentBox.ParentShip.getUnitCasts() > 0)
                {
                    GhostCast g = (GhostCast)ParentBox.ParentShip.CurrentSpecialWeapon;
                    OffenseTexture = g.MyCard.CastTexture();

                    IconAlpha += gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
                    if (IconAlpha > 1)
                    {
                        IconAlpha = 1;
                    }
                    if (ParentBox.ParentShip.getUnitCasts() != OldCasts)
                    {
                        OldCasts  = ParentBox.ParentShip.getUnitCasts();
                        GlowAlpha = 1;
                    }
                }
                else
                {
                    IconAlpha -= gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * IconAlpha;
                    if (IconAlpha < 0.2f)
                    {
                        IconAlpha = 0.2f;
                    }
                }
            }
            base.Update(gameTime);
        }