@@ -119,23 +119,25 @@ private void Begin()
119119
120120 public override void _Process ( double delta )
121121 {
122+ //check if either one is dead until one is true, feel free to remove if we have a more efficent way of checking
123+ //alternatively, stop the other process since the battle is over
122124 if ( ! battleLost || ! battleWon )
123125 {
124126 CheckBattleStatus ( ) ;
125127 }
126128 TimeKeeper . CurrentTime = Audio . GetPlaybackPosition ( ) ;
127129 CD . CheckMiss ( ) ;
128- //CheckBattleStatus();
129130 }
130131 #endregion
131132
132133 #region Input&Timing
133134
134135 public override void _UnhandledInput ( InputEvent @event )
135136 {
137+ //this one is for calling a debug key to insta-kill the enemy
136138 if ( @event is InputEventKey eventKey && eventKey . Pressed && ! eventKey . Echo )
137139 {
138- if ( eventKey . Keycode == Key . Key0 ) // Adjust if you prefer a different key code.
140+ if ( eventKey . Keycode == Key . Key0 )
139141 {
140142 DebugKillEnemy ( ) ;
141143 }
@@ -239,13 +241,20 @@ private void CheckBattleStatus()
239241 return ;
240242 }
241243
244+ //will have to adjust this to account for when we have multiple enemies at once
242245 if ( Enemy . GetCurrentHealth ( ) <= 0 )
243246 {
244247 GD . Print ( "Enemy is dead" ) ;
245248 battleWon = true ;
246249
247- Reward . GiveRandomRelic ( Player . Stats ) ;
248- EventizeRelics ( ) ; //literally just here for debugging, ignore later
250+ //below, old method that just adds a random relic to the inventory
251+ //Reward.GiveRandomRelic(Player.Stats);
252+ //EventizeRelics(); //literally just here to force the ui to update and see if it was added, remove with the proper ui update
253+ //probably won't even need it since we'll be loading to seperate scene anyways
254+
255+ //new method that allows player to choose a relic
256+ ShowRewardSelection ( ) ;
257+
249258 return ;
250259 }
251260 }
@@ -254,4 +263,12 @@ private void DebugKillEnemy()
254263 {
255264 Enemy . TakeDamage ( 1000 ) ;
256265 }
266+
267+ private void ShowRewardSelection ( )
268+ {
269+ var rewardUI = GD . Load < PackedScene > ( "res://RewardSelectionUI.tscn" )
270+ . Instantiate < RewardSelect > ( ) ;
271+ AddChild ( rewardUI ) ;
272+ rewardUI . Initialize ( Player . Stats ) ;
273+ }
257274}
0 commit comments