public void CheckOut()
        {
            if (basket.Empty)
            {
                return;
            }

            if (Stats.Money < basket.TotalCost)
            {
                GameLibOfMethods.CreateFloatingText("Not enough money", 2);
                return;
            }

            if (!Inventory.PlaceOnBag(basket.Itemlist))
            {
                GameLibOfMethods.CreateFloatingText("Not enough space in inventory", 2);
                return;
            }

            Stats.GetMoney(basket.TotalCost);
            Stats.AddXP(Type.Charisma, basket.TotalCost * 0.2f);

            ClearBasketItems();

            Inventory.SetBagItemActions(ItemActionOnShopping);
        }
Exemplo n.º 2
0
 public void OnFix()
 {
     BrokenParticleSystem.Stop();
     Progress.transform.parent.gameObject.SetActive(false);
     isBroken            = false;
     RepairProgress      = 0;
     Progress.fillAmount = RepairProgress;
     PlayerAnimationHelper.ResetPlayer();
     Stats.AddXP(Type.Repair, 10);
 }
Exemplo n.º 3
0
    public IEnumerator RunningOnTreadmill()
    {
        GameLibOfMethods.cantMove    = true;
        GameLibOfMethods.canInteract = true;

        SpriteControler.Instance.FaceLEFT();
        GameLibOfMethods.animator.SetBool("Jumping", false);
        GameLibOfMethods.animator.SetBool("Walking", true);
        GameLibOfMethods.animator.SetFloat("Horizontal", -1);

        yield return(new WaitForFixedUpdate());


        while (!Input.GetKey(InteractionChecker.Instance.KeyToInteract))
        {
            GameLibOfMethods.animator.SetBool("Walking", true);

            SpriteControler.Instance.FaceLEFT();

            Stats.AddXP(Fitness, 0.027777778f);
            Stats.Status(Energy).Remove(0.027777778f);

            if (Stats.Status(Energy).CurrentAmount <= 0 || Stats.Status(Health).CurrentAmount <= 0)
            {
                break;
            }


            yield return(new WaitForFixedUpdate());
        }
        GameLibOfMethods.animator.SetFloat("Horizontal", 0);

        Debug.Log("Playing exit sound");
        PlayExitSound();

        GameLibOfMethods.animator.SetBool("Walking", false);
        yield return(new WaitForEndOfFrame());


        if (Stats.Status(Energy).CurrentAmount <= 0 || Stats.Status(Health).CurrentAmount <= 0)
        {
            void act() => GameLibOfMethods.animator.SetBool("PassOut", true);

            PlayerCommands.JumpOff(0, act);
        }
        else
        {
            PlayerCommands.JumpOff();
        }
    }
Exemplo n.º 4
0
    public IEnumerator StartLifting()
    {
        GameLibOfMethods.animator.SetBool("Jumping", false);
        GameLibOfMethods.animator.SetBool("Lifting", true);
        Weights.SetActive(false);

        yield return(new WaitForEndOfFrame());

        SpriteControler.Instance.FaceRIGHT();

        while (!Input.GetKey(InteractionChecker.Instance.KeyToInteract))
        {
            Stats.AddXP(Strength, 0.027777778f);
            Stats.Status(Energy).Remove(0.027777778f);

            if (Stats.Status(Energy).CurrentAmount <= 0 || Stats.Status(Health).CurrentAmount <= 0)
            {
                break;
            }

            yield return(new WaitForFixedUpdate());
        }

        Debug.Log("Playing exit sound");
        PlayExitSound();

        GameLibOfMethods.animator.SetBool("Lifting", false);
        yield return(new WaitForEndOfFrame());

        Weights.SetActive(true);


        if (Stats.Status(Energy).CurrentAmount <= 0 || Stats.Status(Health).CurrentAmount <= 0)
        {
            void act() => GameLibOfMethods.animator.SetBool("PassOut", true);

            PlayerCommands.JumpOff(0, act);
        }
        else
        {
            PlayerCommands.JumpOff();
        }
    }
        public void CheckOut()
        {
            if (basket.Empty)
            {
                return;
            }

            if (Stats.Money < basket.TotalCost)
            {
                GameLibOfMethods.CreateFloatingText("Not enough money", 2);
                return;
            }

            Stats.GetMoney(basket.TotalCost);
            Stats.AddXP(Type.Charisma, basket.TotalCost * 0.2f);

            ExecuteUpgrades();

            Shop.CloseUpgradeShop();
        }