Exemplo n.º 1
0
    public void UseAmmo()
    {
        if (ammo == -1)
        {
            return;
        }

        ammo -= ammo_per_shot;

        if (ammo_panel != null)
        {
            ammo_panel.SetAmmo();
        }
        else
        {
            Debug.Log($"{gameObject.name} Ammo panel is empty!\n");
        }

        if (ammo == 0)
        {
            active = false;
            if (toy.parent_toy != null)
            {
                toy.parent_toy.RemoveTargetToy(toy);
            }

            toy.Die(reload_time * .8f);
        }
    }
Exemplo n.º 2
0
    void DoModulatorStuff()
    {
        my_toy.Die(0f);
        IslandType new_type = (my_toy.island.island_type == IslandType.Permanent) ? IslandType.Temporary : IslandType.Permanent;

        my_toy.island.ChangeType(new_type, false);
    }
Exemplo n.º 3
0
    /*
     *  public void getToy(ref string s){
     *          string name;
     *          Central.Instance.effect_toys.TryGetValue (Get.RuneTypeFromString (s), out name);
     *          if (name != null) {
     *                  s = name;
     *          }
     *  }
     */



    public void sellToy(Toy toy, int cost)
    {
        addDreams(cost, toy.transform.position, false);

        Tracker.Log(PlayerEvent.SellTower, true,
                    customAttributes: new Dictionary <string, string>()
        {
            { "attribute_1", toy.my_name }, { "attribute_2", toy.island.ID }
        },
                    customMetrics: new Dictionary <string, double>()
        {
            { "metric_1", toy.rune.order }
        });

        toy.Die(0f);
        if (toy.toy_type == ToyType.Hero)
        {
            int i = 0;
            hero_points.TryGetValue(toy.runetype, out i);
            SetHeroPoint(toy.runetype, i + 1, true);
        }
        else
        {
            if (onSellToy != null)
            {
                onSellToy();
            }
        }



        Monitor.Instance.global_rune_panel.DisableMe();
        if (onSelected != null)
        {
            onSelected(SelectedType.Island, "");
        }
    }