Exemplo n.º 1
0
 void AddAction(ESCRoom.RoomDirection dir, ActionType action)
 {
     if (action != ActionType.None)
     {
         if (!siblingActions.ContainsKey(dir))
         {
             siblingActions[dir] = new List <ActionType>();
         }
         siblingActions[dir].Add(action);
     }
 }
Exemplo n.º 2
0
    //Pushed Button
    public void PerformAction(ESCRoom.RoomDirection dir, ActionType action, int playerId)
    {
        switch (action)
        {
        case ActionType.Discover:
            currentRoom.InsertSibling(dir);
            break;

        case ActionType.Move:
            currentRoom = currentRoom.Siblings[dir];
            break;

        case ActionType.OpenMinorLock:
            --maze.Gems;
            currentRoom.InnerCondition = null;
            break;

        case ActionType.OpenNormalLock:
            maze.Gems -= 2;
            currentRoom.InnerCondition = null;
            break;

        case ActionType.OpenBigLock:
            maze.Gems -= 3;
            currentRoom.InnerCondition = null;
            break;

        case ActionType.Exit:
            List <ESCPlayer> playerList = GameObject.FindObjectOfType <ESCEngine>().PlayerList;
            playerList[playerId].dice.Synthesize();
            playerList.Remove(this);
            break;
        }

        roomAction.Clear();
        siblingActions.Clear();
    }