Example #1
0
    public bool SelectToy(string toy, RuneType rune, bool quietly)
    {
        //   Debug.Log("Select toy " + toy + "\n") ;
        if (toy == null)
        {
            toy = "";
        }

        if (toy.Equals(toy_selected))
        {
            return(toy_selected.Equals(""));
        }

        if (toy.Equals(""))
        {
            toy_selected = null;
            SetAllowedRange("");

            if (!quietly && onSelected != null)
            {
                onSelected(SelectedType.Toy, "");
            }

            return(false);
        }
        else
        {
            rune_selected = rune;
            unitStats stats = Central.Instance.getToy(toy);
            if (stats == null)
            {
                return(false);
            }

            toy_selected = new SelectedToy(toy, stats.island_type);

            SetAllowedRange(toy_selected.name);

            if (!quietly && onSelected != null)
            {
                onSelected(SelectedType.Toy, toy_selected.name);
            }

            return(true);
        }
    }
Example #2
0
    void Init()
    {
        Debug.Log("Peripheral INITIALIZING\n");
        //done_making_wave = false;
        targets       = new MyArray <HitMe>();
        monster_count = 0;
        level_state   = LState.WaveButton;
        //wave_button_visible = false;
        my_inventory.InitWishes();
        cities                = new List <int>();
        have_cities           = false;
        building_a_city       = false;
        default_wave_interval = 0.1f;           // waves are spaced at least X seconds apart
        next_wave_time        = 0.5f;           // first wave time
        previous_timeScale    = TimeScale.Normal;
        current_timeScale     = TimeScale.Normal;
        setTimeScale(current_timeScale);
        toy_parents = new List <Toy>();
        firearms    = new List <Firearm>();
        // haveToys = new List<string>();
        haveMonsters  = new Dictionary <string, bool>();
        toy_selected  = null;
        rune_selected = RuneType.Null;
        //	monsters = 0;
        Wave_interval     = 0;
        next_monster_time = 0;
        level_active      = false;

        island_selected = null;
        make_wave       = false;
        dreams          = 0;
        toys            = 0;
        all_toys        = 0;
        TIME            = 0f;
        my_inventory.InitWishes();
        hero_points = new Dictionary <RuneType, int> {
            { RuneType.Sensible, 1 }, { RuneType.Airy, 1 }, { RuneType.Vexing, 1 }
        };
        zoo = Zoo.Instance;
    }