void SetAttack() { SetPlayerAttack(); switch (enemyType) { case EnemyStats.EnemyType.Skull: if (!isSpinning) { skullAttack = SkullAttacks.BasicAttack; } else { skullAttack = SkullAttacks.SpinAttack; alreadyAttacked = false; } break; case EnemyStats.EnemyType.Fenrir: if (!isJumping) { enemyAgent.SetDestination(transform.position); Random.InitState(Random.Range(0, 300)); basicAttackIndex = Random.Range(0, baAnimationLength); baAnimationTimesPlayed = 0; fenrirAttack = FenrirAttacks.BasicAttack; } else { isJumpingIn = true; jumpAttacking = false; jumpAvailable = false; hasStartedJumpAttack = false; hasJumpAttacked = false; alreadyAttacked = false; jumpDelayTime = jumpInitDelayTime; jumpAttackTime = jumpAttackInitTime; fenrirAttack = FenrirAttacks.JumpAttack; } break; default: break; } enemyState = EnemyStates.Attack; }
void SpinAttackUpdateS() { if (isSpinning) { if (weaponTriggerHit) { Vector3 directionToTarget = transform.position - targetTransform.position; float desiredAngle = Mathf.Atan2(directionToTarget.x, directionToTarget.z) * Mathf.Rad2Deg; targetBehaviour.SetDamage(24, true, Quaternion.Euler(0, desiredAngle, 0)); weaponTriggerHit = false; isSpinning = false; enemyAgent.angularSpeed = enemyAngularSpeed; skullAttack = SkullAttacks.BasicAttack; SetSpeed(); } } }