Beispiel #1
0
    public void updateInfoBoxLabel()
    {
        if (info_box == null)
        {
            return;
        }
        String str = (!my_wish.absolute) ? Show.ToPercent(my_wish.getEffect()) : my_wish.getEffect().ToString();

        String[] hey = { str, Mathf.CeilToInt(my_wish.getTime()).ToString() };
        MyLabel  l   = info_box.GetComponent <MyLabel>();

        l.text.text = Show.FixText(l.content, hey);
    }
Beispiel #2
0
    void OnEnable()
    {
        _InitPeripheral();

        position = parent.position;

        max_height = my_peripheral.tileSize * 50;
        velocity   = .03f;
        direction  = new Vector2(0, 0);
        if (transform.position.x > 0)
        {
            direction.x = -x_direction();
        }
        else
        {
            direction.x = x_direction();
        }
        if (transform.position.y > 0)
        {
            direction.y = -y_direction();
        }
        else
        {
            direction.y = y_direction();
        }

        Vector3 new_scale = (0.3f + 0.2f * stats.getEffect()) * Vector3.one;

        new_scale.z = 1f;
        sprite.transform.localScale = new_scale;
        //   Debug.Log("Setting wish size\n");

        _update_position();
        //StartCoroutine("SlowMe");
    }
Beispiel #3
0
    bool DoTheThing(Wish w)
    {
        Tracker.Log(PlayerEvent.UsedInventory, true,
                    customAttributes: new Dictionary <string, string>()
        {
            { "attribute_2", Peripheral.Instance.difficulty.ToString() },
            { "attribute_1", w.type.ToString() }
        },
                    customMetrics: new Dictionary <string, double>()
        {
            { "metric_1", w.getEffect() }
        });

        bool status = false;

        switch (w.type)
        {
        case WishType.MoreXP:
            status = Peripheral.Instance.xp_factor.AddEffect(w.getEffect(), w.getTime());
            break;

        case WishType.MoreDreams:
            status = Peripheral.Instance.dream_factor.AddEffect(w.getEffect(), w.getTime());
            break;

        case WishType.MoreDamage:
            status = Peripheral.Instance.damage_factor.AddEffect(w.getEffect(), w.getTime());
            break;

        case WishType.MoreHealth:
            Peripheral.Instance.AdjustHealth(w.getEffect());
            status = true;
            break;

        default:
            Debug.Log("Inventory does not know how to deal with wishtype " + w.type + "\n");
            break;
        }
        return(status);

        //return status;
    }