add all mechanics
This commit is contained in:
parent
87383d5b8c
commit
0e2a7cc7c3
434 changed files with 238349 additions and 2092 deletions
|
|
@ -56,8 +56,11 @@ public class CirnoFreezeDeflect : EnemyAbility
|
|||
currentDelay -= Time.deltaTime;
|
||||
if (currentDelay <= 0)
|
||||
{
|
||||
if (projectilesInRange.Count > 0)
|
||||
{
|
||||
currentDissipationTime = sweepDissipationTime;
|
||||
}
|
||||
DeflectProjectiles();
|
||||
currentDissipationTime = sweepDissipationTime;
|
||||
swordSweepEffect.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ public class EnemyAbility : Ability
|
|||
|
||||
public override bool TryAbility()
|
||||
{
|
||||
WaveManager.instance.audioSource.PlayOneShot(abilitySound, volume);
|
||||
if (willLookAtPlayer)
|
||||
{
|
||||
direction = WaveManager.instance.GetRandomPlayerPoint();
|
||||
|
|
@ -20,9 +21,13 @@ public class EnemyAbility : Ability
|
|||
}
|
||||
return base.TryAbility();
|
||||
}
|
||||
public void ShootProjectile(Projectile projectile, Vector3 location, float speed, bool aimed)
|
||||
public void ShootProjectile(Projectile projectile, Vector3 location, float speed, bool aimed, Transform bulletParent = null)
|
||||
{
|
||||
Projectile newProjectile = Instantiate(projectile, origin.position, Quaternion.identity);
|
||||
if (bulletParent)
|
||||
{
|
||||
newProjectile.transform.SetParent(bulletParent);
|
||||
}
|
||||
Vector3 projectileDirection = location;
|
||||
if (aimed)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public class EnemyBulletPattern : EnemyAbility
|
|||
public float burstTiming;
|
||||
public float projectileSpeed;
|
||||
public bool aimedShot;
|
||||
public Transform bulletParent = null;
|
||||
}
|
||||
|
||||
[SerializeField] protected ProjectileDirection[] projectileDirections;
|
||||
|
|
@ -33,7 +34,7 @@ public class EnemyBulletPattern : EnemyAbility
|
|||
{
|
||||
if (projectileDirection.timing <= 0 && projectileDirection.amount <= 1)
|
||||
{
|
||||
ShootProjectile(projectileDirection.projectile, projectileDirection.direction.position, projectileDirection.projectileSpeed, projectileDirection.aimedShot);
|
||||
ShootProjectile(projectileDirection.projectile, projectileDirection.direction.position, projectileDirection.projectileSpeed, projectileDirection.aimedShot, projectileDirection.bulletParent);
|
||||
}
|
||||
else if (projectileDirection.amount > 1)
|
||||
{
|
||||
|
|
@ -51,7 +52,7 @@ public class EnemyBulletPattern : EnemyAbility
|
|||
int currentCount = 0;
|
||||
while (currentCount < burstCount)
|
||||
{
|
||||
ShootProjectile(projectile.projectile, projectile.direction.position, projectile.projectileSpeed, projectile.aimedShot);
|
||||
ShootProjectile(projectile.projectile, projectile.direction.position, projectile.projectileSpeed, projectile.aimedShot, projectile.bulletParent);
|
||||
currentCount++;
|
||||
yield return new WaitForSeconds(burstDelay);
|
||||
}
|
||||
|
|
@ -72,7 +73,7 @@ public class EnemyBulletPattern : EnemyAbility
|
|||
}
|
||||
else
|
||||
{
|
||||
ShootProjectile(projectile.projectile, projectile.direction.position, projectile.projectileSpeed, projectile.aimedShot);
|
||||
ShootProjectile(projectile.projectile, projectile.direction.position, projectile.projectileSpeed, projectile.aimedShot, projectile.bulletParent);
|
||||
}
|
||||
}
|
||||
yield return null;
|
||||
|
|
|
|||
14
Assets/Scripts/Abilities/MultiPattern.cs
Normal file
14
Assets/Scripts/Abilities/MultiPattern.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class MultiPattern : EnemyAbility
|
||||
{
|
||||
[SerializeField] private EnemyBulletPattern[] patterns;
|
||||
protected override void AbilityEffects()
|
||||
{
|
||||
base.AbilityEffects();
|
||||
foreach (EnemyBulletPattern pattern in patterns)
|
||||
{
|
||||
pattern.TryAbility();
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Abilities/MultiPattern.cs.meta
Normal file
2
Assets/Scripts/Abilities/MultiPattern.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3ab2599b41b50f9c386745492b5e289f
|
||||
|
|
@ -170,7 +170,7 @@ public class YoumuDeflect : Ability
|
|||
List<Enemy> enemiesFound = new();
|
||||
foreach (Collider2D foundEntity in entitiesFound)
|
||||
{
|
||||
if (!foundEntity.CompareTag(tag) && foundEntity.TryGetComponent(out Enemy isEnemy))
|
||||
if (!foundEntity.CompareTag(tag) && foundEntity.TryGetComponent(out Enemy isEnemy) && !isEnemy.isBossEnemy)
|
||||
{
|
||||
enemiesFound.Add(isEnemy);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue