Added offsets and remade modifiers system

This commit is contained in:
Marco 2025-05-09 11:46:58 +02:00
commit aab69fb609
16 changed files with 474 additions and 426 deletions

View file

@ -1,4 +1,5 @@
using Godot;
using Cirno.Scripts.Components;
using Godot;
namespace Cirno.Scripts.Resources;
@ -8,7 +9,13 @@ public partial class DecreasingSpeedModifier : BulletCreationModifier, IBulletMo
{
[Export] private float decreaseRate = 0.1f;
public override float ModifySpeed(float baseSpeed, int bulletIndex, int totalBullets)
public override BulletInfo ModifyBullet(BulletInfo bullet, int bulletIndex, int totalBullets)
{
bullet.Speed = ModifySpeed(bullet.OriginalBulletResource.BulletSpeed, bulletIndex, totalBullets);
return bullet;
}
public float ModifySpeed(float baseSpeed, int bulletIndex, int totalBullets)
{
return Mathf.Max(0, baseSpeed - (decreaseRate * bulletIndex));
}