void ShootArrow() { if (!isHit) { audioCont.PlaySound(shootSound); ArrowController arrowCont = arrowInstance.GetComponent<ArrowController>(); if (abilityIndex == 4 && !isNoble) { arrowCont.SetRicochetAbility(1, this); } arrowCont.Shoot((200 + (50 * timeFactor)), isNoble, true, player.transform.position); } }
public void ArrowAbility() { float plusRot = Random.Range(-Mathf.PI / 8, Mathf.PI / 8); for (int i = 0; i < 8; i++) { GameObject arrowInstance = Instantiate(arrow, transform.position, Quaternion.Euler(0, 0, 0 + i * 45)); arrowInstance.transform.localScale = arrow.transform.localScale * 2; ArrowController arrowCont = arrowInstance.GetComponentInChildren <ArrowController>(); arrowCont.SetRicochetAbility(2, null); arrowCont.Shoot(5000, false, true, new Vector3(Mathf.Round(transform.position.x + Mathf.Sin(i * Mathf.PI / 4 + plusRot)), transform.position.y + Mathf.Sin((i - 2) * Mathf.PI / 4 + plusRot), 0)); } }
//Call from animation private void Shoot() { _arrow.Shoot(BattleManager.GetPlayer(), _mediator.Stats.AttackPower); }