Fix export

This commit is contained in:
2025-03-31 01:18:36 -07:00
parent ffc3177244
commit 20dad3069a
15 changed files with 212 additions and 189 deletions

66
Ma.sln
View File

@@ -1,66 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ma", "Zennysoft.Game.Ma\Ma.csproj", "{B685AA99-B971-46A7-A708-00546BA0EF55}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zennysoft.Ma.Adapter", "Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj", "{3C934960-1375-4971-BF3F-C21F5241573A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E4C0167B-02AB-49E0-B36D-30D0A2479C25}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zennysoft.Game.Abstractions", "Zennysoft.Game.Abstractions\Zennysoft.Game.Abstractions.csproj", "{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zennysoft.Game.Implementation", "Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj", "{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B685AA99-B971-46A7-A708-00546BA0EF55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.Release|Any CPU.ActiveCfg = ExportRelease|Any CPU
{B685AA99-B971-46A7-A708-00546BA0EF55}.Release|Any CPU.Build.0 = ExportRelease|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C934960-1375-4971-BF3F-C21F5241573A}.Release|Any CPU.Build.0 = Release|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB9A8B79-82E1-4254-B4FB-7F4BCB57BDBF}.Release|Any CPU.Build.0 = Release|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F93CA4C0-DFA0-4AE2-AFB4-8238390F11F0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EFF5E6D7-4263-4677-8014-337284356F7A}
EndGlobalSection
EndGlobal

View File

@@ -5,5 +5,4 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -14,6 +14,7 @@
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" /> <PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Zennysoft.Game.Abstractions\Zennysoft.Game.Abstractions.csproj" /> <ProjectReference Include="..\Zennysoft.Game.Abstractions\Zennysoft.Game.Abstractions.csproj" />
</ItemGroup> </ItemGroup>

View File

@@ -1,8 +0,0 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Style", "IDE0130:Namespace does not match folder structure", Justification = "<Pending>", Scope = "namespace", Target = "~N:Zennysoft.Game.Ma.Implementation")]

View File

@@ -2,18 +2,8 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading> <EnableDynamicLoading>true</EnableDynamicLoading>
<!-- Use NativeAOT. --> <WarningsAsErrors>CS9057</WarningsAsErrors>
<PublishAot>true</PublishAot>
</PropertyGroup> </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> <ItemGroup>
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" /> <PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" /> <PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
@@ -29,11 +19,6 @@
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" /> <PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
<PackageReference Include="Zeroconf" Version="3.7.16" /> <PackageReference Include="Zeroconf" Version="3.7.16" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="src\enemy\enemy_types\14. horse_head\" />
<Folder Include="src\enemy\enemy_types\15. ox_face\" />
<Folder Include="src\ui\dialogue\" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include=".editorconfig" /> <None Include=".editorconfig" />
</ItemGroup> </ItemGroup>

61
Zennysoft.Game.Ma/Ma.sln Normal file
View File

@@ -0,0 +1,61 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ma", "Ma.csproj", "{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zennysoft.Game.Abstractions", "..\Zennysoft.Game.Abstractions\Zennysoft.Game.Abstractions.csproj", "{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zennysoft.Game.Implementation", "..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj", "{F6808C1C-EDFB-4602-BA01-34FB682A270C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Zennysoft.Ma.Adapter", "..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj", "{CC55EDC3-B9EA-4393-BE4D-630C34393A94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.Release|Any CPU.ActiveCfg = ExportRelease|Any CPU
{94D57D73-EDC5-47B2-BF34-7B57BA9C3881}.Release|Any CPU.Build.0 = ExportRelease|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D65D2AE9-D371-49F8-9E1D-BBA2907AB4AA}.Release|Any CPU.Build.0 = Release|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6808C1C-EDFB-4602-BA01-34FB682A270C}.Release|Any CPU.Build.0 = Release|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.ExportDebug|Any CPU.ActiveCfg = Debug|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.ExportDebug|Any CPU.Build.0 = Debug|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.ExportRelease|Any CPU.ActiveCfg = Release|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.ExportRelease|Any CPU.Build.0 = Release|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC55EDC3-B9EA-4393-BE4D-630C34393A94}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {797FF6A1-5959-42C9-A7A2-A8D39F9AC1A4}
EndGlobalSection
EndGlobal

View File

@@ -26,16 +26,16 @@ DialogueController="*res://src/game/DialogueController.cs"
editor/wrap_long_lines=true editor/wrap_long_lines=true
runtime/balloon_path="res://src/ui/dialogue/Balloon.tscn" runtime/balloon_path="res://src/ui/dialogue/Balloon.tscn"
runtime/advanced/uses_dotnet=true
[display] [display]
window/size/viewport_width=1920 window/size/viewport_width=1024
window/size/viewport_height=1080 window/size/viewport_height=768
[dotnet] [dotnet]
project/assembly_name="Ma" project/assembly_name="Ma"
project/solution_directory="Ma"
[editor_plugins] [editor_plugins]

View File

@@ -40,9 +40,9 @@ public partial class App : CanvasLayer, IApp
{ {
var container = new SimpleInjector.Container(); var container = new SimpleInjector.Container();
container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); container.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle();
container.Register<IAppRepo, AppRepo>(Lifestyle.Singleton); container.RegisterSingleton<IAppRepo, AppRepo>();
container.Register<IAppLogic, AppLogic>(Lifestyle.Singleton); container.RegisterSingleton<IAppLogic, AppLogic>();
container.Verify(); //container.Verify();
Instantiator = new Instantiator(GetTree()); Instantiator = new Instantiator(GetTree());

View File

@@ -78,7 +78,7 @@ public partial class Game : Node3D, IGame
{ {
_container = new SimpleInjector.Container(); _container = new SimpleInjector.Container();
Module.Bootstrap(_container); Module.Bootstrap(_container);
_container.Verify(); //_container.Verify();
GameRepo = _container.GetInstance<IGameRepo>(); GameRepo = _container.GetInstance<IGameRepo>();
GameLogic = _container.GetInstance<IGameLogic>(); GameLogic = _container.GetInstance<IGameLogic>();

View File

@@ -173,7 +173,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
if (ItemSlots.Length == 0 || UseButton.HasFocus() || DropButton.HasFocus() || ThrowButton.HasFocus()) if (ItemSlots.Length == 0 || UseButton.HasFocus() || DropButton.HasFocus() || ThrowButton.HasFocus())
return; return;
if (@event.IsActionPressed(GameInputs.UiRight) && _currentPageNumber == InventoryPageNumber.FirstPage && inventory.Items.Count() > _itemsPerPage) if (@event.IsActionPressed(GameInputs.UiRight) && _currentPageNumber == InventoryPageNumber.FirstPage && inventory.Items.Count > _itemsPerPage)
ChangeInventoryPage(InventoryPageNumber.SecondPage); ChangeInventoryPage(InventoryPageNumber.SecondPage);
if (@event.IsActionPressed(GameInputs.UiLeft) && _currentPageNumber == InventoryPageNumber.SecondPage) if (@event.IsActionPressed(GameInputs.UiLeft) && _currentPageNumber == InventoryPageNumber.SecondPage)
@@ -250,7 +250,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
{ {
FloorLabel.Text = $"Floor {_map.CurrentFloorNumber:D2}"; FloorLabel.Text = $"Floor {_map.CurrentFloorNumber:D2}";
if (ItemSlots.Any()) if (ItemSlots.Length != 0)
{ {
var item = ItemSlots.ElementAt(_currentIndex).Item; var item = ItemSlots.ElementAt(_currentIndex).Item;
ItemDescriptionTitle.Text = $"{item.ItemName}"; ItemDescriptionTitle.Text = $"{item.ItemName}";
@@ -272,9 +272,9 @@ public partial class InventoryMenu : Control, IInventoryMenu
if (currentItem is EquipableItem equipable) if (currentItem is EquipableItem equipable)
{ {
UseButton.Text = equipable.IsEquipped ? "Unequip" : "Equip"; UseButton.Text = equipable.IsEquipped ? "Unequip" : "Equip";
ThrowButton.Disabled = equipable.IsEquipped ? true : false; ThrowButton.Disabled = equipable.IsEquipped;
ThrowButton.FocusMode = equipable.IsEquipped ? FocusModeEnum.None : FocusModeEnum.All; ThrowButton.FocusMode = equipable.IsEquipped ? FocusModeEnum.None : FocusModeEnum.All;
DropButton.Disabled = equipable.IsEquipped ? true : false; DropButton.Disabled = equipable.IsEquipped;
DropButton.FocusMode = equipable.IsEquipped ? FocusModeEnum.None : FocusModeEnum.All; DropButton.FocusMode = equipable.IsEquipped ? FocusModeEnum.None : FocusModeEnum.All;
} }
else else
@@ -345,7 +345,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
itemSlot.SetEquippedItemStyle(); itemSlot.SetEquippedItemStyle();
} }
if (ItemSlots.Any()) if (ItemSlots.Length != 0)
{ {
ItemSlots.ElementAt(_currentIndex).SetSelectedItemStyle(); ItemSlots.ElementAt(_currentIndex).SetSelectedItemStyle();
if (ItemSlots.ElementAt(_currentIndex).Item is EquipableItem equipable && equipable.IsEquipped) if (ItemSlots.ElementAt(_currentIndex).Item is EquipableItem equipable && equipable.IsEquipped)

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=50 format=3 uid="uid://jds3hr41coal"] [gd_scene load_steps=50 format=3 uid="uid://jds3hr41coal"]
[ext_resource type="Script" uid="uid://dcqssoikr3pl7" path="res://src/npc/Npc.cs" id="1_f3624"] [ext_resource type="Script" uid="uid://dcqssoikr3pl7" path="res://src/npc/Npc.cs" id="1_f3624"]
[ext_resource type="Resource" uid="uid://b681mabgdkg6j" path="res://src/npc/Ran/ran.dialogue" id="2_3udpp"] [ext_resource type="Resource" uid="uid://lao0opxww3ib" path="res://src/dialog/Dialogue.dialogue" id="2_3udpp"]
[ext_resource type="Texture2D" uid="uid://ct2523slwx30o" path="res://src/npc/Ran/animations/Layer 1.png" id="4_bww12"] [ext_resource type="Texture2D" uid="uid://ct2523slwx30o" path="res://src/npc/Ran/animations/Layer 1.png" id="4_bww12"]
[ext_resource type="Texture2D" uid="uid://b72fnsmgg1mff" path="res://src/npc/Ran/animations/Layer 2.png" id="5_jl1c6"] [ext_resource type="Texture2D" uid="uid://b72fnsmgg1mff" path="res://src/npc/Ran/animations/Layer 2.png" id="5_jl1c6"]
[ext_resource type="Texture2D" uid="uid://c01a6i2hmq7nb" path="res://src/npc/Ran/animations/Layer 3.png" id="6_yx0nu"] [ext_resource type="Texture2D" uid="uid://c01a6i2hmq7nb" path="res://src/npc/Ran/animations/Layer 3.png" id="6_yx0nu"]

View File

@@ -95,7 +95,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
private Dictionary<int, int> _expToNextLevel; private Dictionary<int, int> _expToNextLevel;
private IDamageCalculator _damageCalculator; private DamageCalculator _damageCalculator;
#region Initialization #region Initialization
public void Initialize() public void Initialize()
@@ -118,7 +118,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
{ {
var container = new SimpleInjector.Container(); var container = new SimpleInjector.Container();
container.Register<IPlayerLogic, PlayerLogic>(Lifestyle.Singleton); container.Register<IPlayerLogic, PlayerLogic>(Lifestyle.Singleton);
container.Verify(); //container.Verify();
Settings = new PlayerLogic.Settings() { RotationSpeed = PlayerStatResource.RotationSpeed, MoveSpeed = PlayerStatResource.MoveSpeed, Acceleration = PlayerStatResource.Acceleration }; Settings = new PlayerLogic.Settings() { RotationSpeed = PlayerStatResource.RotationSpeed, MoveSpeed = PlayerStatResource.MoveSpeed, Acceleration = PlayerStatResource.Acceleration };
Stats = new PlayerStatController(); Stats = new PlayerStatController();
@@ -218,10 +218,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
} }
else else
{ {
var attackSpeed = ((Weapon)EquippedWeapon.Value).AttackSpeed; PlayAttackAnimation();
AnimationPlayer.SetSpeedScale((float)attackSpeed);
AnimationPlayer.Play("attack");
_gameRepo.OnPlayerAttack();
} }
}) })
.Handle((in PlayerLogic.Output.ThrowItem output) => .Handle((in PlayerLogic.Output.ThrowItem output) =>
@@ -321,7 +318,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
transform.Basis = new Basis(Vector3.Up, Settings.RotationSpeed * -rawInput.X * delta) * transform.Basis; transform.Basis = new Basis(Vector3.Up, Settings.RotationSpeed * -rawInput.X * delta) * transform.Basis;
var moveDirection = new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z).Normalized(); var moveDirection = new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z).Normalized();
var velocity = Basis * moveDirection * Settings.MoveSpeed * Settings.Acceleration; var velocity = Basis * moveDirection * Settings.MoveSpeed * Settings.Acceleration;
_knockbackStrength = _knockbackStrength * 0.9f; _knockbackStrength *= 0.9f;
Transform = Transform with { Basis = transform.Basis }; Transform = Transform with { Basis = transform.Basis };
Velocity = velocity + (_knockbackDirection * _knockbackStrength); Velocity = velocity + (_knockbackDirection * _knockbackStrength);
MoveAndSlide(); MoveAndSlide();
@@ -481,6 +478,17 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
throwItem.GlobalRotation = GlobalRotation; throwItem.GlobalRotation = GlobalRotation;
} }
private void PlayAttackAnimation()
{
var attackSpeed = ((Weapon)EquippedWeapon.Value).AttackSpeed;
AnimationPlayer.SetSpeedScale((float)attackSpeed);
if (EquippedWeapon.Value.ItemName == "Atonement")
AnimationPlayer.Play("atonement_attack");
else
AnimationPlayer.Play("attack");
_gameRepo.OnPlayerAttack();
}
private void OnAnimationFinished(StringName animation) private void OnAnimationFinished(StringName animation)
{ {
PlayerLogic.Input(new PlayerLogic.Input.AttackAnimationFinished()); PlayerLogic.Input(new PlayerLogic.Input.AttackAnimationFinished());

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=61 format=4 uid="uid://cfecvvav8kkp6"] [gd_scene load_steps=62 format=4 uid="uid://cfecvvav8kkp6"]
[ext_resource type="Script" uid="uid://yxmiqy7i0t7r" path="res://src/player/Player.cs" id="1_xcol5"] [ext_resource type="Script" uid="uid://yxmiqy7i0t7r" path="res://src/player/Player.cs" id="1_xcol5"]
[ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="2_lb3qc"] [ext_resource type="Script" uid="uid://6edayafleq8y" path="res://src/hitbox/Hitbox.cs" id="2_lb3qc"]
@@ -109,9 +109,14 @@ tracks/0/keys = {
"values": [10, 1, 11] "values": [10, 1, 11]
} }
[sub_resource type="Animation" id="Animation_g183x"]
resource_name = "atonement_attack"
step = 0.0833333
[sub_resource type="AnimationLibrary" id="AnimationLibrary_w8l8m"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_w8l8m"]
_data = { _data = {
&"RESET": SubResource("Animation_hcjph"), &"RESET": SubResource("Animation_hcjph"),
&"atonement_attack": SubResource("Animation_g183x"),
&"attack": SubResource("Animation_0jjwv"), &"attack": SubResource("Animation_0jjwv"),
&"hit_wall": SubResource("Animation_es4xk") &"hit_wall": SubResource("Animation_es4xk")
} }
@@ -539,7 +544,7 @@ flip_v = true
[node name="Camera" type="Node3D" parent="."] [node name="Camera" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="Camera"] [node name="Camera3D" type="Camera3D" parent="Camera"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.003, 1.52615, 0.482136) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.003, 1.62599, 0.482136)
cull_mask = 1048569 cull_mask = 1048569
fov = 45.0 fov = 45.0
near = 0.001 near = 0.001

View File

@@ -0,0 +1,37 @@
shader_type spatial;
render_mode unshaded;
// 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;
uniform float blending : hint_range(0.0, 1.0, 0.01) = 1.0;
// 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;
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear_mipmap, repeat_disable;
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() {
vec2 screen_pixel_size = 1.0 / VIEWPORT_SIZE;
vec2 center_position = -1.0 + 2.0 * UV;
float center_distance = length(center_position);
float ripple = sin(center_distance * -frequency * PI + ripple_rate * TIME) * amplitude / (center_distance + 1.0);
vec2 uv = FRAGCOORD.xy * screen_pixel_size + (center_position/center_distance) * ripple * wave_amplitude;
vec2 background_wave = wave(uv, TIME);
vec4 background_texture = texture(SCREEN_TEXTURE, background_wave) * sqrt(amplitude);
ALBEDO = background_texture.rgb;
ALPHA = blending;
}

View File

@@ -0,0 +1 @@
uid://oatmuwfkep0w