Skip to content

Commit b793ee6

Browse files
committed
Fix Shop Removal and 0 Hp Battle Start
1 parent 0118617 commit b793ee6

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Scenes/BattleDirector/Scripts/BattleDirector.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ private void BeginPlayback()
8787
CM.BeginTweens();
8888
Audio.Play();
8989
}
90+
if (Player.GetCurrentHealth() <= 0 && !_battleEnding)
91+
CheckBattleStatus(Player);
9092
HasPlayed = true;
9193
_initializedPlaying = true;
9294
}
@@ -332,10 +334,13 @@ private Timing CheckTiming(double beatDif)
332334
#endregion
333335

334336
#region Battle End
337+
private bool _battleEnding = false;
338+
335339
private void CheckBattleStatus(PuppetTemplate puppet) //Called when a puppet dies
336340
{
337341
var tween = CreateTween();
338342
tween.TweenProperty(puppet, "modulate:a", 0, 2f);
343+
_battleEnding = true;
339344
if (puppet == Player)
340345
{
341346
CM.ProcessMode = ProcessModeEnum.Disabled;

Scenes/Puppets/Scripts/PlayerStats.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public void RemoveNote(int index)
8080
CurNotes = CurNotes.Where((_, i) => i != index).ToArray();
8181
}
8282

83+
//Can remove more than 1
8384
public void RemoveNote(Note nSelection)
8485
{
8586
CurNotes = CurNotes.Where(n => n != nSelection).ToArray();

Scenes/ShopScene/Scripts/ShopScene.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ private void RemoveNote()
332332
StageProducer.PlayerStats.Money -= RemovalCost;
333333
_removalButton.Disabled = true;
334334
_hasRemoved = true;
335-
StageProducer.PlayerStats.RemoveNote(_toRemove);
335+
StageProducer.PlayerStats.RemoveNote(
336+
Array.IndexOf(StageProducer.PlayerStats.CurNotes, _toRemove)
337+
);
336338
_selectedRemoveButton.QueueFree();
337339
CloseRemovalPane();
338340
UpdateMoneyLabel();

0 commit comments

Comments
 (0)