Skip to content

Commit d6dae53

Browse files
committed
placed notes now instantly do their effect
The note being placed uses it's effect at the "okay" timing, since this is the middle option for note damage this should be good enough for the player to at least feel the effect instantly.
1 parent 56167f5 commit d6dae53

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

scenes/BattleDirector/scripts/BattleDirector.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ private bool PlayerAddNote(ArrowType type, int beat)
4343
{
4444
if (!NotePlacementBar.CanPlaceNote())
4545
return false;
46-
if (!CD.AddNoteToLane(type, beat % CM.BeatsPerLoop, NotePlacementBar.PlacedNote(), false))
46+
if (
47+
!CD.AddNoteToLane(
48+
type,
49+
beat % CM.BeatsPerLoop,
50+
NotePlacementBar.PlacedNote(this, Timing.Okay),
51+
false
52+
)
53+
)
4754
return false;
4855
NotePlaced?.Invoke(this);
4956
return true;

scenes/BattleDirector/scripts/NotePlacementBar.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using FunkEngine;
45
using Godot;
56

67
public partial class NotePlacementBar : Node
@@ -183,13 +184,16 @@ public void IncreaseCharge(int amount = 1)
183184
}
184185

185186
// Placing a note resets the note placement bar
186-
public Note PlacedNote()
187+
public Note PlacedNote(BattleDirector BD, Timing timing)
187188
{
188189
_currentBarValue -= (int)(_currentNoteInstance.CostModifier * MaxValue);
189190

190191
UpdateNotePlacementBar(_currentBarValue);
191192
//fullBarParticles.Emitting = false;
192-
return GetNote(Input.IsActionPressed("Secondary"));
193+
194+
Note placedNote = GetNote(Input.IsActionPressed("Secondary"));
195+
placedNote?.OnHit(BD, timing);
196+
return placedNote;
193197
}
194198

195199
public bool CanPlaceNote()

0 commit comments

Comments
 (0)