public override void InitializeWeaponList() { //Use this to initialize weapon list AND alliance state foreach (Transform child in transform) { GeneralObject childScript = child.GetComponent <GeneralObject>(); if (childScript != null) { childScript.myAllianceState = myAllianceState; NormalGun childWeaponScript = child.GetComponent <NormalGun>(); if (childWeaponScript != null) { childWeaponScript.fromPlayer = true; if (childScript.GetComponent <UltimateWeapon>() != null) { ultimateList.Add(child); child.GetComponent <NormalGun>().canFire = false; } else { weaponList.Add(child); child.GetComponent <NormalGun>().canFire = false; } } } } }
//Weapon stuff public virtual void UseGun(NormalGun curGun) { if (canAttack == true && curGun != null && curGun.fireCoroutine == null) { curGun.fireCoroutine = StartCoroutine(curGun.Fire()); } }
public void RemoveActiveWeapon(int indx) { NormalGun weaponScript = weaponList[indx].GetComponent <NormalGun>(); activeWeaponList.Remove(weaponList[indx]); weaponScript.canFire = false; }
public virtual void AddActiveWeapon(int indx) { NormalGun weaponScript = weaponList[indx].GetComponent <NormalGun>(); activeWeaponList.Add(weaponList[indx]); weaponScript.canFire = true; }
public override void Add(Point mouseLocation) { NormalGun gun = new NormalGun(); gun.Location = mouseLocation; gun.IdItem = model.Map.ListItems.Count; model.Map.ListItems.Add(gun); }
public override void UseGun(NormalGun curGun) { if (canAttack == true && curGun != null && curGun.fireCoroutine == null) { float rageCost = curGun.bulletList[curGun.curIndx].rageCost; if (curRage >= rageCost) { curRage = ClampRage(curRage - rageCost); curGun.fireCoroutine = StartCoroutine(curGun.Fire()); } } }
public bool GenerateItems() //карта { try { Random n = new Random(); List <Item> ListItems = new List <Item>(); int Count = model.Map.MapBorders.Height * model.Map.MapBorders.Width / 450000; for (int i = 0; i < Count; i++) { NormalShotgun gun = new NormalShotgun(); Thread.Sleep(7); gun.Location = new Point(n.Next(0, model.Map.MapBorders.Width), n.Next(0, model.Map.MapBorders.Height)); gun.IdItem = ListItems.Count; ListItems.Add(gun); } for (int i = 0; i < Count; i++) { NormalGun gun = new NormalGun(); Thread.Sleep(8); gun.Location = new Point(n.Next(0, model.Map.MapBorders.Width), n.Next(0, model.Map.MapBorders.Height)); gun.IdItem = ListItems.Count; ListItems.Add(gun); } for (int i = 0; i < Count; i++) { Grenade grenade = new Grenade(); Thread.Sleep(8); grenade.Location = new Point(n.Next(0, model.Map.MapBorders.Width), n.Next(0, model.Map.MapBorders.Height)); grenade.IdItem = ListItems.Count; ListItems.Add(grenade); } for (int i = 0; i < Count; i++) { NormalPistol pistol = new NormalPistol(); Thread.Sleep(8); pistol.Location = new Point(n.Next(0, model.Map.MapBorders.Width), n.Next(0, model.Map.MapBorders.Height)); pistol.IdItem = ListItems.Count; ListItems.Add(pistol); } model.Map.ListItems = ListItems; return(true); } catch { return(false); } }
public override void AddActiveWeapon(int indx) { NormalGun weaponScript = weaponList[indx].GetComponent <NormalGun>(); activeWeaponList.Add(weaponList[indx]); weaponScript.canFire = true; if (weaponScript.myTag.Contains("Ulti")) { curUlti = weaponScript; } else if (weaponScript.myTag.Contains("Single")) { curSingle.Add(weaponScript); } else if (weaponScript.myTag.Contains("Multi")) { curMulti = weaponScript; } }