示例#1
0
 public void OnInteract(T_Player player)
 {
     if (HasEaten)
     {
         return;
     }
     if (player.ServeCustomer(ingredients))
     {
         player.IncrementScore(ingredients.Count * Constants.SATISFIED_CUSTOMER_REWARD);
         player.IncrementTime(ingredients.Count * Constants.SATISFIED_CUSTOMER_REWARD_TIME);
         State = CustomerState.LEAVING;
         player.ThrowInDustbin();
     }
     else
     {
         if (State != CustomerState.ANGRY)
         {
             failedServer = player;
             State        = CustomerState.ANGRY;
         }
         else
         {
             if (player == failedServer)
             {
                 failedServer.IncrementScore(2 * Constants.ANGRY_CUSTOMER_PENALTY);
             }
             else
             {
                 playerManager.PenalizeAll();
             }
             State = CustomerState.LEAVING;
         }
     }
 }
示例#2
0
 public void OnInteract(T_Player player)
 {
     if (player.ThrowInDustbin())
     {
         player.IncrementScore(Constants.ANGRY_CUSTOMER_PENALTY);
     }
 }
示例#3
0
    private void Wait(int units)
    {
        waitTimeCounter -= units * Time.deltaTime;
        progressScale.x  = waitTimeCounter / waitingDelay;
        progress.transform.localScale = progressScale;

        if (waitTimeCounter <= 0)
        {
            if (failedServer != null)
            {
                failedServer.IncrementScore(2 * Constants.ANGRY_CUSTOMER_PENALTY);
            }
            else
            {
                playerManager.PenalizeAll();
            }
            State = CustomerState.LEAVING;
        }
    }
示例#4
0
 public void PenalizeAll()
 {
     playerOne.IncrementScore(Constants.ANGRY_CUSTOMER_PENALTY);
     playerTwo.IncrementScore(Constants.ANGRY_CUSTOMER_PENALTY);
 }