public void AddBottle(BottleData type)
 {
     if (bottle.Count <= 8)
     {
         bottle.Add(type);
         UIController.ui.InitPanelObj();
     }
 }
Exemple #2
0
 public void InitPanelObj(BottleData data)
 {
     bottle_data = data;
     if (sprite_rend != null)
     {
         sprite_rend.sprite = data.bottle_sprite;
     }
 }
Exemple #3
0
 public void DrinkBottle(BottleData bottle)
 {
     if (Player.player.CheckIfDefault())
     {
         Player.player.DrinkBottle(bottle);
         soundmanager.sound_manager.SingleSound(SoundSample.drink);
         BottleHandler.b.RemoveBottle(bottle);
         SetBottles();
     }
 }
Exemple #4
0
 public void InitBottle(BottleData data)
 {
     bottle_data = data;
     if (image != null)
     {
         image.sprite = data.bottle_sprite;
     }
     //else
     //{
     //    sprite_rend.sprite = data.bottle_sprite;
     //}
 }
Exemple #5
0
    public void DrinkBottle(BottleData bottle)
    {
        current_bottle     = bottle;
        sprite_rend.sprite = bottle.char_sprite;
        speed = bottle.speed;
        if (!CheckIfDefault())
        {
            hp++;

            for (int i = 0; i < bottle.abil.Length; i++)
            {
                if (bottle.abil[i].ability_type == AbilityType.Passive)
                {
                    passive_abil.Add(bottle.abil[i].enemy_type);
                }
            }
            StartCoroutine(DrinkCor());
        }
        else
        {
            passive_abil.Clear();
        }
    }
Exemple #6
0
    public void Mix()
    {
        Bottle[] bottles_mixing = mix_field.GetComponentsInChildren <Bottle>();
        if (bottles_mixing.Length < 2)
        {
            return;
        }



        List <BottleData> bottle_data = new List <BottleData>();

        for (int i = 0; i < bottles_mixing.Length; i++)
        {
            bottle_data.Add(bottles_mixing[i].bottle_data);
        }

        float          new_speed   = bottle_data[0].speed;
        int            active_abil = 0;
        List <Ability> new_abil    = new List <Ability>();

        for (int i = 0; i < bottle_data.Count; i++)
        {
            for (int j = 0; j < bottle_data[i].abil.Length; j++)
            {
                if ((active_abil < 2) && (bottle_data[i].abil[j].ability_type == AbilityType.Active))
                {
                    new_abil.Add(bottle_data[i].abil[j]);
                    goto mark;
                }
            }

            for (int j = 0; j < bottle_data[i].abil.Length; j++)
            {
                if (bottle_data[i].abil[j].ability_type == AbilityType.Passive)
                {
                    new_abil.Add(bottle_data[i].abil[j]);
                    goto mark;
                }
            }

mark:

            if (bottle_data[i].speed > new_speed)
            {
                new_speed = bottle_data[i].speed;
            }
        }


        BottleData new_data = ScriptableObject.CreateInstance <BottleData>();

        new_data.abil = new Ability[new_abil.Count];
        for (int i = 0; i < new_abil.Count; i++)
        {
            new_data.abil[i] = new_abil[i];
        }
        new_data.speed         = new_speed;
        new_data.bottle_sprite = new_bottle_sprite;
        new_data.char_sprite   = bottle_data[0].char_sprite;
        for (int i = 0; i < bottle_data.Count; i++)
        {
            BottleHandler.b.RemoveBottle(bottle_data[i]);
        }
        BottleHandler.b.AddBottle(new_data);
        soundmanager.sound_manager.SingleSound(SoundSample.mix);
        SetBottles();
    }
 public void RemoveBottle(BottleData data)
 {
     bottle.Remove(data);
 }
Exemple #8
0
 public void Clear()
 {
     sprite_rend.sprite = null;
     bottle_data        = null;
 }