Player warp item implementation

This commit is contained in:
2025-03-03 01:17:30 -08:00
parent 05295f535a
commit 4ac70b1ca7
48 changed files with 231 additions and 138 deletions

View File

@@ -6,6 +6,7 @@ using Chickensoft.Introspection;
using Godot;
using System;
using System.Collections.Immutable;
using static GameJamDungeon.GameLogic.State;
[Meta(typeof(IAutoNode))]
public partial class Game : Node3D, IGame
@@ -124,7 +125,6 @@ public partial class Game : Node3D, IGame
FloorClearMenu.SaveAndExit += FloorClearMenu_SaveAndExit;
FloorClearMenu.TransitionCompleted += FloorClearMenu_TransitionCompleted;
GameEventDepot.EnemyDefeated += OnEnemyDefeated;
GameEventDepot.RestorativePickedUp += GameEventDepot_RestorativePickedUp;
DoubleEXPTimer.Timeout += DoubleEXPTimer_Timeout;
@@ -132,7 +132,10 @@ public partial class Game : Node3D, IGame
public void ToggleInventory()
{
GameLogic.Input(new GameLogic.Input.OpenInventory());
if (GameLogic.Value is InventoryOpened)
GameLogic.Input(new GameLogic.Input.CloseInventory());
else
GameLogic.Input(new GameLogic.Input.OpenInventory());
}
public void ToggleMinimap()
@@ -182,10 +185,10 @@ public partial class Game : Node3D, IGame
public IDungeonFloor CurrentFloor => Map.CurrentFloor;
private void OnEnemyDefeated(Vector3 vector, EnemyStatResource resource)
public void EnemyDefeated(Vector3 defeatedLocation, EnemyStatResource resource)
{
Player.GainExp(resource.ExpFromDefeat * GameRepo.EXPRate);
DropRestorative(vector);
DropRestorative(defeatedLocation);
}
private void DropRestorative(Vector3 vector)
@@ -256,7 +259,7 @@ public partial class Game : Node3D, IGame
public async void DoubleEXP(TimeSpan lengthOfEffect)
{
InventoryMenu_CloseInventory();
ToggleInventory();
InGameUI.PlayerInfoUI.DisplayMessage("Experience points temporarily doubled.");
DoubleEXPTimer.Start(lengthOfEffect.Seconds);
GameRepo.EXPRate = 2;