Add more floors, light refactoring
This commit is contained in:
@@ -35,21 +35,21 @@ public partial class Game : Node3D, IGame
|
||||
[Dependency] public IAppRepo AppRepo => this.DependOn<IAppRepo>();
|
||||
|
||||
#region Nodes
|
||||
[Node] public IMap Map { get; set; } = default!;
|
||||
[Node] private IMap Map { get; set; } = default!;
|
||||
|
||||
[Node] public IPlayer Player { get; set; } = default!;
|
||||
[Node] private InGameUI InGameUI { get; set; } = default!;
|
||||
|
||||
[Node] public InGameUI InGameUI { get; set; } = default!;
|
||||
[Node] private IFloorClearMenu FloorClearMenu { get; set; } = default!;
|
||||
|
||||
[Node] public IFloorClearMenu FloorClearMenu { get; set; } = default!;
|
||||
[Node] private DeathMenu DeathMenu { get; set; } = default!;
|
||||
|
||||
[Node] public DeathMenu DeathMenu { get; set; } = default!;
|
||||
[Node] private IPauseMenu PauseMenu { get; set; } = default!;
|
||||
|
||||
[Node] public IPauseMenu PauseMenu { get; set; } = default!;
|
||||
[Node] private InGameAudio InGameAudio { get; set; } = default!;
|
||||
|
||||
[Node] public InGameAudio InGameAudio { get; set; } = default!;
|
||||
[Node] private Timer DoubleEXPTimer { get; set; } = default!;
|
||||
|
||||
[Node] public Timer DoubleEXPTimer { get; set; } = default!;
|
||||
[Node] private IPlayer Player { get; set; } = default!;
|
||||
#endregion
|
||||
|
||||
public RescuedItemDatabase RescuedItems { get; set; } = default!;
|
||||
@@ -121,7 +121,6 @@ public partial class Game : Node3D, IGame
|
||||
|
||||
Player.Inventory.InventoryAtCapacity += PlayerInventory_InventoryAtCapacity;
|
||||
Player.Inventory.PickedUpItem += Inventory_PickedUpItem;
|
||||
Player.Inventory.RaiseStatRequest += Inventory_RaiseStatRequest;
|
||||
FloorClearMenu.GoToNextFloor += FloorClearMenu_GoToNextFloor;
|
||||
FloorClearMenu.SaveAndExit += FloorClearMenu_SaveAndExit;
|
||||
FloorClearMenu.TransitionCompleted += FloorClearMenu_TransitionCompleted;
|
||||
@@ -166,6 +165,16 @@ public partial class Game : Node3D, IGame
|
||||
thrown.Throw();
|
||||
}
|
||||
|
||||
public void AnnounceMessageOnInventoryScreen(string message)
|
||||
{
|
||||
InGameUI.InventoryMenu.ShowMessage(message);
|
||||
}
|
||||
|
||||
public void AnnounceMessageOnMainScreen(string message)
|
||||
{
|
||||
InGameUI.PlayerInfoUI.DisplayMessage(message);
|
||||
}
|
||||
|
||||
private void OnEnemyDefeated(Vector3 vector, EnemyStatResource resource)
|
||||
{
|
||||
Player.GainExp(resource.ExpFromDefeat * GameRepo.EXPRate);
|
||||
@@ -209,8 +218,12 @@ public partial class Game : Node3D, IGame
|
||||
private void FloorClearMenu_TransitionCompleted()
|
||||
{
|
||||
GameRepo.Resume();
|
||||
if (Player.Inventory.EquippedWeapon.Value.WeaponTags.Contains(WeaponTag.BreaksOnChange))
|
||||
if (Player.Inventory.EquippedWeapon.Value.ItemTags.Contains(ItemTag.BreaksOnChange))
|
||||
Player.Inventory.Unequip(Player.Inventory.EquippedWeapon.Value);
|
||||
if (Player.Inventory.EquippedArmor.Value.ItemTags.Contains(ItemTag.BreaksOnChange))
|
||||
Player.Inventory.Unequip(Player.Inventory.EquippedArmor.Value);
|
||||
if (Player.Inventory.EquippedAccessory.Value.ItemTags.Contains(ItemTag.BreaksOnChange))
|
||||
Player.Inventory.Unequip(Player.Inventory.EquippedAccessory.Value);
|
||||
}
|
||||
|
||||
private void FloorClearMenu_GoToNextFloor()
|
||||
@@ -228,52 +241,12 @@ public partial class Game : Node3D, IGame
|
||||
private void GameEventDepot_RestorativePickedUp(Restorative obj)
|
||||
=> Player.Stats.SetCurrentVT(Player.Stats.CurrentVT.Value + obj.VTRestoreAmount);
|
||||
|
||||
private void Inventory_RaiseStatRequest(InventoryItemStats itemStats)
|
||||
{
|
||||
HealHP(itemStats.HealHPAmount);
|
||||
HealVT(itemStats.HealVTAmount);
|
||||
}
|
||||
|
||||
private void SetPauseMode(bool isPaused)
|
||||
{
|
||||
if (GetTree() != null)
|
||||
GetTree().Paused = isPaused;
|
||||
}
|
||||
|
||||
public void RaiseHP(int amountToRaise)
|
||||
{
|
||||
if (Player.Stats.CurrentHP.Value == Player.Stats.MaximumHP.Value)
|
||||
{
|
||||
Player.Stats.SetMaximumHP(Player.Stats.MaximumHP.Value + amountToRaise);
|
||||
Player.Stats.SetCurrentHP(Player.Stats.MaximumHP.Value);
|
||||
EmitSignal(SignalName.StatRaisedAlert, $"{amountToRaise}MAXHP Up.");
|
||||
}
|
||||
}
|
||||
|
||||
public void HealHP(int amountToRestore)
|
||||
{
|
||||
Player.Stats.SetCurrentHP(Player.Stats.CurrentHP.Value + amountToRestore);
|
||||
var raiseString = amountToRestore == 1000 ? "MAX" : $"{amountToRestore}";
|
||||
EmitSignal(SignalName.StatRaisedAlert, $"{raiseString}HP Restored.");
|
||||
}
|
||||
|
||||
public void RaiseVT(int amountToRaise)
|
||||
{
|
||||
if (Player.Stats.CurrentVT.Value == Player.Stats.MaximumVT.Value)
|
||||
{
|
||||
Player.Stats.SetMaximumVT(Player.Stats.MaximumVT.Value + amountToRaise);
|
||||
Player.Stats.SetCurrentVT(Player.Stats.MaximumVT.Value);
|
||||
EmitSignal(SignalName.StatRaisedAlert, $"{amountToRaise}MAXVT Up.");
|
||||
}
|
||||
}
|
||||
|
||||
public void HealVT(int amountToRestore)
|
||||
{
|
||||
Player.Stats.SetCurrentVT(Player.Stats.CurrentVT.Value + amountToRestore);
|
||||
var raiseString = amountToRestore == 1000 ? "MAX" : $"{amountToRestore}";
|
||||
EmitSignal(SignalName.StatRaisedAlert, $"{raiseString}VT Restored.");
|
||||
}
|
||||
|
||||
public async void DoubleEXP(TimeSpan lengthOfEffect)
|
||||
{
|
||||
InventoryMenu_CloseInventory();
|
||||
|
||||
Reference in New Issue
Block a user