Exemple #1
0
    public bool addedCity(bool added, Toy added_tower)
    {
        if (added_tower.runetype != RuneType.SensibleCity)
        {
            return(have_cities);
        }

        if (added)
        {
            Peripheral.Instance.building_a_city = false;
            bool need_to_update_buttons = !have_cities;
            ListUtil.Add <int>(ref cities, added_tower.gameObject.GetInstanceID());
            have_cities = true;


            if (need_to_update_buttons)
            {
                EagleEyes.Instance.UpdateToyButtons("blah", ToyType.Temporary, false);
            }
        }
        else
        {
            ListUtil.Remove <int>(ref cities, added_tower.gameObject.GetInstanceID());
            bool need_to_update_buttons = have_cities;

            have_cities = (cities.Count > 0);

            if (need_to_update_buttons)
            {
                EagleEyes.Instance.UpdateToyButtons("blah", ToyType.Temporary, false);
            }
        }
        return(have_cities);
    }
Exemple #2
0
    public void onWishChanged(Wish w, bool added, bool visible, float delta)
    {
        //if (w.type != WishType.Sensible) return;
        WishDial possible = getPossibleWish(w.type);

        if (possible == null)
        {
            WishDial add_me = new WishDial();
            add_me.type = w.type;
            ListUtil.Add <WishDial>(ref this.possible_wishes, add_me);
            possible = getPossibleWish(w.type);
        }

        if (w.type == WishType.Sensible)
        {
            //     Debug.Log("On wishes added " + w.type + " ADD " + added + "\n");
            int add = (int)w.Strength; // I have no idea why this is so

            //adjustment = previous wish count
            if (add - (int)possible.adjustment > 0)
            {
                possible.count += add - (int)possible.adjustment;
            }

            possible.adjustment = add;
        }
        else
        {
            int add = w.count;
            //        Debug.Log("On wishes added " + w.type + " ADD " + add + "\n");
            if (added)
            {
                possible.count += add;
            }
        }
    }