cirnogodot/Scripts/Resources/DecreasingSpeedModifier.cs

14 lines
380 B
C#
Raw Normal View History

2025-02-05 19:41:49 +01:00
using Godot;
namespace Cirno.Scripts.Resources;
[GlobalClass]
2025-02-13 14:32:24 +01:00
public partial class DecreasingSpeedModifier : BulletCreationModifier, IBulletModifier
2025-02-05 19:41:49 +01:00
{
[Export] private float decreaseRate = 0.1f;
2025-02-13 14:32:24 +01:00
public override float ModifySpeed(float baseSpeed, int bulletIndex, int totalBullets)
2025-02-05 19:41:49 +01:00
{
return Mathf.Max(0, baseSpeed - (decreaseRate * bulletIndex));
}
}