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; }
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; }
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); }
public void SetWeaponBox(WeaponBoxScript wp) { takenWeaponBox = wp; }