Player warp item implementation
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user