private void Update() { Debug.Log(string.Format("Bandit: {0}", banditObj)); if (Input.GetButtonDown("Attack") && attackCooldown == false) { attackActive = true; GetComponent <ccLocks>().crouchSwitch = false; GetComponent <ccLocks>().jumpSwitch = false; GetComponent <ccLocks>().rotationSwitch = false; GetComponent <Animator>().SetBool("isAttack", true); attackCooldown = true; Invoke("ResetCooldown", 0.1f); float floatRand = Random.Range(1f, 3f); float intRound = Mathf.Round(floatRand); GetComponent <Animator>().SetFloat("Attack", intRound); if (bandit == true && banditObj != null) { banditScript = banditObj.GetComponent <Bandits>(); } } if (Input.GetButtonUp("Attack")) { GetComponent <Animator>().SetBool("isAttack", false); StartCoroutine("AttackTimer"); } }
private void AttackSystem() { Debug.Log(string.Format("Bandit: {0}", banditObj)); if (Input.GetButtonDown("Attack") && attackCooldown == false) { attackActive = true; //movementSwitch = false; crouchSwitch = false; jumpSwitch = false; rotateSwitch = false; playerAnimator.SetBool("isAttack", true); attackCooldown = true; Invoke("ResetCooldown", 1.0f); float floatRand = Random.Range(1f, 3f); float intRound = Mathf.Round(floatRand); playerAnimator.SetFloat("Attack", intRound); if (bandit == true && banditObj != null) { banditScript = banditObj.GetComponent <Bandits>(); } } if (Input.GetButtonUp("Attack")) { playerAnimator.SetBool("isAttack", false); StartCoroutine("AttackTimer"); } }
public override PoEBuild DeepClone() { var o = (PoEBuild)SafeMemberwiseClone(); o.CustomGroups = new ObservableCollection <string[]>(CustomGroups.Select(a => (string[])a.Clone())); o.CheckedNodeIds = new ObservableSet <ushort>(CheckedNodeIds); o.CrossedNodeIds = new ObservableSet <ushort>(CrossedNodeIds); o.AdditionalData = new JObject(AdditionalData); o.Bandits = Bandits.DeepClone(); return(o); }
/// <summary> /// moze sie zdarzyc ze enemy zaatakuje, to jest wlasnie po to /// </summary> private void PossibleEnemy() { Random r = new Random(); int randomNum = r.Next(100); if (randomNum > 70) { Rats rats = new Rats("Brunatne szczury!", 2); rats.DoDamage(this.tavern); MessageBox.Show(rats.GetName() + " atakuja! Tracisz zywnosc!"); } else if (randomNum < 5) { Bandits bandits = new Bandits("Szkarłatna zgraja!"); bandits.DoDamage(this.tavern); MessageBox.Show(bandits.GetName() + " atakuja! Tracisz piwo i monety!!!"); } UpdateResources(); ListViewChanged(); }