Пример #1
0
    public void SetWeapon(string w)
    {
        if (w == "Aku-Aku")
        {
            if (baddie)
            {
                w = "Uka-Uka";
            }
        }

        if (w.IndexOf("triple") != -1)
        {
            int j = weapons.Count;
            if (j == 0)
            {
                j = 3;
            }
            weapons = new List <string> ();
            for (int i = 0; i < j; i++)
            {
                //[w.Split('_').Length - 1] = [1]
                weapons.Add(w.Split('_')[1]);                 //w.Split('_').Length - 1]);
            }
        }
        else
        {
            weapons = new List <string> ();
            weapons.Add(w);
        }
        if (!kart_state.IsArmed)
        {
            kart_state.IsArmed = true;
        }
        takenWeaponBox = null;
    }
Пример #2
0
    public void GetWeapon(GameObject box)
    {
        WeaponBoxScript s = box.GetComponent <WeaponBoxScript> ();

        ammo     = s.ammo;
        ammoMax  = s.ammoMax;
        fireRate = s.fireRate;
        power    = s.power;
        sprite   = s.sprite;
        bullet   = GameObject.Instantiate(s.bullet);
        bullet.SetActive(false);
        isEquiped = true;
    }
Пример #3
0
    public void UseWeapon()
    {
        // stop the random searching of weapon from WeaponBox
        if (takenWeaponBox != null)
        {
            if (takenWeaponBox.selectRandomWeapon())
            {
                takenWeaponBox = null;
            }
            return;
        }

        // while wearing a tnt you can't use a weapon
        if (tnt)
        {
            return;
        }

        Vector3 posToAdd = Vector3.zero;


        if (weapons.Count == 0)
        {
            return;
        }
        // apply
        string w = weapons [0];

        // superisation
        if (IsSuper())
        {
        }

        // computing the side


        //use the weapon so remove
        weapons.RemoveAt(0);
    }
Пример #4
0
 public void SetWeaponBox(WeaponBoxScript wp)
 {
     takenWeaponBox = wp;
 }