Fix dying loop, add death counter, add die button to debug
This commit is contained in:
@@ -8,7 +8,7 @@ public partial class GameState
|
|||||||
public partial record State
|
public partial record State
|
||||||
{
|
{
|
||||||
[Meta, LogicBlock(typeof(State), Diagram = true)]
|
[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)
|
public Transition On(in Input.DebugButtonPressed input)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ namespace Zennysoft.Ma.Adapter;
|
|||||||
[Meta, Id("quest_data")]
|
[Meta, Id("quest_data")]
|
||||||
public partial record QuestData
|
public partial record QuestData
|
||||||
{
|
{
|
||||||
|
[Save("death_count")]
|
||||||
|
public int DeathCount { get; set; } = 0;
|
||||||
|
|
||||||
[Save("quest_data_1")]
|
[Save("quest_data_1")]
|
||||||
public bool QuestMarker1 { get; set; } = false;
|
public bool QuestMarker1 { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Godot.NET.Sdk/4.4.1">
|
<Project Sdk="Godot.NET.Sdk/4.4.0">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -99,6 +99,7 @@ public partial class Game : Node3D, IGame
|
|||||||
},
|
},
|
||||||
QuestData = new QuestData()
|
QuestData = new QuestData()
|
||||||
{
|
{
|
||||||
|
DeathCount = QuestData.DeathCount,
|
||||||
QuestMarker1 = QuestData.QuestMarker1
|
QuestMarker1 = QuestData.QuestMarker1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -145,6 +146,8 @@ public partial class Game : Node3D, IGame
|
|||||||
|
|
||||||
public async void OnResolved()
|
public async void OnResolved()
|
||||||
{
|
{
|
||||||
|
LoadExistingGame();
|
||||||
|
|
||||||
await InitializeGame();
|
await InitializeGame();
|
||||||
|
|
||||||
GameState.Set(GameRepo);
|
GameState.Set(GameRepo);
|
||||||
@@ -256,8 +259,10 @@ public partial class Game : Node3D, IGame
|
|||||||
|
|
||||||
public IDungeonFloor CurrentFloor => _map.CurrentFloor;
|
public IDungeonFloor CurrentFloor => _map.CurrentFloor;
|
||||||
|
|
||||||
public void GameOver()
|
public async void GameOver()
|
||||||
{
|
{
|
||||||
|
QuestData.DeathCount++;
|
||||||
|
await Save();
|
||||||
_player.Deactivate();
|
_player.Deactivate();
|
||||||
GameState.Input(new GameState.Input.GameOver());
|
GameState.Input(new GameState.Input.GameOver());
|
||||||
}
|
}
|
||||||
@@ -363,8 +368,8 @@ public partial class Game : Node3D, IGame
|
|||||||
})
|
})
|
||||||
.Handle((in GameState.Output.GameOver _) =>
|
.Handle((in GameState.Output.GameOver _) =>
|
||||||
{
|
{
|
||||||
//GameRepo.Pause();
|
GameRepo.Pause();
|
||||||
//DeathMenu.FadeIn();
|
GameOverMenu.FadeIn();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://33ek675mfb5n"]
|
[gd_scene load_steps=6 format=3 uid="uid://33ek675mfb5n"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://chftlu4proh3d" path="res://src/game/Game.cs" id="1_ytcii"]
|
[ext_resource type="Script" uid="uid://chftlu4proh3d" path="res://src/game/Game.cs" id="1_ytcii"]
|
||||||
[ext_resource type="PackedScene" uid="uid://b1muxus5qdbeu" path="res://src/ui/in_game_ui/InGameUI.tscn" id="5_lxtnp"]
|
[ext_resource type="PackedScene" uid="uid://b1muxus5qdbeu" path="res://src/ui/in_game_ui/InGameUI.tscn" id="5_lxtnp"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cgwiwufvxvfs4" path="res://src/ui/load_next_level/LoadNextLevel.tscn" id="7_yw8km"]
|
[ext_resource type="PackedScene" uid="uid://cgwiwufvxvfs4" path="res://src/ui/load_next_level/LoadNextLevel.tscn" id="7_yw8km"]
|
||||||
[ext_resource type="Script" uid="uid://cbal5oeaha4nx" path="res://src/ui/pause_menu/PauseMenu.cs" id="11_5ng8c"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dbtfgrtgpr4qg" path="res://src/ui/game_over/GameOverMenu.tscn" id="11_wypid"]
|
[ext_resource type="PackedScene" uid="uid://dbtfgrtgpr4qg" path="res://src/ui/game_over/GameOverMenu.tscn" id="11_wypid"]
|
||||||
[ext_resource type="PackedScene" uid="uid://blbqgw3wosc1w" path="res://src/ui/pause_menu/PauseMenu.tscn" id="12_yev8k"]
|
[ext_resource type="PackedScene" uid="uid://blbqgw3wosc1w" path="res://src/ui/pause_menu/PauseMenu.tscn" id="12_yev8k"]
|
||||||
|
|
||||||
@@ -45,4 +44,3 @@ unique_name_in_owner = true
|
|||||||
[node name="PauseMenu" parent="." instance=ExtResource("12_yev8k")]
|
[node name="PauseMenu" parent="." instance=ExtResource("12_yev8k")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
script = ExtResource("11_5ng8c")
|
|
||||||
|
|||||||
@@ -53,4 +53,6 @@ public partial class RescuedItems : Node3D
|
|||||||
|
|
||||||
Game.RescuedItems.Items.Clear();
|
Game.RescuedItems.Items.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void _ExitTree() => base._ExitTree();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,15 +76,63 @@ libraries = {
|
|||||||
[node name="MapOrder" type="Node" parent="."]
|
[node name="MapOrder" type="Node" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
||||||
|
[node name="Overworld" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("3_v14r0")
|
||||||
|
|
||||||
[node name="Altar" type="Node" parent="MapOrder"]
|
[node name="Altar" type="Node" parent="MapOrder"]
|
||||||
script = ExtResource("3_v14r0")
|
script = ExtResource("3_v14r0")
|
||||||
FloorName = 1
|
FloorName = 1
|
||||||
|
|
||||||
[node name="FirstFloor" type="Node" parent="MapOrder"]
|
[node name="Floor01" type="Node" parent="MapOrder"]
|
||||||
script = ExtResource("2_00xd7")
|
script = ExtResource("2_00xd7")
|
||||||
FolderName = "SetAFloors"
|
FolderName = "Floor01"
|
||||||
FloorOdds = Array[float]([0.0, 1.0])
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
Sproingy = 1.0
|
Sproingy = 1.0
|
||||||
|
|
||||||
[node name="Overworld" type="Node" parent="MapOrder"]
|
[node name="Floor02" type="Node" parent="MapOrder"]
|
||||||
script = ExtResource("3_v14r0")
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor02"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor03" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor03"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor04" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor04"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor05" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor05"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor06" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor06"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor07" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor07"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor08" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor08"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|
||||||
|
[node name="Floor09" type="Node" parent="MapOrder"]
|
||||||
|
script = ExtResource("2_00xd7")
|
||||||
|
FolderName = "Floor09"
|
||||||
|
FloorOdds = Array[float]([0.0, 1.0])
|
||||||
|
Sproingy = 1.0
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ public partial class Overworld : Node3D, IDungeonFloor
|
|||||||
|
|
||||||
[Node] private Area3D Exit { get; set; } = default!;
|
[Node] private Area3D Exit { get; set; } = default!;
|
||||||
|
|
||||||
[Node] private RescuedItems RescuedItems { get; set; } = default!;
|
|
||||||
|
|
||||||
[Node] private Area3D RestoreArea { get; set; } = default!;
|
[Node] private Area3D RestoreArea { get; set; } = default!;
|
||||||
|
|
||||||
public ImmutableList<IDungeonRoom> Rooms => [];
|
public ImmutableList<IDungeonRoom> Rooms => [];
|
||||||
@@ -32,7 +30,6 @@ public partial class Overworld : Node3D, IDungeonFloor
|
|||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
Exit.AreaEntered += Exit_AreaEntered;
|
Exit.AreaEntered += Exit_AreaEntered;
|
||||||
RescuedItems.SpawnRescuedItems();
|
|
||||||
RestoreArea.AreaEntered += RestoreArea_AreaEntered;
|
RestoreArea.AreaEntered += RestoreArea_AreaEntered;
|
||||||
RestoreArea.AreaExited += RestoreArea_AreaExited;
|
RestoreArea.AreaExited += RestoreArea_AreaExited;
|
||||||
RestoreTimer = new Timer();
|
RestoreTimer = new Timer();
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
[gd_scene load_steps=523 format=4 uid="uid://dvnc26rebk6o0"]
|
[gd_scene load_steps=522 format=4 uid="uid://dvnc26rebk6o0"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cuhfkyh3d7noa" path="res://src/map/dungeon/code/Overworld.cs" id="1_5hmt3"]
|
[ext_resource type="Script" uid="uid://cuhfkyh3d7noa" path="res://src/map/dungeon/code/Overworld.cs" id="1_5hmt3"]
|
||||||
[ext_resource type="Texture2D" uid="uid://co6h8vyi11sl2" path="res://src/map/overworld/Models/Overworld_CLOUD_RINGS_INNER_63.png" id="2_g6b7b"]
|
[ext_resource type="Texture2D" uid="uid://co6h8vyi11sl2" path="res://src/map/overworld/Models/Overworld_CLOUD_RINGS_INNER_63.png" id="2_g6b7b"]
|
||||||
[ext_resource type="AudioStream" uid="uid://dqmsaok6fyhe7" path="res://src/audio/amb/amb_perlin.wav" id="2_wbbo3"]
|
[ext_resource type="AudioStream" uid="uid://dqmsaok6fyhe7" path="res://src/audio/AMB/amb_perlin.wav" id="2_wbbo3"]
|
||||||
[ext_resource type="AudioStream" uid="uid://dl07vg00se7hd" path="res://src/audio/amb/amb_white_noise.wav" id="3_c2gp5"]
|
[ext_resource type="AudioStream" uid="uid://dl07vg00se7hd" path="res://src/audio/AMB/amb_white_noise.wav" id="3_c2gp5"]
|
||||||
[ext_resource type="AudioStream" uid="uid://boypvgaweep8a" path="res://src/audio/amb/amb_beach.wav" id="3_pvi8n"]
|
[ext_resource type="AudioStream" uid="uid://boypvgaweep8a" path="res://src/audio/AMB/amb_beach.wav" id="3_pvi8n"]
|
||||||
[ext_resource type="Texture2D" uid="uid://w33fr6exryiy" path="res://src/map/overworld/Models/Overworld_CLOUD_RINGS_INNER_37.png" id="3_uyygh"]
|
[ext_resource type="Texture2D" uid="uid://w33fr6exryiy" path="res://src/map/overworld/Models/Overworld_CLOUD_RINGS_INNER_37.png" id="3_uyygh"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dv10yaqvp3mub" path="res://src/map/overworld/Models/Overworld_CLOUD_RINGS_INNER_71.png" id="4_r8r3k"]
|
[ext_resource type="Texture2D" uid="uid://dv10yaqvp3mub" path="res://src/map/overworld/Models/Overworld_CLOUD_RINGS_INNER_71.png" id="4_r8r3k"]
|
||||||
[ext_resource type="Shader" uid="uid://brhf7s3riyag5" path="res://src/map/map shaders/Metal.gdshader" id="5_d1qcb"]
|
[ext_resource type="Shader" uid="uid://brhf7s3riyag5" path="res://src/map/map shaders/Metal.gdshader" id="5_d1qcb"]
|
||||||
@@ -104,7 +104,6 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://clml6uw8csbw1" path="res://src/map/overworld/Models/Overworld Re-Scaled (Missing Distance Objects).glb" id="108_yksd7"]
|
[ext_resource type="PackedScene" uid="uid://clml6uw8csbw1" path="res://src/map/overworld/Models/Overworld Re-Scaled (Missing Distance Objects).glb" id="108_yksd7"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dld10xlpr8d17" path="res://src/map/assets/OW_gate.glb" id="109_8vsb2"]
|
[ext_resource type="PackedScene" uid="uid://dld10xlpr8d17" path="res://src/map/assets/OW_gate.glb" id="109_8vsb2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dnomijv6j8s3" path="res://src/map/overworld/Models/Overworld COLLISION.glb" id="109_vbsj2"]
|
[ext_resource type="PackedScene" uid="uid://dnomijv6j8s3" path="res://src/map/overworld/Models/Overworld COLLISION.glb" id="109_vbsj2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://tc5kdfoggrng" path="res://src/item_rescue/RescuedItems.tscn" id="141_b6pah"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bd3ad0jb6emg" path="res://src/vfx/World/GREEN_FLAME.png" id="141_fmewe"]
|
[ext_resource type="Texture2D" uid="uid://bd3ad0jb6emg" path="res://src/vfx/World/GREEN_FLAME.png" id="141_fmewe"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b7kj1pxt7wx1g" path="res://src/vfx/World/BLUE_FLAME.png" id="142_8vsb2"]
|
[ext_resource type="Texture2D" uid="uid://b7kj1pxt7wx1g" path="res://src/vfx/World/BLUE_FLAME.png" id="142_8vsb2"]
|
||||||
[ext_resource type="Texture2D" uid="uid://tqkq5kaijq7f" path="res://src/vfx/World/REGULAR_FLAME.png" id="143_xuv6m"]
|
[ext_resource type="Texture2D" uid="uid://tqkq5kaijq7f" path="res://src/vfx/World/REGULAR_FLAME.png" id="143_xuv6m"]
|
||||||
@@ -10671,10 +10670,6 @@ omni_range = 60.893
|
|||||||
|
|
||||||
[node name="Item Transport" type="Node3D" parent="Node3D"]
|
[node name="Item Transport" type="Node3D" parent="Node3D"]
|
||||||
|
|
||||||
[node name="RescuedItems" parent="Node3D/Item Transport" instance=ExtResource("141_b6pah")]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -349.863, 9.41853, 131.703)
|
|
||||||
|
|
||||||
[node name="Flames" type="Node3D" parent="Node3D"]
|
[node name="Flames" type="Node3D" parent="Node3D"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -384.577, -32.0995, 112.205)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -384.577, -32.0995, 112.205)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://rq7xhwirdq4k"
|
uid="uid://d2b7x8y1t8h0c"
|
||||||
path="res://.godot/imported/A1-Longroom_brick_corridor_corrected.png-b1ea2c8e973447760ca54f5a871194df.ctex"
|
path="res://.godot/imported/A1-Longroom_brick_corridor_corrected.png-b1ea2c8e973447760ca54f5a871194df.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -117,3 +117,25 @@ popup/item_14/id = 14
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Load Next Floor"
|
text = "Load Next Floor"
|
||||||
|
|
||||||
|
[node name="DieButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer/VFlowContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Die"
|
||||||
|
|
||||||
|
[node name="DeathCountLabel" type="Label" parent="."]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 58.0
|
||||||
|
offset_top = 657.0
|
||||||
|
offset_right = 160.0
|
||||||
|
offset_bottom = 680.0
|
||||||
|
text = "Death Count:"
|
||||||
|
|
||||||
|
[node name="DeathCount" type="Label" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 165.0
|
||||||
|
offset_top = 658.0
|
||||||
|
offset_right = 205.0
|
||||||
|
offset_bottom = 681.0
|
||||||
|
text = "100"
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
|||||||
|
|
||||||
public void ResetPlayerData()
|
public void ResetPlayerData()
|
||||||
{
|
{
|
||||||
|
PlayerFXAnimations.Play("RESET");
|
||||||
|
|
||||||
foreach (var item in Inventory.Items)
|
foreach (var item in Inventory.Items)
|
||||||
Inventory.Remove(item);
|
Inventory.Remove(item);
|
||||||
|
|
||||||
@@ -170,6 +172,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
|||||||
Hitbox.AreaEntered += Hitbox_AreaEntered;
|
Hitbox.AreaEntered += Hitbox_AreaEntered;
|
||||||
CollisionDetector.AreaEntered += CollisionDetector_AreaEntered;
|
CollisionDetector.AreaEntered += CollisionDetector_AreaEntered;
|
||||||
HealthComponent.HealthReachedZero += Die;
|
HealthComponent.HealthReachedZero += Die;
|
||||||
|
PlayerFXAnimations.AnimationFinished += PlayerFXAnimations_AnimationFinished;
|
||||||
HealthTimer.WaitTime = _healthTimerWaitTime;
|
HealthTimer.WaitTime = _healthTimerWaitTime;
|
||||||
SetProcessInput(false);
|
SetProcessInput(false);
|
||||||
SetPhysicsProcess(false);
|
SetPhysicsProcess(false);
|
||||||
@@ -237,7 +240,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
|||||||
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
||||||
SetProcessInput(false);
|
SetProcessInput(false);
|
||||||
SetPhysicsProcess(false);
|
SetPhysicsProcess(false);
|
||||||
PlayerDied?.Invoke();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
@@ -337,6 +339,12 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
|||||||
AnimationPlayer.Play("attack");
|
AnimationPlayer.Play("attack");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PlayerFXAnimations_AnimationFinished(StringName animName)
|
||||||
|
{
|
||||||
|
if (animName == "death")
|
||||||
|
PlayerDied?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnExitTree()
|
private void OnExitTree()
|
||||||
{
|
{
|
||||||
PlayerLogic.Stop();
|
PlayerLogic.Stop();
|
||||||
|
|||||||
@@ -2847,6 +2847,9 @@ animations = [{
|
|||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_ywo1c")
|
"texture": SubResource("AtlasTexture_ywo1c")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": null
|
||||||
}],
|
}],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": &"default",
|
"name": &"default",
|
||||||
@@ -8002,6 +8005,9 @@ animations = [{
|
|||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_d4xbt")
|
"texture": SubResource("AtlasTexture_d4xbt")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": null
|
||||||
}],
|
}],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": &"default",
|
"name": &"default",
|
||||||
@@ -12585,7 +12591,7 @@ frame_progress = 1.0
|
|||||||
[node name="Crit Marker" type="AnimatedSprite2D" parent="ScreenFX/SubViewportContainer/SubViewport"]
|
[node name="Crit Marker" type="AnimatedSprite2D" parent="ScreenFX/SubViewportContainer/SubViewport"]
|
||||||
position = Vector2(730, 531)
|
position = Vector2(730, 531)
|
||||||
sprite_frames = SubResource("SpriteFrames_gtij5")
|
sprite_frames = SubResource("SpriteFrames_gtij5")
|
||||||
frame = 31
|
frame = 32
|
||||||
frame_progress = 1.0
|
frame_progress = 1.0
|
||||||
speed_scale = 2.0
|
speed_scale = 2.0
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
|||||||
{
|
{
|
||||||
public override void _Notification(int what) => this.Notify(what);
|
public override void _Notification(int what) => this.Notify(what);
|
||||||
|
|
||||||
|
[Dependency] private IGame _game => this.DependOn<IGame>();
|
||||||
|
|
||||||
[Dependency] private IMap _map => this.DependOn<IMap>(() => new Map());
|
[Dependency] private IMap _map => this.DependOn<IMap>(() => new Map());
|
||||||
|
|
||||||
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
|
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
|
||||||
@@ -24,6 +26,10 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
|||||||
|
|
||||||
[Node] public Button LoadNextFloorButton { get; set; } = default!;
|
[Node] public Button LoadNextFloorButton { get; set; } = default!;
|
||||||
|
|
||||||
|
[Node] public Button DieButton { get; set; } = default!;
|
||||||
|
|
||||||
|
[Node] public Label DeathCount { get; set; } = default!;
|
||||||
|
|
||||||
private readonly string _floorFilePath = @"res://src/map/dungeon/floors/";
|
private readonly string _floorFilePath = @"res://src/map/dungeon/floors/";
|
||||||
private readonly string _enemyFilePath = @"res://src/enemy/enemy_types";
|
private readonly string _enemyFilePath = @"res://src/enemy/enemy_types";
|
||||||
|
|
||||||
@@ -35,6 +41,8 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
|||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
LoadNextFloorButton.Pressed += LoadNextFloorButton_Pressed;
|
LoadNextFloorButton.Pressed += LoadNextFloorButton_Pressed;
|
||||||
|
DieButton.Pressed += DieButton_Pressed;
|
||||||
|
VisibilityChanged += PauseDebugMenu_VisibilityChanged;
|
||||||
|
|
||||||
_itemDatabase = ItemDatabase.Instance;
|
_itemDatabase = ItemDatabase.Instance;
|
||||||
_spawnableItems = _itemDatabase.Items;
|
_spawnableItems = _itemDatabase.Items;
|
||||||
@@ -79,6 +87,10 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
|||||||
SpawnEnemyDropDown.ItemSelected += SpawnEnemyDropDown_ItemSelected;
|
SpawnEnemyDropDown.ItemSelected += SpawnEnemyDropDown_ItemSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DieButton_Pressed() => _player.Die();
|
||||||
|
|
||||||
|
private void PauseDebugMenu_VisibilityChanged() => DeathCount.Text = _game.QuestData.DeathCount.ToString("D2");
|
||||||
|
|
||||||
private void FloorSelectDropDown_ItemSelected(long index)
|
private void FloorSelectDropDown_ItemSelected(long index)
|
||||||
{
|
{
|
||||||
var sceneName = FloorSelectDropDown.GetItemText((int)index);
|
var sceneName = FloorSelectDropDown.GetItemText((int)index);
|
||||||
|
|||||||
Reference in New Issue
Block a user