Update resource files and add new tileset; remove inactive properties and upgrade paths
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using Godot;
|
||||
using Limbo.Console.Sharp;
|
||||
using Mr.BrickAdventures.scripts;
|
||||
using Mr.BrickAdventures.scripts.components;
|
||||
|
||||
namespace Mr.BrickAdventures.Autoloads;
|
||||
@@ -17,66 +15,42 @@ public partial class ConsoleManager : Node
|
||||
_gameManager = GetNode<GameManager>("/root/GameManager");
|
||||
_achievementManager = GetNode<AchievementManager>("/root/AchievementManager");
|
||||
_skillManager = GetNode<SkillManager>("/root/SkillManager");
|
||||
|
||||
RegisterConsoleCommands();
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
UnregisterConsoleCommands();
|
||||
}
|
||||
|
||||
[ConsoleCommand("add_coins", "Adds a specified amount of coins to the player's total.")]
|
||||
private void AddCoinsCommand(int amount)
|
||||
{
|
||||
_gameManager.AddCoins(amount);
|
||||
LimboConsole.Info($"Increased coins by {amount}. Total coins: {_gameManager.GetCoins()}");
|
||||
}
|
||||
|
||||
[ConsoleCommand("set_coins", "Sets the player's total coins to a specified amount.")]
|
||||
private void SetCoinsCommand(int amount)
|
||||
{
|
||||
_gameManager.SetCoins(amount);
|
||||
LimboConsole.Info($"Set coins to {amount}. Total coins: {_gameManager.GetCoins()}");
|
||||
}
|
||||
|
||||
[ConsoleCommand("set_lives", "Sets the player's total lives to a specified amount.")]
|
||||
private void SetLivesCommand(int amount)
|
||||
{
|
||||
_gameManager.SetLives(amount);
|
||||
LimboConsole.Info($"Set lives to {amount}.");
|
||||
}
|
||||
|
||||
[ConsoleCommand("add_lives", "Adds a specified amount of lives to the player's total.")]
|
||||
private void AddLivesCommand(int amount)
|
||||
{
|
||||
_gameManager.AddLives(amount);
|
||||
LimboConsole.Info($"Increased lives by {amount}. Total lives: {_gameManager.GetLives()}");
|
||||
}
|
||||
|
||||
[ConsoleCommand("set_health", "Sets the player's health to a specified amount.")]
|
||||
private void SetHealthCommand(float amount)
|
||||
{
|
||||
var playerHealthComponent = _gameManager.Player.GetNode<HealthComponent>("HealthComponent");
|
||||
if (playerHealthComponent != null)
|
||||
{
|
||||
playerHealthComponent.Health = amount;
|
||||
LimboConsole.Info($"Set player health to {amount}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
LimboConsole.Warn("Player HealthComponent not found.");
|
||||
}
|
||||
}
|
||||
|
||||
[ConsoleCommand("reset_session", "Resets the current session state.")]
|
||||
private void ResetSessionCommand()
|
||||
{
|
||||
_gameManager.ResetCurrentSessionState();
|
||||
LimboConsole.Info("Current session state has been reset.");
|
||||
}
|
||||
|
||||
[ConsoleCommand("unlock_skill", "Unlocks and activates a skill by its name.")]
|
||||
private void UnlockSkillCommand(string skillName)
|
||||
{
|
||||
if (!GetSkillManagement()) return;
|
||||
@@ -84,14 +58,12 @@ public partial class ConsoleManager : Node
|
||||
var skill = _skillManager.GetSkillByName(skillName);
|
||||
if (skill == null)
|
||||
{
|
||||
LimboConsole.Warn($"Skill '{skillName}' not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
_gameManager.UnlockSkill(skill);
|
||||
_skillManager.ActivateSkill(skill);
|
||||
_skillUnlockerComponent.EmitSignal(SkillUnlockerComponent.SignalName.SkillUnlocked, skill);
|
||||
LimboConsole.Info($"Skill '{skillName}' has been unlocked and activated.");
|
||||
}
|
||||
|
||||
private bool GetSkillManagement()
|
||||
@@ -99,7 +71,6 @@ public partial class ConsoleManager : Node
|
||||
var player = _gameManager.Player;
|
||||
if (player == null || !IsInstanceValid(player))
|
||||
{
|
||||
LimboConsole.Warn("Player node not found or is invalid.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -107,21 +78,17 @@ public partial class ConsoleManager : Node
|
||||
|
||||
if (_skillManager != null && _skillUnlockerComponent != null) return true;
|
||||
|
||||
LimboConsole.Warn("SkillManager or SkillUnlockerComponent not found on the player.");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
[ConsoleCommand("unlock_all_skills", "Unlocks and activates all available skills.")]
|
||||
private void UnlockAllSkillsCommand()
|
||||
{
|
||||
if (!GetSkillManagement()) return;
|
||||
|
||||
_skillUnlockerComponent.UnlockAllSkills();
|
||||
LimboConsole.Info("All skills have been unlocked and activated.");
|
||||
}
|
||||
|
||||
[ConsoleCommand("remove_skill", "Deactivates and removes a skill by its name.")]
|
||||
private void RemoveSkillCommand(string skillName)
|
||||
{
|
||||
if (!GetSkillManagement()) return;
|
||||
@@ -129,16 +96,13 @@ public partial class ConsoleManager : Node
|
||||
var skill = _skillManager.GetSkillByName(skillName);
|
||||
if (skill == null)
|
||||
{
|
||||
LimboConsole.Warn($"Skill '{skillName}' not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
_gameManager.RemoveSkill(skill.Name);
|
||||
_skillManager.DeactivateSkill(skill);
|
||||
LimboConsole.Info($"Skill '{skillName}' has been deactivated.");
|
||||
}
|
||||
|
||||
[ConsoleCommand("remove_all_skills", "Deactivates and removes all skills.")]
|
||||
private void RemoveAllSkillsCommand()
|
||||
{
|
||||
if (!GetSkillManagement()) return;
|
||||
@@ -148,23 +112,18 @@ public partial class ConsoleManager : Node
|
||||
_gameManager.RemoveSkill(skill.Name);
|
||||
_skillManager.DeactivateSkill(skill);
|
||||
}
|
||||
LimboConsole.Info("All skills have been deactivated.");
|
||||
}
|
||||
|
||||
[ConsoleCommand("next_level", "Advances the game to the next level.")]
|
||||
private void GoToNextLevelCommand()
|
||||
{
|
||||
_gameManager.OnLevelComplete();
|
||||
}
|
||||
|
||||
[ConsoleCommand("unlock_achievement", "Unlocks an achievement by its ID.")]
|
||||
private void UnlockAchievementCommand(string achievementId)
|
||||
{
|
||||
_achievementManager.UnlockAchievement(achievementId);
|
||||
LimboConsole.Info($"Attempted to unlock achievement '{achievementId}'.");
|
||||
}
|
||||
|
||||
[ConsoleCommand("reset_achievement", "Resets (locks) an achievement by its ID.")]
|
||||
private void ResetAchievementCommand(string achievementId)
|
||||
{
|
||||
_achievementManager.LockAchievement(achievementId);
|
||||
|
||||
Reference in New Issue
Block a user