Beispiel #1
0
        public override void UpdateState(GameTime time, HackGameBoard board, HackGameBoardElement_Node node)
        {
            if (lerp != null && lerp.IsAlive())
            {
                lerp.Update(time);
            }

            pulseEffect.Update(time);

            if (!Empty && PlayerHacking != null && PlayerHacking.IsHacking() == true)
            {
                HackTimerRemaining -= (float)time.ElapsedGameTime.TotalSeconds * board.GetSpeedUpFactor();
                float pctTiming = HackTimerMax != 0.0f ? 1.0f - (HackTimerRemaining / HackTimerMax) : 0.0f;
                board.SetHackLoopSoundAmountComplete(pctTiming);
                HackBackgroundTextUpdateTimer -= (float)time.ElapsedGameTime.TotalSeconds;
                if (HackBackgroundTextUpdateTimer <= 0)
                {
                    HackBackgroundTextUpdateTimer = HackBackgroundTextUpdateTimerMax;

                    //draw the right number of dots
                    pctTiming = HackTimerMax != 0.0f ? 1.0f - (HackTimerRemaining / HackTimerMax) : 0.0f;
                    int numdots = HackBackgroundMaxDrawDots - (int)((float)HackBackgroundMaxDrawDots * pctTiming);//blah
                    hackbackgroundstringbuilder.Remove(0, hackbackgroundstringbuilder.Length);
                    for(int i = 0; i < numdots; i++)
                    {
                        hackbackgroundstringbuilder.Append(board.r.NextDouble() > 0.5f ? '0' : '1');
                    }
                    board.AddBackgroundTextStandard(new StringBuilder(hackbackgroundstringbuilder.ToString()), 0); //have to create a copy in order for it to be unique in the list
                }
                if (HackTimerRemaining <= 0.0f)
                {
                    Empty = true;
                    PlayerHacking.SetHacking(false);
                    PlayerHacking.HackSuccess();
                    board.StopHackLoopSound();
                    board.PlayHackSuccessSound();
                    board.AwardNodeContents(this);
                    //board.PopUpScoreboard(4.0f);

                    board.AddBackgroundTextAward(new StringBuilder("CRACKER SUCCESSFUL"), 0);
                    board.AddBackgroundTextAward(new StringBuilder("CONTENTS UNENCRYPTED"), 0.25f);
                    board.AddBackgroundTextAward(new StringBuilder("DELETING TRACES"), 0.5f);
                }
            }
        }
Beispiel #2
0
        public void Wander_Update(GameTime time, HackGameBoard board)
        {
            if (this.getMovementDirection() != MovementDirection.MovementDirection_None)
            {
                setTtoDestination(getTtoDestination() + Wander_movementSpeed * (float)time.ElapsedGameTime.TotalSeconds * board.GetSpeedUpFactor());
            }

            else if (nextBoardElementDestinations.Count > 0)
            {
                setDestinationBoardLocation(nextBoardElementDestinations.Pop(), board);
            }

            else
            {
                // we are in the "arrived" sub-mode.
                switch (wanderSubState)
                {
                    case HackGameAgent_AI_Wander_SubState.HackGameAgent_AI_State_Wander_Substate_Ping:
                        Wander_Ping(board);
                        break;
                    case HackGameAgent_AI_Wander_SubState.HackGameAgent_AI_State_Wander_Substate_AnalyzePing:
                        Wander_AnalyzePing(board);
                        break;
                    case HackGameAgent_AI_Wander_SubState.HackGameAgent_AI_State_Wander_Substate_Loiter:
                        Wander_Loiter(board);
                        break;
                }
            }
        }
Beispiel #3
0
 public override void UpdateActiveState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing)
 {
     pingTimer.Update(time);
     if (!pingTimer.IsAlive())
     {
         pingTimer.Reset(heatseeker_pingTime);
         playPing = true;
     }
     if (this.getMovementDirection() != MovementDirection.MovementDirection_None)
     {
         setTtoDestination(getTtoDestination() + heatseeker_movementSpeed * (float)time.ElapsedGameTime.TotalSeconds * board.GetSpeedUpFactor());
     }
     else if (nextBoardElementDestinations.Count > 0)
     {
         setDestinationBoardLocation(nextBoardElementDestinations.Pop(), board);
     }
 }
Beispiel #4
0
 public override void UpdateActiveState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing)
 {
     if (this.getMovementDirection() != MovementDirection.MovementDirection_None)
     {
         setTtoDestination(getTtoDestination() + multimissile_movementSpeed * (float)time.ElapsedGameTime.TotalSeconds * board.GetSpeedUpFactor());
     }
     else if (nextBoardElementDestinations.Count > 0)
     {
         setDestinationBoardLocation(nextBoardElementDestinations.Pop(), board);
     }
 }
Beispiel #5
0
        private void UpdateActiveState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing)
        {
            if (StartPing_Update)
            {
                //be sure we're in a node.
                if (board.InBoard(getCurrentBoardLocation()) && board.GetElementAtPoint(getCurrentBoardLocation()).type == HackGameBoardElementBaseType.HackGameBoardElementBaseType_Node)
                {
                    //do some other stuff here.
                    board.AddBackgroundTextStandard(new StringBuilder("HACKNODE PING #0198"), 0);
                    board.AddBackgroundTextStandard(new StringBuilder("HACKNODE OK"), 0.75f);
                    StartPing_Draw = true;
                    StartPing_Update = false;
                }
            }
            if (this.getMovementDirection() != MovementDirection.MovementDirection_None)
            {
                setTtoDestination(getTtoDestination() + movementSpeed * (float)time.ElapsedGameTime.TotalSeconds * board.GetSpeedUpFactor());
            }
            else if (nextBoardElementDestinations.Count > 0)
            {
                setDestinationBoardLocation(nextBoardElementDestinations.Pop(), board);
            }

            if (isHacking)
            {
                drawing.binaryOneFountain_emitter.Update(time, lastDrawPos + new Vector2(41.0f, 41.0f));
                drawing.binaryZeroFountain_emitter.Update(time, lastDrawPos + new Vector2(41.0f, 41.0f));
            }
        }