Exemplo n.º 1
0
    /// <summary>
    /// This removes the held item from the player's character and deposits it into the monster machine.
    /// </summary>
    public void DepositValue()
    {
        //This will need to be where the audio clips are played from.
        //PSUEDO: Add a check to see if the resource value can even be added to begin with.
        switch (pHeldActions.heldAction.StatBoostType)
        {
        case Action.StatType.Food:
            rMgr.FoodTotal += pHeldActions.heldAction.NodeAmount;
            pActList.AddActivity(pHeldActions.heldAction.ActionName, pHeldActions.heldAction.ActionCost);
            GameObject.Find("Bucket_AtClient").GetComponent <BucketTrigger>().IsTriggerActive = true;    //The bucket can be picked up by the player.
            GameObject.Find("Field Objects").GetComponent <BucketManager>().AtPipe            = false;
            GameObject.Find("Field Objects").GetComponent <BucketManager>().InPlayerPosession = false;
            GameObject.Find("Field Objects").GetComponent <BucketManager>().AtClient          = true; //The bucket is at the client.
            GameObject.Find("AudioManager").GetComponent <AudioManager>().PlayFullDrop();
            Debug.Log("Trigger [CLIENT]: Bucket placed at Client.");
            GameObject.Find("HUD_Held").GetComponent <HeldHUD>().ShownHUD = HeldHUD.HUDElement.Empty;
            GameObject.Find("ChiliSwitch").GetComponent <ChiliSwitch>().SwitchDisabled = false;    //Re-enable this stupid f*****g switch
            GameObject.Find("Reboot Trigger").GetComponent <RebootManager>().RandomBSODChanceTrigger();
            break;

        case Action.StatType.Water:
            rMgr.WaterTotal += pHeldActions.heldAction.NodeAmount;
            pActList.AddActivity(pHeldActions.heldAction.ActionName, pHeldActions.heldAction.ActionCost);
            //PSUEDO: Set HUD_Held.
            GameObject.Find("HUD_Held").GetComponent <HeldHUD>().ShownHUD = HeldHUD.HUDElement.Empty;
            Debug.Log($"Adding Water: {pHeldActions.heldAction.NodeAmount.ToString()}");
            break;

        case Action.StatType.Entertainment:
            rMgr.EntertainmentTotal += pHeldActions.heldAction.NodeAmount;
            pActList.AddActivity(pHeldActions.heldAction.ActionName, pHeldActions.heldAction.ActionCost);
            GameObject.Find("HUD_Held").GetComponent <HeldHUD>().ShownHUD = HeldHUD.HUDElement.Empty;
            GameObject.Find("Reboot Trigger").GetComponent <RebootManager>().RandomBSODChanceTrigger();
            break;

        case Action.StatType.Heat:
            rMgr.HeatTotal += pHeldActions.heldAction.NodeAmount;
            pActList.AddActivity(pHeldActions.heldAction.ActionName, pHeldActions.heldAction.ActionCost);
            GameObject.Find("HUD_Held").GetComponent <HeldHUD>().ShownHUD = HeldHUD.HUDElement.Empty;
            GameObject.Find("Reboot Trigger").GetComponent <RebootManager>().RandomBSODChanceTrigger();
            break;

        default:
            break;
        }

        pHeldActions.heldAction = null;
    }