Beispiel #1
0
    public void RoundToInt(string cost)
    {
        int itemCost = 0;

        if (cost[0] == '$')
        {
            itemCost = YarnGeneral.IntFromVariableName(cost, ds.Storage);
        }
        else
        {
            itemCost = Mathf.CeilToInt(float.Parse(cost));
        }
        ds.Storage.SetValue("$rounded_num", itemCost);
    }
Beispiel #2
0
    public void CheckAffordability(string cost)
    {
        int itemCost = 0;

        if (cost[0] == '$')
        {
            itemCost = YarnGeneral.IntFromVariableName(cost, ds.Storage);
        }
        else
        {
            itemCost = Mathf.CeilToInt(float.Parse(cost));
        }
        ds.Storage.SetValue("$can_afford", Globals.GameVars.playerShipVariables.ship.currency >= itemCost);
    }
Beispiel #3
0
    public void PayAmount(string cost)
    {
        int itemCost = 0;

        if (cost[0] == '$')
        {
            itemCost = YarnGeneral.IntFromVariableName(cost, ds.Storage);
        }
        else
        {
            itemCost = Mathf.RoundToInt(float.Parse(cost));
        }

        Globals.GameVars.playerShipVariables.ship.currency -= itemCost;
        ds.UpdateMoney();
    }