Moved rumia NS 1 to spiral pattern

This commit is contained in:
Marco 2025-02-12 16:51:00 +01:00
commit 1db132d77d
4 changed files with 46 additions and 5 deletions

View file

@ -25,10 +25,14 @@ public partial class SpiralPattern : AttackPattern
[Export] private Resource _modifier;
[Export] private Array<Resource> _timeModifiers;
[Export] private bool _targetPlayer = false;
private double timer;
private double burstTimer;
private BulletSpawner spawner;
private GameManager _gameManager;
public override void Start(Boss boss)
{
Boss = boss;
@ -43,12 +47,20 @@ public partial class SpiralPattern : AttackPattern
burstTimer += delta;
if (timer < duration && burstTimer >= burstInterval)
{
float angleOffset = (float)(rotationSpeed * timer);
float angleOffset = _rotationOffset + (float)(rotationSpeed * timer);
Vector2 direction = Vector2.Right;
;
if (_targetPlayer && Boss.GameManager.PlayerPosition.HasValue)
{
direction = (Boss.GameManager.PlayerPosition.Value - Boss.GlobalPosition).Normalized();
}
spawner.SpawnBullet(new BulletInfo()
{
Position = Boss.GlobalPosition,
Direction = Vector2.Right,
Direction = direction,
Speed = bulletSpeed,
Owner = owner,
DamageType = _damageType,
@ -56,7 +68,7 @@ public partial class SpiralPattern : AttackPattern
BulletCount = bulletCount,
Spread = spread,
BulletScene = BulletScene,
RotationOffset = _rotationOffset,
RotationOffset = angleOffset,
Modifier = _modifier as IBulletModifier,
TimeModifiers = _timeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().ToList() ?? new List<TimeModifier>()
});