mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-03 20:25:54 +00:00
Made bullet creation modifier generics
This commit is contained in:
parent
9ae07e5b38
commit
797e24d766
7 changed files with 46 additions and 10 deletions
|
|
@ -3,11 +3,11 @@
|
|||
namespace Cirno.Scripts.Resources;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class DecreasingSpeedModifier : Resource, IBulletModifier
|
||||
public partial class DecreasingSpeedModifier : BulletCreationModifier, IBulletModifier
|
||||
{
|
||||
[Export] private float decreaseRate = 0.1f;
|
||||
|
||||
public float ModifySpeed(float baseSpeed, int bulletIndex, int totalBullets)
|
||||
public override float ModifySpeed(float baseSpeed, int bulletIndex, int totalBullets)
|
||||
{
|
||||
return Mathf.Max(0, baseSpeed - (decreaseRate * bulletIndex));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue