mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Added offsets and remade modifiers system
This commit is contained in:
parent
881a4897da
commit
aab69fb609
16 changed files with 474 additions and 426 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue