Example #1
0
 public Computer()
 {
     _delay = 0;
     _status = 0;
     _drawn = false;
     _hacking = false;
     _player = null;
 }
Example #2
0
 public Player(int playerIndex)
 {
     _playerIndex = playerIndex;
     _unit = new UnitPlayer(this);
     if (playerIndex != -1)
         _controls = new PlayerControls(_playerIndex);
     else
         _controls = new PlayerControls();
     _money = 1000;
 }
Example #3
0
        public void Interact(UnitPlayer player)
        {
            player.Inventory.Add(this);
            player.UpdateHeader();
            Console.SetCursorPosition(this.Index % Game.MainGame.Board.MaxWidth, this.Index / Game.MainGame.Board.MaxWidth);
            Console.Write(" ");

            Game.MainGame.Board.Tiles[this.Index] = -1;
            Game.MainGame.Board.SpecialTiles[Game.MainGame.Board.SpecialTiles.IndexOf(this)] = null;
            this.Index = -1;
        }
Example #4
0
 public void Draw(int x, int y)
 {
     if (!_drawn)
     {
         if (_status < 20)
             Console.ForegroundColor = ConsoleColor.Green;
         else
             Console.ForegroundColor = ConsoleColor.Blue;
         Console.SetCursorPosition(x, y);
         Console.Write("C");
         Console.ForegroundColor = ConsoleColor.White;
     }
     if (_hacking)
     {
         _delay++;
         if (_delay > 20)
         {
             if ((_player.Y == y && (_player.X == x - 1 || _player.X == x + 1)) ||
                 (_player.X == x && (_player.Y == y - 1 || _player.Y == y + 1)))
             {
                 _status++;
                 if (_status == 20)
                 {
                     _player.Player.Money += 2000;
                     _player.UpdateHeader();
                     _drawn = false;
                     _hacking = false;
                 }
             }
             else
             {
                 _player = null;
                 _hacking = false;
             }
             UpdateHackingStatus();
             _delay = 0;
         }
     }
 }
Example #5
0
        public void Interact(UnitPlayer player)
        {
            if (_locked)
            {
                for (int i = 0; i < player.Inventory.Count; i++)
                    if (player.Inventory[i] is Key)
                    {
                        player.Inventory.RemoveAt(i);
                        player.UpdateHeader();
                        this._locked = false;
                        this.Interact(player);
                        break;
                    }
                return;
            }
            int x = this.Index % Game.MainGame.Board.MaxWidth, y = this.Index / Game.MainGame.Board.MaxWidth;
            this.Clear();

            CheckForDoor(x - 1, y, player);
            CheckForDoor(x + 1, y, player);
            CheckForDoor(x, y - 1, player);
            CheckForDoor(x, y + 1, player);
        }
Example #6
0
        public void Interact(UnitPlayer player)
        {
            this.Clear();

            Console.SetCursorPosition(_lastX, _lastY);
            Console.Write(" ");
            _lastX = _lastY = -1;

            if (player.Guns.Count > 0)
                for (int i = 0; i < player.Guns.Count; i++)
                    if (player.Guns[i].Name == this.Name)
                    {
                        player.Guns[i].Ammo += this.Ammo;
                        player.UpdateHeader();
                        return;
                    }
            player.Guns.Add(this);
            this.Owner = player;
            player.UpdateHeader();
        }
Example #7
0
 public void Interact(UnitPlayer player)
 {
     _player = player;
     Game.MainGame.InCutSchene = _animation = true;
 }
Example #8
0
 public Exit()
 {
     _reverse = _animation = _drawn = false;
     _step = _delay = 0;
     _player = null;
 }
Example #9
0
 public void Interact(UnitPlayer player)
 {
     if (_status < 20)
     {
         if (_player == null)
         {
             _player = player;
             _hacking = true;
         }
     }
 }
Example #10
0
 protected void CheckForDoor(int x, int y, UnitPlayer player)
 {
     if (Game.MainGame.Board[x, y] >= 0)
     {
         if (Game.MainGame.Board.SpecialTiles[Game.MainGame.Board[x, y]] is Door)
         {
             Door d = (Door)Game.MainGame.Board.SpecialTiles[Game.MainGame.Board[x, y]];
             d._locked = this._locked;
             d.Interact(player);
         }
     }
 }