Compare commits
142 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 34c125e6bb | |||
| 66905c9b53 | |||
| a1f4a29eb3 | |||
| a6ea1b1873 | |||
| 47ceb2f613 | |||
| bf6b0d50c3 | |||
| c7603a163f | |||
| a20c80d922 | |||
| e14007b7f4 | |||
| b17c134c9a | |||
| fe0241ac88 | |||
| 0ab6ef1343 | |||
| 638946d23a | |||
| b56668dcbe | |||
| d6faf8642a | |||
| 68b1455c53 | |||
| 9615e1e251 | |||
| c755485855 | |||
| d503413140 | |||
| ac31c3ae65 | |||
| 549040c339 | |||
| c246d8d654 | |||
| b475df6f68 | |||
| 230b47061d | |||
| 8ce38c3c13 | |||
| 5451f0b31f | |||
| 92b4e8662f | |||
| 2f377d2d7a | |||
| 363ee1cd33 | |||
| 97198afe18 | |||
| fdc4a6f2c1 | |||
| 843a100218 | |||
| 8001556f37 | |||
| 90d054a3c6 | |||
| aba325ff2b | |||
| bfaa324e6a | |||
| f08c69fa10 | |||
| 9d6aa6d88d | |||
| 654e368a65 | |||
| ce727b523a | |||
| 6a474576f0 | |||
| 8dd194a202 | |||
| 70a33d68cf | |||
| da8c4209d7 | |||
| c6fbc9f553 | |||
| 36b851254e | |||
| 147f04d2ff | |||
| 8ea881edb3 | |||
| 8a99771491 | |||
| d45bc67722 | |||
| 13ebe54474 | |||
| b9a1888bfc | |||
| 5ae556cb4b | |||
| 52dc8fb9e4 | |||
| affa5e1f79 | |||
| 35a625f636 | |||
| d5de5f7379 | |||
| 3e6e21977e | |||
| 4a2d131276 | |||
| d9c2ba7ed1 | |||
| 051ffbbcb1 | |||
| 9747d7d2c5 | |||
| 34dce8c5a2 | |||
| 51010c4f7d | |||
| fd96eb2dc9 | |||
| 51c8f26e50 | |||
| 4c90eb6f07 | |||
| 30f0a078a9 | |||
| 6e4a4d605c | |||
| 836b9eb26d | |||
| cb2df83079 | |||
| 0282ef68f3 | |||
| 1678d79bbd | |||
| 20d2890b37 | |||
| e85c8d51f1 | |||
| 3e178257aa | |||
| 25b6d53ec4 | |||
| a9ed8fda10 | |||
| 4801d7d9b3 | |||
| f08817a586 | |||
| 4b23c2ca6f | |||
| 39b2bc631d | |||
| f346f0f529 | |||
| 4ffe04fcff | |||
| 2ef838f270 | |||
| e63a94210c | |||
| 865934399d | |||
| 2622ed4423 | |||
| 79dd6eb33a | |||
| bba0bb5ecd | |||
| d6b20ce4c2 | |||
| 60d8c55c7d | |||
| d3a3c18d13 | |||
| 12993bced0 | |||
| 8fd7a5133d | |||
| 97472f2a61 | |||
| 5284a7c00d | |||
| 92b39c1ee9 | |||
| faf3288061 | |||
| b715d6b459 | |||
| 9897acffac | |||
| aa9e14c498 | |||
| 945c5e14bb | |||
| a1f67c3d71 | |||
| 670f8baabf | |||
| 6a62d3d943 | |||
| 3fe45cb3e7 | |||
| db218f26e7 | |||
| eb4e901c8a | |||
| 48a00933d9 | |||
| be8bbcac28 | |||
| c5cb586e4b | |||
| 1e97eb9ede | |||
| 0591dccc31 | |||
| 70f7642d0f | |||
| 7e8826f143 | |||
| f13afc9fdc | |||
| 04543fcfac | |||
| 5b9de11e5a | |||
| 678916be89 | |||
| f39bd8ecdb | |||
| 76f4adc5be | |||
| 95227946d1 | |||
| 1ee3e97f85 | |||
| 6f90a0985a | |||
| 34742d568e | |||
| 3c369f79f7 | |||
| fe45f0bcf2 | |||
| edff41af22 | |||
| 4ee4e02a51 | |||
| 8f8cc217dc | |||
| c491ea5050 | |||
| 725547d388 | |||
| 539430d112 | |||
| 46402401b4 | |||
| ed9e611fd9 | |||
| db7a1df1f7 | |||
| 3e8c11d55d | |||
| 613fc3bf60 | |||
| f69e219643 | |||
| 0afbf38bf9 | |||
| 23fdf7309d |
@@ -715,3 +715,8 @@ healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
/Zennysoft.Game.Ma/src/map/dungeon/models/Area 2/Puer/A2-Puer.glb.import
|
||||
/Zennysoft.Game.Ma/src/audio/AMB/amb_beach.wav.import
|
||||
/Zennysoft.Game.Ma/src/audio/AMB/amb_perlin.wav.import
|
||||
/Zennysoft.Game.Ma/src/audio/AMB/amb_white_noise.wav.import
|
||||
/Zennysoft.Game.Ma/src/audio/AMB/amb_wind_loop_altar.wav.import
|
||||
|
||||
@@ -10,6 +10,8 @@ public interface IAppRepo : IDisposable
|
||||
|
||||
event Action? MainMenuEntered;
|
||||
|
||||
event Action? DataViewerExited;
|
||||
|
||||
void SkipSplashScreen();
|
||||
|
||||
void OnMainMenuEntered();
|
||||
@@ -19,4 +21,6 @@ public interface IAppRepo : IDisposable
|
||||
void OnExitGame();
|
||||
|
||||
void OnGameOver();
|
||||
|
||||
void OnDataViewerExited();
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace Zennysoft.Game.Abstractions;
|
||||
|
||||
public interface IStackable
|
||||
{
|
||||
int Count { get; }
|
||||
|
||||
void SetCount(int count);
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
public interface IHealthPack
|
||||
{
|
||||
public double RestoreAmount { get; }
|
||||
public int RestoreAmount { get; }
|
||||
}
|
||||
|
||||
@@ -11,4 +11,8 @@ public interface ISaveFileManager
|
||||
public Task<T?> ReadFromFile<T>(params IJsonTypeInfoResolver?[] resolvers);
|
||||
|
||||
public Task<T?> ReadFromFile<T>(string filePath, params IJsonTypeInfoResolver?[] resolvers);
|
||||
|
||||
public void DeleteSaveData(string filePath);
|
||||
|
||||
public void DeleteSaveData();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
namespace Zennysoft.Game.Implementation;
|
||||
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Godot;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
|
||||
public partial class DimmableAudioStreamPlayer3D : AudioStreamPlayer3D, IDimmableAudioStreamPlayer
|
||||
{
|
||||
#region Constants
|
||||
// -60 to -80 is considered inaudible for decibels.
|
||||
public const float VOLUME_DB_INAUDIBLE = -80f;
|
||||
public const double FADE_DURATION = 3d; // seconds
|
||||
#endregion Constants
|
||||
|
||||
public ITween? FadeTween { get; set; }
|
||||
|
||||
public float InitialVolumeDb;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
InitialVolumeDb = VolumeDb;
|
||||
VolumeDb = VOLUME_DB_INAUDIBLE;
|
||||
}
|
||||
|
||||
public void FadeIn()
|
||||
{
|
||||
SetupFade(InitialVolumeDb, Tween.EaseType.Out);
|
||||
Play();
|
||||
}
|
||||
|
||||
public void FadeOut()
|
||||
{
|
||||
SetupFade(VOLUME_DB_INAUDIBLE, Tween.EaseType.In);
|
||||
FadeTween!.TweenCallback(Callable.From(Stop));
|
||||
}
|
||||
|
||||
public void SetupFade(float volumeDb, Tween.EaseType ease)
|
||||
{
|
||||
FadeTween?.Kill();
|
||||
|
||||
FadeTween = GodotInterfaces.Adapt<ITween>(CreateTween());
|
||||
|
||||
FadeTween.TweenProperty(
|
||||
this,
|
||||
"volume_db",
|
||||
volumeDb,
|
||||
FADE_DURATION
|
||||
).SetTrans(Tween.TransitionType.Circ).SetEase(ease);
|
||||
}
|
||||
|
||||
public override void _EnterTree() => FadeIn();
|
||||
|
||||
public override void _ExitTree() => FadeOut();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Chickensoft.Collections;
|
||||
|
||||
namespace Zennysoft.Game.Implementation;
|
||||
|
||||
public interface IStackable
|
||||
{
|
||||
AutoProp<int> Count { get; }
|
||||
|
||||
void SetCount(int count);
|
||||
}
|
||||
@@ -74,4 +74,8 @@ public class SaveFileManager : ISaveFileManager
|
||||
var json = JsonSerializer.Serialize(gameData, jsonOptions);
|
||||
await _fileSystem.File.WriteAllTextAsync(filePath, json);
|
||||
}
|
||||
|
||||
public void DeleteSaveData() => DeleteSaveData(_defaultSaveLocation);
|
||||
|
||||
public void DeleteSaveData(string filePath) => _fileSystem.File.Delete(filePath);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Abstractions\Zennysoft.Game.Abstractions.csproj" />
|
||||
|
||||
@@ -8,6 +8,7 @@ public class AppRepo : IAppRepo
|
||||
public event Action? MainMenuEntered;
|
||||
public event Action? GameEntered;
|
||||
public event Action? GameExited;
|
||||
public event Action? DataViewerExited;
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
@@ -21,6 +22,8 @@ public class AppRepo : IAppRepo
|
||||
|
||||
public void OnGameOver() => GameExited?.Invoke();
|
||||
|
||||
public void OnDataViewerExited() => DataViewerExited?.Invoke();
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (!_disposedValue)
|
||||
|
||||
@@ -24,6 +24,8 @@ public partial class AppLogic
|
||||
|
||||
public readonly record struct EnemyViewerOpened;
|
||||
|
||||
public readonly record struct EnemyViewerExited;
|
||||
|
||||
public readonly record struct GalleryOpened;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ public partial class AppLogic
|
||||
{
|
||||
public static class Output
|
||||
{
|
||||
public readonly record struct Initialize;
|
||||
|
||||
public readonly record struct FadeToBlack;
|
||||
|
||||
public readonly record struct ShowSplashScreen;
|
||||
@@ -24,6 +26,8 @@ public partial class AppLogic
|
||||
|
||||
public readonly record struct ShowMainMenu;
|
||||
|
||||
public readonly record struct CloseGame;
|
||||
|
||||
public readonly record struct ExitGame;
|
||||
|
||||
public readonly record struct GameOver;
|
||||
@@ -32,6 +36,8 @@ public partial class AppLogic
|
||||
|
||||
public readonly record struct EnemyViewerOpened;
|
||||
|
||||
public readonly record struct EnemyViewerExited;
|
||||
|
||||
public readonly record struct GalleryOpened;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,5 @@ public interface IAppLogic : ILogicBlock<AppLogic.State>;
|
||||
[LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial class AppLogic : LogicBlock<AppLogic.State>, IAppLogic
|
||||
{
|
||||
public override Transition GetInitialState() => To<State.MainMenu>();
|
||||
public override Transition GetInitialState() => To<State.Initialize>();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public partial class AppLogic
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record EnemyViewer : State
|
||||
public partial record EnemyViewer : State, IGet<Input.EnemyViewerExited>
|
||||
{
|
||||
public EnemyViewer()
|
||||
{
|
||||
@@ -18,7 +18,13 @@ public partial class AppLogic
|
||||
{
|
||||
Output(new Output.EnemyViewerOpened());
|
||||
});
|
||||
this.OnExit(() =>
|
||||
{
|
||||
Output(new Output.EnemyViewerExited());
|
||||
});
|
||||
}
|
||||
|
||||
public Transition On(in Input.EnemyViewerExited input) => To<MainMenu>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public partial class AppLogic
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record GameStarted : State
|
||||
public partial record GameStarted : State, IGet<Input.QuitGame>
|
||||
{
|
||||
public GameStarted()
|
||||
{
|
||||
@@ -26,6 +26,11 @@ public partial class AppLogic
|
||||
OnDetach(() => Get<IAppRepo>().GameExited -= OnGameExited);
|
||||
}
|
||||
|
||||
public Transition On(in Input.QuitGame input)
|
||||
{
|
||||
Output(new Output.CloseGame());
|
||||
return To<MainMenu>();
|
||||
}
|
||||
public void OnGameExited() => Input(new Input.QuitGame());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
|
||||
public partial class AppLogic
|
||||
{
|
||||
public partial record State
|
||||
{
|
||||
[Meta]
|
||||
public partial record Initialize : State, IGet<Input.SaveFileLoaded>
|
||||
{
|
||||
public Initialize()
|
||||
{
|
||||
this.OnEnter(() => Output(new Output.Initialize()));
|
||||
}
|
||||
|
||||
public Transition On(in Input.SaveFileLoaded input) => To<SplashScreen>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public partial class AppLogic
|
||||
this.OnEnter(() => Output(new Output.StartLoadingSaveFile()));
|
||||
}
|
||||
|
||||
public Transition On(in Input.SaveFileLoaded input) => To<GameStarted>();
|
||||
public Transition On(in Input.SaveFileLoaded input) => To<MainMenu>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ public partial class AppLogic
|
||||
{
|
||||
public MainMenu()
|
||||
{
|
||||
OnAttach(() => Output(new Output.ShowMainMenu()));
|
||||
}
|
||||
|
||||
public Transition On(in Input.NewGame input) => To<GameStarted>();
|
||||
|
||||
@@ -16,15 +16,17 @@ public partial class AppLogic
|
||||
this.OnEnter(() => Output(new Output.ShowSplashScreen()));
|
||||
|
||||
OnAttach(
|
||||
() => Get<IAppRepo>().SplashScreenSkipped += OnSplashScreenSkipped
|
||||
);
|
||||
() =>
|
||||
{
|
||||
Get<IAppRepo>().SplashScreenSkipped += OnSplashScreenSkipped;
|
||||
});
|
||||
|
||||
OnDetach(
|
||||
() => Get<IAppRepo>().SplashScreenSkipped -= OnSplashScreenSkipped
|
||||
);
|
||||
}
|
||||
|
||||
public Transition On(in Input.FadeOutFinished input) => To<GameStarted>();
|
||||
public Transition On(in Input.FadeOutFinished input) => To<MainMenu>();
|
||||
|
||||
public void OnSplashScreenSkipped() =>
|
||||
Output(new Output.HideSplashScreen());
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public partial class AudioManager : Node
|
||||
{
|
||||
#pragma warning disable IDE0044 // Add readonly modifier
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
private static string _sfxPath = $"res://src/audio/sfx";
|
||||
private AudioStreamPlayer _audioPlayer;
|
||||
private IDictionary<SoundEffects, AudioStream> _sfxDictionary;
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
|
||||
#pragma warning restore IDE0044 // Add readonly modifier
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_audioPlayer = new AudioStreamPlayer();
|
||||
_sfxDictionary = new Dictionary<SoundEffects, AudioStream>();
|
||||
var soundEffects = Enum.GetValues(typeof(SoundEffects));
|
||||
foreach (var effect in soundEffects)
|
||||
_sfxDictionary.Add((SoundEffects)effect, GD.Load<AudioStream>(_sfxPath + effect + ".ogg"));
|
||||
}
|
||||
|
||||
public void Play(SoundEffects soundEffect)
|
||||
{
|
||||
_sfxDictionary.TryGetValue(soundEffect, out var stream);
|
||||
_audioPlayer.Stream = stream;
|
||||
_audioPlayer.Play();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public enum SoundEffects
|
||||
{
|
||||
Cancel,
|
||||
Equip,
|
||||
Heal,
|
||||
MenuBack,
|
||||
MoveThroughOptions,
|
||||
PlayerAttack,
|
||||
PlayerHitWall,
|
||||
Sort,
|
||||
Unequip
|
||||
}
|
||||
@@ -12,7 +12,6 @@ namespace Zennysoft.Ma.Adapter
|
||||
calculatedDamage = CalculateDefenseResistance(calculatedDamage, defense);
|
||||
if (!damage.IgnoreElementalResistance)
|
||||
calculatedDamage = CalculateElementalResistance(calculatedDamage, elementalResistanceSet.ElementalResistance[damage.ElementType]);
|
||||
|
||||
return Mathf.Max(1, calculatedDamage);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,5 +7,8 @@ public enum ElementType
|
||||
Telluric,
|
||||
Hydric,
|
||||
Igneous,
|
||||
Ferrum
|
||||
Ferrum,
|
||||
Holy,
|
||||
Curse,
|
||||
All
|
||||
}
|
||||
|
||||
@@ -5,17 +5,23 @@ using Zennysoft.Ma.Adapter.Entity;
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
public interface IEquipmentComponent : IEntityComponent
|
||||
{
|
||||
public IAutoProp<EquipableItem> EquippedWeapon { get; }
|
||||
public IAutoProp<IWeapon> EquippedWeapon { get; }
|
||||
|
||||
public IAutoProp<EquipableItem> EquippedArmor { get; }
|
||||
public IAutoProp<IArmor> EquippedArmor { get; }
|
||||
|
||||
public IAutoProp<EquipableItem> EquippedAccessory { get; }
|
||||
public IAutoProp<IAccessory> EquippedAccessory { get; }
|
||||
|
||||
public void Equip(EquipableItem equipable);
|
||||
public IAutoProp<IEquipableItem> EquippedAmmo { get; }
|
||||
|
||||
public void Unequip(EquipableItem equipable);
|
||||
public void Equip(IEquipableItem equipable);
|
||||
|
||||
public bool IsItemEquipped(InventoryItem item);
|
||||
public void Unequip(IEquipableItem equipable);
|
||||
|
||||
public bool IsItemEquipped(IEquipableItem item);
|
||||
|
||||
public void UpdateEquipment(IEquipableItem equipable);
|
||||
|
||||
public bool AugmentableEquipmentExists();
|
||||
|
||||
public int BonusAttack { get; }
|
||||
|
||||
@@ -29,5 +35,5 @@ public interface IEquipmentComponent : IEntityComponent
|
||||
|
||||
public ElementalResistanceSet ElementalResistance { get; }
|
||||
|
||||
public event Action<EquipableItem> EquipmentChanged;
|
||||
public event Action<IEquipableItem> EquipmentChanged;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,13 @@ public interface IExperiencePointsComponent : IEntityComponent
|
||||
|
||||
public IAutoProp<int> Level { get; }
|
||||
|
||||
public void ModifyExpGainRate(double newRate);
|
||||
|
||||
public void Gain(int baseExpGain);
|
||||
|
||||
public void GainUnmodified(int flateRateExpGain);
|
||||
|
||||
public void LevelUp();
|
||||
|
||||
public event Action PlayerLevelUp;
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace Zennysoft.Ma.Adapter.Entity
|
||||
[Save("elemental_resist_set")]
|
||||
public Dictionary<ElementType, double> ElementalResistance { get; }
|
||||
|
||||
public static ElementalResistanceSet None => new ElementalResistanceSet(0, 0, 0, 0, 0);
|
||||
public static ElementalResistanceSet None => new ElementalResistanceSet(0, 0, 0, 0, 0, 0, 0);
|
||||
|
||||
public ElementalResistanceSet(double aeolicResistance, double hydricResistance, double igneousResistance, double ferrumResistance, double telluricResistance)
|
||||
public ElementalResistanceSet(double aeolicResistance, double hydricResistance, double igneousResistance, double ferrumResistance, double telluricResistance, double holyResistance, double curseResistance)
|
||||
{
|
||||
ElementalResistance = new Dictionary<ElementType, double>
|
||||
{
|
||||
@@ -19,6 +19,9 @@ namespace Zennysoft.Ma.Adapter.Entity
|
||||
{ ElementType.Igneous, igneousResistance },
|
||||
{ ElementType.Ferrum, ferrumResistance },
|
||||
{ ElementType.Telluric, telluricResistance },
|
||||
{ ElementType.Holy, holyResistance },
|
||||
{ ElementType.Curse, curseResistance },
|
||||
{ ElementType.All, aeolicResistance + hydricResistance + igneousResistance + ferrumResistance + telluricResistance + holyResistance + curseResistance },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,7 +32,9 @@ namespace Zennysoft.Ma.Adapter.Entity
|
||||
left.ElementalResistance[ElementType.Hydric] + right.ElementalResistance[ElementType.Hydric],
|
||||
left.ElementalResistance[ElementType.Igneous] + right.ElementalResistance[ElementType.Igneous],
|
||||
left.ElementalResistance[ElementType.Ferrum] + right.ElementalResistance[ElementType.Ferrum],
|
||||
left.ElementalResistance[ElementType.Telluric] + right.ElementalResistance[ElementType.Telluric]);
|
||||
left.ElementalResistance[ElementType.Telluric] + right.ElementalResistance[ElementType.Telluric],
|
||||
left.ElementalResistance[ElementType.Holy] + right.ElementalResistance[ElementType.Holy],
|
||||
left.ElementalResistance[ElementType.Curse] + right.ElementalResistance[ElementType.Curse]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Godot;
|
||||
using System.Collections.Immutable;
|
||||
using Zennysoft.Game.Ma;
|
||||
|
||||
@@ -16,6 +17,10 @@ namespace Zennysoft.Ma.Adapter.Entity
|
||||
|
||||
public void ReturnToDefaultState();
|
||||
|
||||
public void OnAbsorb();
|
||||
|
||||
public void OnMorph();
|
||||
|
||||
public IDungeonRoom GetCurrentRoom(ImmutableList<IDungeonRoom> dungeonRooms);
|
||||
|
||||
public void MoveEnemyToNewRoom(IDungeonRoom newRoom);
|
||||
@@ -26,6 +31,8 @@ namespace Zennysoft.Ma.Adapter.Entity
|
||||
|
||||
public IDefenseComponent DefenseComponent { get; }
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet { get; }
|
||||
|
||||
public int InitialHP { get; }
|
||||
|
||||
public int InitialAttack { get; }
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
public class Augment
|
||||
{
|
||||
public JewelTags AugmentTag;
|
||||
|
||||
public Augment(JewelTags tag, IAugmentType augment)
|
||||
{
|
||||
AugmentTag = tag;
|
||||
AugmentType = augment;
|
||||
}
|
||||
|
||||
public IAugmentType AugmentType { get; set; }
|
||||
}
|
||||
|
||||
public class HPRecoverySpeedAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public HPRecoverySpeedAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply() => _player.HealthTimerHPRate += 2;
|
||||
|
||||
public void Remove() => _player.HealthTimerHPRate -= 2;
|
||||
}
|
||||
|
||||
public class BasicAugment : IAugmentType
|
||||
{
|
||||
public void Apply()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
public class HastenVTAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public HastenVTAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier + 0.25f);
|
||||
|
||||
public void Remove() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier - 0.25f);
|
||||
}
|
||||
|
||||
public class SlowVTReductionAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public SlowVTReductionAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier - 0.25f);
|
||||
|
||||
public void Remove() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier + 0.25f);
|
||||
}
|
||||
|
||||
public class IncreaseEXPRateAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public IncreaseEXPRateAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value + 0.25f);
|
||||
public void Remove() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value - 0.25f);
|
||||
}
|
||||
|
||||
public class LowerEXPRateAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public LowerEXPRateAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value - 0.25f);
|
||||
public void Remove() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value + 0.25f);
|
||||
}
|
||||
|
||||
public class LowerHPRecoveryAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public LowerHPRecoveryAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply() => _player.HealthTimerHPRate -= 1;
|
||||
public void Remove() => _player.HealthTimerHPRate += 1;
|
||||
}
|
||||
|
||||
public class IdentifyAllItemsAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public IdentifyAllItemsAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
_player.AutoIdentifyItems = true;
|
||||
foreach (var item in _player.Inventory.Items.ToList())
|
||||
{
|
||||
if (item.ItemTag == ItemTag.MysteryItem)
|
||||
_player.IdentifyItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
var weaponAugment = _player.EquipmentComponent.EquippedWeapon.Value.Augment;
|
||||
var armorAugment = _player.EquipmentComponent.EquippedArmor.Value.Augment;
|
||||
var accessoryAugment = _player.EquipmentComponent.EquippedAccessory.Value.Augment;
|
||||
var augments = new List<Augment?>() { weaponAugment, armorAugment, accessoryAugment };
|
||||
if (augments.Count(x => x != null && x.AugmentTag == JewelTags.AutoIdentifyAllItems) > 1)
|
||||
return;
|
||||
else
|
||||
_player.AutoIdentifyItems = false;
|
||||
}
|
||||
}
|
||||
|
||||
public class RevivePlayerAugment : IAugmentType
|
||||
{
|
||||
private readonly IPlayer _player;
|
||||
|
||||
public RevivePlayerAugment(IPlayer player)
|
||||
{
|
||||
_player = player;
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
_player.AutoRevive = true;
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
{
|
||||
var weaponAugment = _player.EquipmentComponent.EquippedWeapon.Value.Augment;
|
||||
var armorAugment = _player.EquipmentComponent.EquippedArmor.Value.Augment;
|
||||
var accessoryAugment = _player.EquipmentComponent.EquippedAccessory.Value.Augment;
|
||||
var augments = new List<Augment?>() { weaponAugment, armorAugment, accessoryAugment };
|
||||
if (augments.Count(x => x != null && x.AugmentTag == JewelTags.ReviveUserOnce) > 1)
|
||||
return;
|
||||
else
|
||||
_player.AutoRevive = false;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Zennysoft.Ma.Adapter.Entity;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
[Meta, Id("equipable_item")]
|
||||
public abstract partial class EquipableItem : InventoryItem
|
||||
{
|
||||
[Save("bonus_attack_stats")]
|
||||
public virtual int BonusAttack { get; }
|
||||
[Save("bonus_defense_stats")]
|
||||
public virtual int BonusDefense { get; }
|
||||
[Save("bonus_hp_stats")]
|
||||
public virtual int BonusHP { get; }
|
||||
[Save("bonus_vt_stats")]
|
||||
public virtual int BonusVT { get; }
|
||||
[Save("bonus_luck_stats")]
|
||||
public virtual int BonusLuck { get; }
|
||||
[Save("bonus_elemental_resist_stats")]
|
||||
public virtual ElementalResistanceSet ElementalResistance { get; } = new ElementalResistanceSet(0, 0, 0, 0, 0);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public interface IAugmentType
|
||||
{
|
||||
void Apply();
|
||||
|
||||
void Remove();
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
[Meta, Id("inventory_item")]
|
||||
public abstract partial class InventoryItem : Node3D
|
||||
{
|
||||
[Save("inventory_item_id")]
|
||||
public Guid ID => Guid.NewGuid();
|
||||
[Save("inventory_item_name")]
|
||||
public abstract string ItemName { get; }
|
||||
[Save("inventory_item_description")]
|
||||
public abstract string Description { get; }
|
||||
[Save("inventory_item_spawn_rate")]
|
||||
public abstract float SpawnRate { get; }
|
||||
[Save("inventory_item_throw_damage")]
|
||||
public abstract int ThrowDamage { get; }
|
||||
[Save("inventory_item_throw_speed")]
|
||||
public abstract float ThrowSpeed { get; }
|
||||
[Save("inventory_item_tag")]
|
||||
public abstract ItemTag ItemTag { get; }
|
||||
|
||||
public abstract Texture2D GetTexture();
|
||||
}
|
||||
@@ -4,5 +4,21 @@ public enum ItemTag
|
||||
{
|
||||
None,
|
||||
BreaksOnChange,
|
||||
MysteryItem
|
||||
}
|
||||
MysteryItem,
|
||||
DamagesPlayer,
|
||||
ContainsRestorative,
|
||||
ContainsWeapon,
|
||||
ContainsArmor,
|
||||
ContainsBox,
|
||||
RandomSpell,
|
||||
ContainsAccessory,
|
||||
DropTo1HPAndGainRareItem,
|
||||
TradeOneRandomItem,
|
||||
TradeAllRandomItems,
|
||||
ContainsUnobtainedItem,
|
||||
ContainsBasicItem,
|
||||
RestrictUnequip,
|
||||
UnequipAllItems,
|
||||
EjectAllItems,
|
||||
UseAllItems
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
public enum JewelTags
|
||||
{
|
||||
None,
|
||||
AeolicElement,
|
||||
IncreaseHPRecovery,
|
||||
HastenVT,
|
||||
LowerEXPGain,
|
||||
Glue,
|
||||
ItemRescue,
|
||||
HydricElement,
|
||||
IgneousElement,
|
||||
IncreaseEXPGain,
|
||||
LowerHPRecovery,
|
||||
SlowVTReduction,
|
||||
AutoIdentifyAllItems,
|
||||
ReviveUserOnce,
|
||||
TelluricElement,
|
||||
IncreaseAtkDefLuck,
|
||||
IncreaseLuck
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
public enum ThrowableItemTag
|
||||
{
|
||||
None,
|
||||
DoubleExp,
|
||||
LowerTargetTo1HP,
|
||||
CanChangeAffinity,
|
||||
TeleportToRandomLocation,
|
||||
WarpToExitIfFound
|
||||
}
|
||||
@@ -16,4 +16,9 @@ public enum UsableItemTag
|
||||
RaiseCurrentDefenseArmor,
|
||||
RaiseLevel,
|
||||
RandomEffect,
|
||||
DoubleExp,
|
||||
LowerTargetTo1HP,
|
||||
CanChangeAffinity,
|
||||
TeleportToRandomLocation,
|
||||
WarpToExitIfFound
|
||||
}
|
||||
|
||||
@@ -7,4 +7,12 @@ public enum WeaponTag
|
||||
IgnoreAffinity,
|
||||
IgnoreDefense,
|
||||
Knockback,
|
||||
InverseHPAttackPower,
|
||||
RustChanceSelfAndEnemy,
|
||||
Instakill,
|
||||
DegradeOnSwing,
|
||||
DoubleAttack,
|
||||
TripleAttack,
|
||||
ElementalProjectile,
|
||||
KineticProjectile
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Godot;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
using Zennysoft.Game.Implementation;
|
||||
using Zennysoft.Ma.Adapter.Entity;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
@@ -19,7 +20,7 @@ public interface IGameRepo : IDisposable
|
||||
|
||||
event Action? DoubleExpTimeEnd;
|
||||
|
||||
event Action<InventoryItem>? RemoveItemFromInventoryEvent;
|
||||
event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent;
|
||||
|
||||
event Action? PlayerAttack;
|
||||
|
||||
@@ -27,11 +28,11 @@ public interface IGameRepo : IDisposable
|
||||
|
||||
event Action? PlayerAttackedEnemy;
|
||||
|
||||
event Action<EquipableItem>? EquippedItem;
|
||||
event Action<IEquipableItem>? EquippedItem;
|
||||
|
||||
event Action<EquipableItem>? UnequippedItem;
|
||||
event Action<IEquipableItem>? UnequippedItem;
|
||||
|
||||
event Action<IHealthPack>? RestorativePickedUp;
|
||||
event Action<IEnemy>? EnemyDied;
|
||||
|
||||
void Pause();
|
||||
|
||||
@@ -47,21 +48,21 @@ public interface IGameRepo : IDisposable
|
||||
|
||||
public void AnnounceMessageInInventory(string message);
|
||||
|
||||
public void RemoveItemFromInventory(InventoryItem item);
|
||||
public void RemoveItemFromInventory(IBaseInventoryItem item);
|
||||
|
||||
public void OnPlayerAttack();
|
||||
|
||||
public void OnPlayerAttackedWall();
|
||||
|
||||
public void OnRestorativePickedUp(IHealthPack restorative);
|
||||
|
||||
public void CloseInventory();
|
||||
|
||||
public void GameEnded();
|
||||
|
||||
public void OnEquippedItem(EquipableItem item);
|
||||
public void OnEquippedItem(IEquipableItem item);
|
||||
|
||||
public void OnUnequippedItem(EquipableItem item);
|
||||
public void OnUnequippedItem(IEquipableItem item);
|
||||
|
||||
public void OnEnemyDied(IEnemy enemy);
|
||||
|
||||
public double ExpRate { get; }
|
||||
}
|
||||
@@ -74,13 +75,13 @@ public class GameRepo : IGameRepo
|
||||
public event Action<string>? AnnounceMessageInInventoryEvent;
|
||||
public event Action<int>? DoubleExpTimeStart;
|
||||
public event Action? DoubleExpTimeEnd;
|
||||
public event Action<InventoryItem>? RemoveItemFromInventoryEvent;
|
||||
public event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent;
|
||||
public event Action? PlayerAttack;
|
||||
public event Action? PlayerAttackedWall;
|
||||
public event Action? PlayerAttackedEnemy;
|
||||
public event Action<EquipableItem>? EquippedItem;
|
||||
public event Action<EquipableItem>? UnequippedItem;
|
||||
public event Action<IHealthPack>? RestorativePickedUp;
|
||||
public event Action<IEquipableItem>? EquippedItem;
|
||||
public event Action<IEquipableItem>? UnequippedItem;
|
||||
public event Action<IEnemy>? EnemyDied;
|
||||
public IAutoProp<bool> IsPaused => _isPaused;
|
||||
private readonly AutoProp<bool> _isPaused;
|
||||
|
||||
@@ -110,14 +111,14 @@ public class GameRepo : IGameRepo
|
||||
{
|
||||
AnnounceMessageInInventory("Experience points temporarily doubled.");
|
||||
DoubleExpTimeStart?.Invoke(lengthOfEffect.Seconds);
|
||||
ExpRate = 2;
|
||||
ExpRate *= 2;
|
||||
}
|
||||
|
||||
public void EndDoubleExp()
|
||||
{
|
||||
AnnounceMessageOnMainScreen("Experience points effect wore off.");
|
||||
DoubleExpTimeEnd?.Invoke();
|
||||
ExpRate = 1;
|
||||
ExpRate /= 2;
|
||||
}
|
||||
|
||||
public void AnnounceMessageOnMainScreen(string message)
|
||||
@@ -130,7 +131,7 @@ public class GameRepo : IGameRepo
|
||||
AnnounceMessageInInventoryEvent?.Invoke(message);
|
||||
}
|
||||
|
||||
public void RemoveItemFromInventory(InventoryItem item)
|
||||
public void RemoveItemFromInventory(IBaseInventoryItem item)
|
||||
{
|
||||
RemoveItemFromInventoryEvent?.Invoke(item);
|
||||
}
|
||||
@@ -145,19 +146,16 @@ public class GameRepo : IGameRepo
|
||||
PlayerAttackedWall?.Invoke();
|
||||
}
|
||||
|
||||
public void OnRestorativePickedUp(IHealthPack restorative)
|
||||
{
|
||||
RestorativePickedUp?.Invoke(restorative);
|
||||
}
|
||||
|
||||
public void CloseInventory()
|
||||
{
|
||||
CloseInventoryEvent?.Invoke();
|
||||
}
|
||||
|
||||
public void OnEquippedItem(EquipableItem item) => EquippedItem?.Invoke(item);
|
||||
public void OnEquippedItem(IEquipableItem item) => EquippedItem?.Invoke(item);
|
||||
|
||||
public void OnUnequippedItem(EquipableItem item) => UnequippedItem?.Invoke(item);
|
||||
public void OnUnequippedItem(IEquipableItem item) => UnequippedItem?.Invoke(item);
|
||||
|
||||
public void OnEnemyDied(IEnemy enemy) => EnemyDied?.Invoke(enemy);
|
||||
|
||||
public void GameEnded()
|
||||
{
|
||||
|
||||
@@ -8,10 +8,14 @@ public partial class GameState
|
||||
|
||||
public readonly record struct LoadGame;
|
||||
|
||||
public readonly record struct ExitGame;
|
||||
|
||||
public readonly record struct LoadNextFloor;
|
||||
|
||||
public readonly record struct InventoryButtonPressed;
|
||||
|
||||
public readonly record struct InteractButtonPressed;
|
||||
|
||||
public readonly record struct PauseButtonPressed;
|
||||
|
||||
public readonly record struct DebugButtonPressed;
|
||||
@@ -24,6 +28,8 @@ public partial class GameState
|
||||
|
||||
public readonly record struct CloseTeleport;
|
||||
|
||||
public readonly record struct CloseInventory;
|
||||
|
||||
public readonly record struct GameOver;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ public partial class GameState
|
||||
{
|
||||
public readonly record struct InitializeGame;
|
||||
|
||||
public readonly record struct ExitGame;
|
||||
|
||||
public readonly record struct LoadGameFromFile;
|
||||
|
||||
public readonly record struct OpenInventoryMenu;
|
||||
|
||||
@@ -8,7 +8,7 @@ public partial class GameState
|
||||
public partial record State
|
||||
{
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record DebugMenu : State, IGet<Input.DebugButtonPressed>
|
||||
public partial record DebugMenu : InGame, IGet<Input.DebugButtonPressed>
|
||||
{
|
||||
public Transition On(in Input.DebugButtonPressed input)
|
||||
{
|
||||
|
||||
@@ -8,13 +8,20 @@ public partial class GameState
|
||||
public partial record State
|
||||
{
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record GameOver : State, IGet<Input.NewGame>
|
||||
public partial record GameOver : InGame, IGet<Input.NewGame>, IGet<Input.ExitGame>
|
||||
{
|
||||
public Transition On(in Input.NewGame input)
|
||||
{
|
||||
Output(new Output.InitializeGame());
|
||||
return To<InGame>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.ExitGame input)
|
||||
{
|
||||
Output(new Output.ClosePauseScreen());
|
||||
Output(new Output.ExitGame());
|
||||
return To<State>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-2
@@ -8,9 +8,15 @@ public partial class GameState
|
||||
public partial record State
|
||||
{
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record InventoryScreen : State, IGet<Input.InventoryButtonPressed>
|
||||
public partial record InventoryScreen : State, IGet<Input.InteractButtonPressed>, IGet<Input.CloseInventory>
|
||||
{
|
||||
public Transition On(in Input.InventoryButtonPressed input)
|
||||
public Transition On(in Input.InteractButtonPressed input)
|
||||
{
|
||||
Output(new Output.CloseInventoryMenu());
|
||||
return To<InGame>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.CloseInventory input)
|
||||
{
|
||||
Output(new Output.CloseInventoryMenu());
|
||||
return To<InGame>();
|
||||
|
||||
+9
-1
@@ -1,5 +1,6 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.LogicBlocks;
|
||||
using static Zennysoft.Ma.Adapter.GameState.Output;
|
||||
|
||||
namespace Zennysoft.Ma.Adapter;
|
||||
|
||||
@@ -8,13 +9,20 @@ public partial class GameState
|
||||
public partial record State
|
||||
{
|
||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
||||
public partial record PauseScreen : State, IGet<Input.PauseButtonPressed>
|
||||
public partial record PauseScreen : State, IGet<Input.PauseButtonPressed>, IGet<Input.ExitGame>
|
||||
{
|
||||
public Transition On(in Input.PauseButtonPressed input)
|
||||
{
|
||||
Output(new Output.ClosePauseScreen());
|
||||
return To<InGame>();
|
||||
}
|
||||
|
||||
public Transition On(in Input.ExitGame input)
|
||||
{
|
||||
Output(new Output.ClosePauseScreen());
|
||||
Output(new Output.ExitGame());
|
||||
return To<State>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
public interface IAccessory : IEquipableItem, IAugmentableItem
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
public interface IArmor : IEquipableItem, IAugmentableItem
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public interface IAugmentItem : IBaseInventoryItem
|
||||
{
|
||||
|
||||
public IAugmentType Augment { get; }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Zennysoft.Ma.Adapter
|
||||
{
|
||||
public interface IAugmentableItem
|
||||
{
|
||||
public Augment? Augment { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
public interface IBaseInventoryItem
|
||||
{
|
||||
public string ItemName { get; }
|
||||
public string Description { get; }
|
||||
public float SpawnRate { get; }
|
||||
public int ThrowDamage { get; }
|
||||
public float ThrowSpeed { get; }
|
||||
public ItemTag ItemTag { get; }
|
||||
|
||||
public abstract Texture2D GetTexture();
|
||||
}
|
||||
@@ -4,6 +4,6 @@
|
||||
{
|
||||
void RescueItem();
|
||||
|
||||
public InventoryItem Item { get; }
|
||||
public IBaseInventoryItem Item { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using Zennysoft.Ma.Adapter.Entity;
|
||||
|
||||
public interface IEquipableItem : IBaseInventoryItem
|
||||
{
|
||||
public int BonusAttack { get; }
|
||||
public int BonusDefense { get; }
|
||||
public int BonusHP { get; }
|
||||
public int BonusVT { get; }
|
||||
public int BonusLuck { get; }
|
||||
|
||||
public bool Glued { get; set; }
|
||||
|
||||
public ElementalResistanceSet ElementalResistance { get; }
|
||||
}
|
||||
@@ -2,17 +2,19 @@
|
||||
|
||||
public interface IInventory
|
||||
{
|
||||
public bool PickUpItem(InventoryItem item);
|
||||
public bool PickUpItem(IBaseInventoryItem item);
|
||||
|
||||
public List<InventoryItem> Items { get; }
|
||||
public List<IBaseInventoryItem> Items { get; }
|
||||
|
||||
public bool TryAdd(InventoryItem inventoryItem);
|
||||
public bool TryAdd(IBaseInventoryItem inventoryItem);
|
||||
|
||||
public bool TryInsert(InventoryItem inventoryItem, int index);
|
||||
public bool TryInsert(IBaseInventoryItem inventoryItem, int index);
|
||||
|
||||
public void Remove(InventoryItem inventoryItem);
|
||||
public void Remove(IBaseInventoryItem inventoryItem);
|
||||
|
||||
public void Sort(EquipableItem currentWeapon, EquipableItem currentArmor, EquipableItem currentAccessory);
|
||||
public bool Sort(IWeapon currentWeapon, IArmor currentArmor, IAccessory currentAccessory, IEquipableItem ammo);
|
||||
|
||||
public bool AtCapacity();
|
||||
|
||||
public event Action<string> BroadcastMessage;
|
||||
public event Action InventoryChanged;
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
public interface IThrownItem
|
||||
{
|
||||
public InventoryItem ItemThatIsThrown { get; set; }
|
||||
public IBaseInventoryItem ItemThatIsThrown { get; set; }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
public interface IWeapon : IEquipableItem, IAugmentableItem
|
||||
{
|
||||
}
|
||||
@@ -7,10 +7,10 @@ namespace Zennysoft.Ma.Adapter;
|
||||
public partial class RescuedItemDatabase
|
||||
{
|
||||
[Save("rescued_item_list")]
|
||||
public List<InventoryItem> Items { get; init; }
|
||||
public List<IBaseInventoryItem> Items { get; init; }
|
||||
|
||||
public RescuedItemDatabase()
|
||||
{
|
||||
Items = new List<InventoryItem>();
|
||||
Items = new List<IBaseInventoryItem>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,6 @@ public partial class ItemTagEnumContext : JsonSerializerContext;
|
||||
[JsonSerializable(typeof(AccessoryTag))]
|
||||
public partial class AccessoryTagEnumContext : JsonSerializerContext;
|
||||
|
||||
[JsonSerializable(typeof(ThrowableItemTag))]
|
||||
public partial class ThrowableItemTagEnumContext : JsonSerializerContext;
|
||||
|
||||
[JsonSerializable(typeof(UsableItemTag))]
|
||||
public partial class UsableItemTagEnumContext : JsonSerializerContext;
|
||||
|
||||
|
||||
@@ -7,9 +7,11 @@ public interface IDungeonFloor : INode3D
|
||||
{
|
||||
void InitializeDungeon();
|
||||
|
||||
public Transform3D GetPlayerSpawnPoint();
|
||||
public abstract (Vector3 Rotation, Vector3 Position) GetPlayerSpawnPoint();
|
||||
|
||||
public ImmutableList<IDungeonRoom> Rooms { get; }
|
||||
|
||||
public void FadeOutAudio();
|
||||
|
||||
public bool FloorIsLoaded { get; set; }
|
||||
}
|
||||
|
||||
@@ -18,11 +18,17 @@ public interface IPlayer : IKillable, ICharacterBody3D
|
||||
|
||||
public void LevelUp();
|
||||
|
||||
public void TeleportPlayer(Transform3D newTransform);
|
||||
public void TeleportPlayer((Vector3 Rotation, Vector3 Position) newTransform);
|
||||
|
||||
public void Equip(EquipableItem equipable);
|
||||
public void Equip(IEquipableItem equipable);
|
||||
|
||||
public void Unequip(EquipableItem equipable);
|
||||
public void Unequip(IEquipableItem equipable);
|
||||
|
||||
public void PlayJumpScareAnimation();
|
||||
|
||||
public void ApplyNewAugment(IAugmentItem jewel, IAugmentableItem equipableItem);
|
||||
|
||||
public void IdentifyItem(IBaseInventoryItem unidentifiedItem);
|
||||
|
||||
public IInventory Inventory { get; }
|
||||
|
||||
@@ -40,6 +46,22 @@ public interface IPlayer : IKillable, ICharacterBody3D
|
||||
|
||||
public IEquipmentComponent EquipmentComponent { get; }
|
||||
|
||||
public void SetHealthTimerStatus(bool isActive);
|
||||
|
||||
public void ModifyHealthTimerSpeed(float newModifier);
|
||||
|
||||
public bool AutoRevive { get; set; }
|
||||
|
||||
public int TotalAttack { get; }
|
||||
public int TotalDefense { get; }
|
||||
public int TotalLuck { get; }
|
||||
|
||||
public int HealthTimerHPRate { get; set; }
|
||||
|
||||
public float HealthTimerSpeedModifier { get; }
|
||||
|
||||
public bool AutoIdentifyItems { get; set; }
|
||||
|
||||
public event Action PlayerDied;
|
||||
public delegate InventoryItem RerollItem(InventoryItem item);
|
||||
public delegate IBaseInventoryItem RerollItem(IBaseInventoryItem item);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ public partial class PlayerLogic
|
||||
{
|
||||
public readonly record struct PhysicsTick(double Delta);
|
||||
|
||||
public readonly record struct Moved(Vector3 GlobalPosition, Transform3D GlobalTransform);
|
||||
|
||||
public readonly record struct Enable;
|
||||
|
||||
public readonly record struct Attack;
|
||||
|
||||
@@ -6,6 +6,9 @@ namespace Zennysoft.Ma.Adapter;
|
||||
[Meta, Id("quest_data")]
|
||||
public partial record QuestData
|
||||
{
|
||||
[Save("death_count")]
|
||||
public int DeathCount { get; set; } = 0;
|
||||
|
||||
[Save("quest_data_1")]
|
||||
public bool QuestMarker1 { get; set; } = false;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public sealed class MaSaveFileManager : IMaSaveFileManager
|
||||
public MaSaveFileManager(ISaveFileManager saveFileManager)
|
||||
{
|
||||
_saveFileManager = saveFileManager;
|
||||
_converters = [WeaponTagEnumContext.Default, ItemTagEnumContext.Default, ElementTypeEnumContext.Default, AccessoryTagEnumContext.Default, ThrowableItemTagEnumContext.Default, UsableItemTagEnumContext.Default, BoxItemTagEnumContext.Default];
|
||||
_converters = [WeaponTagEnumContext.Default, ItemTagEnumContext.Default, ElementTypeEnumContext.Default, AccessoryTagEnumContext.Default, UsableItemTagEnumContext.Default, BoxItemTagEnumContext.Default];
|
||||
}
|
||||
|
||||
public async Task Save<T>(T gameData)
|
||||
|
||||
@@ -38,7 +38,7 @@ public partial class InGameUILogic
|
||||
Output(new Output.AnnounceMessageInInventory(message));
|
||||
}
|
||||
|
||||
private void OnRemoveItemFromInventory(InventoryItem item) => Output(new Output.RemoveItemFromInventory(item));
|
||||
private void OnRemoveItemFromInventory(IBaseInventoryItem item) => Output(new Output.RemoveItemFromInventory(item));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ public partial class InGameUILogic
|
||||
{
|
||||
public readonly record struct AnnounceMessageOnMainScreen(string Message);
|
||||
public readonly record struct AnnounceMessageInInventory(string Message);
|
||||
public readonly record struct RemoveItemFromInventory(InventoryItem Item);
|
||||
public readonly record struct RemoveItemFromInventory(IBaseInventoryItem Item);
|
||||
public readonly record struct ShowInventory;
|
||||
public readonly record struct HideInventory;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Actions\**" />
|
||||
<Compile Remove="Game\state\states\**" />
|
||||
<EmbeddedResource Remove="Actions\**" />
|
||||
<EmbeddedResource Remove="Game\state\states\**" />
|
||||
<None Remove="Actions\**" />
|
||||
<None Remove="Game\state\states\**" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -28,8 +31,4 @@
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Actions\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<!-- Use NativeAOT. -->
|
||||
<PublishAot>true</PublishAot>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="src\items\weapons\models\**" />
|
||||
<EmbeddedResource Remove="src\items\weapons\models\**" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<!-- Root the assemblies to avoid trimming. -->
|
||||
<TrimmerRootAssembly Include="GodotSharp" />
|
||||
<TrimmerRootAssembly Include="$(TargetName)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
|
||||
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
|
||||
<PackageReference Include="SimpleInjector" Version="5.5.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
<PackageReference Include="Zeroconf" Version="3.7.16" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="src\ui\dialogue\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,38 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<WarningsAsErrors>CS9057</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
|
||||
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
|
||||
<PackageReference Include="SimpleInjector" Version="5.5.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
<PackageReference Include="Zeroconf" Version="3.7.16" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,38 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<WarningsAsErrors>CS9057</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
|
||||
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
|
||||
<PackageReference Include="SimpleInjector" Version="5.5.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
<PackageReference Include="Zeroconf" Version="3.7.16" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,38 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.1">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<WarningsAsErrors>CS9057</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
|
||||
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
|
||||
<PackageReference Include="SimpleInjector" Version="5.5.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
<PackageReference Include="Zeroconf" Version="3.7.16" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,38 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<WarningsAsErrors>CS9057</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
|
||||
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
|
||||
<PackageReference Include="SimpleInjector" Version="5.5.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
<PackageReference Include="Zeroconf" Version="3.7.16" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,38 +0,0 @@
|
||||
<Project Sdk="Godot.NET.Sdk/4.4.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
<WarningsAsErrors>CS9057</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
|
||||
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
|
||||
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
|
||||
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
|
||||
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
|
||||
<PackageReference Include="SimpleInjector" Version="5.5.0" />
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
|
||||
<PackageReference Include="Zeroconf" Version="3.7.16" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".editorconfig" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
|
||||
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,4 +1,8 @@
|
||||
[gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://c2mk6c27y0mdf"]
|
||||
[gd_resource type="AudioBusLayout" load_steps=4 format=3 uid="uid://c2mk6c27y0mdf"]
|
||||
|
||||
[sub_resource type="AudioEffectLimiter" id="AudioEffectLimiter_j3pel"]
|
||||
resource_name = "Limiter"
|
||||
soft_clip_db = 1.0
|
||||
|
||||
[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_j3pel"]
|
||||
resource_name = "Reverb"
|
||||
@@ -7,8 +11,16 @@ damping = 0.9
|
||||
dry = 0.99
|
||||
wet = 0.05
|
||||
|
||||
[sub_resource type="AudioEffectLimiter" id="AudioEffectLimiter_g28q7"]
|
||||
resource_name = "Limiter"
|
||||
ceiling_db = -0.5
|
||||
threshold_db = -0.6
|
||||
soft_clip_db = 1.5
|
||||
|
||||
[resource]
|
||||
bus/0/volume_db = -0.130497
|
||||
bus/0/effect/0/effect = SubResource("AudioEffectLimiter_j3pel")
|
||||
bus/0/effect/0/enabled = true
|
||||
bus/1/name = &"AMBIENT"
|
||||
bus/1/solo = false
|
||||
bus/1/mute = false
|
||||
@@ -23,6 +35,8 @@ bus/2/volume_db = 0.0
|
||||
bus/2/send = &"Master"
|
||||
bus/2/effect/0/effect = SubResource("AudioEffectReverb_j3pel")
|
||||
bus/2/effect/0/enabled = true
|
||||
bus/2/effect/1/effect = SubResource("AudioEffectLimiter_g28q7")
|
||||
bus/2/effect/1/enabled = true
|
||||
bus/3/name = &"MUSIC"
|
||||
bus/3/solo = false
|
||||
bus/3/mute = false
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
[preset.0]
|
||||
|
||||
name="Steamdeck"
|
||||
platform="Linux"
|
||||
name="Windows Desktop"
|
||||
platform="Windows Desktop"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
advanced_options=true
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="exclude"
|
||||
export_files=PackedStringArray()
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=""
|
||||
export_path="Export/Ma.exe"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
script_export_mode=1
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
@@ -28,51 +27,6 @@ binary_format/embed_pck=false
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
binary_format/architecture="x86_64"
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
ssh_remote_deploy/extra_args_ssh=""
|
||||
ssh_remote_deploy/extra_args_scp=""
|
||||
ssh_remote_deploy/run_script="#!/usr/bin/env bash
|
||||
export DISPLAY=:0
|
||||
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
|
||||
\"{temp_dir}/{exe_name}\" {cmd_args}"
|
||||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
dotnet/include_scripts_content=false
|
||||
dotnet/include_debug_symbols=true
|
||||
dotnet/embed_build_outputs=false
|
||||
|
||||
[preset.1]
|
||||
|
||||
name="Windows Desktop"
|
||||
platform="Windows Desktop"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path="Output/Ma.zip"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.1.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=0
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
binary_format/architecture="x86_64"
|
||||
codesign/enable=false
|
||||
codesign/timestamp=true
|
||||
codesign/timestamp_server_url=""
|
||||
@@ -111,5 +65,5 @@ ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debu
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||
Remove-Item -Recurse -Force '{temp_dir}'"
|
||||
dotnet/include_scripts_content=false
|
||||
dotnet/include_debug_symbols=false
|
||||
dotnet/include_debug_symbols=true
|
||||
dotnet/embed_build_outputs=false
|
||||
|
||||
@@ -12,9 +12,8 @@ config_version=5
|
||||
|
||||
config/name="Ma"
|
||||
run/main_scene="uid://d1gjaijijd5ot"
|
||||
run/print_header=false
|
||||
config/features=PackedStringArray("4.4", "C#", "GL Compatibility")
|
||||
run/delta_smoothing=false
|
||||
run/max_fps=60
|
||||
boot_splash/show_image=false
|
||||
|
||||
[autoload]
|
||||
@@ -24,6 +23,7 @@ DialogueController="*res://src/game/DialogueController.cs"
|
||||
AudioManager="*res://src/audio/AudioManager.cs"
|
||||
BgmPlayer="*res://src/audio/BGMPlayer.cs"
|
||||
InputHelper="*res://addons/input_helper/input_helper.gd"
|
||||
SfxDatabase="*res://src/audio/SFXDatabase.tscn"
|
||||
|
||||
[dialogue_manager]
|
||||
|
||||
@@ -35,13 +35,16 @@ runtime/advanced/uses_dotnet=true
|
||||
|
||||
window/size/viewport_width=1920
|
||||
window/size/viewport_height=1080
|
||||
window/stretch/mode="viewport"
|
||||
window/stretch/aspect="expand"
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="Ma"
|
||||
|
||||
[editor]
|
||||
|
||||
export/convert_text_resources_to_binary=false
|
||||
|
||||
[editor_plugins]
|
||||
|
||||
enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg", "res://addons/input_helper/plugin.cfg")
|
||||
@@ -54,6 +57,20 @@ folder_colors={
|
||||
"res://src/game/": "orange",
|
||||
"res://src/items/": "teal",
|
||||
"res://src/map/": "gray",
|
||||
"res://src/map/dungeon/floors/Floor01/": "red",
|
||||
"res://src/map/dungeon/floors/Floor02/": "red",
|
||||
"res://src/map/dungeon/floors/Floor03/": "red",
|
||||
"res://src/map/dungeon/floors/Floor04/": "red",
|
||||
"res://src/map/dungeon/floors/Floor05/": "red",
|
||||
"res://src/map/dungeon/floors/Floor06/": "red",
|
||||
"res://src/map/dungeon/floors/Floor07/": "red",
|
||||
"res://src/map/dungeon/floors/Floor09/": "teal",
|
||||
"res://src/map/dungeon/floors/Floor10/": "teal",
|
||||
"res://src/map/dungeon/floors/Floor11/": "teal",
|
||||
"res://src/map/dungeon/floors/Floor12/": "teal",
|
||||
"res://src/map/dungeon/floors/Floor13/": "teal",
|
||||
"res://src/map/dungeon/floors/Floor14/": "teal",
|
||||
"res://src/map/dungeon/floors/Floor15/": "teal",
|
||||
"res://src/player/": "blue",
|
||||
"res://src/ui/inventory_menu/": "green"
|
||||
}
|
||||
@@ -62,10 +79,16 @@ folder_colors={
|
||||
|
||||
import/blender/enabled=false
|
||||
|
||||
[global_group]
|
||||
|
||||
DimmableAudio=""
|
||||
|
||||
[importer_defaults]
|
||||
|
||||
texture={
|
||||
"detect_3d/compress_to": 0
|
||||
&"compress/high_quality": true,
|
||||
&"compress/mode": 2,
|
||||
&"detect_3d/compress_to": 0
|
||||
}
|
||||
|
||||
[input]
|
||||
@@ -84,6 +107,7 @@ ui_cancel={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":1,"pressure":0.0,"pressed":true,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ui_focus_next={
|
||||
@@ -122,24 +146,28 @@ MoveUp={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
MoveLeft={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
MoveRight={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
MoveDown={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
Attack={
|
||||
@@ -223,10 +251,30 @@ AltAttack={
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
CameraForward={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null)
|
||||
]
|
||||
}
|
||||
CameraBack={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
EnemyViewerIdle={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
EnemyViewerWalk={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[internationalization]
|
||||
|
||||
locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialogue", "res://src/npc/Ran/ran.dialogue", "res://src/npc/Rat/ratdialogue.dialogue")
|
||||
locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialogue", "res://src/npc/Ran/ran.dialogue", "res://src/npc/Rat/ratdialogue.dialogue", "res://src/dialog/Altar.dialogue", "res://stone.dialogue", "res://src/npc/Proscenium/JumpScare.dialogue", "res://tutorialstone.dialogue")
|
||||
|
||||
[layer_names]
|
||||
|
||||
@@ -242,6 +290,8 @@ locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialo
|
||||
3d_physics/layer_10="Minimap"
|
||||
3d_physics/layer_11="ItemRescue"
|
||||
3d_physics/layer_12="EnemyHitbox"
|
||||
3d_physics/layer_13="UnlockableDoor"
|
||||
3d_physics/layer_14="ExplodableWall"
|
||||
3d_physics/layer_32="Navigation"
|
||||
|
||||
[navigation]
|
||||
@@ -252,6 +302,7 @@ locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialo
|
||||
|
||||
3d/run_on_separate_thread=true
|
||||
common/physics_ticks_per_second=144
|
||||
jolt_physics_3d/simulation/areas_detect_static_bodies=true
|
||||
|
||||
[rendering]
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://bevfcpew3kket
|
||||
@@ -1,5 +1,4 @@
|
||||
using Chickensoft.Collections;
|
||||
using Godot;
|
||||
using System;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
using Zennysoft.Ma.Adapter.Entity;
|
||||
@@ -7,19 +6,23 @@ using Zennysoft.Ma.Adapter.Entity;
|
||||
namespace Zennysoft.Game.Ma;
|
||||
public class EquipmentComponent : IEquipmentComponent
|
||||
{
|
||||
public IAutoProp<EquipableItem> EquippedWeapon => _equippedWeapon;
|
||||
public IAutoProp<IWeapon> EquippedWeapon => _equippedWeapon;
|
||||
|
||||
public IAutoProp<EquipableItem> EquippedArmor => _equippedArmor;
|
||||
public IAutoProp<IArmor> EquippedArmor => _equippedArmor;
|
||||
|
||||
public IAutoProp<EquipableItem> EquippedAccessory => _equippedAccessory;
|
||||
public IAutoProp<IAccessory> EquippedAccessory => _equippedAccessory;
|
||||
|
||||
public AutoProp<EquipableItem> _equippedWeapon;
|
||||
public IAutoProp<IEquipableItem> EquippedAmmo => _equippedAmmo;
|
||||
|
||||
public AutoProp<EquipableItem> _equippedArmor;
|
||||
public AutoProp<IWeapon> _equippedWeapon;
|
||||
|
||||
public AutoProp<EquipableItem> _equippedAccessory;
|
||||
public AutoProp<IArmor> _equippedArmor;
|
||||
|
||||
public event Action<EquipableItem> EquipmentChanged;
|
||||
public AutoProp<IAccessory> _equippedAccessory;
|
||||
|
||||
public AutoProp<IEquipableItem> _equippedAmmo;
|
||||
|
||||
public event Action<IEquipableItem> EquipmentChanged;
|
||||
|
||||
public int BonusAttack => _equippedWeapon.Value.BonusAttack + _equippedArmor.Value.BonusAttack + _equippedAccessory.Value.BonusAttack;
|
||||
|
||||
@@ -35,9 +38,10 @@ public class EquipmentComponent : IEquipmentComponent
|
||||
|
||||
public EquipmentComponent()
|
||||
{
|
||||
_equippedWeapon = new AutoProp<EquipableItem>(new Weapon());
|
||||
_equippedArmor = new AutoProp<EquipableItem>(new Armor());
|
||||
_equippedAccessory = new AutoProp<EquipableItem>(new Accessory());
|
||||
_equippedWeapon = new AutoProp<IWeapon>(new Weapon());
|
||||
_equippedArmor = new AutoProp<IArmor>(new Armor());
|
||||
_equippedAccessory = new AutoProp<IAccessory>(new Accessory());
|
||||
_equippedAmmo = new AutoProp<IEquipableItem>(new Ammo());
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
@@ -45,9 +49,10 @@ public class EquipmentComponent : IEquipmentComponent
|
||||
_equippedWeapon.OnNext(new Weapon());
|
||||
_equippedArmor.OnNext(new Armor());
|
||||
_equippedAccessory.OnNext(new Accessory());
|
||||
_equippedAmmo.OnNext(new Ammo());
|
||||
}
|
||||
|
||||
public void Equip(EquipableItem equipable)
|
||||
public void Equip(IEquipableItem equipable)
|
||||
{
|
||||
if (equipable is Weapon weapon)
|
||||
_equippedWeapon.OnNext(weapon);
|
||||
@@ -55,10 +60,12 @@ public class EquipmentComponent : IEquipmentComponent
|
||||
_equippedArmor.OnNext(armor);
|
||||
if (equipable is Accessory accessory)
|
||||
_equippedAccessory.OnNext(accessory);
|
||||
if (equipable is Ammo ammo)
|
||||
_equippedAmmo.OnNext(ammo);
|
||||
EquipmentChanged?.Invoke(equipable);
|
||||
}
|
||||
|
||||
public void Unequip(EquipableItem equipable)
|
||||
public void Unequip(IEquipableItem equipable)
|
||||
{
|
||||
if (equipable is Weapon weapon)
|
||||
_equippedWeapon.OnNext(new Weapon());
|
||||
@@ -66,14 +73,20 @@ public class EquipmentComponent : IEquipmentComponent
|
||||
_equippedArmor.OnNext(new Armor());
|
||||
if (equipable is Accessory accessory)
|
||||
_equippedAccessory.OnNext(new Accessory());
|
||||
if (equipable is Ammo ammo)
|
||||
_equippedAmmo.OnNext(new Ammo());
|
||||
EquipmentChanged?.Invoke(equipable);
|
||||
}
|
||||
|
||||
public bool IsItemEquipped(InventoryItem item)
|
||||
public bool IsItemEquipped(IEquipableItem item)
|
||||
{
|
||||
if (item is not EquipableItem)
|
||||
return false;
|
||||
return item == _equippedWeapon.Value || item == _equippedArmor.Value || item == _equippedAccessory.Value || item == _equippedAmmo.Value;
|
||||
}
|
||||
|
||||
return item == _equippedWeapon.Value || item == _equippedArmor.Value || item == _equippedAccessory.Value;
|
||||
public void UpdateEquipment(IEquipableItem equipable) => EquipmentChanged?.Invoke(equipable);
|
||||
|
||||
public bool AugmentableEquipmentExists()
|
||||
{
|
||||
return (_equippedWeapon.Value.ItemName != null && _equippedWeapon.Value.Augment == null) || (_equippedArmor.Value.ItemName != null && _equippedArmor.Value.Augment == null) || (_equippedAccessory.Value.ItemName != null && _equippedAccessory.Value.Augment == null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
|
||||
|
||||
private readonly AutoProp<int> _level;
|
||||
|
||||
public event Action PlayerLevelUp;
|
||||
|
||||
public ExperiencePointsComponent()
|
||||
{
|
||||
var firstLevelExpRequirement = ExpToNextLevelCalculation(1);
|
||||
@@ -50,12 +52,25 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
|
||||
_currentExp.OnNext(cappedAmount);
|
||||
}
|
||||
|
||||
public void GainUnmodified(int flatRateExp)
|
||||
{
|
||||
var newCurrentExpTotal = flatRateExp + _currentExp.Value;
|
||||
while (flatRateExp + _currentExp.Value >= _expToNextLevel.Value)
|
||||
LevelUp();
|
||||
var cappedAmount = Math.Min(flatRateExp + _currentExp.Value, _expToNextLevel.Value);
|
||||
_currentExp.OnNext(cappedAmount);
|
||||
}
|
||||
|
||||
public void ModifyExpGainRate(double newRate) => _expGainRate.OnNext(newRate);
|
||||
|
||||
public void LevelUp()
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.LevelUp);
|
||||
_level.OnNext(_level.Value + 1);
|
||||
var expToNextLevel = ExpToNextLevelCalculation(_level.Value);
|
||||
_currentExp.OnNext(_currentExp.Value - _expToNextLevel.Value);
|
||||
_expToNextLevel.OnNext(expToNextLevel);
|
||||
PlayerLevelUp?.Invoke();
|
||||
}
|
||||
|
||||
private int ExpToNextLevelCalculation(int nextLevel)
|
||||
|
||||
@@ -36,12 +36,18 @@ public class HealthComponent : IHealthComponent
|
||||
|
||||
public void Heal(int healAmount)
|
||||
{
|
||||
if (CurrentHP.Value <= 0)
|
||||
return;
|
||||
|
||||
var cappedAmount = Math.Min(healAmount + _currentHP.Value, _maximumHP.Value);
|
||||
_currentHP.OnNext(cappedAmount);
|
||||
}
|
||||
|
||||
public void Damage(int damageAmount)
|
||||
{
|
||||
if (CurrentHP.Value <= 0)
|
||||
return;
|
||||
|
||||
var cappedAmount = Math.Max(_currentHP.Value - damageAmount, 0);
|
||||
_currentHP.OnNext(cappedAmount);
|
||||
|
||||
|
||||
@@ -2,15 +2,10 @@ namespace Zennysoft.Game.Ma;
|
||||
|
||||
using Godot;
|
||||
|
||||
#if DEBUG
|
||||
using System.Reflection;
|
||||
#endif
|
||||
|
||||
public partial class Main : Node
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
// If we don't need to run tests, we can just switch to the game scene.
|
||||
CallDeferred("RunScene");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Collections;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using NathanHoad;
|
||||
using SimpleInjector.Lifestyles;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Zennysoft.Game.Abstractions;
|
||||
using Zennysoft.Game.Implementation;
|
||||
@@ -32,7 +29,7 @@ public partial class App : Node, IApp
|
||||
|
||||
[Node] private OptionsMenu OptionsMenu { get; set; }
|
||||
|
||||
public IInstantiator Instantiator { get; set; } = default!;
|
||||
[Node] private GalleryMenu GalleryMenu { get; set; }
|
||||
|
||||
IAppRepo IProvide<IAppRepo>.Value() => AppRepo;
|
||||
|
||||
@@ -40,15 +37,19 @@ public partial class App : Node, IApp
|
||||
public IAppLogic AppLogic { get; set; } = default!;
|
||||
public AppLogic.IBinding AppBinding { get; set; } = default!;
|
||||
|
||||
private Array _progress;
|
||||
private Godot.Collections.Array _progress;
|
||||
private SimpleInjector.Container _container;
|
||||
|
||||
private AutoProp<string> _loadedScene = new(string.Empty);
|
||||
private DataViewer _dataViewer;
|
||||
private bool _loadingGame = false;
|
||||
private bool _loadingEnemyViewer = false;
|
||||
private string _optionsSavePath = string.Empty;
|
||||
private string _controllerSavePath = string.Empty;
|
||||
private ISaveFileManager _saveFileManager;
|
||||
private IGame _game;
|
||||
private IDataViewer _enemyViewer;
|
||||
|
||||
private double _reportedProgress = 0;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
@@ -63,11 +64,18 @@ public partial class App : Node, IApp
|
||||
_optionsSavePath = $"{OS.GetUserDataDir()}/options.json";
|
||||
_controllerSavePath = $"{OS.GetUserDataDir()}/controls.json";
|
||||
|
||||
Task.Run(() => _saveFileManager.ReadFromFile<OptionsData>(_optionsSavePath).ContinueWith((data) =>
|
||||
{
|
||||
if (data.IsCompletedSuccessfully)
|
||||
OptionsMenu.CallDeferred("Load", data.Result);
|
||||
}));
|
||||
MainMenu.StartGame += OnStartGame;
|
||||
MainMenu.EnemyViewer += OnEnemyViewer;
|
||||
MainMenu.Gallery += OnGallery;
|
||||
MainMenu.Options += OnOptions;
|
||||
MainMenu.Quit += OnQuit;
|
||||
|
||||
GalleryMenu.GalleryExited += GalleryExited;
|
||||
|
||||
OptionsMenu.OptionsMenuExited += OptionsMenu_OptionsMenuExited;
|
||||
OptionsMenu.DeleteSaveData += DeleteSaveData;
|
||||
AppRepo = _container.GetInstance<IAppRepo>();
|
||||
AppLogic = _container.GetInstance<IAppLogic>();
|
||||
|
||||
Task.Run(() => _saveFileManager.ReadFromFile<string>(_controllerSavePath).ContinueWith((data) =>
|
||||
{
|
||||
@@ -75,25 +83,32 @@ public partial class App : Node, IApp
|
||||
OptionsMenu.Controller.CallDeferred(nameof(OptionsMenu.Controller.LoadControllerInput), data.Result);
|
||||
}));
|
||||
|
||||
MainMenu.StartGame += OnStartGame;
|
||||
MainMenu.EnemyViewer += OnEnemyViewer;
|
||||
MainMenu.Options += OnOptions;
|
||||
MainMenu.Quit += OnQuit;
|
||||
_loadedScene.Changed += OnGameLoaded;
|
||||
|
||||
OptionsMenu.OptionsMenuExited += OptionsMenu_OptionsMenuExited;
|
||||
|
||||
AppRepo = _container.GetInstance<IAppRepo>();
|
||||
AppLogic = _container.GetInstance<IAppLogic>();
|
||||
|
||||
AppLogic.Set(AppRepo);
|
||||
AppLogic.Set(new AppLogic.Data());
|
||||
|
||||
AppRepo.DataViewerExited += DataViewerExited;
|
||||
|
||||
Input.MouseMode = Input.MouseModeEnum.Visible;
|
||||
_progress = [];
|
||||
this.Provide();
|
||||
}
|
||||
|
||||
private void GameExitRequested()
|
||||
{
|
||||
AppLogic.Input(new AppLogic.Input.QuitGame());
|
||||
}
|
||||
|
||||
private void DeleteSaveData()
|
||||
{
|
||||
var saveFileManager = _container.GetInstance<ISaveFileManager>();
|
||||
saveFileManager.DeleteSaveData();
|
||||
}
|
||||
|
||||
private void DataViewerExited()
|
||||
{
|
||||
AppLogic.Input(new AppLogic.Input.EnemyViewerExited());
|
||||
}
|
||||
|
||||
private async void OptionsMenu_OptionsMenuExited()
|
||||
{
|
||||
var saveFileManager = _container.GetInstance<ISaveFileManager>();
|
||||
@@ -104,12 +119,10 @@ public partial class App : Node, IApp
|
||||
MainMenu.OptionsButton.GrabFocus();
|
||||
}
|
||||
|
||||
private void OnGameLoaded(string sceneName)
|
||||
private void GalleryExited()
|
||||
{
|
||||
LoadingScreen.Hide();
|
||||
var scene = (PackedScene)ResourceLoader.LoadThreadedGet(sceneName);
|
||||
var node = scene.Instantiate();
|
||||
AddChild(node);
|
||||
GalleryMenu.Hide();
|
||||
MainMenu.GalleryButton.GrabFocus();
|
||||
}
|
||||
|
||||
public void OnReady()
|
||||
@@ -117,33 +130,53 @@ public partial class App : Node, IApp
|
||||
AppBinding = AppLogic.Bind();
|
||||
|
||||
AppBinding
|
||||
.Handle((in AppLogic.Output.Initialize _) =>
|
||||
{
|
||||
Task.Run(() => _saveFileManager.ReadFromFile<string>(_optionsSavePath).ContinueWith((data) =>
|
||||
{
|
||||
AppLogic.Input(new AppLogic.Input.SaveFileLoaded());
|
||||
}));
|
||||
})
|
||||
.Handle((in AppLogic.Output.ShowSplashScreen _) =>
|
||||
{
|
||||
AppLogic.Input(new AppLogic.Input.FadeOutFinished());
|
||||
})
|
||||
.Handle((in AppLogic.Output.HideSplashScreen _) =>
|
||||
{
|
||||
})
|
||||
.Handle((in AppLogic.Output.SetupGameScene _) =>
|
||||
{
|
||||
ResourceLoader.LoadThreadedRequest(GAME_SCENE_PATH);
|
||||
_loadingGame = true;
|
||||
MainMenu.ReleaseFocus();
|
||||
MainMenu.Hide();
|
||||
LoadingScreen.ShowLoadingScreen();
|
||||
LoadGame(GAME_SCENE_PATH);
|
||||
})
|
||||
.Handle((in AppLogic.Output.ShowMainMenu _) =>
|
||||
{
|
||||
MainMenu.CallDeferred(MainMenu.MethodName.FadeIn);
|
||||
})
|
||||
.Handle((in AppLogic.Output.ShowGame _) =>
|
||||
.Handle((in AppLogic.Output.CloseGame _) =>
|
||||
{
|
||||
LoadingScreen.HideLoadingScreen();
|
||||
_game.GameExitRequested -= GameExitRequested;
|
||||
MainMenu.StartGameButton.GrabFocus();
|
||||
_game.CallDeferred(MethodName.QueueFree, []);
|
||||
GetTree().Paused = false;
|
||||
})
|
||||
.Handle((in AppLogic.Output.StartLoadingSaveFile _) =>
|
||||
{
|
||||
})
|
||||
.Handle((in AppLogic.Output.EnemyViewerOpened _) =>
|
||||
{
|
||||
ResourceLoader.LoadThreadedRequest(ENEMY_VIEWER_PATH);
|
||||
_loadingEnemyViewer = true;
|
||||
LoadingScreen.ShowLoadingScreen();
|
||||
MainMenu.Hide();
|
||||
LoadEnemyViewer(ENEMY_VIEWER_PATH);
|
||||
})
|
||||
.Handle((in AppLogic.Output.EnemyViewerExited _) =>
|
||||
{
|
||||
LoadingScreen.HideLoadingScreen();
|
||||
if (_enemyViewer != null && _enemyViewer is DataViewer enemyViewer)
|
||||
enemyViewer.CallDeferred(MethodName.QueueFree);
|
||||
MainMenu.Show();
|
||||
MainMenu.EnemyViewerButton.GrabFocus();
|
||||
})
|
||||
.Handle((in AppLogic.Output.ExitGame _) =>
|
||||
{
|
||||
@@ -155,31 +188,60 @@ public partial class App : Node, IApp
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (_loadingGame)
|
||||
{
|
||||
ResourceLoader.LoadThreadedGetStatus(GAME_SCENE_PATH, _progress);
|
||||
LoadingScreen.ProgressBar.Value = (double)_progress.Single();
|
||||
if ((double)_progress.Single() == 1)
|
||||
_loadedScene.OnNext(GAME_SCENE_PATH);
|
||||
}
|
||||
|
||||
if (_loadingEnemyViewer)
|
||||
{
|
||||
ResourceLoader.LoadThreadedGetStatus(ENEMY_VIEWER_PATH, _progress);
|
||||
LoadingScreen.ProgressBar.Value = (double)_progress.Single();
|
||||
if ((double)_progress.Single() == 1)
|
||||
_loadedScene.OnNext(ENEMY_VIEWER_PATH);
|
||||
}
|
||||
LoadingScreen.ProgressBar.Value = Mathf.RoundToInt(Mathf.Lerp(LoadingScreen.ProgressBar.Value, _reportedProgress * 100, (float)delta * 2));
|
||||
}
|
||||
|
||||
public void OnStartGame() => AppLogic.Input(new AppLogic.Input.NewGame());
|
||||
|
||||
private void OnEnemyViewer() => AppLogic.Input(new AppLogic.Input.EnemyViewerOpened());
|
||||
|
||||
private void OnGalleryViewer() => AppLogic.Input(new AppLogic.Input.GalleryOpened());
|
||||
|
||||
private async void LoadGame(string sceneName)
|
||||
{
|
||||
var scene = await LoadSceneInternal(sceneName);
|
||||
_game = scene as IGame;
|
||||
_game.GameLoaded += OnGameLoaded;
|
||||
_game.GameExitRequested += GameExitRequested;
|
||||
CallDeferred(MethodName.AddChild, scene);
|
||||
}
|
||||
|
||||
private void OnGameLoaded() => LoadingScreen.HideLoadingScreen();
|
||||
|
||||
private async void LoadEnemyViewer(string sceneName)
|
||||
{
|
||||
var scene = await LoadSceneInternal(sceneName);
|
||||
_enemyViewer = scene as IDataViewer;
|
||||
CallDeferred(MethodName.AddChild, scene);
|
||||
LoadingScreen.HideLoadingScreen();
|
||||
}
|
||||
|
||||
private async Task<Node> LoadSceneInternal(string sceneName)
|
||||
{
|
||||
LoadingScreen.ShowLoadingScreen();
|
||||
LoadingScreen.ProgressBar.Value = 0;
|
||||
var sceneLoader = new SceneLoader();
|
||||
CallDeferred(MethodName.AddChild, sceneLoader);
|
||||
sceneLoader.LoadSceneRequest(sceneName);
|
||||
sceneLoader.SceneReportedProgress += SceneLoader_SceneReportedProgress;
|
||||
await ToSignal(sceneLoader, SceneLoader.SignalName.SceneLoaded);
|
||||
var result = sceneLoader.LoadedScene;
|
||||
sceneLoader.QueueFree();
|
||||
return result;
|
||||
}
|
||||
|
||||
private void SceneLoader_SceneReportedProgress(double progress) => _reportedProgress = progress;
|
||||
|
||||
private async void OnOptions()
|
||||
{
|
||||
OptionsMenu.Show();
|
||||
OptionsMenu.MasterVolumeSlider.GrabFocus();
|
||||
OptionsMenu.GameTab.GrabFocus();
|
||||
}
|
||||
|
||||
private async void OnGallery()
|
||||
{
|
||||
GalleryMenu.Show();
|
||||
GalleryMenu.ItemButton1.GrabFocus();
|
||||
}
|
||||
|
||||
public void OnQuit() => AppLogic.Input(new AppLogic.Input.QuitGame());
|
||||
@@ -197,7 +259,13 @@ public partial class App : Node, IApp
|
||||
|
||||
MainMenu.StartGame -= OnStartGame;
|
||||
MainMenu.EnemyViewer -= OnEnemyViewer;
|
||||
MainMenu.Gallery -= OnGallery;
|
||||
MainMenu.Options -= OnOptions;
|
||||
MainMenu.Quit -= OnQuit;
|
||||
_loadedScene.Changed -= OnGameLoaded;
|
||||
|
||||
GalleryMenu.GalleryExited -= GalleryExited;
|
||||
|
||||
OptionsMenu.OptionsMenuExited -= OptionsMenu_OptionsMenuExited;
|
||||
OptionsMenu.DeleteSaveData -= DeleteSaveData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,140 +1,42 @@
|
||||
// Attach to a ColorRect in front of texture/background
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
// Handles the resolution changes, color depth, and dithering
|
||||
group_uniforms resolution_and_colors;
|
||||
uniform bool change_color_depth = false;
|
||||
uniform int target_color_depth : hint_range(1, 8) = 5;
|
||||
uniform bool dithering = false;
|
||||
uniform bool scale_resolution = false;
|
||||
uniform int target_resolution_scale = 3;
|
||||
// Handles the concentric ripples
|
||||
uniform float frequency: hint_range(0, 15, 0.01) = 4.0;
|
||||
uniform float amplitude: hint_range(0, 3, 0.1) = 2.0;
|
||||
uniform float ripple_rate : hint_range(0, 20.0, 1) = 5;
|
||||
|
||||
// Handles the LUTish recoloring
|
||||
group_uniforms gradient_recoloring;
|
||||
uniform bool enable_recolor = false;
|
||||
uniform sampler2D to_gradient: hint_default_black;
|
||||
// Handles the waves themselves
|
||||
uniform float wave_amplitude: hint_range(0.001, 0.1, 0.001) = 0.05;
|
||||
uniform float wave_frequency: hint_range(0, 15, 0.01) = 4.0;
|
||||
|
||||
int dithering_pattern(ivec2 fragcoord) {
|
||||
const int pattern[] = {
|
||||
-4, +0, -3, +1,
|
||||
+2, -2, +3, -1,
|
||||
-3, +1, -4, +0,
|
||||
+3, -1, +2, -2
|
||||
};
|
||||
uniform sampler2D noise;
|
||||
|
||||
int x = fragcoord.x % 4;
|
||||
int y = fragcoord.y % 4;
|
||||
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear_mipmap;
|
||||
|
||||
return pattern[y * 4 + x];
|
||||
}
|
||||
|
||||
vec3 rgb2hsv(vec3 rgb) { //Converts RGB values to HSV
|
||||
float r = rgb.r;
|
||||
float g = rgb.g;
|
||||
float b = rgb.b;
|
||||
|
||||
float cmax = max(r,max(g,b));
|
||||
float cmin = min(r,min(g,b));
|
||||
float delta = cmax - cmin;
|
||||
|
||||
float h = 0.f; //hue
|
||||
|
||||
if (delta > 0.f){
|
||||
if (cmax == r){
|
||||
h = (g-b)/delta;
|
||||
h = mod(h,6.f);
|
||||
} else if (cmax == g){
|
||||
h = ((b - r) / delta) + 2.f;
|
||||
} else {
|
||||
h = ((r-g)/delta) + 4.f;
|
||||
}
|
||||
h = h * 60.f;
|
||||
}
|
||||
|
||||
float s = 0.f; //saturation
|
||||
if (cmax > 0.f){
|
||||
s = delta / cmax;
|
||||
}
|
||||
|
||||
return vec3(h,s,cmax); // Keep original alpha value
|
||||
|
||||
}
|
||||
|
||||
vec3 hsv2rgb(vec3 hsv) { //Converts HSV values to RGB
|
||||
float h = hsv.r;
|
||||
float s = hsv.g;
|
||||
float v = hsv.b;
|
||||
float c = v * s;
|
||||
//X = C × (1 - |(H / 60°) mod 2 - 1|)
|
||||
float x = h / 60.f;
|
||||
x = mod(x,2.f);
|
||||
x = abs(x - 1.f);
|
||||
x = c * (1.f - x);
|
||||
|
||||
float m = v - c;
|
||||
|
||||
vec3 rgb = vec3(0.f,0.f,0.f);
|
||||
|
||||
if (h < 60.f) {
|
||||
rgb = vec3(c,x,0.f);
|
||||
} else if (h < 120.f){
|
||||
rgb = vec3(x,c,0.f);
|
||||
} else if (h < 180.f){
|
||||
rgb = vec3(0.f,c,x);
|
||||
} else if (h < 240.f){
|
||||
rgb = vec3(0.f,x,c);
|
||||
} else if (h < 300.f){
|
||||
rgb = vec3(x,0.f,c);
|
||||
} else if (h < 360.f){
|
||||
rgb = vec3(c,0.f,x);
|
||||
}
|
||||
rgb[0] = rgb[0] + m;
|
||||
rgb[1] = rgb[1] + m;
|
||||
rgb[2] = rgb[2] + m;
|
||||
|
||||
return rgb;
|
||||
vec2 wave(vec2 uv, float time) {
|
||||
return vec2(
|
||||
uv.x + sin(uv.y * wave_frequency + time) * wave_amplitude,
|
||||
uv.y + sin(uv.x * wave_frequency + time) * wave_amplitude
|
||||
);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
ivec2 uv;
|
||||
vec3 color;
|
||||
vec2 center_position = -1.0 + 2.0 * UV / (1.0 / TEXTURE_PIXEL_SIZE);
|
||||
float center_distance = length(center_position);
|
||||
|
||||
if(scale_resolution){
|
||||
uv = ivec2(FRAGCOORD.xy / float(target_resolution_scale));
|
||||
color = texelFetch(TEXTURE, uv * target_resolution_scale, 0).rgb;
|
||||
} else {
|
||||
uv = ivec2(FRAGCOORD.xy);
|
||||
color = texelFetch(TEXTURE, uv, 0).rgb;
|
||||
}
|
||||
float ripple = sin(center_distance * -frequency * PI + ripple_rate * TIME) * amplitude / (center_distance + 1.0);
|
||||
|
||||
if(enable_recolor){
|
||||
vec3 hsv = rgb2hsv(color);
|
||||
float color_pos = (hsv.x / 360.0);
|
||||
vec3 new_color = texture(to_gradient, vec2((color_pos), 0.5)).rgb;
|
||||
vec3 new_hsv = rgb2hsv(new_color);
|
||||
hsv.x = new_hsv.x;
|
||||
vec3 final_rgb = hsv2rgb(hsv);
|
||||
vec2 uv = FRAGCOORD.xy / (1.0 / SCREEN_PIXEL_SIZE).xy + (center_position/center_distance) * ripple * wave_amplitude;
|
||||
vec2 background_wave = wave(uv, TIME);
|
||||
vec4 background_texture = texture(SCREEN_TEXTURE,background_wave) * sqrt(amplitude);
|
||||
|
||||
color.rgb = final_rgb;
|
||||
}
|
||||
float alpha_scalar = (1.0 - min(center_distance, 1.0)) * background_texture.x * 2.5;
|
||||
|
||||
background_texture.a *= 1.0 * alpha_scalar * (ripple + background_texture.x * background_texture.y);
|
||||
background_texture.a = max(background_texture.a - (background_texture.y * 0.45), 0.0);
|
||||
|
||||
// Convert from [0.0, 1.0] range to [0, 255] range
|
||||
ivec3 c = ivec3(round(color * 255.0));
|
||||
COLOR = vec4(background_texture.xyz, background_texture.a);
|
||||
|
||||
// Apply the dithering pattern
|
||||
if (dithering) {
|
||||
c += ivec3(dithering_pattern(uv));
|
||||
}
|
||||
|
||||
vec3 final_color;
|
||||
if(change_color_depth){
|
||||
// Truncate from 8 bits to color_depth bits
|
||||
c >>= (8 - target_color_depth);
|
||||
final_color = vec3(c) / float(1 << target_color_depth);
|
||||
} else {
|
||||
final_color = vec3(c) / float(1 << 8);
|
||||
}
|
||||
|
||||
// Convert back to [0.0, 1.0] range
|
||||
COLOR.rgb = final_color;
|
||||
}
|
||||
@@ -1,20 +1,36 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cagfc5ridmteu"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cagfc5ridmteu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1f8blk5ucqvq" path="res://src/app/App.cs" id="1_rt73h"]
|
||||
[ext_resource type="PackedScene" uid="uid://rfvnddfqufho" path="res://src/menu/MainMenu.tscn" id="2_1uiag"]
|
||||
[ext_resource type="PackedScene" uid="uid://drkl3btdy6uxj" path="res://src/options/OptionsMenu.tscn" id="2_v0mgf"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpjlj7kxdhv16" path="res://src/menu/LoadingScreen.tscn" id="3_3st5l"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm6fo70yb2hip" path="res://src/ui/gallery/GalleryMenu.tscn" id="5_iuu71"]
|
||||
|
||||
[node name="App" type="Node"]
|
||||
process_mode = 3
|
||||
script = ExtResource("1_rt73h")
|
||||
|
||||
[node name="LoadingScreen" parent="." instance=ExtResource("3_3st5l")]
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="MainMenu" parent="." instance=ExtResource("2_1uiag")]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="OptionsMenu" parent="." instance=ExtResource("2_v0mgf")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
|
||||
[node name="MainMenu" parent="." instance=ExtResource("2_1uiag")]
|
||||
[node name="GalleryMenu" parent="." instance=ExtResource("5_iuu71")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
|
||||
[node name="LoadingScreen" parent="." instance=ExtResource("3_3st5l")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
top_level = true
|
||||
z_index = 999
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://ddii3pi8x75xc"
|
||||
path="res://.godot/imported/amb_beach.wav-046e4f838e50e43a1aba1a754b92aad6.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/audio/AMB/amb_beach.wav"
|
||||
dest_files=["res://.godot/imported/amb_beach.wav-046e4f838e50e43a1aba1a754b92aad6.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=3
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://ym4ur8a2qxhp"
|
||||
path="res://.godot/imported/amb_perlin.wav-ba6da0d5591f392e4aca7d2f85c4dfc2.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/audio/AMB/amb_perlin.wav"
|
||||
dest_files=["res://.godot/imported/amb_perlin.wav-ba6da0d5591f392e4aca7d2f85c4dfc2.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=3
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://b7wxddjx3qw5o"
|
||||
path="res://.godot/imported/amb_white_noise.wav-d316dd05afe429f6bcdda594285ad718.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/audio/AMB/amb_white_noise.wav"
|
||||
dest_files=["res://.godot/imported/amb_white_noise.wav-d316dd05afe429f6bcdda594285ad718.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=3
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://bmiitw4fcs68e"
|
||||
path="res://.godot/imported/amb_wind_loop_altar.wav-e766e3db29faa01ad6dbaa8cb18d7de6.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/audio/AMB/amb_wind_loop_altar.wav"
|
||||
dest_files=["res://.godot/imported/amb_wind_loop_altar.wav-e766e3db29faa01ad6dbaa8cb18d7de6.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=3
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
||||
@@ -0,0 +1,6 @@
|
||||
using Zennysoft.Game.Implementation;
|
||||
|
||||
public partial class AmbientSFXPlayer : DimmableAudioStreamPlayer
|
||||
{
|
||||
public override void _EnterTree() => FadeIn();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cstc8tdapyrst
|
||||
@@ -0,0 +1,6 @@
|
||||
using Zennysoft.Game.Implementation;
|
||||
|
||||
public partial class AmbientSFXPlayer3D : DimmableAudioStreamPlayer3D
|
||||
{
|
||||
public override void _EnterTree() => FadeIn();
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://b83kye8yinfxs
|
||||
@@ -1,43 +1,21 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public partial class AudioManager : Node
|
||||
{
|
||||
private static string sfxPath = $"res://src/audio/sfx/";
|
||||
private AudioStreamPlayer _audioPlayer;
|
||||
private IDictionary<SoundEffect, AudioStream> _sfxDictionary;
|
||||
private static AudioStreamPlayer _audioPlayer;
|
||||
private static AudioManager _instance;
|
||||
|
||||
public static AudioManager Instance => _instance;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_audioPlayer = new AudioStreamPlayer();
|
||||
AddChild(_audioPlayer);
|
||||
_sfxDictionary = new Dictionary<SoundEffect, AudioStream>();
|
||||
var soundEffects = Enum.GetValues(typeof(SoundEffect));
|
||||
foreach (var effect in soundEffects)
|
||||
_sfxDictionary.Add((SoundEffect)effect, GD.Load<AudioStream>(sfxPath + effect + ".ogg"));
|
||||
if (_instance != null)
|
||||
QueueFree();
|
||||
_instance = this;
|
||||
_audioPlayer = new AudioStreamPlayer();
|
||||
AddChild(_audioPlayer);
|
||||
_audioPlayer.Bus = "SFX";
|
||||
}
|
||||
|
||||
public void Play(SoundEffect soundEffect)
|
||||
{
|
||||
_sfxDictionary.TryGetValue(soundEffect, out var stream);
|
||||
_audioPlayer.Stream = stream;
|
||||
_audioPlayer.Play();
|
||||
}
|
||||
}
|
||||
public enum SoundEffect
|
||||
{
|
||||
Cancel,
|
||||
Equip,
|
||||
Heal,
|
||||
MenuBack,
|
||||
MoveThroughOptions,
|
||||
PlayerAttack,
|
||||
PlayerHitWall,
|
||||
Select,
|
||||
Sort,
|
||||
Unequip
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
[gd_scene load_steps=26 format=3 uid="uid://brgi35xj3b4ud"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cw100tox0ufsy" path="res://src/audio/SfxDatabase.cs" id="1_ojkqd"]
|
||||
[ext_resource type="AudioStream" uid="uid://cye8wlqbx66h4" path="res://src/audio/sfx/player_heal.ogg" id="2_158j8"]
|
||||
[ext_resource type="AudioStream" uid="uid://1nuk6xpkwujl" path="res://src/audio/sfx/player_gain_VT.ogg" id="3_kac56"]
|
||||
[ext_resource type="AudioStream" uid="uid://bfrp34y2m8b1l" path="res://src/audio/sfx/item_number_increase.ogg" id="4_fa8i8"]
|
||||
[ext_resource type="AudioStream" uid="uid://xjdv23q5cqhm" path="res://src/audio/sfx/UI_PAUSE.ogg" id="5_p5cio"]
|
||||
[ext_resource type="AudioStream" uid="uid://clhdcrs4dxt6h" path="res://src/audio/sfx/UI_MOVE.ogg" id="6_r16t0"]
|
||||
[ext_resource type="AudioStream" uid="uid://c817txm4tmup7" path="res://src/audio/sfx/PLAYER_EQUIP.ogg" id="7_sew62"]
|
||||
[ext_resource type="AudioStream" uid="uid://qxi7qto7hhgk" path="res://src/audio/sfx/PLAYER_UNEQUIP.ogg" id="8_rf1la"]
|
||||
[ext_resource type="AudioStream" uid="uid://doeefxilh0luj" path="res://src/audio/sfx/ITEM_SORT.ogg" id="9_l6w22"]
|
||||
[ext_resource type="AudioStream" uid="uid://4mk4hlse81if" path="res://src/audio/sfx/player_losehealth.ogg" id="10_kac56"]
|
||||
[ext_resource type="AudioStream" uid="uid://dwp3ep3jddvrr" path="res://src/audio/sfx/UI_SELECT.ogg" id="10_nerso"]
|
||||
[ext_resource type="AudioStream" uid="uid://ilf2s8ct2stt" path="res://src/audio/sfx/PLAYER_slower_slash.ogg" id="10_vyvit"]
|
||||
[ext_resource type="AudioStream" uid="uid://oslvh60ec5gc" path="res://src/audio/sfx/UI_CANCEL_BACK.ogg" id="11_rloay"]
|
||||
[ext_resource type="AudioStream" uid="uid://bo2u1ceci6k1i" path="res://src/audio/sfx/PLAYER_quicker_slash.ogg" id="13_fa8i8"]
|
||||
[ext_resource type="AudioStream" uid="uid://na0lxb1lib11" path="res://src/audio/sfx/player_crit.ogg" id="14_p5cio"]
|
||||
[ext_resource type="AudioStream" uid="uid://bsc83jkt7uisg" path="res://src/audio/sfx/PLAYER_GET_ITEM.ogg" id="15_r16t0"]
|
||||
[ext_resource type="AudioStream" uid="uid://ckf3md1ujxhvm" path="res://src/audio/sfx/player_levelup.ogg" id="16_sew62"]
|
||||
[ext_resource type="AudioStream" uid="uid://coeynqnn61c43" path="res://src/audio/sfx/ITEM_TRANSFER.ogg" id="18_l6w22"]
|
||||
[ext_resource type="AudioStream" uid="uid://bfrmm07vthpwt" path="res://src/audio/sfx/item_divine_recall.ogg" id="19_nerso"]
|
||||
[ext_resource type="AudioStream" uid="uid://bu8akh5uh3ioo" path="res://src/audio/sfx/item_devic_balance_element1.ogg" id="20_rloay"]
|
||||
[ext_resource type="AudioStream" uid="uid://bjkn6s2xjxuji" path="res://src/audio/sfx/item_gospel_dimension.ogg" id="21_6hsck"]
|
||||
[ext_resource type="AudioStream" uid="uid://c3ur4bgvmsidi" path="res://src/audio/sfx/item_gospel_escape.ogg" id="22_3wq6u"]
|
||||
[ext_resource type="AudioStream" uid="uid://bc2pe0l5nr5ro" path="res://src/audio/sfx/ITEM_kyuu_hit.ogg" id="23_aaerj"]
|
||||
[ext_resource type="AudioStream" uid="uid://ck0nc757t0jq5" path="res://src/audio/sfx/ITEM_PERSPECTIVE.ogg" id="23_jdwj3"]
|
||||
[ext_resource type="AudioStream" uid="uid://dblijlgm8njjv" path="res://src/audio/sfx/item_sine_morphization.ogg" id="24_jdwj3"]
|
||||
|
||||
[node name="SfxDatabase" type="Node"]
|
||||
script = ExtResource("1_ojkqd")
|
||||
|
||||
[node name="UI" type="Node" parent="."]
|
||||
|
||||
[node name="OpenInventorySound" type="AudioStreamPlayer" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("5_p5cio")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="MoveSound" type="AudioStreamPlayer" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("6_r16t0")
|
||||
max_polyphony = 5
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="SelectSound" type="AudioStreamPlayer" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("10_nerso")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="CancelSound" type="AudioStreamPlayer" parent="UI"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("11_rloay")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="Player" type="Node" parent="."]
|
||||
|
||||
[node name="HealHPSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("2_158j8")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="TakeDamageSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("10_kac56")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="HealVTSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("3_kac56")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="WeaponQuickSlashSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("13_fa8i8")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="WeaponSlowSlashSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("10_vyvit")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="CritSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("14_p5cio")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="PickupItemSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("15_r16t0")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="LevelUpSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("16_sew62")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="EquipSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("7_sew62")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="UnequipSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("8_rf1la")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="Item" type="Node" parent="."]
|
||||
|
||||
[node name="TransferItemSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("18_l6w22")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="IncreaseStatSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("4_fa8i8")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="SortSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("9_l6w22")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="RecallEnemiesSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("19_nerso")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="KillHalfEnemiesSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("20_rloay")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="TeleportToRandomRoomSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("21_6hsck")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="TeleportToExitSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("22_3wq6u")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="AbsorbHPFromAllEnemiesSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("23_aaerj")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="SwapHPAndVTSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("23_jdwj3")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="TurnAllEnemiesIntoHealingItemsSound" type="AudioStreamPlayer" parent="Item"]
|
||||
unique_name_in_owner = true
|
||||
stream = ExtResource("24_jdwj3")
|
||||
bus = &"SFX"
|
||||
@@ -0,0 +1,111 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
|
||||
[Meta(typeof(IAutoNode)), Id("sfx_database")]
|
||||
public partial class SfxDatabase : Node
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
private static SfxDatabase _instance;
|
||||
|
||||
public static SfxDatabase Instance => _instance;
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
if (_instance != null)
|
||||
QueueFree();
|
||||
_instance = this;
|
||||
|
||||
_sfxMap = new Dictionary<SoundEffect, AudioStreamPlayer>
|
||||
{
|
||||
{SoundEffect.HealHP, HealHPSound },
|
||||
{SoundEffect.TakeDamage, TakeDamageSound },
|
||||
{SoundEffect.HealVT, HealVTSound },
|
||||
{SoundEffect.IncreaseStat, IncreaseStatSound },
|
||||
{SoundEffect.Crit, CritSound },
|
||||
{SoundEffect.PickupItem, PickupItemSound },
|
||||
{SoundEffect.OpenInventory, OpenInventorySound },
|
||||
{SoundEffect.MoveUI, MoveSound },
|
||||
{SoundEffect.Equip, EquipSound },
|
||||
{SoundEffect.Unequip, UnequipSound },
|
||||
{SoundEffect.SortInventory, SortSound },
|
||||
{SoundEffect.SelectUI, SelectSound },
|
||||
{SoundEffect.CancelUI, CancelSound },
|
||||
{SoundEffect.LevelUp, LevelUpSound },
|
||||
{SoundEffect.Transfer, TransferItemSound },
|
||||
{SoundEffect.RecallEnemies, RecallEnemiesSound},
|
||||
{SoundEffect.KillHalfEnemies, KillHalfEnemiesSound},
|
||||
{SoundEffect.TeleportToRandomRoom, TeleportToRandomRoomSound},
|
||||
{SoundEffect.TeleportToExit, TeleportToExitSound},
|
||||
{SoundEffect.AbsorbHPFromAllEnemies, AbsorbHPFromAllEnemiesSound},
|
||||
{SoundEffect.TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItemsSound},
|
||||
{SoundEffect.WeaponQuickSlash, WeaponQuickSlashSound },
|
||||
{SoundEffect.WeaponSlowSlash, WeaponSlowSlashSound },
|
||||
};
|
||||
}
|
||||
|
||||
[Node] private AudioStreamPlayer HealHPSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer TakeDamageSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer HealVTSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer IncreaseStatSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer WeaponQuickSlashSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer WeaponSlowSlashSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer CritSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer PickupItemSound { get; set; } = default!;
|
||||
[Node] private AudioStreamPlayer OpenInventorySound { get; set; }
|
||||
[Node] private AudioStreamPlayer MoveSound { get; set; }
|
||||
[Node] private AudioStreamPlayer EquipSound { get; set; }
|
||||
[Node] private AudioStreamPlayer UnequipSound { get; set; }
|
||||
[Node] private AudioStreamPlayer SortSound { get; set; }
|
||||
[Node] private AudioStreamPlayer SelectSound { get; set; }
|
||||
[Node] private AudioStreamPlayer CancelSound { get; set; }
|
||||
[Node] private AudioStreamPlayer LevelUpSound { get; set; }
|
||||
[Node] private AudioStreamPlayer TransferItemSound { get; set; }
|
||||
[Node] private AudioStreamPlayer RecallEnemiesSound { get; set; }
|
||||
[Node] private AudioStreamPlayer KillHalfEnemiesSound { get; set; }
|
||||
[Node] private AudioStreamPlayer TeleportToRandomRoomSound { get; set; }
|
||||
[Node] private AudioStreamPlayer TeleportToExitSound { get; set; }
|
||||
[Node] private AudioStreamPlayer AbsorbHPFromAllEnemiesSound { get; set; }
|
||||
[Node] private AudioStreamPlayer SwapHPAndVTSound { get; set; }
|
||||
[Node] private AudioStreamPlayer TurnAllEnemiesIntoHealingItemsSound { get; set; }
|
||||
|
||||
private Dictionary<SoundEffect, AudioStreamPlayer> _sfxMap;
|
||||
|
||||
public void Play(SoundEffect soundEffect)
|
||||
{
|
||||
_sfxMap.TryGetValue(soundEffect, out var audio);
|
||||
if (audio != null)
|
||||
audio.Play();
|
||||
}
|
||||
}
|
||||
|
||||
public enum SoundEffect
|
||||
{
|
||||
HealHP,
|
||||
TakeDamage,
|
||||
HealVT,
|
||||
IncreaseStat,
|
||||
Crit,
|
||||
PickupItem,
|
||||
OpenInventory,
|
||||
MoveUI,
|
||||
Equip,
|
||||
Unequip,
|
||||
SortInventory,
|
||||
SelectUI,
|
||||
CancelUI,
|
||||
LevelUp,
|
||||
Transfer,
|
||||
RecallEnemies,
|
||||
KillHalfEnemies,
|
||||
TeleportToRandomRoom,
|
||||
TeleportToExit,
|
||||
AbsorbHPFromAllEnemies,
|
||||
SwapHPAndVT,
|
||||
TurnAllEnemiesIntoHealingItems,
|
||||
WeaponQuickSlash,
|
||||
WeaponSlowSlash,
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://cw100tox0ufsy
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://dci08kmwsu6k1"
|
||||
path="res://.godot/imported/Cancel.ogg-90240069a266fcef76dd638dfd79efd5.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/audio/sfx/Cancel.ogg"
|
||||
dest_files=["res://.godot/imported/Cancel.ogg-90240069a266fcef76dd638dfd79efd5.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
@@ -12,8 +12,8 @@ dest_files=["res://.godot/imported/ENEMY_AGNI_AMBIENT_LOOP.ogg-c85d2b023556dd456
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
loop=true
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
|
||||
@@ -12,8 +12,8 @@ dest_files=["res://.godot/imported/ENEMY_AQUEOS_LOOP.ogg-8237cb508a4b08073b02775
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
loop=true
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
|
||||
@@ -12,8 +12,8 @@ dest_files=["res://.godot/imported/ENEMY_PILLAR_TURN.ogg-b699bc5922c503a73a9d924
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
loop=true
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
|
||||
@@ -12,8 +12,8 @@ dest_files=["res://.godot/imported/ENEMY_golden_sproing_loop.ogg-127cd3900505921
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
loop=true
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
|
||||
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="oggvorbisstr"
|
||||
type="AudioStreamOggVorbis"
|
||||
uid="uid://nebh8kbv638p"
|
||||
path="res://.godot/imported/Equip.ogg-217f5d9ca98d54921c4ec31e13fb9ba4.oggvorbisstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://src/audio/sfx/Equip.ogg"
|
||||
dest_files=["res://.godot/imported/Equip.ogg-217f5d9ca98d54921c4ec31e13fb9ba4.oggvorbisstr"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user