Example #1
0
 public override void Trigger()
 {
     if (FactionManager.CanAfford(ParentShip.FactionNumber, 0, 150) && ParentShip.GetOffenseProgress() == 0)
     {
         Triggered = true;
         PauseTime = 0;
     }
     base.Trigger();
 }
Example #2
0
 public override void Draw(Vector2 Position, Vector2 Size)
 {
     if (ProgressAlpha > 0)
     {
         Render.DrawSprite(OuterTexture, Position, Size * ProgressAlpha, 0, TeamInfo.HudColors[ParentShip.GetTeam()] * ProgressAlpha);
         Render.DrawSprite(InnerTexture, Position, Size * ProgressAlpha, ParentShip.GetOffenseProgress() * (float)Math.PI, TeamInfo.HudColors[ParentShip.GetTeam()] * ProgressAlpha);
     }
     if (EliminatedAlpha > 0)
     {
         Render.DrawSprite(EliminatedTexture, Position, Size * EliminatedAlpha, 0, TeamInfo.HudColors[WaveFSM.PlayerEliminatedState.LastEliminatedTeam] * EliminatedAlpha);
     }
     base.Draw(Position, Size);
 }
Example #3
0
        public override void Update(GameTime gameTime)
        {
            if (ParentShip.GetOffenseProgress() > 0)
            {
                ProgressAlpha += gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
                if (ProgressAlpha > 1)
                {
                    ProgressAlpha = 1;
                }
            }
            else
            {
                ProgressAlpha -= gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
                if (ProgressAlpha < 0)
                {
                    ProgressAlpha = 0;
                }
            }


            if (WaveFSM.PlayerEliminatedState.LastEliminatedTeam != -1)
            {
                EliminatedAlpha += gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
                if (EliminatedAlpha > 1)
                {
                    EliminatedAlpha = 1;
                }
            }
            else
            {
                EliminatedAlpha -= gameTime.ElapsedGameTime.Milliseconds * 60 / 1000f * AlphaChange;
                if (EliminatedAlpha < 0)
                {
                    EliminatedAlpha = 0;
                }
            }

            base.Update(gameTime);
        }