Improvements to save and loading

Improvements to Chinthe animation logic
Fix broken Godot Tool system and just use a more manual approach to setting map nodes
Remove ItemDatabase from individual room scenes
This commit is contained in:
2025-10-24 01:33:18 -07:00
parent f5360adbf1
commit 286c221530
93 changed files with 497 additions and 678 deletions

View File

@@ -8,7 +8,7 @@ public interface ISaveFileManager
public Task WriteToFile<T>(T gameData, string filePath, params IJsonTypeInfoResolver?[] resolvers);
public Task<object?> ReadFromFile(params IJsonTypeInfoResolver?[] resolvers);
public Task<T?> ReadFromFile<T>(params IJsonTypeInfoResolver?[] resolvers);
public Task<object?> ReadFromFile(string filePath, params IJsonTypeInfoResolver?[] resolvers);
public Task<T?> ReadFromFile<T>(string filePath, params IJsonTypeInfoResolver?[] resolvers);
}

View File

@@ -12,7 +12,6 @@ namespace Zennysoft.Game.Implementation;
public class SaveFileManager : ISaveFileManager
{
private readonly IFileSystem _fileSystem;
private readonly JsonSerializerOptions _jsonOptions;
private string _defaultSaveLocation;
public const string DEFAULT_SAVE_FILE_NAME = "game.json";
@@ -23,27 +22,17 @@ public class SaveFileManager : ISaveFileManager
GodotSerialization.Setup();
Serializer.AddConverter(new Texture2DConverter());
var upgradeDependencies = new Blackboard();
_jsonOptions = new JsonSerializerOptions
{
Converters = {
new SerializableTypeConverter(upgradeDependencies)
},
WriteIndented = true
};
}
public Task<object?> ReadFromFile(params IJsonTypeInfoResolver?[] resolvers)
public Task<T?> ReadFromFile<T>(params IJsonTypeInfoResolver?[] resolvers)
{
if (!_fileSystem.File.Exists(_defaultSaveLocation))
throw new FileNotFoundException();
return ReadFromFile(_defaultSaveLocation, resolvers);
return ReadFromFile<T>(_defaultSaveLocation, resolvers);
}
public async Task<object?> ReadFromFile(string filePath, params IJsonTypeInfoResolver?[] resolvers)
public async Task<T?> ReadFromFile<T>(string filePath, params IJsonTypeInfoResolver?[] resolvers)
{
if (!_fileSystem.File.Exists(filePath))
throw new FileNotFoundException();
@@ -51,8 +40,17 @@ public class SaveFileManager : ISaveFileManager
var json = await _fileSystem.File.ReadAllTextAsync(filePath);
var resolver = new SerializableTypeResolver();
_jsonOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine([resolver, .. resolvers]);
return JsonSerializer.Deserialize<object?>(json, _jsonOptions);
var upgradeDependencies = new Blackboard();
var jsonOptions = new JsonSerializerOptions
{
Converters = {
new SerializableTypeConverter(upgradeDependencies)
},
WriteIndented = true
};
jsonOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine([resolver, .. resolvers]);
return JsonSerializer.Deserialize<T?>(json, jsonOptions);
}
public Task WriteToFile<T>(T gameData, params IJsonTypeInfoResolver?[] resolvers)
@@ -63,8 +61,17 @@ public class SaveFileManager : ISaveFileManager
public async Task WriteToFile<T>(T gameData, string filePath, params IJsonTypeInfoResolver?[] resolvers)
{
var resolver = new SerializableTypeResolver();
_jsonOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine([resolver, .. resolvers]);
var json = JsonSerializer.Serialize(gameData, _jsonOptions);
var upgradeDependencies = new Blackboard();
var jsonOptions = new JsonSerializerOptions
{
Converters = {
new SerializableTypeConverter(upgradeDependencies)
},
WriteIndented = true
};
jsonOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine([resolver, .. resolvers]);
var json = JsonSerializer.Serialize(gameData, jsonOptions);
await _fileSystem.File.WriteAllTextAsync(filePath, json);
}
}

View File

@@ -1,14 +1,11 @@
using Chickensoft.Collections;
using Chickensoft.Serialization;
namespace Zennysoft.Ma.Adapter;
public interface IHealthComponent
{
[Save("current_hp")]
public IAutoProp<int> CurrentHP { get; }
[Save("maximum_hp")]
public IAutoProp<int> MaximumHP { get; }
public event Action? HealthReachedZero;

View File

@@ -1,7 +1,10 @@
namespace Zennysoft.Ma.Adapter.Entity
using Chickensoft.Serialization;
namespace Zennysoft.Ma.Adapter.Entity
{
public record ElementalResistanceSet
{
[Save("elemental_resist_set")]
public Dictionary<ElementType, double> ElementalResistance { get; }
public static ElementalResistanceSet None => new ElementalResistanceSet(0, 0, 0, 0, 0);

View File

@@ -1,4 +1,5 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Ma.Adapter;
@@ -6,15 +7,16 @@ 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);
}

View File

@@ -1,7 +1,5 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Implementation;
namespace Zennysoft.Ma.Adapter;

View File

@@ -21,25 +21,4 @@ public partial class UsableItemTagEnumContext : JsonSerializerContext;
public partial class BoxItemTagEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(ElementType))]
public partial class ElementTypeEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(IHealthComponent))]
public partial class HealthComponentContext : JsonSerializerContext;
[JsonSerializable(typeof(IVTComponent))]
public partial class VTComponentContext : JsonSerializerContext;
[JsonSerializable(typeof(IAttackComponent))]
public partial class AttackComponentContext : JsonSerializerContext;
[JsonSerializable(typeof(IDefenseComponent))]
public partial class DefenseComponentContext : JsonSerializerContext;
[JsonSerializable(typeof(IExperiencePointsComponent))]
public partial class ExperiencePointsComponentContext : JsonSerializerContext;
[JsonSerializable(typeof(ILuckComponent))]
public partial class LuckComponentContext : JsonSerializerContext;
[JsonSerializable(typeof(IEquipmentComponent))]
public partial class EquipmentComponentContext : JsonSerializerContext;
public partial class ElementTypeEnumContext : JsonSerializerContext;

View File

@@ -0,0 +1,11 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
namespace Zennysoft.Ma.Adapter;
[Meta, Id("quest_data")]
public partial record QuestData
{
[Save("quest_data_1")]
public bool QuestMarker1 { get; set; } = false;
}

View File

@@ -8,7 +8,7 @@ public interface IMaSaveFileManager
{
Task Save<T>(T gameData);
Task<object?> Load();
Task<T?> Load<T>();
}
public sealed class MaSaveFileManager : IMaSaveFileManager
@@ -19,7 +19,7 @@ public sealed class MaSaveFileManager : IMaSaveFileManager
public MaSaveFileManager(ISaveFileManager saveFileManager)
{
_saveFileManager = saveFileManager;
_converters = [HealthComponentContext.Default, WeaponTagEnumContext.Default, ItemTagEnumContext.Default, ElementTypeEnumContext.Default, AccessoryTagEnumContext.Default, ThrowableItemTagEnumContext.Default, UsableItemTagEnumContext.Default, BoxItemTagEnumContext.Default];
_converters = [WeaponTagEnumContext.Default, ItemTagEnumContext.Default, ElementTypeEnumContext.Default, AccessoryTagEnumContext.Default, ThrowableItemTagEnumContext.Default, UsableItemTagEnumContext.Default, BoxItemTagEnumContext.Default];
}
public async Task Save<T>(T gameData)
@@ -27,5 +27,5 @@ public sealed class MaSaveFileManager : IMaSaveFileManager
await _saveFileManager.WriteToFile(gameData, [.. _converters]);
}
public async Task<object?> Load() => await _saveFileManager.ReadFromFile([.. _converters]);
public async Task<T?> Load<T>() => await _saveFileManager.ReadFromFile<T>([.. _converters]);
}

View File

@@ -1,68 +0,0 @@
using Godot;
using Godot.Collections;
using System.Linq;
using Zennysoft.Game.Ma;
[Tool]
public partial class DungeonFloorLayout : LayoutType
{
[Export]
public DungeonFloorSetType SetType
{
get => _setType;
set
{
_setType = value;
LayoutWithSpawnRate = [];
NotifyPropertyListChanged();
}
}
[ExportToolButton("Populate Map Data")]
public Callable PopulateMapList => Callable.From(() => PopulateDictionary(SetType));
[Export]
public Dictionary<string, float> LayoutWithSpawnRate;
[Export]
public Dictionary<EnemyType, float> EnemySpawnRates;
private string _floorPath = "res://src/map/dungeon/floors/";
private DungeonFloorSetType _setType;
private void PopulateDictionary(DungeonFloorSetType setType)
{
var floorPath = _floorPath;
var floorType = string.Empty;
if (setType == DungeonFloorSetType.SetA)
floorType = "SetAFloors";
else if (setType == DungeonFloorSetType.SetB)
floorType = "SetBFloors";
var pathToScenes = $"{floorPath}/{floorType}";
var files = DirAccess.GetFilesAt(pathToScenes).Where(x => x.EndsWith(".tscn"));
var newMaps = new Dictionary<string, float>();
foreach (var file in files)
{
if (LayoutWithSpawnRate.ContainsKey($"{floorType}/{file}"))
{
var spawnRate = LayoutWithSpawnRate.TryGetValue($"{floorType}/{file}", out var currentSpawnRate);
newMaps.Add($"{floorType}/{file}", currentSpawnRate);
}
else
newMaps.Add($"{floorType}/{file}", 1.0f);
}
LayoutWithSpawnRate = newMaps;
NotifyPropertyListChanged();
}
public enum DungeonFloorSetType
{
SetA,
SetB
}
}

View File

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

View File

@@ -1,22 +0,0 @@
#if TOOLS
using Godot;
using Zennysoft.Game.Ma;
[Tool]
public partial class DungeonFloorLayoutNode : EditorPlugin
{
public override void _EnterTree()
{
// Initialization of the plugin goes here.
var script = GD.Load<Script>("res://addons/dungeon_floor_layout/DungeonFloorLayout.cs");
var texture = GD.Load<Texture2D>("res://addons/dungeon_floor_layout/icon.png");
AddCustomType(nameof(DungeonFloorLayout), nameof(LayoutType), script, texture);
}
public override void _ExitTree()
{
// Clean-up of the plugin goes here.
RemoveCustomType(nameof(DungeonFloorLayout));
}
}
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cgd2d4fusp4pg"
path="res://.godot/imported/icon.png-f075641bee242eff6dcbc69a1dabede8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dungeon_floor_layout/icon.png"
dest_files=["res://.godot/imported/icon.png-f075641bee242eff6dcbc69a1dabede8.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@@ -1,7 +0,0 @@
[plugin]
name="Dungeon Floor Layout"
description=""
author="Zenny"
version=""
script="DungeonFloorLayoutNode.cs"

View File

@@ -1,25 +0,0 @@
using Godot;
using Zennysoft.Game.Ma;
[Tool]
public partial class SpecialFloorLayout : LayoutType
{
[Export]
public SpecialFloorType FloorName { get; set; }
public override void _EnterTree()
{
base._EnterTree();
}
public enum SpecialFloorType
{
Overworld,
Altar,
BossFloorA,
BossFloorB,
GoddessOfGuidanceFloor,
TrueGoddessOfGuidanceFloor,
FinalFloor
}
}

View File

@@ -1,23 +0,0 @@
#if TOOLS
using Godot;
using System;
using Zennysoft.Game.Ma;
[Tool]
public partial class SpecialFloorLayoutNode : EditorPlugin
{
public override void _EnterTree()
{
// Initialization of the plugin goes here.
var script = GD.Load<Script>("res://addons/special_floor_layout_node/SpecialFloorLayout.cs");
var texture = GD.Load<Texture2D>("res://addons/special_floor_layout_node/icon.png");
AddCustomType(nameof(SpecialFloorLayout), nameof(LayoutType), script, texture);
}
public override void _ExitTree()
{
// Clean-up of the plugin goes here.
RemoveCustomType(nameof(SpecialFloorLayout));
}
}
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

View File

@@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dkj2u56olatdq"
path="res://.godot/imported/icon.png-f3d3329191ced87c3dfb24631add3cb6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/special_floor_layout_node/icon.png"
dest_files=["res://.godot/imported/icon.png-f3d3329191ced87c3dfb24631add3cb6.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

View File

@@ -1,7 +0,0 @@
[plugin]
name="Special Floor Layout Node"
description=""
author="Zenny"
version=""
script="SpecialFloorLayoutNode.cs"

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections;
using Chickensoft.Serialization;
using System;
using Zennysoft.Ma.Adapter;
@@ -7,10 +6,8 @@ namespace Zennysoft.Game.Ma;
public class HealthComponent : IHealthComponent
{
[Save("current_hp")]
public IAutoProp<int> CurrentHP => _currentHP;
[Save("maximum_hp")]
public IAutoProp<int> MaximumHP => _maximumHP;
private readonly AutoProp<int> _currentHP;

View File

@@ -47,8 +47,7 @@ public partial class App : Node, IApp
container.RegisterSingleton<IAppRepo, AppRepo>();
container.RegisterSingleton<IAppLogic, AppLogic>();
MainMenu.NewGame += OnNewGame;
MainMenu.LoadGame += OnLoadGame;
MainMenu.StartGame += OnStartGame;
MainMenu.EnemyViewer += OnEnemyViewer;
MainMenu.Quit += OnQuit;
_loadedScene.Changed += OnGameLoaded;
@@ -132,7 +131,7 @@ public partial class App : Node, IApp
}
}
public void OnNewGame() => AppLogic.Input(new AppLogic.Input.NewGame());
public void OnStartGame() => AppLogic.Input(new AppLogic.Input.NewGame());
private void OnEnemyViewer() => AppLogic.Input(new AppLogic.Input.EnemyViewerOpened());
@@ -151,8 +150,7 @@ public partial class App : Node, IApp
AppBinding.Dispose();
AppRepo.Dispose();
MainMenu.NewGame -= OnNewGame;
MainMenu.LoadGame -= OnLoadGame;
MainMenu.StartGame -= OnStartGame;
MainMenu.EnemyViewer -= OnEnemyViewer;
MainMenu.Quit -= OnQuit;
_loadedScene.Changed -= OnGameLoaded;

View File

@@ -16,7 +16,7 @@
[ext_resource type="PackedScene" uid="uid://dxwwfbt2mtmer" path="res://src/enemy/enemy_types/11. Palan/PalanModelView.tscn" id="14_3wl4s"]
[ext_resource type="PackedScene" uid="uid://drkaq6grim1fb" path="res://src/enemy/enemy_types/12. Shield of Heaven/ShieldModelView.tscn" id="15_37gx6"]
[ext_resource type="PackedScene" uid="uid://bli0t0d6ommvi" path="res://src/enemy/enemy_types/04. sara/SaraModelView.tscn" id="16_alsxp"]
[ext_resource type="PackedScene" uid="uid://byd7cwxq1be6f" path="res://src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn" id="17_qov77"]
[ext_resource type="PackedScene" uid="uid://byd7cwxq1be6f" path="res://src/enemy/enemy_types/07. chinthe/ChintheModelView.tscn" id="17_qov77"]
[ext_resource type="PackedScene" uid="uid://c5xijwxkg4pf6" path="res://src/enemy/enemy_types/05. ballos/BallosModelView.tscn" id="18_sxd8s"]
[ext_resource type="PackedScene" uid="uid://c5asojy73n44d" path="res://src/enemy/enemy_types/13. gold sproingy/GoldSproingyModelView.tscn" id="19_gkucd"]

View File

@@ -45,6 +45,8 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
[Export] public int ExpGiven { get; set; } = 10;
private bool _activated = false;
public Enemy()
{
HealthComponent = new HealthComponent(InitialHP);
@@ -72,7 +74,9 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
EnemyBinding
.Handle((in EnemyLogic.Output.Activate _) =>
{
Activate();
if (!_activated)
Activate();
_activated = true;
})
.Handle((in EnemyLogic.Output.Idle _) =>
{

View File

@@ -67,7 +67,7 @@ public abstract partial class Enemy2D : Enemy
{
var collider = Raycast.GetCollider();
if (collider is IPlayer)
_enemyLogic.Input(new EnemyLogic.Input.Attack());
_enemyLogic.Input(new EnemyLogic.Input.Alert());
}
}
}

View File

@@ -2,7 +2,6 @@
using Chickensoft.Introspection;
using Godot;
using System;
using System.Linq;
namespace Zennysoft.Game.Ma;
@@ -16,6 +15,10 @@ public abstract partial class EnemyModelView : Node3D, IEnemyModelView
private readonly string _primaryAttackName = "Primary Attack";
private readonly string _secondaryAttackName = "Secondary Attack";
private readonly string _activateName = "Activate";
private readonly string _activateFront = "activate";
private readonly string _activateLeft = "activate_left";
private readonly string _activateRight = "activate_right";
private readonly string _activateBack = "activate_back";
private readonly string _parametersPlayback = "parameters/playback";
[Node] public AnimationTree AnimationTree { get; set; } = default!;
@@ -26,9 +29,15 @@ public abstract partial class EnemyModelView : Node3D, IEnemyModelView
public event EventHandler HitPlayer;
public event EventHandler ActivationFinished;
[Export]
public bool CanMove { get; set; } = false;
public void OnReady()
{
_stateMachine = (AnimationNodeStateMachinePlayback)AnimationTree.Get(_parametersPlayback);
AnimationTree.AnimationFinished += AnimationTree_AnimationFinished;
}
public virtual void PlayPrimaryAttackAnimation() => _stateMachine.Travel(_primaryAttackName);
@@ -49,6 +58,13 @@ public abstract partial class EnemyModelView : Node3D, IEnemyModelView
protected virtual void OnPlayerHit(AttackEventArgs arg) => HitPlayer?.Invoke(this, arg);
private void AnimationTree_AnimationFinished(StringName animName)
{
if (animName == _activateFront || animName == _activateLeft || animName == _activateRight || animName == _activateBack)
ActivationFinished?.Invoke(this, EventArgs.Empty);
}
public override void _ExitTree()
{
AnimationTree.Get(_parametersPlayback).As<AnimationNodeStateMachinePlayback>().Stop();

View File

@@ -22,4 +22,6 @@ public interface IEnemyModelView : INode3D
public void PlayDeathAnimation();
public event EventHandler HitPlayer;
public event EventHandler ActivationFinished;
}

View File

@@ -87,4 +87,4 @@ states/left/position = Vector2(378, 179)
states/right/node = SubResource("AnimationNodeAnimation_8wbs7")
states/right/position = Vector2(701, 179)
transitions = ["Start", "forward", SubResource("AnimationNodeStateMachineTransition_ivy74"), "forward", "left", SubResource("AnimationNodeStateMachineTransition_x7uye"), "left", "forward", SubResource("AnimationNodeStateMachineTransition_djeua"), "forward", "back", SubResource("AnimationNodeStateMachineTransition_8wbs7"), "back", "forward", SubResource("AnimationNodeStateMachineTransition_mnr4r"), "left", "right", SubResource("AnimationNodeStateMachineTransition_l2wq1"), "right", "left", SubResource("AnimationNodeStateMachineTransition_jwlar"), "back", "left", SubResource("AnimationNodeStateMachineTransition_fdoul"), "left", "back", SubResource("AnimationNodeStateMachineTransition_kpotx"), "forward", "right", SubResource("AnimationNodeStateMachineTransition_lfuuf"), "right", "forward", SubResource("AnimationNodeStateMachineTransition_dfvqa"), "right", "back", SubResource("AnimationNodeStateMachineTransition_dnvt3"), "back", "right", SubResource("AnimationNodeStateMachineTransition_m7aft")]
graph_offset = Vector2(0, 26.7654)
graph_offset = Vector2(-372.546, -3.34571)

View File

@@ -15,18 +15,34 @@ public partial class Chinthe : Enemy2D, IHaveEngagePlayerBehavior, IHaveFollowBe
[Node] public Area3D PlayerDetector { get; set; } = default!;
public void OnReady()
{
EnemyModelView.ActivationFinished += EnemyModelView_ActivationFinished;
SetPhysicsProcess(true);
}
private void EnemyModelView_ActivationFinished(object sender, System.EventArgs e)
{
FollowBehavior.Init(NavigationAgent);
FollowBehavior.OnVelocityComputed += OnVelocityComputed;
FollowBehavior.OnVelocityComputed += OnChintheVelocityComputed;
EngagePlayerBehavior.TakeAction += EngagePlayerBehavior_TakeAction;
EngagePlayerBehavior.AcquireTarget += EngagePlayerBehavior_AcquireTarget;
PlayerDetector.BodyEntered += PlayerDetector_BodyEntered;
PlayerDetector.BodyExited += PlayerDetector_BodyExited;
SetPhysicsProcess(true);
_enemyLogic.Input(new EnemyLogic.Input.Follow());
_enemyLogic.Input(new EnemyLogic.Input.Move());
}
public override void Activate()
{
EnemyModelView.PlayActivateAnimation();
}
public void OnChintheVelocityComputed(Vector3 safeVelocity)
{
_enemyLogic.Input(new EnemyLogic.Input.Move());
Velocity = safeVelocity;
LookAtTarget(safeVelocity);
if (((EnemyModelView)EnemyModelView).CanMove)
MoveAndSlide();
}
}

View File

@@ -2,7 +2,7 @@
[ext_resource type="Script" uid="uid://fwtjthix6awv" path="res://src/enemy/enemy_types/07. chinthe/Chinthe.cs" id="1_120m2"]
[ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="3_567xa"]
[ext_resource type="PackedScene" uid="uid://byd7cwxq1be6f" path="res://src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn" id="3_ncr2e"]
[ext_resource type="PackedScene" uid="uid://byd7cwxq1be6f" path="res://src/enemy/enemy_types/07. chinthe/ChintheModelView.tscn" id="3_ncr2e"]
[ext_resource type="PackedScene" uid="uid://mqj4jju3870v" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_t7elt"]
[ext_resource type="PackedScene" uid="uid://8bcme8ao4axa" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="7_24q6i"]
@@ -24,6 +24,7 @@ metadata/_custom_type_script = "uid://dlsgyx4i1jmp3"
radius = 1.20703
[sub_resource type="CylinderShape3D" id="CylinderShape3D_q6h01"]
radius = 1.26172
[node name="Chinthe" type="CharacterBody3D"]
process_mode = 1
@@ -81,7 +82,7 @@ shape = SubResource("CylinderShape3D_q6h01")
[node name="FollowBehavior" parent="Components" instance=ExtResource("6_t7elt")]
unique_name_in_owner = true
_followSpeed = 150.0
_followSpeed = 500.0
[node name="EngagePlayerBehavior" parent="Components" instance=ExtResource("7_24q6i")]
unique_name_in_owner = true

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=469 format=3 uid="uid://byd7cwxq1be6f"]
[gd_scene load_steps=475 format=3 uid="uid://byd7cwxq1be6f"]
[ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_6dej3"]
[ext_resource type="Texture2D" uid="uid://dnd6d5cx7x7i8" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/BACK/0400.png" id="2_3sdh3"]
@@ -393,6 +393,8 @@
[ext_resource type="Texture2D" uid="uid://b6yiy63mab0q0" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/FRONT/0350.png" id="388_l12jf"]
[ext_resource type="Texture2D" uid="uid://gteini5vxmj1" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/FRONT/0352.png" id="389_whqu2"]
[ext_resource type="Texture2D" uid="uid://csdrkeer8xklt" path="res://src/enemy/enemy_types/07. chinthe/animations/CHINTHE - RERENDER/FRONT/0354.png" id="390_ksvn0"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://cbq8xog50cjjy" path="res://src/enemy/animation_state_machines/PrimaryAttackStateMachine.tres" id="394_ldtka"]
[ext_resource type="AnimationNodeStateMachine" uid="uid://cy2ngl55c0rws" path="res://src/enemy/animation_state_machines/WalkingStateMachine.tres" id="395_jbhro"]
[ext_resource type="Texture2D" uid="uid://c7pf2dib2ilhs" path="res://src/vfx/Enemy/CHINTHE_BLAST.png" id="395_ymova"]
[sub_resource type="ViewportTexture" id="ViewportTexture_h1kaf"]
@@ -1725,7 +1727,7 @@ tracks/4/keys = {
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath(".:CanMove")
tracks/5/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:flip_h")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
@@ -1737,86 +1739,86 @@ tracks/5/keys = {
tracks/6/type = "value"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:flip_h")
tracks/6/path = NodePath("Sprite3D:scale:x")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
"update": 0,
"values": [1.5]
}
tracks/7/type = "value"
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/path = NodePath("Sprite3D:scale:x")
tracks/7/path = NodePath("Sprite3D:scale")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [1.5]
"values": [Vector3(1.5, 1.5, 1.5)]
}
tracks/8/type = "value"
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/path = NodePath("Sprite3D:scale")
tracks/8/path = NodePath("Sprite3D:modulate")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(1.5, 1.5, 1.5)]
"values": [Color(1, 1, 1, 1)]
}
tracks/9/type = "value"
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/path = NodePath("Sprite3D:modulate")
tracks/9/path = NodePath("GPUParticles3D:emitting")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
"update": 1,
"values": [false]
}
tracks/10/type = "value"
tracks/10/imported = false
tracks/10/enabled = true
tracks/10/path = NodePath("GPUParticles3D:emitting")
tracks/10/path = NodePath("Sprite3D:transparency")
tracks/10/interp = 1
tracks/10/loop_wrap = true
tracks/10/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
"update": 0,
"values": [0.0]
}
tracks/11/type = "value"
tracks/11/imported = false
tracks/11/enabled = true
tracks/11/path = NodePath("Sprite3D:transparency")
tracks/11/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:modulate")
tracks/11/interp = 1
tracks/11/loop_wrap = true
tracks/11/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
"values": [Color(1, 1, 1, 1)]
}
tracks/12/type = "value"
tracks/12/imported = false
tracks/12/enabled = true
tracks/12/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:modulate")
tracks/12/path = NodePath(".:CanMove")
tracks/12/interp = 1
tracks/12/loop_wrap = true
tracks/12/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(1, 1, 1, 1)]
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_7d8af"]
@@ -1949,7 +1951,7 @@ tracks/2/keys = {
[sub_resource type="Animation" id="Animation_xydva"]
resource_name = "idle_back"
length = 3.33334
length = 6.66667
loop_mode = 1
step = 0.0833333
tracks/0/type = "value"
@@ -1971,15 +1973,15 @@ tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSpri
tracks/1/interp = 1
tracks/1/loop_wrap = false
tracks/1/keys = {
"times": PackedFloat32Array(0, 3.33333),
"times": PackedFloat32Array(0, 6.66666),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0, 40]
"values": [0, 80]
}
[sub_resource type="Animation" id="Animation_fn0g1"]
resource_name = "idle_front"
length = 3.33334
length = 6.66667
loop_mode = 1
step = 0.0833333
tracks/0/type = "value"
@@ -2001,15 +2003,15 @@ tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSpri
tracks/1/interp = 1
tracks/1/loop_wrap = false
tracks/1/keys = {
"times": PackedFloat32Array(0, 3.33133),
"times": PackedFloat32Array(0, 6.66667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0, 40]
"values": [0, 80]
}
[sub_resource type="Animation" id="Animation_iapwd"]
resource_name = "idle_left"
length = 3.33334
length = 6.66667
loop_mode = 1
step = 0.0833333
tracks/0/type = "value"
@@ -2031,15 +2033,15 @@ tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSpri
tracks/1/interp = 1
tracks/1/loop_wrap = false
tracks/1/keys = {
"times": PackedFloat32Array(0, 3.33133),
"times": PackedFloat32Array(0, 6.66666),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0, 40]
"values": [0, 80]
}
[sub_resource type="Animation" id="Animation_nvqie"]
resource_name = "idle_right"
length = 3.33334
length = 6.66667
loop_mode = 1
step = 0.0833333
tracks/0/type = "value"
@@ -2061,10 +2063,10 @@ tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSpri
tracks/1/interp = 1
tracks/1/loop_wrap = false
tracks/1/keys = {
"times": PackedFloat32Array(0, 3.33133),
"times": PackedFloat32Array(0, 6.66666),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0, 40]
"values": [0, 80]
}
tracks/2/type = "value"
tracks/2/imported = false
@@ -2238,7 +2240,7 @@ tracks/3/path = NodePath(".:CanMove")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.166533, 0.417721),
"times": PackedFloat32Array(0, 0.0833333, 0.416667),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [false, true, false]
@@ -2924,32 +2926,45 @@ advance_mode = 2
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2oumr"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gr3tp"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_oxq0i"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ixs6i"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jbhro"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_keq07"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_w4c47"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5lbxl"]
xfade_time = 0.2
break_loop_at_end = true
switch_mode = 1
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_li182"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_sgkk0"]
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_nvqie"]
states/Activate/node = ExtResource("243_5jjkq")
states/Activate/position = Vector2(583, 100)
"states/Activated Idle/node" = ExtResource("244_2oumr")
"states/Activated Idle/position" = Vector2(348, 285)
states/Idle/node = ExtResource("245_gr3tp")
states/Idle/position = Vector2(357, 100)
"states/Primary Attack/node" = ExtResource("244_2oumr")
"states/Primary Attack/position" = Vector2(583, 285)
states/Idle/node = ExtResource("244_2oumr")
states/Idle/position = Vector2(348, 285)
"states/Primary Attack/node" = ExtResource("394_ldtka")
"states/Primary Attack/position" = Vector2(623.437, 285)
"states/Secondary Attack/node" = SubResource("AnimationNodeAnimation_op3hf")
"states/Secondary Attack/position" = Vector2(583, 404)
states/Start/position = Vector2(199, 100)
transitions = ["Start", "Idle", SubResource("AnimationNodeStateMachineTransition_umemc"), "Idle", "Activate", SubResource("AnimationNodeStateMachineTransition_t3xhd"), "Activate", "Activated Idle", SubResource("AnimationNodeStateMachineTransition_5jjkq"), "Activated Idle", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_2oumr"), "Activated Idle", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_gr3tp"), "Primary Attack", "Activated Idle", SubResource("AnimationNodeStateMachineTransition_oxq0i"), "Secondary Attack", "Activated Idle", SubResource("AnimationNodeStateMachineTransition_ixs6i")]
graph_offset = Vector2(-27, 57)
"states/Unactivated Idle/node" = ExtResource("245_gr3tp")
"states/Unactivated Idle/position" = Vector2(357, 100)
states/Walking/node = ExtResource("395_jbhro")
states/Walking/position = Vector2(348, 398.498)
transitions = ["Start", "Unactivated Idle", SubResource("AnimationNodeStateMachineTransition_umemc"), "Unactivated Idle", "Activate", SubResource("AnimationNodeStateMachineTransition_t3xhd"), "Activate", "Idle", SubResource("AnimationNodeStateMachineTransition_5jjkq"), "Idle", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_gr3tp"), "Secondary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_ixs6i"), "Idle", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_jbhro"), "Primary Attack", "Idle", SubResource("AnimationNodeStateMachineTransition_keq07"), "Idle", "Walking", SubResource("AnimationNodeStateMachineTransition_w4c47"), "Walking", "Idle", SubResource("AnimationNodeStateMachineTransition_5lbxl"), "Walking", "Primary Attack", SubResource("AnimationNodeStateMachineTransition_li182"), "Walking", "Secondary Attack", SubResource("AnimationNodeStateMachineTransition_sgkk0")]
graph_offset = Vector2(-196.563, 205.778)
[sub_resource type="AtlasTexture" id="AtlasTexture_tawq7"]
atlas = ExtResource("395_ymova")
@@ -3183,7 +3198,7 @@ tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [14]
"values": [0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_wj5ph"]
@@ -3268,7 +3283,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.788494, 0.186749, 0.63838)
billboard = 2
render_priority = 101
sprite_frames = SubResource("SpriteFrames_4f8vl")
frame = 14
[node name="Attack VFX" type="AnimationPlayer" parent="."]
libraries = {

View File

@@ -9,5 +9,5 @@ public interface IEnemyLogic : ILogicBlock<EnemyLogic.State>;
[LogicBlock(typeof(State), Diagram = false)]
public partial class EnemyLogic : LogicBlock<EnemyLogic.State>, IEnemyLogic
{
public override Transition GetInitialState() => To<State.Idle>();
public override Transition GetInitialState() => To<State.Unactivated>();
}

View File

@@ -1,4 +1,5 @@
using Chickensoft.Introspection;
using static Zennysoft.Game.Ma.EnemyLogic.Input;
namespace Zennysoft.Game.Ma;
@@ -7,9 +8,19 @@ public partial class EnemyLogic
public partial record State
{
[Meta, Id("enemy_logic_state_activated")]
public partial record Activated : Alive
public partial record Activated : Alive,
IGet<ReachedPlayer>,
IGet<Patrol>,
IGet<Follow>,
IGet<Reset>
{
public Activated() => OnAttach(() => Output(new Output.Activate()));
}
public Transition On(in ReachedPlayer input) => To<EngagePlayer>();
public Transition On(in Patrol _) => To<Patrolling>();
public Transition On(in Follow _) => To<FollowPlayer>();
}
}

View File

@@ -11,18 +11,8 @@ public partial class EnemyLogic
public abstract partial record Alive : State,
IGet<Input.Idle>,
IGet<Move>,
IGet<ReachedPlayer>,
IGet<Patrol>,
IGet<Follow>,
IGet<Reset>,
IGet<Input.Defeated>
{
public Transition On(in ReachedPlayer input) => To<EngagePlayer>();
public Transition On(in Patrol _) => To<Patrolling>();
public Transition On(in Follow _) => To<FollowPlayer>();
public Transition On(in Reset input)
{
Output(new Output.ReturnToDefaultState());

View File

@@ -8,7 +8,7 @@ public partial class EnemyLogic
public partial record State
{
[Meta, Id("enemy_logic_state_engage_player")]
public partial record EngagePlayer : Alive
public partial record EngagePlayer : Activated
{
public EngagePlayer()
{
@@ -17,6 +17,7 @@ public partial class EnemyLogic
var enemy = Get<IEnemy>();
if (enemy is IHaveEngagePlayerBehavior engagePlayerEnemy)
engagePlayerEnemy.EngagePlayerBehavior.Engage();
enemy.Idle();
});
OnDetach(() =>
{

View File

@@ -8,7 +8,7 @@ public partial class EnemyLogic
public partial record State
{
[Meta, Id("enemy_logic_state_followplayer")]
public partial record FollowPlayer : Alive, IGet<Input.LoseTrackOfTarget>
public partial record FollowPlayer : Activated, IGet<Input.LoseTrackOfTarget>
{
public FollowPlayer()
{

View File

@@ -7,7 +7,7 @@ public partial class EnemyLogic
public partial record State
{
[Meta, Id("enemy_logic_state_idle")]
public partial record Idle : Alive
public partial record Idle : Activated
{
public Idle() => OnAttach(() => Output(new Output.Idle()));
}

View File

@@ -9,7 +9,7 @@ public partial class EnemyLogic
public partial record State
{
[Meta, Id("enemy_logic_state_patrolling")]
public partial record Patrolling : Alive
public partial record Patrolling : Activated
{
public Patrolling()
{

View File

@@ -0,0 +1,16 @@
using Chickensoft.Introspection;
using static Zennysoft.Game.Ma.EnemyLogic.Input;
namespace Zennysoft.Game.Ma;
public partial class EnemyLogic
{
public partial record State
{
[Meta, Id("enemy_logic_state_unactivated")]
public partial record Unactivated : Alive, IGet<Alert>
{
public Transition On(in Alert _) => To<Activated>();
}
}
}

View File

@@ -60,12 +60,19 @@ public partial class Game : Node3D, IGame
public RescuedItemDatabase RescuedItems { get; set; } = default!;
public QuestData QuestData { get; private set; }
private EffectService _effectService;
private IInstantiator _instantiator;
private Player _player;
private Map _map;
public Game()
{
QuestData = new QuestData();
}
public void Setup()
{
_container = new SimpleInjector.Container();
@@ -91,30 +98,24 @@ public partial class Game : Node3D, IGame
{
var gameData = new GameData()
{
PlayerData = new PlayerData()
{
Inventory = (Inventory)_player.Inventory,
HealthComponent = (HealthComponent)_player.HealthComponent,
},
MapData = new MapData()
{
},
RescuedItems = new RescuedItemDatabase()
{
Items = RescuedItems.Items
},
QuestData = new QuestData()
{
QuestMarker1 = QuestData.QuestMarker1
}
};
return gameData;
},
onLoad:
(chunk, data) =>
{
RescuedItems = data.RescuedItems;
chunk.LoadChunkSaveData(data.PlayerData);
chunk.LoadChunkSaveData(data.MapData);
}
);
{
RescuedItems = data.RescuedItems;
QuestData = data.QuestData;
}
);
}
public void OnResolved()
@@ -127,7 +128,7 @@ public partial class Game : Node3D, IGame
{
try
{
var gameData = await saveFileManager.Load() as GameData;
var gameData = await saveFileManager.Load<GameData>();
return gameData;
}
catch (FileNotFoundException)
@@ -200,6 +201,7 @@ public partial class Game : Node3D, IGame
{
FloorClearMenu.FadeOut();
Task.Run(() => _map.LoadFloor());
Task.Run(() => Save());
if (_player.EquipmentComponent.EquippedWeapon.Value.ItemTag == ItemTag.BreaksOnChange)
{
var itemToDestroy = _player.EquipmentComponent.EquippedWeapon.Value;
@@ -248,6 +250,7 @@ public partial class Game : Node3D, IGame
public void OnReady()
{
InitializeGame();
SaveFile.Load();
_map.LoadFloor();
GameRepo.Resume();
InGameUI.Show();
@@ -272,6 +275,8 @@ public partial class Game : Node3D, IGame
_map.InitializeMapData();
}
public async Task Save() => await SaveFile.Save();
public void FloorExitReached()
{
GameState.Input(new GameState.Input.FloorExitEntered());

View File

@@ -1,43 +1,15 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Zennysoft.Game.Ma;
namespace Zennysoft.Ma.Adapter;
[Meta, Id("game_data")]
public partial record GameData
{
[Save("player_data")]
public required PlayerData PlayerData { get; init; }
[Save("map_data")]
public required MapData MapData { get; init; }
[Save("rescued_items")]
public required RescuedItemDatabase RescuedItems { get; init; }
[Save("quest_data")]
public required QuestData QuestData { get; init; }
}
public partial record PlayerData
{
[Save("inventory")]
public required Inventory Inventory { get; init; }
[Save("health_component")]
public required HealthComponent HealthComponent { get; init; }
[Save("vt_component")]
public VTComponent VTComponent { get; init; }
[Save("attack_component")]
public AttackComponent AttackComponent { get; init; }
[Save("defense_component")]
public DefenseComponent DefenseComponent { get; init; }
[Save("experience_points_component")]
public ExperiencePointsComponent ExperiencePointsComponent { get; init; }
[Save("luck_component")]
public LuckComponent LuckComponent { get; init; }
[Save("equipment_component")]
public EquipmentComponent EquipmentComponent { get; init; }
}
public partial record MapData
{
}

View File

@@ -5,7 +5,6 @@ using Chickensoft.AutoInject;
using Chickensoft.GodotNodeInterfaces;
using Chickensoft.SaveFileBuilder;
using System.Threading.Tasks;
using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter;
public interface IGame : IProvide<IGame>, IProvide<IGameRepo>, IProvide<IPlayer>, IProvide<IMap>, IProvide<ISaveChunk<GameData>>, INode3D
@@ -29,4 +28,8 @@ public interface IGame : IProvide<IGame>, IProvide<IGameRepo>, IProvide<IPlayer>
public InventoryItem RerollItem(InventoryItem itemToReroll, bool insertIntoInventory = true);
public void GameOver();
public Task Save();
public QuestData QuestData { get; }
}

View File

@@ -21,5 +21,7 @@ public partial class ItemRescue : Area3D
droppedItem.RescueItem();
if (item is ThrownItem thrownItem)
thrownItem.RescueItem();
BodyEntered -= OnItemRescueEntered;
}
}

View File

@@ -30,6 +30,7 @@ public partial class Accessory : EquipableItem
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance);
[Save("accessory_tag")]
public AccessoryTag AccessoryTag => Stats.AccessoryTag;
public override ItemTag ItemTag => Stats.ItemTag;

View File

@@ -31,6 +31,7 @@ public partial class Armor : EquipableItem
public override int BonusDefense => Stats.BonusDefense + _bonusDefense;
[Save("bonus_defense")]
private int _bonusDefense { get; set; } = 0;
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance);

View File

@@ -28,12 +28,13 @@ public partial class ConsumableItem : InventoryItem
public override float ThrowSpeed => Stats.ThrowSpeed;
[Save("consumable_heal_hp")]
public int HealHPAmount => Stats.HealHPAmount;
[Save("consumable_heal_vt")]
public int HealVTAmount => Stats.HealVTAmount;
[Save("consumable_increase_hp")]
public int RaiseHPAmount => Stats.PermanentRaiseHPAmount;
[Save("consumable_increase_vt")]
public int RaiseVTAmount => Stats.PermanentRaiseVTAmount;
public override ItemTag ItemTag => Stats.ItemTag;

View File

@@ -28,6 +28,7 @@ public partial class EffectItem : InventoryItem
public override float ThrowSpeed => Stats.ThrowSpeed;
[Save("usable_tag")]
public UsableItemTag UsableItemTag => Stats.UsableItemTag;
public override ItemTag ItemTag => Stats.ItemTag;

View File

@@ -29,12 +29,13 @@ public partial class ThrowableItem : InventoryItem, IStackable
public override float ThrowSpeed => Stats.ThrowSpeed;
[Save("throwable_item_element")]
public ElementType ElementType => Stats.ElementType;
[Save("throwable_item_tag")]
public ThrowableItemTag ThrowableItemTag => Stats.ThrowableItemTag;
[Save("throwable_item_heal_hp")]
public int HealHPAmount => Stats.HealHPAmount;
[Save("throwable_item_heal_vt")]
public int HealVTAmount => Stats.HealVTAmount;
public override ItemTag ItemTag => Stats.ItemTag;

View File

@@ -29,23 +29,23 @@ public partial class Weapon : EquipableItem
public override float ThrowSpeed => Stats.ThrowSpeed;
public double Luck => Stats.BonusLuck;
[Save("weapon_attack_speed")]
public double AttackSpeed => Stats.AttackSpeed;
[Save("weapon_tag")]
public WeaponTag WeaponTag => Stats.WeaponTag;
public override ItemTag ItemTag => Stats.ItemTag;
[Save("weapon_element")]
public ElementType WeaponElement => Stats.WeaponElement;
public override ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance);
public void IncreaseWeaponAttack(int bonus) => _extraDamage += bonus;
public void IncreaseWeaponAttack(int bonus) => _bonusDamage += bonus;
public override int BonusAttack { get => Stats.BonusAttack + _extraDamage; }
public override int BonusAttack { get => Stats.BonusAttack + _bonusDamage; }
private int _extraDamage = 0;
[Save("weapon_bonus_damage")]
private int _bonusDamage { get; set; } = 0;
[Export]
[Save("weapon_stats")]

View File

@@ -0,0 +1,45 @@
using Godot;
namespace Zennysoft.Game.Ma;
public partial class DungeonFloorNode : FloorNode
{
[ExportGroup("Floor Set")]
[Export]
public string FolderName { get; set; }
[Export]
public Godot.Collections.Array<float> FloorOdds { get; set; } = [];
[ExportGroup("Spawn Rates")]
[Export]
public float Sproingy { get; set; }
[Export]
public float Michael { get; set; }
[Export]
public float FilthEater { get; set; }
[Export]
public float Sara { get; set; }
[Export]
public float Ballos { get; set; }
[Export]
public float Chariot { get; set; }
[Export]
public float Chinthe { get; set; }
[Export]
public float GreenAmbassador { get; set; }
[Export]
public float RedAmbassador { get; set; }
[Export]
public float SteelAmbassador { get; set; }
[Export]
public float AgniDemon { get; set; }
[Export]
public float AqueosDemon { get; set; }
[Export]
public float Palan { get; set; }
[Export]
public float ShieldOfHeaven { get; set; }
[Export]
public float GoldSproingy { get; set; }
}

View File

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

View File

@@ -0,0 +1,6 @@
using Godot;
namespace Zennysoft.Game.Ma;
public abstract partial class FloorNode : Node
{
}

View File

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

View File

@@ -1,13 +1,11 @@
using Chickensoft.AutoInject;
using Chickensoft.Collections;
using Chickensoft.Collections;
using Chickensoft.GodotNodeInterfaces;
using Chickensoft.SaveFileBuilder;
using Godot;
using System.Threading.Tasks;
namespace Zennysoft.Game.Ma;
public interface IMap : INode3D, IProvide<ISaveChunk<MapInfo>>
public interface IMap : INode3D
{
Task LoadFloor();

View File

@@ -1,7 +1,6 @@
using Godot;
using System;
using System.Linq;
using static SpecialFloorLayout;
namespace Zennysoft.Game.Ma;
@@ -9,41 +8,48 @@ public static class LayoutToScenePathConverter
{
private static readonly string _folderPath = "res://src/map/dungeon/floors";
public static string Convert(LayoutType layoutType)
public static string Convert(FloorNode floorNode)
{
if (layoutType is SpecialFloorLayout specialFloor)
{
var path = $"{_folderPath}/Special Floors/";
var files = DirAccess.GetFilesAt(path);
switch (specialFloor.FloorName)
{
case SpecialFloorType.Overworld:
return path + files.Single(x => x.Contains("Overworld.tscn"));
case SpecialFloorType.Altar:
return path + files.Single(x => x.Contains("Altar.tscn"));
case SpecialFloorType.BossFloorA:
return path + files.Single(x => x.Contains("Boss Floor A.tscn"));
case SpecialFloorType.BossFloorB:
return path + files.Single(x => x.Contains("Boss Floor B.tscn"));
case SpecialFloorType.GoddessOfGuidanceFloor:
return path + files.Single(x => x.Contains("Goddess of Guidance's Room.tscn"));
case SpecialFloorType.TrueGoddessOfGuidanceFloor:
return path + files.Single(x => x.Contains("Goddess of Guidance's Room - True Form.tscn"));
case SpecialFloorType.FinalFloor:
return path + files.Single(x => x.Contains("Final Floor.tscn"));
default:
throw new NotImplementedException();
}
}
else if (layoutType is DungeonFloorLayout dungeonFloor)
{
var rng = new RandomNumberGenerator();
rng.Randomize();
var index = (int)rng.RandWeighted([.. dungeonFloor.LayoutWithSpawnRate.Values]);
var result = dungeonFloor.LayoutWithSpawnRate.ElementAt(index);
return _folderPath + "/" + result.Key;
}
if (floorNode is DungeonFloorNode dungeonFloorNode)
return RandomDungeonFloor(dungeonFloorNode);
else if (floorNode is SpecialFloorNode specialFloorNode)
return SpawnSpecialFloor(specialFloorNode.FloorName);
throw new NotImplementedException();
}
private static string SpawnSpecialFloor(SpecialFloorType floorType)
{
var path = $"{_folderPath}/Special Floors/";
var files = DirAccess.GetFilesAt(path);
switch (floorType)
{
case SpecialFloorType.Overworld:
return path + files.Single(x => x.Contains("Overworld.tscn"));
case SpecialFloorType.Altar:
return path + files.Single(x => x.Contains("Altar.tscn"));
case SpecialFloorType.BossFloorA:
return path + files.Single(x => x.Contains("Boss Floor A.tscn"));
case SpecialFloorType.BossFloorB:
return path + files.Single(x => x.Contains("Boss Floor B.tscn"));
case SpecialFloorType.GoddessOfGuidanceFloor:
return path + files.Single(x => x.Contains("Goddess of Guidance's Room.tscn"));
case SpecialFloorType.TrueGoddessOfGuidanceFloor:
return path + files.Single(x => x.Contains("Goddess of Guidance's Room - True Form.tscn"));
case SpecialFloorType.FinalFloor:
return path + files.Single(x => x.Contains("Final Floor.tscn"));
default:
throw new NotImplementedException();
}
}
private static string RandomDungeonFloor(DungeonFloorNode floorNode)
{
var folderName = _folderPath + "/" + floorNode.FolderName;
var floorList = DirAccess.GetFilesAt(folderName).Where(x => x.EndsWith(".tscn"));
var rng = new RandomNumberGenerator();
rng.Randomize();
var index = (int)rng.RandWeighted([.. floorNode.FloorOdds]);
var result = floorList.ElementAt(index);
return folderName + "/" + result;
}
}

View File

@@ -1,7 +0,0 @@
using Godot;
namespace Zennysoft.Game.Ma;
public abstract partial class LayoutType : Node
{
}

View File

@@ -3,6 +3,7 @@ using Chickensoft.Collections;
using Chickensoft.Introspection;
using Chickensoft.SaveFileBuilder;
using Godot;
using Godot.Collections;
using System.Linq;
using System.Threading.Tasks;
using Zennysoft.Ma.Adapter;
@@ -23,18 +24,9 @@ public partial class Map : Node3D, IMap
[Node]
public Node MapOrder { get; set; } = default!;
#region Save
public ISaveChunk<MapInfo> MapChunk { get; set; } = default!;
ISaveChunk<MapInfo> IProvide<ISaveChunk<MapInfo>>.Value() => MapChunk;
[Node]
public AnimationPlayer AnimationPlayer { get; set; } = default!;
[Dependency]
public ISaveChunk<GameData> GameChunk => this.DependOn<ISaveChunk<GameData>>();
#endregion
public IDungeonFloor CurrentFloor { get; private set; }
public AutoProp<int> CurrentFloorNumber { get; private set; } = new AutoProp<int>(0);
@@ -43,8 +35,6 @@ public partial class Map : Node3D, IMap
public void OnResolved()
{
GameChunk.AddChunk(MapChunk);
this.Provide();
InitializeMapData();
@@ -66,11 +56,11 @@ public partial class Map : Node3D, IMap
public async Task LoadFloor()
{
var floor = MapOrder.GetChildren().OfType<LayoutType>().ElementAt(CurrentFloorNumber.Value);
var floor = MapOrder.GetChildren().OfType<FloorNode>().ElementAt(CurrentFloorNumber.Value);
var sceneToLoad = LayoutToScenePathConverter.Convert(floor);
await LoadFloor(sceneToLoad);
if (CurrentFloor is DungeonFloor dungeonFloor && floor is DungeonFloorLayout dungeonFloorLayout)
dungeonFloor.SpawnEnemies(dungeonFloorLayout.EnemySpawnRates);
if (CurrentFloor is DungeonFloor dungeonFloor && floor is DungeonFloorNode dungeonFloorNode)
dungeonFloor.SpawnEnemies(dungeonFloorNode);
}
public async Task LoadFloor(string sceneName)

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=8 format=3 uid="uid://by67pn7fdsg1m"]
[ext_resource type="Script" uid="uid://14e8mu48ed4" path="res://src/map/Map.cs" id="1_bw70o"]
[ext_resource type="Script" uid="uid://cabvj6s31iucg" path="res://addons/special_floor_layout_node/SpecialFloorLayout.cs" id="2_00xd7"]
[ext_resource type="Script" uid="uid://ci7o3nn4mdo8o" path="res://addons/dungeon_floor_layout/DungeonFloorLayout.cs" id="3_v14r0"]
[ext_resource type="Script" uid="uid://dbe3wf3ywtjqh" path="res://src/map/DungeonFloorNode.cs" id="2_00xd7"]
[ext_resource type="Script" uid="uid://dpj4qg0ip6yui" path="res://src/map/SpecialFloorNode.cs" id="3_v14r0"]
[sub_resource type="Animation" id="Animation_00xd7"]
length = 0.001
@@ -76,18 +76,11 @@ libraries = {
[node name="MapOrder" type="Node" parent="."]
unique_name_in_owner = true
[node name="Floor01 (Press Populate Map Data Button to load floor from SetAFloors folder)" type="Node" parent="MapOrder"]
script = ExtResource("3_v14r0")
metadata/_custom_type_script = "uid://ci7o3nn4mdo8o"
[node name="Overworld (Add SpecialFloorLayout node for special floors and pick the FloorName from the list)" type="Node" parent="MapOrder"]
[node name="FirstFloor" type="Node" parent="MapOrder"]
script = ExtResource("2_00xd7")
metadata/_custom_type_script = "uid://cabvj6s31iucg"
FolderName = "SetAFloors"
FloorOdds = Array[float]([0.0, 1.0])
Chinthe = 1.0
[node name="Altar (Arrange order of nodes to change default load order)" type="Node" parent="MapOrder"]
script = ExtResource("2_00xd7")
metadata/_custom_type_script = "uid://cabvj6s31iucg"
[node name="Floor02 (Add DungeonFloorLayout node for regular dungeon floors)" type="Node" parent="MapOrder"]
[node name="Overworld" type="Node" parent="MapOrder"]
script = ExtResource("3_v14r0")
metadata/_custom_type_script = "uid://ci7o3nn4mdo8o"

View File

@@ -1,10 +0,0 @@
using Godot;
namespace Zennysoft.Game.Ma;
[GlobalClass]
public partial class MapInfo : Resource
{
[Export]
public Godot.Collections.Dictionary<string, float> MapNameAndOdds { get; set; }
}

View File

@@ -0,0 +1,9 @@
using Godot;
namespace Zennysoft.Game.Ma;
public partial class SpecialFloorNode : FloorNode
{
[Export]
public SpecialFloorType FloorName { get; set; }
}

View File

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

View File

@@ -0,0 +1,12 @@
namespace Zennysoft.Game.Ma;
public enum SpecialFloorType
{
Overworld,
Altar,
BossFloorA,
BossFloorB,
GoddessOfGuidanceFloor,
TrueGoddessOfGuidanceFloor,
FinalFloor
}

View File

@@ -25,11 +25,29 @@ public partial class DungeonFloor : Node3D, IDungeonFloor
_playerSpawnPoint = RandomizePlayerSpawnPoint();
}
public void SpawnEnemies(Godot.Collections.Dictionary<EnemyType, float> enemyInfo)
public void SpawnEnemies(DungeonFloorNode floorNode)
{
var enemyOdds = new Godot.Collections.Dictionary<EnemyType, float>
{
{ EnemyType.Sproingy, floorNode.Sproingy },
{ EnemyType.Michael, floorNode.Michael },
{ EnemyType.FilthEater, floorNode.FilthEater },
{ EnemyType.Sara, floorNode.Sara },
{ EnemyType.Ballos, floorNode.Ballos },
{ EnemyType.Chariot, floorNode.Chariot },
{ EnemyType.Chinthe, floorNode.Chinthe },
{ EnemyType.AmbassadorGreen, floorNode.GreenAmbassador },
{ EnemyType.AmbassadorRed, floorNode.RedAmbassador },
{ EnemyType.AmbassadorSteel, floorNode.SteelAmbassador },
{ EnemyType.AgniDemon, floorNode.AgniDemon },
{ EnemyType.AqueousDemon, floorNode.AqueosDemon },
{ EnemyType.Palan, floorNode.Palan },
{ EnemyType.ShieldOfHeaven, floorNode.ShieldOfHeaven },
{ EnemyType.GoldSproingy, floorNode.GoldSproingy },
};
var monsterRooms = Rooms.OfType<MonsterRoom>();
foreach (var room in monsterRooms)
room.SpawnEnemies(enemyInfo);
room.SpawnEnemies(enemyOdds);
}
public Transform3D GetPlayerSpawnPoint() => new Transform3D(_playerSpawnPoint.Basis, new Vector3(_playerSpawnPoint.Origin.X, 0f, _playerSpawnPoint.Origin.Z));

View File

@@ -2,7 +2,6 @@ using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System.Linq;
using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -18,8 +17,6 @@ public partial class MonsterRoom : DungeonRoom
[Node] public Marker3D PlayerSpawn { get; set; } = default!;
[Node] public ItemDatabase ItemDatabase { get; set; } = default!;
public override void _Ready()
{
SpawnItems();
@@ -27,6 +24,9 @@ public partial class MonsterRoom : DungeonRoom
public void SpawnEnemies(Godot.Collections.Dictionary<EnemyType, float> enemyInfo)
{
if (enemyInfo == null || enemyInfo.Count == 0)
return;
var rng = new RandomNumberGenerator();
rng.Randomize();
var enemySpawnPoints = EnemySpawnPoints.GetChildren();

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://c5ekisphioovm"]
[gd_scene load_steps=21 format=3 uid="uid://c5ekisphioovm"]
[ext_resource type="Script" uid="uid://dwt6302nsf4vq" path="res://src/map/dungeon/code/DungeonFloor.cs" id="1_cfhj4"]
[ext_resource type="PackedScene" uid="uid://dhkbvos11tkdw" path="res://src/map/dungeon/rooms/Set A/12. Jump Scare Room.tscn" id="1_crv4e"]
@@ -12,6 +12,7 @@
[ext_resource type="PackedScene" uid="uid://8u5kue6pljh0" path="res://src/map/dungeon/corridors/A - Corridor - T-Block.tscn" id="9_n5246"]
[ext_resource type="PackedScene" uid="uid://cam640h4euewx" path="res://src/map/dungeon/rooms/Set A/05. Pit Room A.tscn" id="12_4sygy"]
[ext_resource type="PackedScene" uid="uid://cdkcvd7pwmr2r" path="res://src/map/assets/Dungeon Doors/DOORA.tscn" id="12_hkp1m"]
[ext_resource type="Script" uid="uid://b8bvom6o034gm" path="res://src/quest/QuestTest.cs" id="13_hkp1m"]
[sub_resource type="Environment" id="Environment_yrcgx"]
background_mode = 1
@@ -39,6 +40,21 @@ adjustment_saturation = 0.7
dof_blur_far_enabled = true
dof_blur_far_distance = 20.0
[sub_resource type="CylinderShape3D" id="CylinderShape3D_4sygy"]
[sub_resource type="CylinderMesh" id="CylinderMesh_4sygy"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4sygy"]
transparency = 1
albedo_color = Color(0.371075, 0.471858, 1, 0.74902)
[sub_resource type="NavigationMesh" id="NavigationMesh_hkp1m"]
vertices = PackedVector3Array(-13.9117, 1.52274, -9.5, -13.9117, 1.52274, 9.5, 5.08825, 1.52274, 9.5, 5.08825, 1.52274, -9.5)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
[sub_resource type="PlaneMesh" id="PlaneMesh_hkp1m"]
size = Vector2(20, 20)
[node name="Node3D" type="Node3D"]
script = ExtResource("1_cfhj4")
@@ -188,3 +204,26 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -20.095, 0, -56.669)
[node name="Node3D" parent="." instance=ExtResource("12_hkp1m")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -30.1149, -0.0400015, 11.7445)
[node name="QuestTest" type="Area3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.50048, 0, -2.16434)
collision_layer = 0
collision_mask = 64
script = ExtResource("13_hkp1m")
[node name="CollisionShape3D" type="CollisionShape3D" parent="QuestTest"]
shape = SubResource("CylinderShape3D_4sygy")
[node name="MeshInstance3D" type="MeshInstance3D" parent="QuestTest"]
mesh = SubResource("CylinderMesh_4sygy")
surface_material_override/0 = SubResource("StandardMaterial3D_4sygy")
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.339771, 0)
navigation_mesh = SubResource("NavigationMesh_hkp1m")
[node name="MeshInstance3D" type="MeshInstance3D" parent="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.41175, 1.02274, 0)
visible = false
mesh = SubResource("PlaneMesh_hkp1m")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=276 format=4 uid="uid://5ja3qxn8h7iw"]
[gd_scene load_steps=275 format=4 uid="uid://5ja3qxn8h7iw"]
[ext_resource type="Script" uid="uid://tqyybt313web" path="res://src/map/dungeon/code/BossRoomA.cs" id="1_0h3lb"]
[ext_resource type="Texture2D" uid="uid://vjbe1lg810gh" path="res://src/map/dungeon/models/Special Floors & Rooms/Boss Floor A/15_A1_BOSS FLOOR A_VER_swirled_column.png" id="2_06eum"]
@@ -22,7 +22,6 @@
[ext_resource type="Texture2D" uid="uid://ptsisd285o78" path="res://src/map/dungeon/models/Special Floors & Rooms/Boss Floor A/15_A1_BOSS FLOOR A_VER_STONE_PANEL_1png.png" id="17_0tjgo"]
[ext_resource type="Texture2D" uid="uid://nljdi5gnv0wr" path="res://src/map/dungeon/models/Special Floors & Rooms/Boss Floor A/15_A1_BOSS FLOOR A_VER_HAND_CYCLE_MOTIF.png" id="19_btt2p"]
[ext_resource type="Texture2D" uid="uid://bln2sy5wq5pe" path="res://src/map/dungeon/models/Special Floors & Rooms/Boss Floor A/15_A1_BOSS FLOOR A_VER_RAIL_TRANSPARENT_PLANE.png" id="22_4tjx7"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="23_gov56"]
[ext_resource type="PackedScene" uid="uid://8yaqqojv4nuv" path="res://src/enemy/enemy_types/14. horse_head/HorseHeadStatue.tscn" id="24_r1rk5"]
[ext_resource type="PackedScene" uid="uid://2wibfnu2jvlv" path="res://src/enemy/enemy_types/14. horse_head/HorseFace.tscn" id="25_a482y"]
[ext_resource type="Texture2D" uid="uid://burw8x227lce2" path="res://src/map/dungeon/models/Special Floors & Rooms/Boss Floor A/Boss Floor 1 Ver_CEILING_1.jpg" id="25_dadmm"]
@@ -4840,13 +4839,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -52.6848, 0, 16.939)
unique_name_in_owner = true
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 1.72795, -2.29748, 0.329851)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("23_gov56")]
unique_name_in_owner = true
[node name="ItemSpawnPoint" type="Marker3D" parent="Spawn Points"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -108.001, -2.05432, 2.0026)
[node name="Room" type="Node3D" parent="."]
[node name="ActivateTrap" type="Area3D" parent="Room"]
@@ -4871,10 +4863,7 @@ transform = Transform3D(-6.55671e-09, 0, -0.15, 0, 0.15, 0, 0.15, 0, -6.55671e-0
visible = false
PrimaryAttackElementalType = null
PrimaryAttackElementalDamageBonus = null
AttackValue = null
DefenseValue = null
InitialHP = null
ExpAmount = null
[node name="OxFaceStatue" parent="Room" instance=ExtResource("26_futcf")]
unique_name_in_owner = true
@@ -4886,10 +4875,7 @@ transform = Transform3D(-6.55671e-09, 0, -0.15, 0, 0.15, 0, 0.15, 0, -6.55671e-0
visible = false
PrimaryAttackElementalType = null
PrimaryAttackElementalDamageBonus = null
AttackValue = null
DefenseValue = null
InitialHP = null
ExpAmount = null
[node name="Exit" type="Area3D" parent="Room"]
unique_name_in_owner = true

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=134 format=4 uid="uid://ceo7ph483io44"]
[gd_scene load_steps=133 format=4 uid="uid://ceo7ph483io44"]
[ext_resource type="Script" uid="uid://cvj30id0i8ska" path="res://src/map/dungeon/code/BossRoomB.cs" id="1_bxvob"]
[ext_resource type="Texture2D" uid="uid://cp8si6xqd3g51" path="res://src/map/dungeon/models/Area 2/Demon Wall Floor/DEMON WALL_FLOOR_COLUMN_WHITE.png" id="2_58rvo"]
@@ -21,7 +21,6 @@
[ext_resource type="Texture2D" uid="uid://wwuer1rj1w03" path="res://src/map/dungeon/models/Area 2/Demon Wall Floor/DEMON WALL_FLOOR_Painting-for-Tempple-merged.png" id="20_66v2o"]
[ext_resource type="Texture2D" uid="uid://eoa8j2dthdcd" path="res://src/map/dungeon/models/Area 2/Demon Wall Floor/DEMON WALL_FLOOR_RUBBLE_1.png" id="21_44y61"]
[ext_resource type="Texture2D" uid="uid://b4qmkkiglj7pw" path="res://src/map/dungeon/models/Area 2/Demon Wall Floor/DEMON WALL_FLOOR_mother_GREEN.png" id="22_tc5an"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="23_br0k2"]
[ext_resource type="PackedScene" uid="uid://6kck5vborfyk" path="res://src/enemy/enemy_types/16. demon wall/DemonWall.tscn" id="25_k2q0o"]
[ext_resource type="Shader" uid="uid://crbilces53hat" path="res://src/map/map shaders/B2 Night Sky World Environment.gdshader" id="27_yu47a"]
[ext_resource type="Texture2D" uid="uid://bk2irsqn0sbex" path="res://src/map/assets/B2 Night Sky Star Textures.png" id="28_nlpir"]
@@ -1865,9 +1864,6 @@ visible = false
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.953176, 25.4308, 149.677)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("23_br0k2")]
unique_name_in_owner = true
[node name="ItemSpawnPoint" type="Marker3D" parent="Spawn Points"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -115.98, -2.05432, 16.535)
@@ -1889,7 +1885,6 @@ shape = SubResource("BoxShape3D_bxvob")
[node name="DemonWall" parent="." instance=ExtResource("25_k2q0o")]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.491528, 21.2936, 55.334)
_maximumWallMoveAmount = 24.0
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_qev6n")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=60 format=4 uid="uid://dpec2lbt83dhe"]
[gd_scene load_steps=59 format=4 uid="uid://dpec2lbt83dhe"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="1_312b8"]
[ext_resource type="Texture2D" uid="uid://dloho0aquwytw" path="res://src/map/dungeon/models/Area 1/Antechamber/antechamberfix_WALL TILE 1.jpg" id="2_312b8"]
@@ -17,7 +17,6 @@
[ext_resource type="Texture2D" uid="uid://ca72fiks8shb1" path="res://src/map/dungeon/models/Area 1/Antechamber/antechamberfix_hand-tiile.png" id="14_jlj58"]
[ext_resource type="Texture2D" uid="uid://c28llbem02swp" path="res://src/map/dungeon/models/Area 1/Antechamber/antechamberfix_mother.png" id="15_6k3r6"]
[ext_resource type="Texture2D" uid="uid://blvw30wlxtpoe" path="res://src/map/dungeon/models/Area 1/Antechamber/antechamberfix_brick3.png" id="16_ik7i4"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="17_25wvm"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="19_312b8"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_grsd5"]
@@ -982,9 +981,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.6143, -3.71027, 6.01731)
[node name="EnemySpawn3" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.9752, -3.71027, 11.0699)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("17_25wvm")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.749275, 2.10907, 0)
visible = false

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=19 format=3 uid="uid://tpgwccr6v43e"]
[gd_scene load_steps=18 format=3 uid="uid://tpgwccr6v43e"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="1_58osi"]
[ext_resource type="PackedScene" uid="uid://cljj515aklhoq" path="res://src/map/dungeon/models/Area 1/Tree/A1-Tree.glb" id="2_rr4cd"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="4_e73oq"]
[ext_resource type="Texture2D" uid="uid://ba7ch5rr7qj1d" path="res://src/minimap/textures/Room Maps/mi_treeante.png" id="7_hy27a"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="19_rlr0c"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_8p1kn"]
data = PackedVector3Array(-1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1)
@@ -127,9 +126,6 @@ shape = SubResource("ConcavePolygonShape3D_b3r1q")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.7193, 0)
visible = false
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("19_rlr0c")]
unique_name_in_owner = true
[node name="PlayerSpawn" type="Marker3D" parent="Spawn Points"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.0512, -1.7174, 7.47123)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=79 format=4 uid="uid://cam640h4euewx"]
[gd_scene load_steps=78 format=4 uid="uid://cam640h4euewx"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="1_5ni02"]
[ext_resource type="PackedScene" uid="uid://c67r6e54ilvyv" path="res://src/map/dungeon/models/Area 1/Pit/pitroomupdate.glb" id="2_7cn32"]
@@ -18,7 +18,6 @@
[ext_resource type="Texture2D" uid="uid://vhv41pmv2dmy" path="res://src/map/dungeon/models/Area 1/Pit/A1-Pit_COLUM6N.png" id="17_iclbf"]
[ext_resource type="Texture2D" uid="uid://ovs7bdpe4suy" path="res://src/map/dungeon/models/Area 1/Pit/A1-Pit_RAILING_1.png" id="18_3iqux"]
[ext_resource type="Texture2D" uid="uid://dnxtarg7i3ikm" path="res://src/map/dungeon/models/Area 1/Pit/A1-Pit_COLUMN.jpg" id="19_x5cao"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="19_yh0qc"]
[ext_resource type="Texture2D" uid="uid://bargm2u01ep8o" path="res://src/map/dungeon/models/Area 1/Pit/A1-Pit_reddertex.png" id="20_yf70i"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="23_vp6c3"]
@@ -1159,9 +1158,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 26.1398, -5.72487, 18)
[node name="Marker3D2" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.7689, -5.81234, 18)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("19_yh0qc")]
unique_name_in_owner = true
[node name="PlayerSpawn" type="Marker3D" parent="Spawn Points"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.23212, -1.76654, 7.753)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=78 format=4 uid="uid://b7111krf365x0"]
[gd_scene load_steps=77 format=4 uid="uid://b7111krf365x0"]
[ext_resource type="Texture2D" uid="uid://qhh3b8xbphqp" path="res://src/map/dungeon/models/Area 1/Balcony/A1-Balcony_HAND_CYCLE_MOTIF.png" id="2_81too"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_fedas"]
@@ -16,7 +16,6 @@
[ext_resource type="Texture2D" uid="uid://kwut1vlbx1qq" path="res://src/map/dungeon/models/Area 1/Balcony/A1-Balcony_FLOOR SYMBOL_1.png" id="13_2q6hq"]
[ext_resource type="Texture2D" uid="uid://ov8o8tsquobu" path="res://src/map/dungeon/models/Area 1/Balcony/A1-Balcony_RAILING_1.png" id="14_7ianf"]
[ext_resource type="Texture2D" uid="uid://ec4hmas2nfke" path="res://src/map/dungeon/models/Area 1/Balcony/A1-Balcony_COLUMN.jpg" id="15_lwn1c"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="15_n8s21"]
[ext_resource type="PackedScene" uid="uid://c7kxdcoruwrn0" path="res://src/map/dungeon/models/Area 1/Pit/balcony columns fixed.glb" id="16_1up8d"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="17_6jb2l"]
@@ -1032,9 +1031,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.516256, -0.306861, -0.3649
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.346, -0.5, -3.546)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("15_n8s21")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2, 0)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=63 format=4 uid="uid://ce0cjm6v7ct6c"]
[gd_scene load_steps=62 format=4 uid="uid://ce0cjm6v7ct6c"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_6xco5"]
[ext_resource type="Texture2D" uid="uid://bwdaaecc443lb" path="res://src/map/dungeon/models/Area 1/Corner Block/A1-CornerBlockRoom_COLUM6N.png" id="2_uoixu"]
@@ -19,7 +19,6 @@
[ext_resource type="Texture2D" uid="uid://cg3ox2rkc3skr" path="res://src/map/dungeon/models/Area 1/Corner Block/A1-CornerBlockRoom_reddertex.png" id="15_ukth6"]
[ext_resource type="Texture2D" uid="uid://ck8d6aggtgt08" path="res://src/map/dungeon/models/Area 1/Corner Block/A1-CornerBlockRoom_yellow_grunge_glass.png" id="16_fw4n7"]
[ext_resource type="Texture2D" uid="uid://dtioqtrjbves8" path="res://src/map/dungeon/models/Area 1/Corner Block/A1-CornerBlockRoom_brick_corridor_corrected.png" id="17_t7k6m"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="23_rhlsp"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_7e7it"]
resource_name = "COLUMN2"
@@ -755,9 +754,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25.114, 0.496096, 10.8555)
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 23.9514, -2.12568, -13.2894)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("23_rhlsp")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=43 format=4 uid="uid://b82dx66mgs2d7"]
[gd_scene load_steps=42 format=4 uid="uid://b82dx66mgs2d7"]
[ext_resource type="Texture2D" uid="uid://cynil12ridsej" path="res://src/map/dungeon/models/Area 1/Basin/A1-Basin_WALL TILE 1.jpg" id="2_ih385"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_pu81k"]
@@ -11,7 +11,6 @@
[ext_resource type="Texture2D" uid="uid://coi30a4n3tii8" path="res://src/map/dungeon/models/Area 1/Basin/A1-Basin_mother.png" id="8_tw45i"]
[ext_resource type="PackedScene" uid="uid://dtb275dc25uq7" path="res://src/map/dungeon/models/Area 1/Basin/basinfixes.glb" id="9_v3wyl"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="12_txn5d"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="18_bwap2"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_8hi54"]
resource_name = "WALL TILE"
@@ -444,9 +443,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17043, 1.6914, -0.0999985)
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.55, -2.55692, 0)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("18_bwap2")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
visible = false

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=75 format=4 uid="uid://c1qicmrcg6q6x"]
[gd_scene load_steps=74 format=4 uid="uid://c1qicmrcg6q6x"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_lij04"]
[ext_resource type="Texture2D" uid="uid://cs0x02prnkfl6" path="res://src/map/dungeon/models/Area 1/Column/A1-ColumnRoom_FLOOR1.jpg" id="2_v11dj"]
@@ -19,7 +19,6 @@
[ext_resource type="Texture2D" uid="uid://dlx4cunid83u2" path="res://src/map/dungeon/models/Area 1/Column/A1-ColumnRoom_mother.png" id="15_qim6e"]
[ext_resource type="Texture2D" uid="uid://broyvokrg41ka" path="res://src/map/dungeon/models/Area 1/Column/A1-ColumnRoom_brick3.png" id="16_xwwa5"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="19_kuo4k"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="24_i01sv"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mgwmo"]
resource_name = "FLOOR1"
@@ -979,9 +978,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.92822, -2, -6.40018)
[node name="EnemySpawn4" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.32741, -2, -3.41341)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("24_i01sv")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 0)

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=30 format=3 uid="uid://dfpyfpnya0f4u"]
[gd_scene load_steps=29 format=3 uid="uid://dfpyfpnya0f4u"]
[ext_resource type="PackedScene" uid="uid://dohedsn6xm54q" path="res://src/map/dungeon/models/Area 1/Water/WaterRoomFixs.glb" id="2_8fw5d"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_hbsbj"]
@@ -7,7 +7,6 @@
[ext_resource type="Texture2D" uid="uid://cbsdc4uthojov" path="res://src/map/assets/waternormal2.jpg" id="5_8py18"]
[ext_resource type="Texture2D" uid="uid://c1jomp8ljn482" path="res://src/minimap/textures/Room Maps/mi_water_room.png" id="5_f4tjo"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="8_7spr2"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="24_7qo1y"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_d8mjt"]
noise_type = 3
@@ -235,9 +234,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.21313, 2.20005, 0.264698)
[node name="EnemySpawn2" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5.77329, 2.00295, -18.2136)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("24_7qo1y")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
visible = false

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=19 format=3 uid="uid://cq82tqhlshn1k"]
[gd_scene load_steps=18 format=3 uid="uid://cq82tqhlshn1k"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_7fo8x"]
[ext_resource type="PackedScene" uid="uid://dycfeab5r3s1w" path="res://src/map/dungeon/models/Area 2/Pit/A2-Pit.glb" id="2_ycerh"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="5_6mfs2"]
[ext_resource type="Texture2D" uid="uid://psqcaww3ufpx" path="res://src/minimap/textures/Room Maps/mi_pit_room.png" id="6_xpqkd"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="19_y4v80"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4f64f"]
transparency = 1
@@ -167,9 +166,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.13979, -5.72487, 0)
[node name="Marker3D2" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.2311, -5.81234, 0)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("19_y4v80")]
unique_name_in_owner = true
[node name="PlayerSpawn" type="Marker3D" parent="Spawn Points"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.76788, -1.76654, -10.247)

View File

@@ -1,9 +1,8 @@
[gd_scene load_steps=19 format=3 uid="uid://d1uldtsv8u8vw"]
[gd_scene load_steps=18 format=3 uid="uid://d1uldtsv8u8vw"]
[ext_resource type="PackedScene" uid="uid://82gby88dqm0l" path="res://src/map/dungeon/models/Area 2/Fountain/A2-Fountain.glb" id="2_0wmhg"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_dp1b6"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="5_vt6li"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="11_31dr0"]
[ext_resource type="Material" uid="uid://b03wrq6l0mi15" path="res://src/map/assets/MinimapTexture.tres" id="14_b3vy3"]
[sub_resource type="BoxShape3D" id="BoxShape3D_beaee"]
@@ -141,9 +140,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25.114, 0.496096, 10.8555)
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 23.9514, -2.12568, -13.2894)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("11_31dr0")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0223598, 1.85308, 0.0241566)

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,8 @@
[gd_scene load_steps=21 format=3 uid="uid://dbfkpodwvxmfe"]
[gd_scene load_steps=20 format=3 uid="uid://dbfkpodwvxmfe"]
[ext_resource type="PackedScene" uid="uid://coxgcbcccj24q" path="res://src/map/dungeon/models/Area 2/Deadend/A2-Deadend.glb" id="2_3jq7h"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_dhi6g"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="5_xirjv"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="11_axa2u"]
[ext_resource type="Material" uid="uid://b03wrq6l0mi15" path="res://src/map/assets/MinimapTexture.tres" id="14_fdaog"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_uwyye"]
@@ -156,9 +155,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25.114, 0.496096, 10.8555)
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 23.9514, -2.12568, -13.2894)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("11_axa2u")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.98136, 0.155262)

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=24 format=3 uid="uid://b8tiuu3l181ke"]
[gd_scene load_steps=23 format=3 uid="uid://b8tiuu3l181ke"]
[ext_resource type="PackedScene" uid="uid://xahptbyj5wfn" path="res://src/map/dungeon/models/Area 2/Longroom/A2-Longroom.glb" id="2_kp5lh"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_oayuk"]
[ext_resource type="Texture2D" uid="uid://b8q6l0tl2383a" path="res://src/minimap/textures/Room Maps/mi_long_rooma2.png" id="5_erovx"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="6_7i5m1"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="15_wjalf"]
[ext_resource type="Texture2D" uid="uid://dvast710lxrmw" path="res://src/map/dungeon/door/A2_BLOCKED_DOOR.png" id="19_xb78s"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_djdya"]
@@ -256,9 +255,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25.114, 0.496096, 10.8555)
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 23.9514, -2.12568, -13.2894)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("15_wjalf")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.85377, 0)

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=19 format=3 uid="uid://5cstpejxygy6"]
[gd_scene load_steps=18 format=3 uid="uid://5cstpejxygy6"]
[ext_resource type="Script" uid="uid://dhollu4j3pynq" path="res://src/map/dungeon/code/MonsterRoom.cs" id="2_i2lux"]
[ext_resource type="PackedScene" uid="uid://bglktekocmksl" path="res://src/map/dungeon/models/Area 2/CircleColumn/A2-CircleColumn.glb" id="2_nqsfp"]
[ext_resource type="Texture2D" uid="uid://dw50ys561j8no" path="res://src/map/assets/DUST_1.png" id="6_vfp5g"]
[ext_resource type="Texture2D" uid="uid://bo32lieutx4fr" path="res://src/minimap/textures/Room Maps/mi_column_circle.png" id="7_be25c"]
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="15_28m48"]
[ext_resource type="Texture2D" uid="uid://dvast710lxrmw" path="res://src/map/dungeon/door/A2_BLOCKED_DOOR.png" id="19_p6lr6"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_jpe4o"]
@@ -219,9 +218,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25.114, 0.496096, 10.8555)
[node name="EnemySpawn1" type="Marker3D" parent="Spawn Points/EnemySpawnPoints"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 23.9514, -2.12568, -13.2894)
[node name="ItemDatabase" parent="Spawn Points" instance=ExtResource("15_28m48")]
unique_name_in_owner = true
[node name="Room" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.78544, 0)

View File

@@ -7,8 +7,7 @@ namespace Zennysoft.Game.Ma;
public interface IMainMenu : IControl
{
event MainMenu.NewGameEventHandler NewGame;
event MainMenu.LoadGameEventHandler LoadGame;
event MainMenu.StartGameEventHandler StartGame;
event MainMenu.EnemyViewerEventHandler EnemyViewer;
event MainMenu.GalleryEventHandler Gallery;
event MainMenu.QuitEventHandler Quit;
@@ -21,9 +20,7 @@ public partial class MainMenu : Control, IMainMenu
{
public override void _Notification(int what) => this.Notify(what);
[Node] public IButton NewGameButton { get; set; } = default!;
[Node] public IButton LoadGameButton { get; set; } = default!;
[Node] public IButton StartGameButton { get; set; } = default!;
[Node] public IButton EnemyViewerButton { get; set; } = default!;
@@ -32,9 +29,7 @@ public partial class MainMenu : Control, IMainMenu
[Node] public IButton QuitButton { get; set; } = default!;
[Signal]
public delegate void NewGameEventHandler();
[Signal]
public delegate void LoadGameEventHandler();
public delegate void StartGameEventHandler();
[Signal]
public delegate void EnemyViewerEventHandler();
[Signal]
@@ -44,32 +39,28 @@ public partial class MainMenu : Control, IMainMenu
public void OnReady()
{
NewGameButton.Pressed += OnNewGamePressed;
LoadGameButton.Pressed += OnLoadGamePressed;
StartGameButton.Pressed += OnStartGamePressed;
EnemyViewerButton.Pressed += EnemyViewerButton_Pressed;
GalleryButton.Pressed += GalleryButton_Pressed;
QuitButton.Pressed += OnQuitPressed;
NewGameButton.GrabFocus();
StartGameButton.GrabFocus();
}
public void FadeIn()
{
NewGameButton.GrabFocus();
StartGameButton.GrabFocus();
Show();
}
public void OnExitTree()
{
NewGameButton.Pressed -= OnNewGamePressed;
LoadGameButton.Pressed -= OnLoadGamePressed;
StartGameButton.Pressed -= OnStartGamePressed;
EnemyViewerButton.Pressed -= EnemyViewerButton_Pressed;
GalleryButton.Pressed -= GalleryButton_Pressed;
QuitButton.Pressed -= OnQuitPressed;
}
public void OnNewGamePressed() => EmitSignal(SignalName.NewGame);
public void OnLoadGamePressed() => EmitSignal(SignalName.LoadGame);
public void OnStartGamePressed() => EmitSignal(SignalName.StartGame);
private void GalleryButton_Pressed() => EmitSignal(SignalName.Gallery);

View File

@@ -39,25 +39,15 @@ size_flags_horizontal = 0
size_flags_vertical = 0
mouse_filter = 0
[node name="NewGameButton" type="Button" parent="MarginContainer/VBoxContainer"]
[node name="StartGameButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_bottom = NodePath("../LoadGameButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
text = "New Game"
[node name="LoadGameButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_top = NodePath("../NewGameButton")
focus_neighbor_bottom = NodePath("../EnemyViewerButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
text = "Load Game"
text = "Start Game"
[node name="EnemyViewerButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
focus_neighbor_top = NodePath("../LoadGameButton")
focus_neighbor_bottom = NodePath("../GalleryButton")
theme_override_colors/font_focus_color = Color(0.976471, 0.827451, 0, 1)
text = "Enemy Viewer"

View File

@@ -10,7 +10,7 @@ using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<PlayerData>>
public partial class Player : CharacterBody3D, IPlayer
{
#region Dependency Injection
public override void _Notification(int what) => this.Notify(what);
@@ -20,10 +20,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
[Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>(() => new GameRepo());
#endregion
#region Save
public ISaveChunk<PlayerData> PlayerChunk { get; set; } = default!;
#endregion
public IHealthComponent HealthComponent { get; private set; }
public IVTComponent VTComponent { get; private set; }
@@ -52,11 +48,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
#region Dependencies
[Dependency]
public IGame Game => this.DependOn<IGame>();
[Dependency]
public ISaveChunk<GameData> GameChunk => this.DependOn<ISaveChunk<GameData>>();
ISaveChunk<PlayerData> IProvide<ISaveChunk<PlayerData>>.Value() => PlayerChunk;
#endregion
#region Exports
@@ -136,19 +127,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
{
Settings = new PlayerLogic.Settings() { RotationSpeed = RotationSpeed, MoveSpeed = MoveSpeed, Acceleration = Acceleration };
PlayerChunk = new SaveChunk<PlayerData>(
onSave: (chunk) => new PlayerData()
{
Inventory = (Inventory)Inventory,
HealthComponent = (HealthComponent)HealthComponent
},
onLoad: (chunk, data) =>
{
Inventory = data.Inventory;
HealthComponent = data.HealthComponent;
}
);
PlayerBinding = PlayerLogic.Bind();
PlayerBinding
@@ -160,8 +138,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<ISaveChunk<Play
Move(output.delta);
});
GameChunk.AddChunk(PlayerChunk);
PlayerLogic.Start();
this.Provide();
}

View File

@@ -0,0 +1,24 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
public partial class QuestTest : Area3D
{
public override void _Notification(int what) => this.Notify(what);
[Dependency] public IGame Game => this.DependOn<IGame>();
public void OnResolved()
{
AreaEntered += QuestTest_AreaEntered;
if (Game.QuestData.QuestMarker1)
QueueFree();
}
private void QuestTest_AreaEntered(Area3D area)
{
Game.QuestData.QuestMarker1 = true;
}
}

View File

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