Ejemplo n.º 1
0
        private void UpdateSpawningInState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing)
        {
            spawnInData.totalTimer -= (float)time.ElapsedGameTime.TotalSeconds;
            if (spawnInData.totalTimer <= 0)
            {
                SetCurrentState(HackGameAgent_State.HackGameAgent_State_Active);
            }
            else
            {
                if (spawnInData.flashing)
                {
                    spawnInData.dropInFlash.Update(time);
                }
                else
                {
                    spawnInData.dropInLerp.Update(time);
                    if (!spawnInData.dropInLerp.IsAlive())
                    {
                        spawnInData.DrawImpact = true;
                        spawnInData.StartFlashing();

                        board.AddBackgroundTextStandard(new StringBuilder("ACTIVATING ALL SYSTEMS"), 0);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK SENSORS [OK]"), 1);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK ATTACK [OK]"), 0.25f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK UNIT [OK]"), 0.25f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK SWEEP [OK]"), 0.25f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK TORPEDO [OK]"), 0.25f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK SENSORS [OK]"), 0.50f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK ATTACK [OK]"), 0.25f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK UNIT [OK]"), 0.25f);
                        board.AddBackgroundTextStandard(new StringBuilder("HACK SWEEP [OK]"), 0.25f);
                        board.AddBackgroundTextNewline(1.0f);
                        for (int i = 0; i < 10; i++)
                        {
                            board.AddBackgroundTextNewline(0.1f);
                        }
                        board.AddBackgroundTextStandard(new StringBuilder("ALL SYSTEMS GO!"), 0.5f);
                    }
                }
            }
        }
Ejemplo n.º 2
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);
                }
            }
        }
Ejemplo n.º 3
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));
            }
        }