Compare commits

..

1 Commits

Author SHA1 Message Date
7979d215cd Reduce Sara sprite file size by 10x (30 MB -> 3MB) 2026-02-06 03:26:06 -08:00
9798 changed files with 59878 additions and 103500 deletions

View File

@@ -0,0 +1,8 @@
namespace Zennysoft.Game.Abstractions;
public interface IStackable
{
int Count { get; }
void SetCount(int count);
}

View File

@@ -2,5 +2,5 @@
public interface IHealthPack public interface IHealthPack
{ {
public int RestoreAmount { get; } public double RestoreAmount { get; }
} }

View File

@@ -47,8 +47,4 @@ public partial class DimmableAudioStreamPlayer3D : AudioStreamPlayer3D, IDimmabl
FADE_DURATION FADE_DURATION
).SetTrans(Tween.TransitionType.Circ).SetEase(ease); ).SetTrans(Tween.TransitionType.Circ).SetEase(ease);
} }
public override void _EnterTree() => FadeIn();
public override void _ExitTree() => FadeOut();
} }

View File

@@ -1,10 +0,0 @@
using Chickensoft.Collections;
namespace Zennysoft.Game.Implementation;
public interface IStackable
{
AutoProp<int> Count { get; }
void SetCount(int count);
}

View File

@@ -6,9 +6,6 @@ using System.IO.Abstractions;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization.Metadata; using System.Text.Json.Serialization.Metadata;
using Zennysoft.Game.Abstractions; using Zennysoft.Game.Abstractions;
using System.Threading.Tasks;
using System.IO;
using Zennysoft.Game.Ma;
namespace Zennysoft.Game.Implementation; namespace Zennysoft.Game.Implementation;
@@ -30,9 +27,9 @@ public class SaveFileManager : ISaveFileManager
public Task<T?> ReadFromFile<T>(params IJsonTypeInfoResolver?[] resolvers) public Task<T?> ReadFromFile<T>(params IJsonTypeInfoResolver?[] resolvers)
{ {
return !_fileSystem.File.Exists(_defaultSaveLocation) if (!_fileSystem.File.Exists(_defaultSaveLocation))
? throw new FileNotFoundException() throw new FileNotFoundException();
: ReadFromFile<T>(_defaultSaveLocation, resolvers); return ReadFromFile<T>(_defaultSaveLocation, resolvers);
} }
public async Task<T?> ReadFromFile<T>(string filePath, params IJsonTypeInfoResolver?[] resolvers) public async Task<T?> ReadFromFile<T>(string filePath, params IJsonTypeInfoResolver?[] resolvers)

View File

@@ -25,7 +25,7 @@ namespace Zennysoft.Ma.Adapter
int incomingDamage, int incomingDamage,
double elementalResistance) double elementalResistance)
{ {
var result = incomingDamage - (int)(incomingDamage * (elementalResistance / 100)); var result = incomingDamage - (int)(incomingDamage * elementalResistance);
return result; return result;
} }
} }

View File

@@ -9,6 +9,5 @@ public enum ElementType
Igneous, Igneous,
Ferrum, Ferrum,
Holy, Holy,
Curse,
All All
} }

View File

@@ -15,6 +15,4 @@ public interface IAttackComponent : IEntityComponent
public void SetAttack(int attack); public void SetAttack(int attack);
public void RaiseMaximumAttack(int raiseAmount); public void RaiseMaximumAttack(int raiseAmount);
public void LowerMaximumAttack(int lowerAmount);
} }

View File

@@ -15,6 +15,4 @@ public interface IDefenseComponent : IEntityComponent
public void SetDefense(int attack); public void SetDefense(int attack);
public void RaiseMaximumDefense(int raiseAmount); public void RaiseMaximumDefense(int raiseAmount);
public void LowerMaximumDefense(int lowerAmount);
} }

View File

@@ -1,26 +1,21 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using Zennysoft.Ma.Adapter.Entity; using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Ma.Adapter; namespace Zennysoft.Ma.Adapter;
public interface IEquipmentComponent : IEntityComponent public interface IEquipmentComponent : IEntityComponent
{ {
public IAutoProp<IWeapon> EquippedWeapon { get; } public IAutoProp<EquipableItem> EquippedWeapon { get; }
public IAutoProp<IArmor> EquippedArmor { get; } public IAutoProp<EquipableItem> EquippedArmor { get; }
public IAutoProp<IAccessory> EquippedAccessory { get; } public IAutoProp<EquipableItem> EquippedAccessory { get; }
public IAutoProp<IEquipableItem> EquippedAmmo { get; } public void Equip(EquipableItem equipable);
public void Equip(IEquipableItem equipable); public void Unequip(EquipableItem equipable);
public void Unequip(IEquipableItem equipable); public bool IsItemEquipped(InventoryItem item);
public bool IsItemEquipped(IEquipableItem item);
public void UpdateEquipment(IEquipableItem equipable);
public bool AugmentableEquipmentExists();
public int BonusAttack { get; } public int BonusAttack { get; }
@@ -34,5 +29,5 @@ public interface IEquipmentComponent : IEntityComponent
public ElementalResistanceSet ElementalResistance { get; } public ElementalResistanceSet ElementalResistance { get; }
public event Action<IEquipableItem> EquipmentChanged; public event Action<EquipableItem> EquipmentChanged;
} }

View File

@@ -12,17 +12,9 @@ public interface IExperiencePointsComponent : IEntityComponent
public IAutoProp<int> Level { get; } public IAutoProp<int> Level { get; }
public void ModifyExpGainRate(double newRate);
public void Gain(int baseExpGain); public void Gain(int baseExpGain);
public void GainUnmodified(int flateRateExpGain);
public void LevelUp(); public void LevelUp();
public void LevelDown();
public event Action PlayerLevelUp; public event Action PlayerLevelUp;
public event Action PlayerLevelDown;
} }

View File

@@ -22,6 +22,4 @@ public interface IHealthComponent : IEntityComponent
public void SetMaximumHealth(int health); public void SetMaximumHealth(int health);
public void RaiseMaximumHP(int raiseAmount, bool restoreHP = false); public void RaiseMaximumHP(int raiseAmount, bool restoreHP = false);
public void LowerMaximumHP(int lowerAmount);
} }

View File

@@ -1,13 +0,0 @@
using Chickensoft.Collections;
using Godot;
using Zennysoft.Ma.Adapter;
public interface IStatusEffectComponent : IEntityComponent
{
[Export] public double RustDuration { get; set; }
public AutoProp<bool> Rust { get; }
public bool ImmuneToRust { get; set; }
}

View File

@@ -4,11 +4,7 @@ namespace Zennysoft.Ma.Adapter;
public interface ILuckComponent : IEntityComponent public interface ILuckComponent : IEntityComponent
{ {
public int InitialLuck { get; }
public IAutoProp<int> Luck { get; } public IAutoProp<int> Luck { get; }
public void IncreaseLuck(int value); public void IncreaseLuck(int value);
void DecreaseLuck(int value);
} }

View File

@@ -18,7 +18,5 @@ public interface IVTComponent : IEntityComponent
public void RaiseMaximumVT(int raiseAmount, bool restoreVT = true); public void RaiseMaximumVT(int raiseAmount, bool restoreVT = true);
public void LowerMaximumVT(int lowerAmount);
public void SetMaximumVT(int vt); public void SetMaximumVT(int vt);
} }

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3 uid="uid://c7e5g8l6wuph"]
[ext_resource type="Script" path="res://src/enemy/behaviors/PatrolBehavior.cs" id="1_lobva"] [ext_resource type="Script" uid="uid://87d8kluait8y" path="res://src/enemy/behaviors/PatrolBehavior.cs" id="1_lobva"]
[node name="NavigationAgent" type="NavigationAgent3D"] [node name="NavigationAgent" type="NavigationAgent3D"]
avoidance_enabled = true avoidance_enabled = true

View File

@@ -7,9 +7,9 @@ namespace Zennysoft.Ma.Adapter.Entity
[Save("elemental_resist_set")] [Save("elemental_resist_set")]
public Dictionary<ElementType, double> ElementalResistance { get; } public Dictionary<ElementType, double> ElementalResistance { get; }
public static ElementalResistanceSet None => new ElementalResistanceSet(0, 0, 0, 0, 0, 0, 0); public static ElementalResistanceSet None => new ElementalResistanceSet(0, 0, 0, 0, 0, 0);
public ElementalResistanceSet(double aeolicResistance, double hydricResistance, double igneousResistance, double ferrumResistance, double telluricResistance, double holyResistance, double curseResistance) public ElementalResistanceSet(double aeolicResistance, double hydricResistance, double igneousResistance, double ferrumResistance, double telluricResistance, double holyResistance)
{ {
ElementalResistance = new Dictionary<ElementType, double> ElementalResistance = new Dictionary<ElementType, double>
{ {
@@ -20,8 +20,7 @@ namespace Zennysoft.Ma.Adapter.Entity
{ ElementType.Ferrum, ferrumResistance }, { ElementType.Ferrum, ferrumResistance },
{ ElementType.Telluric, telluricResistance }, { ElementType.Telluric, telluricResistance },
{ ElementType.Holy, holyResistance }, { ElementType.Holy, holyResistance },
{ ElementType.Curse, curseResistance }, { ElementType.All, aeolicResistance + hydricResistance + igneousResistance + ferrumResistance + telluricResistance + holyResistance },
{ ElementType.All, aeolicResistance + hydricResistance + igneousResistance + ferrumResistance + telluricResistance + holyResistance + curseResistance },
}; };
} }
@@ -33,8 +32,7 @@ namespace Zennysoft.Ma.Adapter.Entity
left.ElementalResistance[ElementType.Igneous] + right.ElementalResistance[ElementType.Igneous], left.ElementalResistance[ElementType.Igneous] + right.ElementalResistance[ElementType.Igneous],
left.ElementalResistance[ElementType.Ferrum] + right.ElementalResistance[ElementType.Ferrum], left.ElementalResistance[ElementType.Ferrum] + right.ElementalResistance[ElementType.Ferrum],
left.ElementalResistance[ElementType.Telluric] + right.ElementalResistance[ElementType.Telluric], left.ElementalResistance[ElementType.Telluric] + right.ElementalResistance[ElementType.Telluric],
left.ElementalResistance[ElementType.Holy] + right.ElementalResistance[ElementType.Holy], left.ElementalResistance[ElementType.Holy] + right.ElementalResistance[ElementType.Holy]);
left.ElementalResistance[ElementType.Curse] + right.ElementalResistance[ElementType.Curse]);
} }
} }
} }

View File

@@ -31,8 +31,6 @@ namespace Zennysoft.Ma.Adapter.Entity
public IDefenseComponent DefenseComponent { get; } public IDefenseComponent DefenseComponent { get; }
public IStatusEffectComponent StatusEffectComponent { get; }
public ElementalResistanceSet ElementalResistanceSet { get; } public ElementalResistanceSet ElementalResistanceSet { get; }
public int InitialHP { get; } public int InitialHP { get; }

View File

@@ -1,11 +0,0 @@
namespace Zennysoft.Ma.Adapter;
public enum SpellFXEnum
{
AnBradan,
DivinityRecall,
ItemBreak,
Kyuuketsuki,
Persiko,
Radial
}

View File

@@ -1,204 +0,0 @@
using Godot;
using Zennysoft.Ma.Adapter;
public class Augment
{
public JewelTags AugmentTag;
public Augment(JewelTags tag, IAugmentType augment, string name, string description, Texture2D augmentTexture)
{
AugmentTag = tag;
AugmentName = name;
AugmentType = augment;
AugmentDescription = description;
AugmentTexture = augmentTexture;
}
public IAugmentType AugmentType { get; set; }
public string AugmentName { get; set; }
public string AugmentDescription { get; set; }
public Texture2D AugmentTexture { get; set; }
}
public class HPRecoverySpeedAugment : IAugmentType
{
private readonly IPlayer _player;
public HPRecoverySpeedAugment(IPlayer player)
{
_player = player;
}
public void Apply() => _player.HealthTimerHPRate += 2;
public void Remove() => _player.HealthTimerHPRate -= 2;
}
public class BasicAugment : IAugmentType
{
public void Apply()
{
// do nothing
}
public void Remove()
{
// do nothing
}
}
public class HastenVTAugment : IAugmentType
{
private readonly IPlayer _player;
public HastenVTAugment(IPlayer player)
{
_player = player;
}
public void Apply() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier + 0.25f);
public void Remove() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier - 0.25f);
}
public class SlowVTReductionAugment : IAugmentType
{
private readonly IPlayer _player;
public SlowVTReductionAugment(IPlayer player)
{
_player = player;
}
public void Apply() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier - 0.25f);
public void Remove() => _player.ModifyHealthTimerSpeed(_player.HealthTimerSpeedModifier + 0.25f);
}
public class IncreaseEXPRateAugment : IAugmentType
{
private readonly IPlayer _player;
public IncreaseEXPRateAugment(IPlayer player)
{
_player = player;
}
public void Apply() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value + 0.25f);
public void Remove() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value - 0.25f);
}
public class LowerEXPRateAugment : IAugmentType
{
private readonly IPlayer _player;
public LowerEXPRateAugment(IPlayer player)
{
_player = player;
}
public void Apply() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value - 0.25f);
public void Remove() => _player.ExperiencePointsComponent.ModifyExpGainRate(_player.ExperiencePointsComponent.ExpGainRate.Value + 0.25f);
}
public class BoostStatsAugment : IAugmentType
{
private readonly IPlayer _player;
private readonly int _bonusLuck;
private readonly int _bonusHp;
private readonly int _bonusVt;
public BoostStatsAugment(IPlayer player, int bonusLuck, int bonusHp, int bonusVt)
{
_player = player;
_bonusLuck = bonusLuck;
_bonusHp = bonusHp;
_bonusVt = bonusVt;
}
public void Apply()
{
_player.HealthComponent.RaiseMaximumHP(_bonusHp);
_player.VTComponent.RaiseMaximumVT(_bonusVt);
_player.LuckComponent.IncreaseLuck(_bonusLuck);
}
public void Remove()
{
}
}
public class LowerHPRecoveryAugment : IAugmentType
{
private readonly IPlayer _player;
public LowerHPRecoveryAugment(IPlayer player)
{
_player = player;
}
public void Apply() => _player.HealthTimerHPRate -= 1;
public void Remove() => _player.HealthTimerHPRate += 1;
}
public class IdentifyAllItemsAugment : IAugmentType
{
private readonly IPlayer _player;
public IdentifyAllItemsAugment(IPlayer player)
{
_player = player;
}
public void Apply()
{
_player.AutoIdentifyItems = true;
foreach (var item in _player.Inventory.Items.ToList())
{
if (item.ItemTag == ItemTag.MysteryItem)
_player.IdentifyItem(item);
}
}
public void Remove()
{
var weaponAugment = _player.EquipmentComponent.EquippedWeapon.Value.Augment;
var armorAugment = _player.EquipmentComponent.EquippedArmor.Value.Augment;
var accessoryAugment = _player.EquipmentComponent.EquippedAccessory.Value.Augment;
var augments = new List<Augment?>() { weaponAugment, armorAugment, accessoryAugment };
if (augments.Count(x => x != null && x.AugmentTag == JewelTags.AutoIdentifyAllItems) > 1)
return;
else
_player.AutoIdentifyItems = false;
}
}
public class RevivePlayerAugment : IAugmentType
{
private readonly IPlayer _player;
public RevivePlayerAugment(IPlayer player)
{
_player = player;
}
public void Apply()
{
_player.AutoRevive = true;
}
public void Remove()
{
var weaponAugment = _player.EquipmentComponent.EquippedWeapon.Value.Augment;
var armorAugment = _player.EquipmentComponent.EquippedArmor.Value.Augment;
var accessoryAugment = _player.EquipmentComponent.EquippedAccessory.Value.Augment;
var augments = new List<Augment?>() { weaponAugment, armorAugment, accessoryAugment };
if (augments.Count(x => x != null && x.AugmentTag == JewelTags.ReviveUserOnce) > 1)
return;
else
_player.AutoRevive = false;
}
}

View File

@@ -0,0 +1,22 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Ma.Adapter;
[Meta, Id("equipable_item")]
public abstract partial class EquipableItem : InventoryItem
{
[Save("bonus_attack_stats")]
public virtual int BonusAttack { get; }
[Save("bonus_defense_stats")]
public virtual int BonusDefense { get; }
[Save("bonus_hp_stats")]
public virtual int BonusHP { get; }
[Save("bonus_vt_stats")]
public virtual int BonusVT { get; }
[Save("bonus_luck_stats")]
public virtual int BonusLuck { get; }
[Save("bonus_elemental_resist_stats")]
public virtual ElementalResistanceSet ElementalResistance { get; } = new ElementalResistanceSet(0, 0, 0, 0, 0, 0);
}

View File

@@ -1,6 +0,0 @@
public interface IAugmentType
{
void Apply();
void Remove();
}

View File

@@ -0,0 +1,26 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
namespace Zennysoft.Ma.Adapter;
[Meta, Id("inventory_item")]
public abstract partial class InventoryItem : Node3D
{
[Save("inventory_item_id")]
public Guid ID => Guid.NewGuid();
[Save("inventory_item_name")]
public abstract string ItemName { get; }
[Save("inventory_item_description")]
public abstract string Description { get; }
[Save("inventory_item_spawn_rate")]
public abstract float SpawnRate { get; }
[Save("inventory_item_throw_damage")]
public abstract int ThrowDamage { get; }
[Save("inventory_item_throw_speed")]
public abstract float ThrowSpeed { get; }
[Save("inventory_item_tag")]
public abstract ItemTag ItemTag { get; }
public abstract Texture2D GetTexture();
}

View File

@@ -4,6 +4,5 @@ public enum AccessoryTag
{ {
None, None,
HalfVTConsumption, HalfVTConsumption,
StatusEffectImmunity, StatusEffectImmunity
BoostEXPGainRate
} }

View File

@@ -1,7 +0,0 @@
namespace Zennysoft.Ma.Adapter;
public enum ArmorTag
{
None,
DegradeOnHit
}

View File

@@ -3,7 +3,7 @@
public enum ItemTag public enum ItemTag
{ {
None, None,
BreaksOnFloorExit, BreaksOnChange,
MysteryItem, MysteryItem,
DamagesPlayer, DamagesPlayer,
ContainsRestorative, ContainsRestorative,
@@ -20,8 +20,5 @@ public enum ItemTag
RestrictUnequip, RestrictUnequip,
UnequipAllItems, UnequipAllItems,
EjectAllItems, EjectAllItems,
UseAllItems, UseAllItems
GlueOnEquip,
BreaksOnUnequip,
ContainsJewel
} }

View File

@@ -1,21 +0,0 @@
public enum JewelTags
{
None,
AeolicElement,
IncreaseHPRecovery,
HastenVT,
LowerEXPGain,
Glue,
ItemRescue,
HydricElement,
IgneousElement,
IncreaseEXPGain,
LowerHPRecovery,
SlowVTReduction,
AutoIdentifyAllItems,
ReviveUserOnce,
TelluricElement,
IncreaseAtkDefLuck,
IncreaseLuck
}

View File

@@ -0,0 +1,11 @@
namespace Zennysoft.Ma.Adapter;
public enum ThrowableItemTag
{
None,
DoubleExp,
LowerTargetTo1HP,
CanChangeAffinity,
TeleportToRandomLocation,
WarpToExitIfFound
}

View File

@@ -14,26 +14,6 @@ public enum UsableItemTag
DealElementalDamageToAllEnemiesInRoom, DealElementalDamageToAllEnemiesInRoom,
RaiseCurrentWeaponAttack, RaiseCurrentWeaponAttack,
RaiseCurrentDefenseArmor, RaiseCurrentDefenseArmor,
LowerCurrentDefenseArmor,
RaiseLevel, RaiseLevel,
LowerLevel,
RandomEffect, RandomEffect,
DoubleExp,
LowerTargetTo1HP,
CanChangeAffinity,
TeleportToRandomLocation,
WarpToExitIfFound,
IncreaseDefense,
IncreaseLuck,
IncreaseAttack,
DecreaseDefense,
DecreaseLuck,
DecreaseAttack,
DecreaseAllStats,
Clone,
MeltAllEquipment,
RestoreStats,
GlueAllEquipment,
DoubleStackedItems,
IdentifyRandomItem
} }

View File

@@ -8,11 +8,5 @@ public enum WeaponTag
IgnoreDefense, IgnoreDefense,
Knockback, Knockback,
InverseHPAttackPower, InverseHPAttackPower,
RustChanceSelfAndEnemy, RustChanceSelfAndEnemy
Instakill,
DegradeOnSwing,
DoubleAttack,
TripleAttack,
ElementalProjectile,
KineticProjectile
} }

View File

@@ -2,7 +2,6 @@
using Godot; using Godot;
using Zennysoft.Game.Abstractions; using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Implementation; using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Ma.Adapter; namespace Zennysoft.Ma.Adapter;
@@ -16,13 +15,23 @@ public interface IGameRepo : IDisposable
event Action<string>? AnnounceMessageInInventoryEvent; event Action<string>? AnnounceMessageInInventoryEvent;
event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent; event Action<int>? DoubleExpTimeStart;
event Action<IEquipableItem>? EquippedItem; event Action? DoubleExpTimeEnd;
event Action<IEquipableItem>? UnequippedItem; event Action<InventoryItem>? RemoveItemFromInventoryEvent;
event Action<IEnemy>? EnemyDied; event Action? PlayerAttack;
event Action? PlayerAttackedWall;
event Action? PlayerAttackedEnemy;
event Action<EquipableItem>? EquippedItem;
event Action<EquipableItem>? UnequippedItem;
event Action<IHealthPack>? RestorativePickedUp;
void Pause(); void Pause();
@@ -30,21 +39,31 @@ public interface IGameRepo : IDisposable
IAutoProp<bool> IsPaused { get; } IAutoProp<bool> IsPaused { get; }
public void StartDoubleEXP(TimeSpan lengthOfEffect);
public void EndDoubleExp();
public void AnnounceMessageOnMainScreen(string message); public void AnnounceMessageOnMainScreen(string message);
public void AnnounceMessageInInventory(string message); public void AnnounceMessageInInventory(string message);
public void RemoveItemFromInventory(IBaseInventoryItem item); public void RemoveItemFromInventory(InventoryItem item);
public void OnPlayerAttack();
public void OnPlayerAttackedWall();
public void OnRestorativePickedUp(IHealthPack restorative);
public void CloseInventory(); public void CloseInventory();
public void GameEnded(); public void GameEnded();
public void OnEquippedItem(IEquipableItem item); public void OnEquippedItem(EquipableItem item);
public void OnUnequippedItem(IEquipableItem item); public void OnUnequippedItem(EquipableItem item);
public void OnEnemyDied(IEnemy enemy); public double ExpRate { get; }
} }
public class GameRepo : IGameRepo public class GameRepo : IGameRepo
@@ -53,18 +72,26 @@ public class GameRepo : IGameRepo
public event Action? CloseInventoryEvent; public event Action? CloseInventoryEvent;
public event Action<string>? AnnounceMessageOnMainScreenEvent; public event Action<string>? AnnounceMessageOnMainScreenEvent;
public event Action<string>? AnnounceMessageInInventoryEvent; public event Action<string>? AnnounceMessageInInventoryEvent;
public event Action<IBaseInventoryItem>? RemoveItemFromInventoryEvent; public event Action<int>? DoubleExpTimeStart;
public event Action<IEquipableItem>? EquippedItem; public event Action? DoubleExpTimeEnd;
public event Action<IEquipableItem>? UnequippedItem; public event Action<InventoryItem>? RemoveItemFromInventoryEvent;
public event Action<IEnemy>? EnemyDied; public event Action? PlayerAttack;
public event Action? PlayerAttackedWall;
public event Action? PlayerAttackedEnemy;
public event Action<EquipableItem>? EquippedItem;
public event Action<EquipableItem>? UnequippedItem;
public event Action<IHealthPack>? RestorativePickedUp;
public IAutoProp<bool> IsPaused => _isPaused; public IAutoProp<bool> IsPaused => _isPaused;
private readonly AutoProp<bool> _isPaused; private readonly AutoProp<bool> _isPaused;
public double ExpRate { get; private set; }
private bool _disposedValue; private bool _disposedValue;
public GameRepo() public GameRepo()
{ {
_isPaused = new AutoProp<bool>(true); _isPaused = new AutoProp<bool>(true);
ExpRate = 1;
} }
public void Pause() public void Pause()
@@ -79,6 +106,20 @@ public class GameRepo : IGameRepo
GD.Print("Resume"); GD.Print("Resume");
} }
public void StartDoubleEXP(TimeSpan lengthOfEffect)
{
AnnounceMessageInInventory("Experience points temporarily doubled.");
DoubleExpTimeStart?.Invoke(lengthOfEffect.Seconds);
ExpRate = 2;
}
public void EndDoubleExp()
{
AnnounceMessageOnMainScreen("Experience points effect wore off.");
DoubleExpTimeEnd?.Invoke();
ExpRate = 1;
}
public void AnnounceMessageOnMainScreen(string message) public void AnnounceMessageOnMainScreen(string message)
{ {
AnnounceMessageOnMainScreenEvent?.Invoke(message); AnnounceMessageOnMainScreenEvent?.Invoke(message);
@@ -89,21 +130,34 @@ public class GameRepo : IGameRepo
AnnounceMessageInInventoryEvent?.Invoke(message); AnnounceMessageInInventoryEvent?.Invoke(message);
} }
public void RemoveItemFromInventory(IBaseInventoryItem item) public void RemoveItemFromInventory(InventoryItem item)
{ {
RemoveItemFromInventoryEvent?.Invoke(item); RemoveItemFromInventoryEvent?.Invoke(item);
} }
public void OnPlayerAttack()
{
PlayerAttack?.Invoke();
}
public void OnPlayerAttackedWall()
{
PlayerAttackedWall?.Invoke();
}
public void OnRestorativePickedUp(IHealthPack restorative)
{
RestorativePickedUp?.Invoke(restorative);
}
public void CloseInventory() public void CloseInventory()
{ {
CloseInventoryEvent?.Invoke(); CloseInventoryEvent?.Invoke();
} }
public void OnEquippedItem(IEquipableItem item) => EquippedItem?.Invoke(item); public void OnEquippedItem(EquipableItem item) => EquippedItem?.Invoke(item);
public void OnUnequippedItem(IEquipableItem item) => UnequippedItem?.Invoke(item); public void OnUnequippedItem(EquipableItem item) => UnequippedItem?.Invoke(item);
public void OnEnemyDied(IEnemy enemy) => EnemyDied?.Invoke(enemy);
public void GameEnded() public void GameEnded()
{ {

View File

@@ -8,20 +8,13 @@ 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 GameOver : InGame, IGet<Input.NewGame>, IGet<Input.ExitGame> public partial record GameOver : State, IGet<Input.NewGame>
{ {
public Transition On(in Input.NewGame input) public Transition On(in Input.NewGame input)
{ {
Output(new Output.InitializeGame()); Output(new Output.InitializeGame());
return To<InGame>(); return To<InGame>();
} }
public Transition On(in Input.ExitGame input)
{
Output(new Output.ClosePauseScreen());
Output(new Output.ExitGame());
return To<State>();
}
} }
} }
} }

View File

@@ -1,5 +0,0 @@
using Zennysoft.Ma.Adapter;
public interface IAccessory : IEquipableItem, IAugmentableItem
{
}

View File

@@ -1,10 +0,0 @@
using Zennysoft.Ma.Adapter;
public interface IArmor : IEquipableItem, IAugmentableItem
{
public void IncreaseArmorDefense(int bonus);
public void DecreaseArmorDefense(int lowerAmount);
public ArmorTag ArmorTag { get; }
}

View File

@@ -1,5 +0,0 @@
public interface IAugmentItem : IBaseInventoryItem
{
public IAugmentType Augment { get; }
}

View File

@@ -1,7 +0,0 @@
namespace Zennysoft.Ma.Adapter
{
public interface IAugmentableItem
{
public Augment? Augment { get; }
}
}

View File

@@ -1,16 +0,0 @@
using Godot;
using Zennysoft.Ma.Adapter;
public interface IBaseInventoryItem
{
public string ItemName { get; }
public string StatDescription { get; }
public string FlavorText { get; }
public float SpawnRate { get; }
public int ThrowDamage { get; }
public float ThrowSpeed { get; }
public ItemTag ItemTag { get; }
public abstract Texture2D GetTexture();
}

View File

@@ -4,6 +4,6 @@
{ {
void RescueItem(); void RescueItem();
public IBaseInventoryItem Item { get; } public InventoryItem Item { get; }
} }
} }

View File

@@ -1,14 +0,0 @@
using Zennysoft.Ma.Adapter.Entity;
public interface IEquipableItem : IBaseInventoryItem
{
public int BonusAttack { get; }
public int BonusDefense { get; }
public int BonusHP { get; }
public int BonusVT { get; }
public int BonusLuck { get; }
public bool Glued { get; set; }
public ElementalResistanceSet ElementalResistance { get; }
}

View File

@@ -2,19 +2,17 @@
public interface IInventory public interface IInventory
{ {
public bool PickUpItem(IBaseInventoryItem item); public bool PickUpItem(InventoryItem item);
public List<IBaseInventoryItem> Items { get; } public List<InventoryItem> Items { get; }
public bool TryAdd(IBaseInventoryItem inventoryItem); public bool TryAdd(InventoryItem inventoryItem);
public bool TryInsert(IBaseInventoryItem inventoryItem, int index); public bool TryInsert(InventoryItem inventoryItem, int index);
public void Remove(IBaseInventoryItem inventoryItem); public void Remove(InventoryItem inventoryItem);
public bool Sort(IWeapon currentWeapon, IArmor currentArmor, IAccessory currentAccessory, IEquipableItem ammo); public bool Sort(EquipableItem currentWeapon, EquipableItem currentArmor, EquipableItem currentAccessory);
public bool AtCapacity();
public event Action<string> BroadcastMessage; public event Action<string> BroadcastMessage;
public event Action InventoryChanged; public event Action InventoryChanged;

View File

@@ -2,5 +2,5 @@
public interface IThrownItem public interface IThrownItem
{ {
public IBaseInventoryItem ItemThatIsThrown { get; set; } public InventoryItem ItemThatIsThrown { get; set; }
} }

View File

@@ -1,5 +0,0 @@
using Zennysoft.Ma.Adapter;
public interface IWeapon : IEquipableItem, IAugmentableItem
{
}

View File

@@ -1,38 +1,16 @@
using Chickensoft.Serialization; using Chickensoft.Introspection;
using Chickensoft.Serialization;
namespace Zennysoft.Ma.Adapter; namespace Zennysoft.Ma.Adapter;
public class RescuedItemDatabase [Meta, Id("rescued_items")]
public partial class RescuedItemDatabase
{ {
[Save("rescued_item_list")] [Save("rescued_item_list")]
private List<IBaseInventoryItem> _items { get; init; } public List<InventoryItem> Items { get; init; }
private int _maxSize { get; init; } = 20;
public RescuedItemDatabase(int maxSize) public RescuedItemDatabase()
{ {
_items = []; Items = new List<InventoryItem>();
_maxSize = maxSize;
} }
public RescuedItemDatabase(List<IBaseInventoryItem> items, int maxSize)
{
_items = items;
_maxSize = maxSize;
}
public bool TryAdd(IBaseInventoryItem item)
{
if (_items.Count >= _maxSize)
return false;
if (item is IEquipableItem equipable)
equipable.Glued = false;
_items.Add(item);
return true;
}
public void Remove(IBaseInventoryItem item) => _items.Remove(item);
public List<IBaseInventoryItem> GetItems() => _items;
public void Clear() => _items.Clear();
} }

View File

@@ -11,6 +11,9 @@ public partial class ItemTagEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(AccessoryTag))] [JsonSerializable(typeof(AccessoryTag))]
public partial class AccessoryTagEnumContext : JsonSerializerContext; public partial class AccessoryTagEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(ThrowableItemTag))]
public partial class ThrowableItemTagEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(UsableItemTag))] [JsonSerializable(typeof(UsableItemTag))]
public partial class UsableItemTagEnumContext : JsonSerializerContext; public partial class UsableItemTagEnumContext : JsonSerializerContext;
@@ -19,18 +22,3 @@ public partial class BoxItemTagEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(ElementType))] [JsonSerializable(typeof(ElementType))]
public partial class ElementTypeEnumContext : JsonSerializerContext; public partial class ElementTypeEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(JewelTags))]
public partial class JewelTagsEnumContext : JsonSerializerContext;
[JsonSerializable(typeof(IBaseInventoryItem))]
public partial class BaseInventoryItemContext : JsonSerializerContext
{
}
[JsonSerializable(typeof(RescuedItemDatabase))]
public partial class RescuedItemDatabaseContext : JsonSerializerContext
{
}

View File

@@ -11,5 +11,7 @@ public interface IDungeonFloor : INode3D
public ImmutableList<IDungeonRoom> Rooms { get; } public ImmutableList<IDungeonRoom> Rooms { get; }
public void FadeOutAudio();
public bool FloorIsLoaded { get; set; } public bool FloorIsLoaded { get; set; }
} }

View File

@@ -10,6 +10,8 @@ public class Module
public static void Bootstrap(Container container) public static void Bootstrap(Container container)
{ {
container.RegisterSingleton<IFileSystem, FileSystem>(); container.RegisterSingleton<IFileSystem, FileSystem>();
container.RegisterSingleton<ISaveFileManager, SaveFileManager>();
container.RegisterSingleton<IMaSaveFileManager, MaSaveFileManager>();
container.RegisterSingleton<IGameRepo, GameRepo>(); container.RegisterSingleton<IGameRepo, GameRepo>();
container.RegisterSingleton<IGameState, GameState>(); container.RegisterSingleton<IGameState, GameState>();
container.RegisterSingleton<IDimmableAudioStreamPlayer, DimmableAudioStreamPlayer>(); container.RegisterSingleton<IDimmableAudioStreamPlayer, DimmableAudioStreamPlayer>();

View File

@@ -20,16 +20,12 @@ public interface IPlayer : IKillable, ICharacterBody3D
public void TeleportPlayer((Vector3 Rotation, Vector3 Position) newTransform); public void TeleportPlayer((Vector3 Rotation, Vector3 Position) newTransform);
public void Equip(IEquipableItem equipable); public void Equip(EquipableItem equipable);
public void Unequip(IEquipableItem equipable); public void Unequip(EquipableItem equipable);
public void PlayJumpScareAnimation(); public void PlayJumpScareAnimation();
public void ApplyNewAugment(IAugmentItem jewel, IAugmentableItem equipableItem);
public IBaseInventoryItem IdentifyItem(IBaseInventoryItem unidentifiedItem);
public IInventory Inventory { get; } public IInventory Inventory { get; }
public IHealthComponent HealthComponent { get; } public IHealthComponent HealthComponent { get; }
@@ -46,26 +42,10 @@ public interface IPlayer : IKillable, ICharacterBody3D
public IEquipmentComponent EquipmentComponent { get; } public IEquipmentComponent EquipmentComponent { get; }
public IStatusEffectComponent StatusEffectComponent { get; }
public void SetHealthTimerStatus(bool isActive); public void SetHealthTimerStatus(bool isActive);
public void ModifyHealthTimerSpeed(float newModifier); public bool CanEquipState { get; set; }
public void PlaySpellFX(SpellFXEnum spellEnum);
public bool AutoRevive { get; set; }
public int TotalAttack { get; }
public int TotalDefense { get; }
public int TotalLuck { get; }
public int HealthTimerHPRate { get; set; }
public float HealthTimerSpeedModifier { get; }
public bool AutoIdentifyItems { get; set; }
public event Action PlayerDied; public event Action PlayerDied;
public delegate IBaseInventoryItem RerollItem(IBaseInventoryItem item); public delegate InventoryItem RerollItem(InventoryItem item);
} }

View File

@@ -8,6 +8,8 @@ public partial class PlayerLogic
{ {
public readonly record struct PhysicsTick(double Delta); public readonly record struct PhysicsTick(double Delta);
public readonly record struct Moved(Vector3 GlobalPosition, Transform3D GlobalTransform);
public readonly record struct Enable; public readonly record struct Enable;
public readonly record struct Attack; public readonly record struct Attack;

View File

@@ -0,0 +1,31 @@
using System.Collections.Immutable;
using System.Text.Json.Serialization.Metadata;
using Zennysoft.Game.Abstractions;
namespace Zennysoft.Ma.Adapter;
public interface IMaSaveFileManager
{
Task Save<T>(T gameData);
Task<T?> Load<T>();
}
public sealed class MaSaveFileManager : IMaSaveFileManager
{
private readonly ISaveFileManager _saveFileManager;
private ImmutableList<IJsonTypeInfoResolver> _converters;
public MaSaveFileManager(ISaveFileManager saveFileManager)
{
_saveFileManager = saveFileManager;
_converters = [WeaponTagEnumContext.Default, ItemTagEnumContext.Default, ElementTypeEnumContext.Default, AccessoryTagEnumContext.Default, ThrowableItemTagEnumContext.Default, UsableItemTagEnumContext.Default, BoxItemTagEnumContext.Default];
}
public async Task Save<T>(T gameData)
{
await _saveFileManager.WriteToFile(gameData, [.. _converters]);
}
public async Task<T?> Load<T>() => await _saveFileManager.ReadFromFile<T>([.. _converters]);
}

View File

@@ -38,7 +38,7 @@ public partial class InGameUILogic
Output(new Output.AnnounceMessageInInventory(message)); Output(new Output.AnnounceMessageInInventory(message));
} }
private void OnRemoveItemFromInventory(IBaseInventoryItem item) => Output(new Output.RemoveItemFromInventory(item)); private void OnRemoveItemFromInventory(InventoryItem item) => Output(new Output.RemoveItemFromInventory(item));
} }
} }

View File

@@ -8,7 +8,7 @@ public partial class InGameUILogic
{ {
public readonly record struct AnnounceMessageOnMainScreen(string Message); public readonly record struct AnnounceMessageOnMainScreen(string Message);
public readonly record struct AnnounceMessageInInventory(string Message); public readonly record struct AnnounceMessageInInventory(string Message);
public readonly record struct RemoveItemFromInventory(IBaseInventoryItem Item); public readonly record struct RemoveItemFromInventory(InventoryItem Item);
public readonly record struct ShowInventory; public readonly record struct ShowInventory;
public readonly record struct HideInventory; public readonly record struct HideInventory;
} }

View File

@@ -31,8 +31,4 @@
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" /> <ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Save\" />
</ItemGroup>
</Project> </Project>

View File

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

View File

@@ -0,0 +1,51 @@
<Project Sdk="Godot.NET.Sdk/4.4.0">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<!-- Use NativeAOT. -->
<PublishAot>true</PublishAot>
</PropertyGroup>
<ItemGroup>
<Compile Remove="src\items\weapons\models\**" />
<EmbeddedResource Remove="src\items\weapons\models\**" />
</ItemGroup>
<ItemGroup>
<!-- Root the assemblies to avoid trimming. -->
<TrimmerRootAssembly Include="GodotSharp" />
<TrimmerRootAssembly Include="$(TargetName)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
<PackageReference Include="SimpleInjector" Version="5.5.0" />
<PackageReference Include="SSH.NET" Version="2024.2.0" />
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
<PackageReference Include="Zeroconf" Version="3.7.16" />
</ItemGroup>
<ItemGroup>
<Folder Include="src\ui\dialogue\" />
</ItemGroup>
<ItemGroup>
<None Include=".editorconfig" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,38 @@
<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>

View File

@@ -0,0 +1,38 @@
<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>

View File

@@ -0,0 +1,38 @@
<Project Sdk="Godot.NET.Sdk/4.4.1">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<WarningsAsErrors>CS9057</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Chickensoft.AutoInject" Version="2.5.0" />
<PackageReference Include="Chickensoft.GodotNodeInterfaces" Version="2.4.0" />
<PackageReference Include="Chickensoft.Introspection" Version="2.2.0" />
<PackageReference Include="Chickensoft.Introspection.Generator" Version="2.2.0" />
<PackageReference Include="Chickensoft.LogicBlocks" Version="5.16.0" />
<PackageReference Include="Chickensoft.LogicBlocks.DiagramGenerator" Version="5.16.0" />
<PackageReference Include="Chickensoft.SaveFileBuilder" Version="1.1.0" />
<PackageReference Include="Chickensoft.Serialization.Godot" Version="0.7.6" />
<PackageReference Include="GodotSharp.SourceGenerators" Version="2.6.0-250131-2115.Release" />
<PackageReference Include="SimpleInjector" Version="5.5.0" />
<PackageReference Include="SSH.NET" Version="2024.2.0" />
<PackageReference Include="System.IO.Abstractions" Version="22.0.11" />
<PackageReference Include="Zeroconf" Version="3.7.16" />
</ItemGroup>
<ItemGroup>
<None Include=".editorconfig" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Zennysoft.Game.Godot.Implementation\Zennysoft.Game.Implementation.csproj" />
<ProjectReference Include="..\Zennysoft.Game.Ma.Implementation\Zennysoft.Ma.Adapter.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Godot.SourceGenerators" Version="4.4.0-dev.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="GodotSharp" Version="4.4.0-dev.2" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="GodotSharpEditor" Version="4.4.0-dev.2" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,38 @@
<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>

View File

@@ -0,0 +1,38 @@
<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>

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=3 uid="uid://ekf8y405ewyq"] [gd_scene load_steps=4 format=3 uid="uid://civ6shmka5e8u"]
[ext_resource type="Script" uid="uid://klpiq4tk3t7a" path="res://addons/dialogue_manager/components/code_edit_syntax_highlighter.gd" id="1_58cfo"] [ext_resource type="Script" uid="uid://klpiq4tk3t7a" path="res://addons/dialogue_manager/components/code_edit_syntax_highlighter.gd" id="1_58cfo"]
[ext_resource type="Script" uid="uid://djeybvlb332mp" path="res://addons/dialogue_manager/components/code_edit.gd" id="1_g324i"] [ext_resource type="Script" uid="uid://djeybvlb332mp" path="res://addons/dialogue_manager/components/code_edit.gd" id="1_g324i"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://cstps104wl17j"] [gd_scene load_steps=3 format=3 uid="uid://qdxrxv3c3hxk"]
[ext_resource type="Script" uid="uid://kpwo418lb2t2" path="res://addons/dialogue_manager/components/download_update_panel.gd" id="1_4tm1k"] [ext_resource type="Script" uid="uid://kpwo418lb2t2" path="res://addons/dialogue_manager/components/download_update_panel.gd" id="1_4tm1k"]
[ext_resource type="Texture2D" uid="uid://d3baj6rygkb3f" path="res://addons/dialogue_manager/assets/update.svg" id="2_4o2m6"] [ext_resource type="Texture2D" uid="uid://d3baj6rygkb3f" path="res://addons/dialogue_manager/assets/update.svg" id="2_4o2m6"]

View File

@@ -1,8 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://bsal283gclopj"] [gd_scene load_steps=4 format=3 uid="uid://ycn6uaj7dsrh"]
[ext_resource type="Script" uid="uid://dooe2pflnqtve" path="res://addons/dialogue_manager/components/editor_property/editor_property_control.gd" id="1_het12"] [ext_resource type="Script" uid="uid://dooe2pflnqtve" path="res://addons/dialogue_manager/components/editor_property/editor_property_control.gd" id="1_het12"]
[ext_resource type="PackedScene" path="res://addons/dialogue_manager/components/editor_property/resource_button.tscn" id="2_hh3d4"] [ext_resource type="PackedScene" uid="uid://b16uuqjuof3n5" path="res://addons/dialogue_manager/components/editor_property/resource_button.tscn" id="2_hh3d4"]
[ext_resource type="PackedScene" path="res://addons/dialogue_manager/components/files_list.tscn" id="3_l8fp6"] [ext_resource type="PackedScene" uid="uid://dnufpcdrreva3" path="res://addons/dialogue_manager/components/files_list.tscn" id="3_l8fp6"]
[node name="PropertyEditorButton" type="HBoxContainer"] [node name="PropertyEditorButton" type="HBoxContainer"]
offset_right = 40.0 offset_right = 40.0

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://bylecer7aexlb"] [gd_scene load_steps=2 format=3 uid="uid://b16uuqjuof3n5"]
[ext_resource type="Script" uid="uid://damhqta55t67c" path="res://addons/dialogue_manager/components/editor_property/resource_button.gd" id="1_7u2i7"] [ext_resource type="Script" uid="uid://damhqta55t67c" path="res://addons/dialogue_manager/components/editor_property/resource_button.gd" id="1_7u2i7"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=4 format=3 uid="uid://c3pniua1enw8v"] [gd_scene load_steps=4 format=3 uid="uid://cs8pwrxr5vxix"]
[ext_resource type="Script" uid="uid://d2l8nlb6hhrfp" path="res://addons/dialogue_manager/components/errors_panel.gd" id="1_nfm3c"] [ext_resource type="Script" uid="uid://d2l8nlb6hhrfp" path="res://addons/dialogue_manager/components/errors_panel.gd" id="1_nfm3c"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://b21h8gsbo60xg"] [gd_scene load_steps=3 format=3 uid="uid://dnufpcdrreva3"]
[ext_resource type="Script" uid="uid://dqa4a4wwoo0aa" path="res://addons/dialogue_manager/components/files_list.gd" id="1_cytii"] [ext_resource type="Script" uid="uid://dqa4a4wwoo0aa" path="res://addons/dialogue_manager/components/files_list.gd" id="1_cytii"]
[ext_resource type="Texture2D" uid="uid://d3lr2uas6ax8v" path="res://addons/dialogue_manager/assets/icon.svg" id="2_3ijx1"] [ext_resource type="Texture2D" uid="uid://d3lr2uas6ax8v" path="res://addons/dialogue_manager/assets/icon.svg" id="2_3ijx1"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://c5to0aeerreb4"] [gd_scene load_steps=3 format=3 uid="uid://0n7hwviyyly4"]
[ext_resource type="Script" uid="uid://q368fmxxa8sd" path="res://addons/dialogue_manager/components/find_in_files.gd" id="1_3xicy"] [ext_resource type="Script" uid="uid://q368fmxxa8sd" path="res://addons/dialogue_manager/components/find_in_files.gd" id="1_3xicy"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://xnv1ojlgiss3"] [gd_scene load_steps=2 format=3 uid="uid://gr8nakpbrhby"]
[ext_resource type="Script" uid="uid://cijsmjkq21cdq" path="res://addons/dialogue_manager/components/search_and_replace.gd" id="1_8oj1f"] [ext_resource type="Script" uid="uid://cijsmjkq21cdq" path="res://addons/dialogue_manager/components/search_and_replace.gd" id="1_8oj1f"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://b7v2agbddgaoi"] [gd_scene load_steps=2 format=3 uid="uid://ctns6ouwwd68i"]
[ext_resource type="Script" uid="uid://d0k2wndjj0ifm" path="res://addons/dialogue_manager/components/title_list.gd" id="1_5qqmd"] [ext_resource type="Script" uid="uid://d0k2wndjj0ifm" path="res://addons/dialogue_manager/components/title_list.gd" id="1_5qqmd"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://c1dliyrsif5jj"] [gd_scene load_steps=3 format=3 uid="uid://co8yl23idiwbi"]
[ext_resource type="Script" uid="uid://cr1tt12dh5ecr" path="res://addons/dialogue_manager/components/update_button.gd" id="1_d2tpb"] [ext_resource type="Script" uid="uid://cr1tt12dh5ecr" path="res://addons/dialogue_manager/components/update_button.gd" id="1_d2tpb"]
[ext_resource type="PackedScene" uid="uid://cstps104wl17j" path="res://addons/dialogue_manager/components/download_update_panel.tscn" id="2_iwm7r"] [ext_resource type="PackedScene" uid="uid://qdxrxv3c3hxk" path="res://addons/dialogue_manager/components/download_update_panel.tscn" id="2_iwm7r"]
[node name="UpdateButton" type="Button"] [node name="UpdateButton" type="Button"]
visible = false visible = false

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://b0sflwm2j27gu"] [gd_scene load_steps=2 format=3 uid="uid://ckvgyvclnwggo"]
[ext_resource type="Script" uid="uid://g32um0mltv5d" path="res://addons/dialogue_manager/dialogue_label.gd" id="1_cital"] [ext_resource type="Script" uid="uid://g32um0mltv5d" path="res://addons/dialogue_manager/dialogue_label.gd" id="1_cital"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://bs44fggx87t73"] [gd_scene load_steps=9 format=3 uid="uid://73jm5qjy52vq"]
[ext_resource type="Script" uid="uid://5b3w40kwakl3" path="res://addons/dialogue_manager/example_balloon/ExampleBalloon.cs" id="1_36de5"] [ext_resource type="Script" uid="uid://5b3w40kwakl3" path="res://addons/dialogue_manager/example_balloon/ExampleBalloon.cs" id="1_36de5"]
[ext_resource type="PackedScene" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_a8ve6"] [ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_a8ve6"]
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_72ixx"] [ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_72ixx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=10 format=3 uid="uid://c4tqvq4mjcfv2"] [gd_scene load_steps=10 format=3 uid="uid://13s5spsk34qu"]
[ext_resource type="Script" uid="uid://5b3w40kwakl3" path="res://addons/dialogue_manager/example_balloon/ExampleBalloon.cs" id="1_s2gbs"] [ext_resource type="Script" uid="uid://5b3w40kwakl3" path="res://addons/dialogue_manager/example_balloon/ExampleBalloon.cs" id="1_s2gbs"]
[ext_resource type="PackedScene" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_hfvdi"] [ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_hfvdi"]
[ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_1j1j0"] [ext_resource type="Script" uid="uid://bb52rsfwhkxbn" path="res://addons/dialogue_manager/dialogue_responses_menu.gd" id="3_1j1j0"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_235ry"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_235ry"]

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=2 format=3 uid="uid://c3ty75yb1un26"] [gd_scene load_steps=2 format=3 uid="uid://ugd552efvil0"]
[ext_resource type="Script" uid="uid://c8e16qdgu40wo" path="res://addons/dialogue_manager/test_scene.gd" id="1_yupoh"] [ext_resource type="Script" uid="uid://c8e16qdgu40wo" path="res://addons/dialogue_manager/test_scene.gd" id="1_yupoh"]

View File

@@ -1,15 +1,15 @@
[gd_scene load_steps=16 format=3 uid="uid://b2lot8kdw2snd"] [gd_scene load_steps=16 format=3 uid="uid://cbuf1q3xsse3q"]
[ext_resource type="Script" uid="uid://cipjcc7bkh1pc" path="res://addons/dialogue_manager/views/main_view.gd" id="1_h6qfq"] [ext_resource type="Script" uid="uid://cipjcc7bkh1pc" path="res://addons/dialogue_manager/views/main_view.gd" id="1_h6qfq"]
[ext_resource type="PackedScene" uid="uid://ekf8y405ewyq" path="res://addons/dialogue_manager/components/code_edit.tscn" id="2_f73fm"] [ext_resource type="PackedScene" uid="uid://civ6shmka5e8u" path="res://addons/dialogue_manager/components/code_edit.tscn" id="2_f73fm"]
[ext_resource type="PackedScene" uid="uid://b21h8gsbo60xg" path="res://addons/dialogue_manager/components/files_list.tscn" id="2_npj2k"] [ext_resource type="PackedScene" uid="uid://dnufpcdrreva3" path="res://addons/dialogue_manager/components/files_list.tscn" id="2_npj2k"]
[ext_resource type="PackedScene" uid="uid://b7v2agbddgaoi" path="res://addons/dialogue_manager/components/title_list.tscn" id="2_onb4i"] [ext_resource type="PackedScene" uid="uid://ctns6ouwwd68i" path="res://addons/dialogue_manager/components/title_list.tscn" id="2_onb4i"]
[ext_resource type="PackedScene" uid="uid://c1dliyrsif5jj" path="res://addons/dialogue_manager/components/update_button.tscn" id="2_ph3vs"] [ext_resource type="PackedScene" uid="uid://co8yl23idiwbi" path="res://addons/dialogue_manager/components/update_button.tscn" id="2_ph3vs"]
[ext_resource type="PackedScene" uid="uid://xnv1ojlgiss3" path="res://addons/dialogue_manager/components/search_and_replace.tscn" id="6_ylh0t"] [ext_resource type="PackedScene" uid="uid://gr8nakpbrhby" path="res://addons/dialogue_manager/components/search_and_replace.tscn" id="6_ylh0t"]
[ext_resource type="PackedScene" uid="uid://c3pniua1enw8v" path="res://addons/dialogue_manager/components/errors_panel.tscn" id="7_5cvl4"] [ext_resource type="PackedScene" uid="uid://cs8pwrxr5vxix" path="res://addons/dialogue_manager/components/errors_panel.tscn" id="7_5cvl4"]
[ext_resource type="Script" uid="uid://klpiq4tk3t7a" path="res://addons/dialogue_manager/components/code_edit_syntax_highlighter.gd" id="7_necsa"] [ext_resource type="Script" uid="uid://klpiq4tk3t7a" path="res://addons/dialogue_manager/components/code_edit_syntax_highlighter.gd" id="7_necsa"]
[ext_resource type="Texture2D" uid="uid://cnm67htuohhlo" path="res://addons/dialogue_manager/assets/banner.png" id="9_y6rqu"] [ext_resource type="Texture2D" uid="uid://cnm67htuohhlo" path="res://addons/dialogue_manager/assets/banner.png" id="9_y6rqu"]
[ext_resource type="PackedScene" uid="uid://c5to0aeerreb4" path="res://addons/dialogue_manager/components/find_in_files.tscn" id="10_yold3"] [ext_resource type="PackedScene" uid="uid://0n7hwviyyly4" path="res://addons/dialogue_manager/components/find_in_files.tscn" id="10_yold3"]
[sub_resource type="Image" id="Image_y6rqu"] [sub_resource type="Image" id="Image_y6rqu"]
data = { data = {

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://bf5kpeg711bo8"] [gd_scene load_steps=3 format=3 uid="uid://b7mst0qu7vjk1"]
[ext_resource type="Script" uid="uid://dcff0mowkn6km" path="res://addons/input_helper/components/download_update_panel.gd" id="1_4tm1k"] [ext_resource type="Script" uid="uid://dcff0mowkn6km" path="res://addons/input_helper/components/download_update_panel.gd" id="1_4tm1k"]
[ext_resource type="Texture2D" uid="uid://ddixs2ish5bi6" path="res://addons/input_helper/assets/update.svg" id="2_j7shv"] [ext_resource type="Texture2D" uid="uid://ddixs2ish5bi6" path="res://addons/input_helper/assets/update.svg" id="2_j7shv"]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://bsi3bm7ig32p"] [gd_scene load_steps=3 format=3 uid="uid://bownbkcmm43gn"]
[ext_resource type="PackedScene" uid="uid://bf5kpeg711bo8" path="res://addons/input_helper/components/download_update_panel.tscn" id="1_37q37"] [ext_resource type="PackedScene" uid="uid://b7mst0qu7vjk1" path="res://addons/input_helper/components/download_update_panel.tscn" id="1_37q37"]
[ext_resource type="Script" uid="uid://1t3qhgrro2es" path="res://addons/input_helper/views/download_dialog.gd" id="1_ltktf"] [ext_resource type="Script" uid="uid://1t3qhgrro2es" path="res://addons/input_helper/views/download_dialog.gd" id="1_ltktf"]
[node name="DownloadDialog" type="AcceptDialog"] [node name="DownloadDialog" type="AcceptDialog"]

View File

@@ -1,12 +1,9 @@
[gd_resource type="AudioBusLayout" load_steps=5 format=3 uid="uid://c2mk6c27y0mdf"] [gd_resource type="AudioBusLayout" load_steps=4 format=3 uid="uid://c2mk6c27y0mdf"]
[sub_resource type="AudioEffectLimiter" id="AudioEffectLimiter_j3pel"] [sub_resource type="AudioEffectLimiter" id="AudioEffectLimiter_j3pel"]
resource_name = "Limiter" resource_name = "Limiter"
soft_clip_db = 1.0 soft_clip_db = 1.0
[sub_resource type="AudioEffectHardLimiter" id="AudioEffectHardLimiter_j3pel"]
resource_name = "HardLimiter"
[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_j3pel"] [sub_resource type="AudioEffectReverb" id="AudioEffectReverb_j3pel"]
resource_name = "Reverb" resource_name = "Reverb"
room_size = 0.5 room_size = 0.5
@@ -23,9 +20,7 @@ soft_clip_db = 1.5
[resource] [resource]
bus/0/volume_db = -0.130497 bus/0/volume_db = -0.130497
bus/0/effect/0/effect = SubResource("AudioEffectLimiter_j3pel") bus/0/effect/0/effect = SubResource("AudioEffectLimiter_j3pel")
bus/0/effect/0/enabled = false bus/0/effect/0/enabled = true
bus/0/effect/1/effect = SubResource("AudioEffectHardLimiter_j3pel")
bus/0/effect/1/enabled = true
bus/1/name = &"AMBIENT" bus/1/name = &"AMBIENT"
bus/1/solo = false bus/1/solo = false
bus/1/mute = false bus/1/mute = false

View File

@@ -1,22 +1,23 @@
[preset.0] [preset.0]
name="Windows Desktop" name="Steamdeck"
platform="Windows Desktop" platform="Linux"
runnable=true runnable=true
advanced_options=true advanced_options=false
dedicated_server=false dedicated_server=false
custom_features="" custom_features=""
export_filter="all_resources" export_filter="exclude"
export_files=PackedStringArray()
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../../Demo/Export.exe" export_path=""
patches=PackedStringArray() patches=PackedStringArray()
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
seed=0 seed=0
encrypt_pck=false encrypt_pck=false
encrypt_directory=false encrypt_directory=false
script_export_mode=1 script_export_mode=2
[preset.0.options] [preset.0.options]
@@ -27,6 +28,51 @@ binary_format/embed_pck=false
texture_format/s3tc_bptc=true texture_format/s3tc_bptc=true
texture_format/etc2_astc=false texture_format/etc2_astc=false
binary_format/architecture="x86_64" binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true
dotnet/embed_build_outputs=false
[preset.1]
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
advanced_options=false
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="Output/Ma.zip"
patches=PackedStringArray()
encryption_include_filters=""
encryption_exclude_filters=""
seed=0
encrypt_pck=false
encrypt_directory=false
script_export_mode=2
[preset.1.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=0
binary_format/embed_pck=true
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
binary_format/architecture="x86_64"
codesign/enable=false codesign/enable=false
codesign/timestamp=true codesign/timestamp=true
codesign/timestamp_server_url="" codesign/timestamp_server_url=""
@@ -65,5 +111,5 @@ ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debu
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'" Remove-Item -Recurse -Force '{temp_dir}'"
dotnet/include_scripts_content=false dotnet/include_scripts_content=false
dotnet/include_debug_symbols=true dotnet/include_debug_symbols=false
dotnet/embed_build_outputs=false dotnet/embed_build_outputs=false

View File

@@ -8,16 +8,13 @@
config_version=5 config_version=5
[animation]
warnings/check_invalid_track_paths=false
[application] [application]
config/name="Ma" config/name="Ma"
run/main_scene="uid://d1gjaijijd5ot" run/main_scene="uid://d1gjaijijd5ot"
run/print_header=false
config/features=PackedStringArray("4.4", "C#", "GL Compatibility") config/features=PackedStringArray("4.4", "C#", "GL Compatibility")
run/max_fps=60 run/delta_smoothing=false
boot_splash/show_image=false boot_splash/show_image=false
[autoload] [autoload]
@@ -40,16 +37,11 @@ runtime/advanced/uses_dotnet=true
window/size/viewport_width=1920 window/size/viewport_width=1920
window/size/viewport_height=1080 window/size/viewport_height=1080
window/stretch/mode="canvas_items" window/stretch/mode="canvas_items"
window/stretch/aspect="expand"
[dotnet] [dotnet]
project/assembly_name="Ma" project/assembly_name="Ma"
[editor]
export/convert_text_resources_to_binary=false
[editor_plugins] [editor_plugins]
enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg", "res://addons/input_helper/plugin.cfg") enabled=PackedStringArray("res://addons/dialogue_manager/plugin.cfg", "res://addons/input_helper/plugin.cfg")
@@ -84,17 +76,10 @@ folder_colors={
import/blender/enabled=false import/blender/enabled=false
[global_group]
DimmableAudio=""
enemy=""
[importer_defaults] [importer_defaults]
texture={ texture={
&"compress/high_quality": true, "detect_3d/compress_to": 0
&"compress/mode": 2,
&"detect_3d/compress_to": 0
} }
[input] [input]
@@ -260,15 +245,11 @@ AltAttack={
CameraForward={ CameraForward={
"deadzone": 0.2, "deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null) "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194446,"key_label":0,"unicode":56,"location":0,"echo":false,"script":null)
] ]
} }
CameraBack={ CameraBack={
"deadzone": 0.2, "deadzone": 0.2,
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null) "events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194440,"key_label":0,"unicode":50,"location":0,"echo":false,"script":null)
] ]
} }
EnemyViewerIdle={ EnemyViewerIdle={
@@ -312,13 +293,11 @@ locale/translations_pot_files=PackedStringArray("res://src/dialog/Dialogue.dialo
3d/run_on_separate_thread=true 3d/run_on_separate_thread=true
common/physics_ticks_per_second=144 common/physics_ticks_per_second=144
jolt_physics_3d/simulation/areas_detect_static_bodies=true
[rendering] [rendering]
textures/canvas_textures/default_texture_filter=0 textures/canvas_textures/default_texture_filter=0
textures/lossless_compression/force_png=true textures/lossless_compression/force_png=true
lights_and_shadows/directional_shadow/size=2048
lights_and_shadows/directional_shadow/soft_shadow_filter_quality=4 lights_and_shadows/directional_shadow/soft_shadow_filter_quality=4
lights_and_shadows/directional_shadow/16_bits=false lights_and_shadows/directional_shadow/16_bits=false
lights_and_shadows/positional_shadow/soft_shadow_filter_quality=3 lights_and_shadows/positional_shadow/soft_shadow_filter_quality=3

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
@@ -50,14 +49,7 @@ public class AttackComponent : IAttackComponent
public void RaiseMaximumAttack(int raiseAmount) public void RaiseMaximumAttack(int raiseAmount)
{ {
_maximumAttack.OnNext(_maximumAttack.Value + raiseAmount); _maximumAttack.OnNext(raiseAmount);
Restore(raiseAmount); Restore(raiseAmount);
} }
public void LowerMaximumAttack(int lowerAmount)
{
_maximumAttack.OnNext(Mathf.Max(_maximumAttack.Value - lowerAmount, 1));
if (_currentAttack.Value > _maximumAttack.Value)
_currentAttack.OnNext(_maximumAttack.Value);
}
} }

View File

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

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
@@ -50,14 +49,7 @@ public class DefenseComponent : IDefenseComponent
public void RaiseMaximumDefense(int raiseAmount) public void RaiseMaximumDefense(int raiseAmount)
{ {
_maximumDefense.OnNext(_maximumDefense.Value + raiseAmount); _maximumDefense.OnNext(raiseAmount);
Restore(raiseAmount); Restore(raiseAmount);
} }
public void LowerMaximumDefense(int lowerAmount)
{
_maximumDefense.OnNext(Mathf.Max(_maximumDefense.Value - lowerAmount, 1));
if (_currentDefense.Value > _maximumDefense.Value)
_currentDefense.OnNext(_maximumDefense.Value);
}
} }

View File

@@ -1,4 +1,5 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity; using Zennysoft.Ma.Adapter.Entity;
@@ -6,23 +7,19 @@ using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma; namespace Zennysoft.Game.Ma;
public class EquipmentComponent : IEquipmentComponent public class EquipmentComponent : IEquipmentComponent
{ {
public IAutoProp<IWeapon> EquippedWeapon => _equippedWeapon; public IAutoProp<EquipableItem> EquippedWeapon => _equippedWeapon;
public IAutoProp<IArmor> EquippedArmor => _equippedArmor; public IAutoProp<EquipableItem> EquippedArmor => _equippedArmor;
public IAutoProp<IAccessory> EquippedAccessory => _equippedAccessory; public IAutoProp<EquipableItem> EquippedAccessory => _equippedAccessory;
public IAutoProp<IEquipableItem> EquippedAmmo => _equippedAmmo; public AutoProp<EquipableItem> _equippedWeapon;
public AutoProp<IWeapon> _equippedWeapon; public AutoProp<EquipableItem> _equippedArmor;
public AutoProp<IArmor> _equippedArmor; public AutoProp<EquipableItem> _equippedAccessory;
public AutoProp<IAccessory> _equippedAccessory; public event Action<EquipableItem> EquipmentChanged;
public AutoProp<IEquipableItem> _equippedAmmo;
public event Action<IEquipableItem> EquipmentChanged;
public int BonusAttack => _equippedWeapon.Value.BonusAttack + _equippedArmor.Value.BonusAttack + _equippedAccessory.Value.BonusAttack; public int BonusAttack => _equippedWeapon.Value.BonusAttack + _equippedArmor.Value.BonusAttack + _equippedAccessory.Value.BonusAttack;
@@ -38,10 +35,9 @@ public class EquipmentComponent : IEquipmentComponent
public EquipmentComponent() public EquipmentComponent()
{ {
_equippedWeapon = new AutoProp<IWeapon>(new Weapon()); _equippedWeapon = new AutoProp<EquipableItem>(new Weapon());
_equippedArmor = new AutoProp<IArmor>(new Armor()); _equippedArmor = new AutoProp<EquipableItem>(new Armor());
_equippedAccessory = new AutoProp<IAccessory>(new Accessory()); _equippedAccessory = new AutoProp<EquipableItem>(new Accessory());
_equippedAmmo = new AutoProp<IEquipableItem>(new Ammo());
} }
public void Reset() public void Reset()
@@ -49,10 +45,9 @@ public class EquipmentComponent : IEquipmentComponent
_equippedWeapon.OnNext(new Weapon()); _equippedWeapon.OnNext(new Weapon());
_equippedArmor.OnNext(new Armor()); _equippedArmor.OnNext(new Armor());
_equippedAccessory.OnNext(new Accessory()); _equippedAccessory.OnNext(new Accessory());
_equippedAmmo.OnNext(new Ammo());
} }
public void Equip(IEquipableItem equipable) public void Equip(EquipableItem equipable)
{ {
if (equipable is Weapon weapon) if (equipable is Weapon weapon)
_equippedWeapon.OnNext(weapon); _equippedWeapon.OnNext(weapon);
@@ -60,12 +55,10 @@ public class EquipmentComponent : IEquipmentComponent
_equippedArmor.OnNext(armor); _equippedArmor.OnNext(armor);
if (equipable is Accessory accessory) if (equipable is Accessory accessory)
_equippedAccessory.OnNext(accessory); _equippedAccessory.OnNext(accessory);
if (equipable is Ammo ammo)
_equippedAmmo.OnNext(ammo);
EquipmentChanged?.Invoke(equipable); EquipmentChanged?.Invoke(equipable);
} }
public void Unequip(IEquipableItem equipable) public void Unequip(EquipableItem equipable)
{ {
if (equipable is Weapon weapon) if (equipable is Weapon weapon)
_equippedWeapon.OnNext(new Weapon()); _equippedWeapon.OnNext(new Weapon());
@@ -73,20 +66,14 @@ public class EquipmentComponent : IEquipmentComponent
_equippedArmor.OnNext(new Armor()); _equippedArmor.OnNext(new Armor());
if (equipable is Accessory accessory) if (equipable is Accessory accessory)
_equippedAccessory.OnNext(new Accessory()); _equippedAccessory.OnNext(new Accessory());
if (equipable is Ammo ammo)
_equippedAmmo.OnNext(new Ammo());
EquipmentChanged?.Invoke(equipable); EquipmentChanged?.Invoke(equipable);
} }
public bool IsItemEquipped(IEquipableItem item) public bool IsItemEquipped(InventoryItem item)
{ {
return item == _equippedWeapon.Value || item == _equippedArmor.Value || item == _equippedAccessory.Value || item == _equippedAmmo.Value; if (item is not EquipableItem)
} return false;
public void UpdateEquipment(IEquipableItem equipable) => EquipmentChanged?.Invoke(equipable); return item == _equippedWeapon.Value || item == _equippedArmor.Value || item == _equippedAccessory.Value;
public bool AugmentableEquipmentExists()
{
return (_equippedWeapon.Value.ItemName != null && _equippedWeapon.Value.Augment == null) || (_equippedArmor.Value.ItemName != null && _equippedArmor.Value.Augment == null) || (_equippedAccessory.Value.ItemName != null && _equippedAccessory.Value.Augment == null);
} }
} }

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
@@ -25,8 +24,6 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
public event Action PlayerLevelUp; public event Action PlayerLevelUp;
public event Action PlayerLevelDown;
public ExperiencePointsComponent() public ExperiencePointsComponent()
{ {
var firstLevelExpRequirement = ExpToNextLevelCalculation(1); var firstLevelExpRequirement = ExpToNextLevelCalculation(1);
@@ -48,21 +45,13 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
public void Gain(int baseExpGain) public void Gain(int baseExpGain)
{ {
var modifiedExpGain = baseExpGain * _expGainRate.Value; var modifiedExpGain = baseExpGain * _expGainRate.Value;
_currentExp.OnNext(Mathf.RoundToInt(modifiedExpGain + _currentExp.Value)); var newCurrentExpTotal = modifiedExpGain + _currentExp.Value;
while (_currentExp.Value >= _expToNextLevel.Value) while (modifiedExpGain + _currentExp.Value >= _expToNextLevel.Value)
LevelUp(); LevelUp();
var cappedAmount = Math.Min(baseExpGain + _currentExp.Value, _expToNextLevel.Value);
_currentExp.OnNext(cappedAmount);
} }
public void GainUnmodified(int flatRateExp)
{
var newCurrentExpTotal = flatRateExp + _currentExp.Value;
_currentExp.OnNext(newCurrentExpTotal);
while (_currentExp.Value >= _expToNextLevel.Value)
LevelUp();
}
public void ModifyExpGainRate(double newRate) => _expGainRate.OnNext(newRate);
public void LevelUp() public void LevelUp()
{ {
SfxDatabase.Instance.Play(SoundEffect.LevelUp); SfxDatabase.Instance.Play(SoundEffect.LevelUp);
@@ -73,21 +62,6 @@ public class ExperiencePointsComponent : IExperiencePointsComponent
PlayerLevelUp?.Invoke(); PlayerLevelUp?.Invoke();
} }
public void LevelDown()
{
SfxDatabase.Instance.Play(SoundEffect.DecreaseStat);
_currentExp.OnNext(0);
if (_level.Value == 1)
return;
var newLevel = Mathf.Max(_level.Value - 1, 1);
_level.OnNext(newLevel);
var expToNextLevel = ExpToNextLevelCalculation(newLevel);
_expToNextLevel.OnNext(expToNextLevel);
PlayerLevelDown.Invoke();
}
private int ExpToNextLevelCalculation(int nextLevel) private int ExpToNextLevelCalculation(int nextLevel)
{ {
return (int)(6.5 * nextLevel + 4.5 * Math.Pow(nextLevel, 2) + Math.Pow(nextLevel, 3)); return (int)(6.5 * nextLevel + 4.5 * Math.Pow(nextLevel, 2) + Math.Pow(nextLevel, 3));

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
@@ -78,11 +77,4 @@ public class HealthComponent : IHealthComponent
if (restoreHP) if (restoreHP)
Heal(raiseAmount); Heal(raiseAmount);
} }
public void LowerMaximumHP(int lowerAmount)
{
_maximumHP.OnNext(Mathf.Max(_maximumHP.Value - lowerAmount, 1));
if (_currentHP.Value > _maximumHP.Value)
_currentHP.OnNext(_maximumHP.Value);
}
} }

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma; namespace Zennysoft.Game.Ma;
@@ -7,14 +6,12 @@ namespace Zennysoft.Game.Ma;
public class LuckComponent : ILuckComponent public class LuckComponent : ILuckComponent
{ {
public IAutoProp<int> Luck => _luck; public IAutoProp<int> Luck => _luck;
public int InitialLuck { get; }
private readonly AutoProp<int> _luck; private AutoProp<int> _luck;
private readonly int _initialValue; private readonly int _initialValue;
public LuckComponent(int initialLuck) public LuckComponent(int initialLuck)
{ {
InitialLuck = initialLuck;
_luck = new AutoProp<int>(initialLuck); _luck = new AutoProp<int>(initialLuck);
_initialValue = initialLuck; _initialValue = initialLuck;
} }
@@ -25,6 +22,4 @@ public class LuckComponent : ILuckComponent
} }
public void IncreaseLuck(int value) => _luck.OnNext(_luck.Value + value); public void IncreaseLuck(int value) => _luck.OnNext(_luck.Value + value);
public void DecreaseLuck(int value) => _luck.OnNext(Godot.Mathf.Max(_luck.Value - value, 0));
} }

View File

@@ -1,20 +0,0 @@
using Chickensoft.Collections;
public class StatusEffectComponent : IStatusEffectComponent
{
public StatusEffectComponent(double rustDuration)
{
RustDuration = rustDuration;
}
public double RustDuration { get; set; }
public AutoProp<bool> Rust { get; } = new AutoProp<bool>(false);
public bool ImmuneToRust { get; set; } = false;
public void Reset()
{
Rust.OnNext(false);
}
}

View File

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

View File

@@ -1,5 +1,4 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
@@ -57,13 +56,6 @@ public class VTComponent : IVTComponent
Restore(raiseAmount); Restore(raiseAmount);
} }
public void LowerMaximumVT(int lowerAmount)
{
_maximumVT.OnNext(Mathf.Max(_maximumVT.Value - lowerAmount, 1));
if (_currentVT.Value > _maximumVT.Value)
_currentVT.OnNext(_maximumVT.Value);
}
public void SetMaximumVT(int vt) public void SetMaximumVT(int vt)
{ {
_maximumVT.OnNext(vt); _maximumVT.OnNext(vt);

View File

@@ -21,7 +21,7 @@ public partial class App : Node, IApp
public const string GAME_SCENE_PATH = "res://src/game/Game.tscn"; public const string GAME_SCENE_PATH = "res://src/game/Game.tscn";
public const string ENEMY_VIEWER_PATH = "res://src/enemy_viewer/EnemyViewer.tscn"; public const string ENEMY_VIEWER_PATH = "res://src/data_viewer/DataViewer.tscn";
[Node] private MainMenu MainMenu { get; set; } = default!; [Node] private MainMenu MainMenu { get; set; } = default!;
@@ -31,6 +31,8 @@ public partial class App : Node, IApp
[Node] private GalleryMenu GalleryMenu { get; set; } [Node] private GalleryMenu GalleryMenu { get; set; }
[Node] private VideoStreamPlayer VideoStreamPlayer { get; set; }
IAppRepo IProvide<IAppRepo>.Value() => AppRepo; IAppRepo IProvide<IAppRepo>.Value() => AppRepo;
public IAppRepo AppRepo { get; set; } = default!; public IAppRepo AppRepo { get; set; } = default!;
@@ -40,14 +42,14 @@ public partial class App : Node, IApp
private Godot.Collections.Array _progress; private Godot.Collections.Array _progress;
private SimpleInjector.Container _container; private SimpleInjector.Container _container;
private EnemyViewer _dataViewer; private DataViewer _dataViewer;
private bool _loadingGame = false; private bool _loadingGame = false;
private bool _loadingEnemyViewer = false; private bool _loadingEnemyViewer = false;
private string _optionsSavePath = string.Empty; private string _optionsSavePath = string.Empty;
private string _controllerSavePath = string.Empty; private string _controllerSavePath = string.Empty;
private ISaveFileManager _saveFileManager; private ISaveFileManager _saveFileManager;
private IGame _game; private IGame _game;
private IEnemyViewer _enemyViewer; private IDataViewer _enemyViewer;
private double _reportedProgress = 0; private double _reportedProgress = 0;
@@ -146,7 +148,7 @@ public partial class App : Node, IApp
}) })
.Handle((in AppLogic.Output.SetupGameScene _) => .Handle((in AppLogic.Output.SetupGameScene _) =>
{ {
LoadingScreen.ShowLoadingScreen(); LoadingScreen.Show();
LoadGame(GAME_SCENE_PATH); LoadGame(GAME_SCENE_PATH);
}) })
.Handle((in AppLogic.Output.ShowMainMenu _) => .Handle((in AppLogic.Output.ShowMainMenu _) =>
@@ -155,7 +157,7 @@ public partial class App : Node, IApp
}) })
.Handle((in AppLogic.Output.CloseGame _) => .Handle((in AppLogic.Output.CloseGame _) =>
{ {
LoadingScreen.HideLoadingScreen(); LoadingScreen.Hide();
_game.GameExitRequested -= GameExitRequested; _game.GameExitRequested -= GameExitRequested;
MainMenu.StartGameButton.GrabFocus(); MainMenu.StartGameButton.GrabFocus();
_game.CallDeferred(MethodName.QueueFree, []); _game.CallDeferred(MethodName.QueueFree, []);
@@ -166,14 +168,14 @@ public partial class App : Node, IApp
}) })
.Handle((in AppLogic.Output.EnemyViewerOpened _) => .Handle((in AppLogic.Output.EnemyViewerOpened _) =>
{ {
LoadingScreen.ShowLoadingScreen(); LoadingScreen.Show();
MainMenu.Hide(); MainMenu.Hide();
LoadEnemyViewer(ENEMY_VIEWER_PATH); LoadEnemyViewer(ENEMY_VIEWER_PATH);
}) })
.Handle((in AppLogic.Output.EnemyViewerExited _) => .Handle((in AppLogic.Output.EnemyViewerExited _) =>
{ {
LoadingScreen.HideLoadingScreen(); LoadingScreen.Hide();
if (_enemyViewer != null && _enemyViewer is EnemyViewer enemyViewer) if (_enemyViewer != null && _enemyViewer is DataViewer enemyViewer)
enemyViewer.CallDeferred(MethodName.QueueFree); enemyViewer.CallDeferred(MethodName.QueueFree);
MainMenu.Show(); MainMenu.Show();
MainMenu.EnemyViewerButton.GrabFocus(); MainMenu.EnemyViewerButton.GrabFocus();
@@ -203,23 +205,24 @@ public partial class App : Node, IApp
_game = scene as IGame; _game = scene as IGame;
_game.GameLoaded += OnGameLoaded; _game.GameLoaded += OnGameLoaded;
_game.GameExitRequested += GameExitRequested; _game.GameExitRequested += GameExitRequested;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
CallDeferred(MethodName.AddChild, scene); CallDeferred(MethodName.AddChild, scene);
} }
private void OnGameLoaded() => LoadingScreen.HideLoadingScreen(); private void OnGameLoaded() => LoadingScreen.Hide();
private async void LoadEnemyViewer(string sceneName) private async void LoadEnemyViewer(string sceneName)
{ {
var scene = await LoadSceneInternal(sceneName); var scene = await LoadSceneInternal(sceneName);
_enemyViewer = scene as IEnemyViewer; _enemyViewer = scene as IDataViewer;
await ToSignal(GetTree().CreateTimer(0.8f), "timeout");
CallDeferred(MethodName.AddChild, scene); CallDeferred(MethodName.AddChild, scene);
LoadingScreen.HideLoadingScreen(); LoadingScreen.Hide();
} }
private async Task<Node> LoadSceneInternal(string sceneName) private async Task<Node> LoadSceneInternal(string sceneName)
{ {
LoadingScreen.ShowLoadingScreen(); LoadingScreen.Show();
MainMenu.Hide();
LoadingScreen.ProgressBar.Value = 0; LoadingScreen.ProgressBar.Value = 0;
var sceneLoader = new SceneLoader(); var sceneLoader = new SceneLoader();
CallDeferred(MethodName.AddChild, sceneLoader); CallDeferred(MethodName.AddChild, sceneLoader);
@@ -239,7 +242,11 @@ public partial class App : Node, IApp
OptionsMenu.GameTab.GrabFocus(); OptionsMenu.GameTab.GrabFocus();
} }
private async void OnGallery() => GalleryMenu.Show(); private async void OnGallery()
{
GalleryMenu.Show();
GalleryMenu.ItemButton1.GrabFocus();
}
public void OnQuit() => AppLogic.Input(new AppLogic.Input.QuitGame()); public void OnQuit() => AppLogic.Input(new AppLogic.Input.QuitGame());
@@ -256,13 +263,6 @@ public partial class App : Node, IApp
MainMenu.StartGame -= OnStartGame; MainMenu.StartGame -= OnStartGame;
MainMenu.EnemyViewer -= OnEnemyViewer; MainMenu.EnemyViewer -= OnEnemyViewer;
MainMenu.Gallery -= OnGallery;
MainMenu.Options -= OnOptions;
MainMenu.Quit -= OnQuit; MainMenu.Quit -= OnQuit;
GalleryMenu.GalleryExited -= GalleryExited;
OptionsMenu.OptionsMenuExited -= OptionsMenu_OptionsMenuExited;
OptionsMenu.DeleteSaveData -= DeleteSaveData;
} }
} }

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=6 format=3 uid="uid://bkhaksn82ws6h"] [gd_scene load_steps=6 format=3 uid="uid://cagfc5ridmteu"]
[ext_resource type="Script" uid="uid://d1f8blk5ucqvq" path="res://src/app/App.cs" id="1_rt73h"] [ext_resource type="Script" uid="uid://d1f8blk5ucqvq" path="res://src/app/App.cs" id="1_rt73h"]
[ext_resource type="PackedScene" uid="uid://rfvnddfqufho" path="res://src/menu/MainMenu.tscn" id="2_1uiag"] [ext_resource type="PackedScene" uid="uid://rfvnddfqufho" path="res://src/menu/MainMenu.tscn" id="2_1uiag"]
@@ -10,16 +10,9 @@
process_mode = 3 process_mode = 3
script = ExtResource("1_rt73h") script = ExtResource("1_rt73h")
[node name="ColorRect" type="ColorRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MainMenu" parent="." instance=ExtResource("2_1uiag")] [node name="MainMenu" parent="." instance=ExtResource("2_1uiag")]
unique_name_in_owner = true unique_name_in_owner = true
visible = false
[node name="OptionsMenu" parent="." instance=ExtResource("2_v0mgf")] [node name="OptionsMenu" parent="." instance=ExtResource("2_v0mgf")]
unique_name_in_owner = true unique_name_in_owner = true
@@ -29,6 +22,12 @@ visible = false
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false
[node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."]
unique_name_in_owner = true
visible = false
offset_right = 40.0
offset_bottom = 40.0
[node name="LoadingScreen" parent="." instance=ExtResource("3_3st5l")] [node name="LoadingScreen" parent="." instance=ExtResource("3_3st5l")]
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false

View File

@@ -2,5 +2,4 @@
public partial class AmbientSFXPlayer : DimmableAudioStreamPlayer public partial class AmbientSFXPlayer : DimmableAudioStreamPlayer
{ {
public override void _EnterTree() => FadeIn();
} }

View File

@@ -2,5 +2,4 @@
public partial class AmbientSFXPlayer3D : DimmableAudioStreamPlayer3D public partial class AmbientSFXPlayer3D : DimmableAudioStreamPlayer3D
{ {
public override void _EnterTree() => FadeIn();
} }

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=27 format=3 uid="uid://brgi35xj3b4ud"] [gd_scene load_steps=26 format=3 uid="uid://brgi35xj3b4ud"]
[ext_resource type="Script" uid="uid://cw100tox0ufsy" path="res://src/audio/SfxDatabase.cs" id="1_ojkqd"] [ext_resource type="Script" uid="uid://cw100tox0ufsy" path="res://src/audio/SfxDatabase.cs" id="1_ojkqd"]
[ext_resource type="AudioStream" uid="uid://cye8wlqbx66h4" path="res://src/audio/sfx/player_heal.ogg" id="2_158j8"] [ext_resource type="AudioStream" uid="uid://cye8wlqbx66h4" path="res://src/audio/sfx/player_heal.ogg" id="2_158j8"]
@@ -9,7 +9,6 @@
[ext_resource type="AudioStream" uid="uid://c817txm4tmup7" path="res://src/audio/sfx/PLAYER_EQUIP.ogg" id="7_sew62"] [ext_resource type="AudioStream" uid="uid://c817txm4tmup7" path="res://src/audio/sfx/PLAYER_EQUIP.ogg" id="7_sew62"]
[ext_resource type="AudioStream" uid="uid://qxi7qto7hhgk" path="res://src/audio/sfx/PLAYER_UNEQUIP.ogg" id="8_rf1la"] [ext_resource type="AudioStream" uid="uid://qxi7qto7hhgk" path="res://src/audio/sfx/PLAYER_UNEQUIP.ogg" id="8_rf1la"]
[ext_resource type="AudioStream" uid="uid://doeefxilh0luj" path="res://src/audio/sfx/ITEM_SORT.ogg" id="9_l6w22"] [ext_resource type="AudioStream" uid="uid://doeefxilh0luj" path="res://src/audio/sfx/ITEM_SORT.ogg" id="9_l6w22"]
[ext_resource type="AudioStream" uid="uid://cyae4bt60m7p4" path="res://src/audio/sfx/item_plasma_sword.ogg" id="10_7th20"]
[ext_resource type="AudioStream" uid="uid://4mk4hlse81if" path="res://src/audio/sfx/player_losehealth.ogg" id="10_kac56"] [ext_resource type="AudioStream" uid="uid://4mk4hlse81if" path="res://src/audio/sfx/player_losehealth.ogg" id="10_kac56"]
[ext_resource type="AudioStream" uid="uid://dwp3ep3jddvrr" path="res://src/audio/sfx/UI_SELECT.ogg" id="10_nerso"] [ext_resource type="AudioStream" uid="uid://dwp3ep3jddvrr" path="res://src/audio/sfx/UI_SELECT.ogg" id="10_nerso"]
[ext_resource type="AudioStream" uid="uid://ilf2s8ct2stt" path="res://src/audio/sfx/PLAYER_slower_slash.ogg" id="10_vyvit"] [ext_resource type="AudioStream" uid="uid://ilf2s8ct2stt" path="res://src/audio/sfx/PLAYER_slower_slash.ogg" id="10_vyvit"]
@@ -34,26 +33,21 @@ script = ExtResource("1_ojkqd")
[node name="OpenInventorySound" type="AudioStreamPlayer" parent="UI"] [node name="OpenInventorySound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("5_p5cio") stream = ExtResource("5_p5cio")
bus = &"SFX" bus = &"SFX"
[node name="MoveSound" type="AudioStreamPlayer" parent="UI"] [node name="MoveSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("6_r16t0") stream = ExtResource("6_r16t0")
max_polyphony = 5
bus = &"SFX" bus = &"SFX"
[node name="SelectSound" type="AudioStreamPlayer" parent="UI"] [node name="SelectSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("10_nerso") stream = ExtResource("10_nerso")
bus = &"SFX" bus = &"SFX"
[node name="CancelSound" type="AudioStreamPlayer" parent="UI"] [node name="CancelSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("11_rloay") stream = ExtResource("11_rloay")
bus = &"SFX" bus = &"SFX"
@@ -61,67 +55,51 @@ bus = &"SFX"
[node name="HealHPSound" type="AudioStreamPlayer" parent="Player"] [node name="HealHPSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("2_158j8") stream = ExtResource("2_158j8")
bus = &"SFX" bus = &"SFX"
[node name="TakeDamageSound" type="AudioStreamPlayer" parent="Player"] [node name="TakeDamageSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("10_kac56") stream = ExtResource("10_kac56")
bus = &"SFX" bus = &"SFX"
[node name="HealVTSound" type="AudioStreamPlayer" parent="Player"] [node name="HealVTSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("3_kac56") stream = ExtResource("3_kac56")
bus = &"SFX" bus = &"SFX"
[node name="WeaponQuickSlashSound" type="AudioStreamPlayer" parent="Player"] [node name="WeaponQuickSlashSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("13_fa8i8") stream = ExtResource("13_fa8i8")
bus = &"SFX" bus = &"SFX"
[node name="WeaponPlasmaSword" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
process_mode = 3
stream = ExtResource("10_7th20")
bus = &"SFX"
[node name="WeaponSlowSlashSound" type="AudioStreamPlayer" parent="Player"] [node name="WeaponSlowSlashSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("10_vyvit") stream = ExtResource("10_vyvit")
bus = &"SFX" bus = &"SFX"
[node name="CritSound" type="AudioStreamPlayer" parent="Player"] [node name="CritSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("14_p5cio") stream = ExtResource("14_p5cio")
bus = &"SFX" bus = &"SFX"
[node name="PickupItemSound" type="AudioStreamPlayer" parent="Player"] [node name="PickupItemSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("15_r16t0") stream = ExtResource("15_r16t0")
bus = &"SFX" bus = &"SFX"
[node name="LevelUpSound" type="AudioStreamPlayer" parent="Player"] [node name="LevelUpSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("16_sew62") stream = ExtResource("16_sew62")
bus = &"SFX" bus = &"SFX"
[node name="EquipSound" type="AudioStreamPlayer" parent="Player"] [node name="EquipSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("7_sew62") stream = ExtResource("7_sew62")
bus = &"SFX" bus = &"SFX"
[node name="UnequipSound" type="AudioStreamPlayer" parent="Player"] [node name="UnequipSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("8_rf1la") stream = ExtResource("8_rf1la")
bus = &"SFX" bus = &"SFX"
@@ -129,66 +107,50 @@ bus = &"SFX"
[node name="TransferItemSound" type="AudioStreamPlayer" parent="Item"] [node name="TransferItemSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("18_l6w22") stream = ExtResource("18_l6w22")
bus = &"SFX" bus = &"SFX"
[node name="IncreaseStatSound" type="AudioStreamPlayer" parent="Item"] [node name="IncreaseStatSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("4_fa8i8")
bus = &"SFX"
[node name="DecreaseStatSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
process_mode = 3
stream = ExtResource("4_fa8i8") stream = ExtResource("4_fa8i8")
bus = &"SFX" bus = &"SFX"
[node name="SortSound" type="AudioStreamPlayer" parent="Item"] [node name="SortSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("9_l6w22") stream = ExtResource("9_l6w22")
bus = &"SFX" bus = &"SFX"
[node name="RecallEnemiesSound" type="AudioStreamPlayer" parent="Item"] [node name="RecallEnemiesSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("19_nerso") stream = ExtResource("19_nerso")
bus = &"SFX" bus = &"SFX"
[node name="KillHalfEnemiesSound" type="AudioStreamPlayer" parent="Item"] [node name="KillHalfEnemiesSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("20_rloay") stream = ExtResource("20_rloay")
bus = &"SFX" bus = &"SFX"
[node name="TeleportToRandomRoomSound" type="AudioStreamPlayer" parent="Item"] [node name="TeleportToRandomRoomSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("21_6hsck") stream = ExtResource("21_6hsck")
bus = &"SFX" bus = &"SFX"
[node name="TeleportToExitSound" type="AudioStreamPlayer" parent="Item"] [node name="TeleportToExitSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("22_3wq6u") stream = ExtResource("22_3wq6u")
bus = &"SFX" bus = &"SFX"
[node name="AbsorbHPFromAllEnemiesSound" type="AudioStreamPlayer" parent="Item"] [node name="AbsorbHPFromAllEnemiesSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("23_aaerj") stream = ExtResource("23_aaerj")
bus = &"SFX" bus = &"SFX"
[node name="SwapHPAndVTSound" type="AudioStreamPlayer" parent="Item"] [node name="SwapHPAndVTSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("23_jdwj3") stream = ExtResource("23_jdwj3")
bus = &"SFX" bus = &"SFX"
[node name="TurnAllEnemiesIntoHealingItemsSound" type="AudioStreamPlayer" parent="Item"] [node name="TurnAllEnemiesIntoHealingItemsSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true unique_name_in_owner = true
process_mode = 3
stream = ExtResource("24_jdwj3") stream = ExtResource("24_jdwj3")
bus = &"SFX" bus = &"SFX"

View File

@@ -24,7 +24,6 @@ public partial class SfxDatabase : Node
{SoundEffect.TakeDamage, TakeDamageSound }, {SoundEffect.TakeDamage, TakeDamageSound },
{SoundEffect.HealVT, HealVTSound }, {SoundEffect.HealVT, HealVTSound },
{SoundEffect.IncreaseStat, IncreaseStatSound }, {SoundEffect.IncreaseStat, IncreaseStatSound },
{SoundEffect.DecreaseStat, DecreaseStatSound },
{SoundEffect.Crit, CritSound }, {SoundEffect.Crit, CritSound },
{SoundEffect.PickupItem, PickupItemSound }, {SoundEffect.PickupItem, PickupItemSound },
{SoundEffect.OpenInventory, OpenInventorySound }, {SoundEffect.OpenInventory, OpenInventorySound },
@@ -44,7 +43,6 @@ public partial class SfxDatabase : Node
{SoundEffect.TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItemsSound}, {SoundEffect.TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItemsSound},
{SoundEffect.WeaponQuickSlash, WeaponQuickSlashSound }, {SoundEffect.WeaponQuickSlash, WeaponQuickSlashSound },
{SoundEffect.WeaponSlowSlash, WeaponSlowSlashSound }, {SoundEffect.WeaponSlowSlash, WeaponSlowSlashSound },
{SoundEffect.WeaponPlasmaSword, WeaponPlasmaSword },
}; };
} }
@@ -52,11 +50,8 @@ public partial class SfxDatabase : Node
[Node] private AudioStreamPlayer TakeDamageSound { get; set; } = default!; [Node] private AudioStreamPlayer TakeDamageSound { get; set; } = default!;
[Node] private AudioStreamPlayer HealVTSound { get; set; } = default!; [Node] private AudioStreamPlayer HealVTSound { get; set; } = default!;
[Node] private AudioStreamPlayer IncreaseStatSound { get; set; } = default!; [Node] private AudioStreamPlayer IncreaseStatSound { get; set; } = default!;
[Node] private AudioStreamPlayer DecreaseStatSound { get; set; } = default!;
[Node] private AudioStreamPlayer WeaponQuickSlashSound { get; set; } = default!; [Node] private AudioStreamPlayer WeaponQuickSlashSound { get; set; } = default!;
[Node] private AudioStreamPlayer WeaponSlowSlashSound { get; set; } = default!; [Node] private AudioStreamPlayer WeaponSlowSlashSound { get; set; } = default!;
[Node] private AudioStreamPlayer WeaponPlasmaSword { get; set; } = default!;
[Node] private AudioStreamPlayer CritSound { get; set; } = default!; [Node] private AudioStreamPlayer CritSound { get; set; } = default!;
[Node] private AudioStreamPlayer PickupItemSound { get; set; } = default!; [Node] private AudioStreamPlayer PickupItemSound { get; set; } = default!;
[Node] private AudioStreamPlayer OpenInventorySound { get; set; } [Node] private AudioStreamPlayer OpenInventorySound { get; set; }
@@ -92,7 +87,6 @@ public enum SoundEffect
TakeDamage, TakeDamage,
HealVT, HealVT,
IncreaseStat, IncreaseStat,
DecreaseStat,
Crit, Crit,
PickupItem, PickupItem,
OpenInventory, OpenInventory,
@@ -112,7 +106,6 @@ public enum SoundEffect
SwapHPAndVT, SwapHPAndVT,
TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItems,
WeaponQuickSlash, WeaponQuickSlash,
WeaponSlowSlash, WeaponSlowSlash
WeaponPlasmaSword
} }

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=3 format=3 uid="uid://dqvlemme0iwa"] [gd_scene load_steps=3 format=3 uid="uid://didc6vnf5ftlg"]
[ext_resource type="Script" uid="uid://bb36q1wpe0tlw" path="res://src/camera/ShakeCamera.cs" id="1_ubmds"] [ext_resource type="Script" uid="uid://bb36q1wpe0tlw" path="res://src/camera/ShakeCamera.cs" id="1_ubmds"]

View File

@@ -0,0 +1,164 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
using Zennysoft.Game.Abstractions;
namespace Zennysoft.Game.Ma;
public interface IDataViewer
{
}
[Meta(typeof(IAutoNode))]
public partial class DataViewer : Control, IDataViewer
{
public override void _Notification(int what) => this.Notify(what);
[Dependency]
public IAppRepo AppRepo => this.DependOn<IAppRepo>();
[Export]
public float _cameraSpeed = 0.01f;
[Node] public Node3D CameraPivot { get; set; } = default!;
[Node] public Camera3D Camera3D { get; set; } = default!;
[Node] public Node3D ModelPivot { get; set; } = default!;
#region UI
[Node] public RichTextLabel EnemyName { get; set; } = default!;
[Node] public RichTextLabel Description { get; set; } = default!;
[Node] public Label HPValue { get; set; } = default!;
[Node] public Label ATKValue { get; set; } = default!;
[Node] public Label DEFValue { get; set; } = default!;
[Node] public Label Drop1Value { get; set; } = default!;
[Node] public Label Drop2Value { get; set; } = default!;
[Node] public Label AffinityValue { get; set; } = default!;
[Node] public Label WeaknessValue { get; set; } = default!;
[Node] public Control EnemyInfo { get; set; } = default!;
[Node] public Button BackButton { get; set; } = default!;
#endregion
private EnemyModelView _currentModel;
private float _cameraStartingPoint = 0f;
private int _currentIndex = 0;
private List<EnemyModelView> _enemies;
public void OnReady()
{
BackButton.Pressed += BackButton_Pressed;
_enemies = [.. ModelPivot.GetChildren().Cast<EnemyModelView>()];
_currentModel = _enemies.First();
DisplayEnemy();
}
public void OnEnterTree() => GetTree().Paused = false;
public void OnExitTree() => GetTree().Paused = false;
private void BackButton_Pressed() => AppRepo.OnDataViewerExited();
public override void _Input(InputEvent @event)
{
if (BackButton.HasFocus() && @event.IsActionPressed(GameInputs.Interact))
{
GetTree().Paused = false;
BackButton.ReleaseFocus();
return;
}
if (_currentModel == null || BackButton.HasFocus())
return;
if (@event.IsActionPressed(GameInputs.Attack))
_currentModel.PlayPrimaryAttackAnimation();
if (@event.IsActionPressed(GameInputs.InventorySort))
_currentModel.PlaySecondaryAttackAnimation();
if (Input.IsActionJustPressed(GameInputs.Inventory))
_currentModel.PlayActivateAnimation();
if (@event.IsActionPressed(GameInputs.EnemyViewerWalk))
_currentModel.PlayWalkAnimation();
if (@event.IsActionReleased(GameInputs.EnemyViewerWalk))
_currentModel.PlayIdleAnimation();
if (@event.IsActionPressed(GameInputs.Interact))
{
GetTree().Paused = true;
BackButton.GrabFocus();
}
if (@event.IsActionPressed(GameInputs.StrafeRight))
{
// Load next model
_enemies[_currentIndex].Hide();
if (_currentIndex == _enemies.Count - 1)
_currentIndex = 0;
else
_currentIndex++;
DisplayEnemy();
}
if (@event.IsActionPressed(GameInputs.StrafeLeft))
{
_enemies[_currentIndex].Hide();
// Load previous model
if (_currentIndex == 0)
_currentIndex = _enemies.Count - 1;
else
_currentIndex--;
DisplayEnemy();
}
}
public override void _Process(double delta)
{
if (_currentModel == null || BackButton.HasFocus())
return;
var forwardStrength = Input.GetActionStrength(GameInputs.CameraForward);
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, _cameraSpeed * forwardStrength * (_cameraStartingPoint / 10));
var backStrength = Input.GetActionStrength(GameInputs.CameraBack);
Camera3D.Position = Camera3D.Position.MoveToward(CameraPivot.Position, -_cameraSpeed * backStrength * (_cameraStartingPoint / 10));
var leftStrength = Input.GetActionStrength(GameInputs.MoveLeft);
CameraPivot.RotateY(_cameraSpeed * leftStrength);
var rightStrength = Input.GetActionStrength(GameInputs.MoveRight);
CameraPivot.RotateY(-_cameraSpeed * rightStrength);
Camera3D.Position = Camera3D.Position.Clamp(new Vector3(0, 0, _cameraStartingPoint / 2), new Vector3(0, 0, _cameraStartingPoint));
ModelPivot.Rotation = ModelPivot.Rotation.Clamp(Mathf.DegToRad(-60), Mathf.DegToRad(60));
if (_currentModel is EnemyModelView2D enemyModelView2D)
enemyModelView2D.SetCurrentDirection(_currentModel.GlobalBasis, -CameraPivot.Basis.Z);
}
private void DisplayEnemy()
{
_currentModel = _enemies[_currentIndex];
var size = _currentModel.GetSize();
if (_currentModel is EnemyModelView2D)
_cameraStartingPoint = size.X / 50;
else
_cameraStartingPoint = size.X * 2;
Camera3D.Position = new Vector3(Camera3D.Position.X, Camera3D.Position.Y, _cameraStartingPoint);
EnemyName.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.Name : "Placeholder Text";
Description.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.Description : "Placeholder Text";
HPValue.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.MaximumHP : "Placeholder Text";
ATKValue.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.ATK : "Placeholder Text";
DEFValue.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.DEF : "Placeholder Text";
Drop1Value.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.Drop1 : "Placeholder Text";
Drop2Value.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.Drop2 : "Placeholder Text";
AffinityValue.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.Affinity : "Placeholder Text";
WeaknessValue.Text = _currentModel.EnemyLoreInfo != null ? _currentModel.EnemyLoreInfo.Weakness : "Placeholder Text";
_enemies[_currentIndex].Show();
}
}

Some files were not shown because too many files have changed in this diff Show More