diff --git a/Zennysoft.Game.Ma.Implementation/Components/IAttackComponent.cs b/Zennysoft.Game.Ma.Implementation/Components/IAttackComponent.cs index abda2db5c..f163505b2 100644 --- a/Zennysoft.Game.Ma.Implementation/Components/IAttackComponent.cs +++ b/Zennysoft.Game.Ma.Implementation/Components/IAttackComponent.cs @@ -15,4 +15,6 @@ public interface IAttackComponent : IEntityComponent public void SetAttack(int attack); public void RaiseMaximumAttack(int raiseAmount); + + public void LowerMaximumAttack(int lowerAmount); } diff --git a/Zennysoft.Game.Ma.Implementation/Components/IDefenseComponent.cs b/Zennysoft.Game.Ma.Implementation/Components/IDefenseComponent.cs index 46875a369..bc88a9c9a 100644 --- a/Zennysoft.Game.Ma.Implementation/Components/IDefenseComponent.cs +++ b/Zennysoft.Game.Ma.Implementation/Components/IDefenseComponent.cs @@ -15,4 +15,6 @@ public interface IDefenseComponent : IEntityComponent public void SetDefense(int attack); public void RaiseMaximumDefense(int raiseAmount); + + public void LowerMaximumDefense(int lowerAmount); } diff --git a/Zennysoft.Game.Ma.Implementation/Components/IExperiencePointsComponent.cs b/Zennysoft.Game.Ma.Implementation/Components/IExperiencePointsComponent.cs index 16ccdf399..01ce97edf 100644 --- a/Zennysoft.Game.Ma.Implementation/Components/IExperiencePointsComponent.cs +++ b/Zennysoft.Game.Ma.Implementation/Components/IExperiencePointsComponent.cs @@ -20,5 +20,9 @@ public interface IExperiencePointsComponent : IEntityComponent public void LevelUp(); + public void LevelDown(); + public event Action PlayerLevelUp; + + public event Action PlayerLevelDown; } diff --git a/Zennysoft.Game.Ma.Implementation/Components/IHealthComponent.cs b/Zennysoft.Game.Ma.Implementation/Components/IHealthComponent.cs index c88a870e8..cc48c9df5 100644 --- a/Zennysoft.Game.Ma.Implementation/Components/IHealthComponent.cs +++ b/Zennysoft.Game.Ma.Implementation/Components/IHealthComponent.cs @@ -22,4 +22,6 @@ public interface IHealthComponent : IEntityComponent public void SetMaximumHealth(int health); public void RaiseMaximumHP(int raiseAmount, bool restoreHP = false); + + public void LowerMaximumHP(int lowerAmount); } \ No newline at end of file diff --git a/Zennysoft.Game.Ma.Implementation/Components/LuckComponent.cs b/Zennysoft.Game.Ma.Implementation/Components/LuckComponent.cs index 230f19b6a..279dd2d80 100644 --- a/Zennysoft.Game.Ma.Implementation/Components/LuckComponent.cs +++ b/Zennysoft.Game.Ma.Implementation/Components/LuckComponent.cs @@ -7,4 +7,6 @@ public interface ILuckComponent : IEntityComponent public IAutoProp Luck { get; } public void IncreaseLuck(int value); + + void DecreaseLuck(int value); } diff --git a/Zennysoft.Game.Ma.Implementation/Equipment/Tags/UsableItemTag.cs b/Zennysoft.Game.Ma.Implementation/Equipment/Tags/UsableItemTag.cs index 010f9f42e..5dcb27bca 100644 --- a/Zennysoft.Game.Ma.Implementation/Equipment/Tags/UsableItemTag.cs +++ b/Zennysoft.Game.Ma.Implementation/Equipment/Tags/UsableItemTag.cs @@ -15,6 +15,7 @@ public enum UsableItemTag RaiseCurrentWeaponAttack, RaiseCurrentDefenseArmor, RaiseLevel, + LowerLevel, RandomEffect, DoubleExp, LowerTargetTo1HP, @@ -26,5 +27,8 @@ public enum UsableItemTag IncreaseAttack, DecreaseDefense, DecreaseLuck, - DecreaseAttack + DecreaseAttack, + DecreaseAllStats, + Clone, + MeltAllEquipment } diff --git a/Zennysoft.Game.Ma/src/Components/ExperiencePointsComponent.cs b/Zennysoft.Game.Ma/src/Components/ExperiencePointsComponent.cs index 17952b3a5..b33bb42d3 100644 --- a/Zennysoft.Game.Ma/src/Components/ExperiencePointsComponent.cs +++ b/Zennysoft.Game.Ma/src/Components/ExperiencePointsComponent.cs @@ -1,4 +1,5 @@ using Chickensoft.Collections; +using Godot; using System; using Zennysoft.Ma.Adapter; @@ -24,6 +25,8 @@ public class ExperiencePointsComponent : IExperiencePointsComponent public event Action PlayerLevelUp; + public event Action PlayerLevelDown; + public ExperiencePointsComponent() { var firstLevelExpRequirement = ExpToNextLevelCalculation(1); @@ -73,6 +76,21 @@ public class ExperiencePointsComponent : IExperiencePointsComponent 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) { return (int)(6.5 * nextLevel + 4.5 * Math.Pow(nextLevel, 2) + Math.Pow(nextLevel, 3)); diff --git a/Zennysoft.Game.Ma/src/Components/HealthComponent.cs b/Zennysoft.Game.Ma/src/Components/HealthComponent.cs index 925d1e3c4..43d70ffd1 100644 --- a/Zennysoft.Game.Ma/src/Components/HealthComponent.cs +++ b/Zennysoft.Game.Ma/src/Components/HealthComponent.cs @@ -1,4 +1,5 @@ using Chickensoft.Collections; +using Godot; using System; using Zennysoft.Ma.Adapter; @@ -77,4 +78,11 @@ public class HealthComponent : IHealthComponent if (restoreHP) Heal(raiseAmount); } + + public void LowerMaximumHP(int lowerAmount) + { + _maximumHP.OnNext(Mathf.Max(_maximumHP.Value - lowerAmount, 1)); + if (_currentHP.Value > _maximumHP.Value) + _currentHP.OnNext(_maximumHP.Value); + } } diff --git a/Zennysoft.Game.Ma/src/audio/SFXDatabase.tscn b/Zennysoft.Game.Ma/src/audio/SFXDatabase.tscn index 86f6fa26d..1a97fdf43 100644 --- a/Zennysoft.Game.Ma/src/audio/SFXDatabase.tscn +++ b/Zennysoft.Game.Ma/src/audio/SFXDatabase.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=26 format=3 uid="uid://brgi35xj3b4ud"] +[gd_scene load_steps=27 format=3 uid="uid://brgi35xj3b4ud"] [ext_resource type="Script" uid="uid://cw100tox0ufsy" path="res://src/audio/SfxDatabase.cs" id="1_ojkqd"] [ext_resource type="AudioStream" uid="uid://cye8wlqbx66h4" path="res://src/audio/sfx/player_heal.ogg" id="2_158j8"] @@ -9,6 +9,7 @@ [ext_resource type="AudioStream" uid="uid://c817txm4tmup7" path="res://src/audio/sfx/PLAYER_EQUIP.ogg" id="7_sew62"] [ext_resource type="AudioStream" uid="uid://qxi7qto7hhgk" path="res://src/audio/sfx/PLAYER_UNEQUIP.ogg" id="8_rf1la"] [ext_resource type="AudioStream" uid="uid://doeefxilh0luj" path="res://src/audio/sfx/ITEM_SORT.ogg" id="9_l6w22"] +[ext_resource type="AudioStream" uid="uid://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://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"] @@ -74,6 +75,11 @@ unique_name_in_owner = true stream = ExtResource("13_fa8i8") bus = &"SFX" +[node name="WeaponPlasmaSword" type="AudioStreamPlayer" parent="Player"] +unique_name_in_owner = true +stream = ExtResource("10_7th20") +bus = &"SFX" + [node name="WeaponSlowSlashSound" type="AudioStreamPlayer" parent="Player"] unique_name_in_owner = true stream = ExtResource("10_vyvit") diff --git a/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs b/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs index 4c8f8a3a1..106d19879 100644 --- a/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs +++ b/Zennysoft.Game.Ma/src/audio/SfxDatabase.cs @@ -44,6 +44,7 @@ public partial class SfxDatabase : Node {SoundEffect.TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItemsSound}, {SoundEffect.WeaponQuickSlash, WeaponQuickSlashSound }, {SoundEffect.WeaponSlowSlash, WeaponSlowSlashSound }, + {SoundEffect.WeaponPlasmaSword, WeaponPlasmaSword }, }; } @@ -55,6 +56,7 @@ public partial class SfxDatabase : Node [Node] private AudioStreamPlayer DecreaseStatSound { get; set; } = default!; [Node] private AudioStreamPlayer WeaponQuickSlashSound { 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 PickupItemSound { get; set; } = default!; [Node] private AudioStreamPlayer OpenInventorySound { get; set; } @@ -111,5 +113,6 @@ public enum SoundEffect TurnAllEnemiesIntoHealingItems, WeaponQuickSlash, WeaponSlowSlash, + WeaponPlasmaSword } diff --git a/Zennysoft.Game.Ma/src/enemy/EnemyTypeToEnemyConverter.cs b/Zennysoft.Game.Ma/src/enemy/EnemyTypeToEnemyConverter.cs index 8d7bd03db..a9957d08e 100644 --- a/Zennysoft.Game.Ma/src/enemy/EnemyTypeToEnemyConverter.cs +++ b/Zennysoft.Game.Ma/src/enemy/EnemyTypeToEnemyConverter.cs @@ -1,5 +1,7 @@ using Godot; using System; +using System.Collections.Generic; +using Zennysoft.Ma.Adapter.Entity; namespace Zennysoft.Game.Ma; @@ -48,6 +50,45 @@ public static class EnemyTypeToEnemyConverter } } + public static EnemyType Convert(IEnemy enemy) + { + if (enemy is Sproingy) + return EnemyType.Sproingy; + if (enemy is Michael) + return EnemyType.Michael; + if (enemy is FilthEater) + return EnemyType.FilthEater; + if (enemy is Sara) + return EnemyType.Sara; + if (enemy is Ballos) + return EnemyType.Ballos; + if (enemy is Chariot) + return EnemyType.Chariot; + if (enemy is Chinthe) + return EnemyType.Chinthe; + if (enemy is Ambassador ambassador) + if (ambassador.Name == "Ambassador") + return EnemyType.AmbassadorGreen; + else if (ambassador.Name == "AmbassadorRed") + return EnemyType.AmbassadorRed; + else + return EnemyType.AmbassadorSteel; + if (enemy is AgniDemon) + return EnemyType.AgniDemon; + if (enemy is AqueousDemon) + return EnemyType.AqueousDemon; + if (enemy is EdenPillar) + return EnemyType.EdenPillar; + if (enemy is Palan) + return EnemyType.Palan; + if (enemy is ShieldOfHeaven) + return EnemyType.ShieldOfHeaven; + if (enemy is GoldSproingy) + return EnemyType.GoldSproingy; + + throw new NotImplementedException("Cannot duplicate this type of enemy."); + } + private static Enemy InstantiateFromPath(string scenePath) { var enemyScene = GD.Load(scenePath); diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn index 776b2e45e..6d48b88f0 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08a. Ambassador/Ambassador.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" uid="uid://dauir5q616wyq" path="res://src/enemy/enemy_types/08a. Ambassador/Ambassador.cs" id="1_m2guv"] [ext_resource type="PackedScene" uid="uid://cn4fv2gv6raql" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="4_hqy0f"] -[ext_resource type="PackedScene" path="res://src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn" id="4_pjmem"] +[ext_resource type="PackedScene" uid="uid://7eo16vsbrgi3" path="res://src/enemy/enemy_types/08a. Ambassador/AmbassadorModelView.tscn" id="4_pjmem"] [ext_resource type="PackedScene" uid="uid://cve5oouhowtff" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="5_gy5yi"] [ext_resource type="PackedScene" uid="uid://cmhem5xknjsvc" path="res://src/enemy/behaviors/EngagePlayerBehavior.tscn" id="6_7f1qq"] [ext_resource type="AudioStream" uid="uid://ba8xendacec6" path="res://src/audio/sfx/item_kyuu_layer_2.ogg" id="6_sjoyv"] diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn index e5f53957f..9c05767ec 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorRed.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=15 format=3 uid="uid://dxxs80o40exdi"] [ext_resource type="Script" uid="uid://dauir5q616wyq" path="res://src/enemy/enemy_types/08a. Ambassador/Ambassador.cs" id="1_4nav4"] -[ext_resource type="PackedScene" path="res://src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn" id="4_hqkeq"] +[ext_resource type="PackedScene" uid="uid://d02te8cwjistl" path="res://src/enemy/enemy_types/08b. Ambassador (red)/AmbassadorSmallModelView.tscn" id="4_hqkeq"] [ext_resource type="PackedScene" uid="uid://cn4fv2gv6raql" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="5_65xvc"] [ext_resource type="AudioStream" uid="uid://ba8xendacec6" path="res://src/audio/sfx/item_kyuu_layer_2.ogg" id="6_a21yr"] [ext_resource type="PackedScene" uid="uid://cve5oouhowtff" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_v4xmn"] diff --git a/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn b/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn index 179412802..b5ccef283 100644 --- a/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn +++ b/Zennysoft.Game.Ma/src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteel.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=15 format=3 uid="uid://dbgecijg766m6"] [ext_resource type="Script" uid="uid://dauir5q616wyq" path="res://src/enemy/enemy_types/08a. Ambassador/Ambassador.cs" id="1_ln0kc"] -[ext_resource type="PackedScene" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn" id="4_kdt1g"] +[ext_resource type="PackedScene" uid="uid://g8km112r1lqa" path="res://src/enemy/enemy_types/08c. Ambassador (steel)/AmbassadorSteelModelView.tscn" id="4_kdt1g"] [ext_resource type="PackedScene" uid="uid://cn4fv2gv6raql" path="res://src/enemy/behaviors/PatrolBehavior.tscn" id="5_fmnae"] [ext_resource type="AudioStream" uid="uid://ba8xendacec6" path="res://src/audio/sfx/item_kyuu_layer_2.ogg" id="6_5r3ee"] [ext_resource type="PackedScene" uid="uid://cve5oouhowtff" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_g5uri"] diff --git a/Zennysoft.Game.Ma/src/game/Game.cs b/Zennysoft.Game.Ma/src/game/Game.cs index 46ca9ca56..74b465679 100644 --- a/Zennysoft.Game.Ma/src/game/Game.cs +++ b/Zennysoft.Game.Ma/src/game/Game.cs @@ -546,6 +546,9 @@ public partial class Game : Node3D, IGame case UsableItemTag.RaiseLevel: _effectService.RaiseLevel(); break; + case UsableItemTag.LowerLevel: + _effectService.LowerLevel(); + break; case UsableItemTag.RandomEffect: _effectService.RandomEffect(effectItem); break; @@ -574,15 +577,25 @@ public partial class Game : Node3D, IGame SfxDatabase.Instance.Play(SoundEffect.IncreaseStat); break; case UsableItemTag.DecreaseAttack: - _player.AttackComponent.RaiseMaximumAttack(effectItem.Stats.BonusAttack); + _player.AttackComponent.LowerMaximumAttack(effectItem.Stats.BonusAttack); SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); break; case UsableItemTag.DecreaseDefense: - _player.DefenseComponent.RaiseMaximumDefense(effectItem.Stats.BonusDefense); + _player.DefenseComponent.LowerMaximumDefense(effectItem.Stats.BonusDefense); SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); break; case UsableItemTag.DecreaseLuck: - _player.LuckComponent.IncreaseLuck(effectItem.Stats.BonusLuck); + _player.LuckComponent.DecreaseLuck(effectItem.Stats.BonusLuck); + SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); + break; + case UsableItemTag.DecreaseAllStats: + _player.AttackComponent.LowerMaximumAttack(effectItem.Stats.BonusAttack); + _player.DefenseComponent.LowerMaximumDefense(effectItem.Stats.BonusDefense); + _player.LuckComponent.DecreaseLuck(effectItem.Stats.BonusLuck); + SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); + break; + case UsableItemTag.MeltAllEquipment: + _effectService.MeltAllEquipment(_player); SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); break; } diff --git a/Zennysoft.Game.Ma/src/items/EffectService.cs b/Zennysoft.Game.Ma/src/items/EffectService.cs index 7b5aa19b4..b0c08d0b8 100644 --- a/Zennysoft.Game.Ma/src/items/EffectService.cs +++ b/Zennysoft.Game.Ma/src/items/EffectService.cs @@ -178,6 +178,12 @@ public class EffectService _player.ExperiencePointsComponent.GainUnmodified(expToNextLevel); } + public void LowerLevel() + { + var expToNextLevel = _player.ExperiencePointsComponent.ExpToNextLevel.Value - _player.ExperiencePointsComponent.CurrentExp.Value; + _player.ExperiencePointsComponent.LevelDown(); + } + public void TeleportToRandomRoom(IEnemy enemy) { var currentFloor = _game.CurrentFloor; @@ -196,6 +202,44 @@ public class EffectService enemy.MoveEnemyToNewRoom(randomRoom); } + public void CloneEnemy(IEnemy enemy) + { + var enemyPosition = new Vector3(enemy.GlobalPosition.X, 0f, enemy.GlobalPosition.Z); + var enemyType = EnemyTypeToEnemyConverter.Convert(enemy); + var duplicatedEnemy = EnemyTypeToEnemyConverter.Convert(enemyType); + duplicatedEnemy.Position = enemy.GlobalPosition + enemy.GlobalBasis.X; + _map.AddChild(duplicatedEnemy); + } + + public void MeltAllEquipment(IPlayer player) + { + var weapon = player.EquipmentComponent.EquippedWeapon.Value; + var armor = player.EquipmentComponent.EquippedArmor.Value; + var accessory = player.EquipmentComponent.EquippedAccessory.Value; + var ammo = player.EquipmentComponent.EquippedAmmo.Value; + + if (weapon != null) + { + player.Unequip(weapon); + player.Inventory.Remove(weapon); + } + if (armor != null) + { + player.Unequip(armor); + player.Inventory.Remove(armor); + } + if (accessory != null) + { + player.Unequip(accessory); + player.Inventory.Remove(accessory); + } + if (ammo != null) + { + player.Unequip(ammo); + player.Inventory.Remove(ammo); + } + } + public void TeleportToRandomRoom(IPlayer player) { var currentFloor = _game.CurrentFloor; diff --git a/Zennysoft.Game.Ma/src/items/accessory/Accessory.cs b/Zennysoft.Game.Ma/src/items/accessory/Accessory.cs index 14aa966f0..d519c5e86 100644 --- a/Zennysoft.Game.Ma/src/items/accessory/Accessory.cs +++ b/Zennysoft.Game.Ma/src/items/accessory/Accessory.cs @@ -20,6 +20,8 @@ public partial class Accessory : Node3D, IAccessory _bonusDamage = Stats.BonusAttack; _bonusDefense = Stats.BonusDefense; _bonusLuck = Stats.BonusLuck; + _bonusHp = Stats.BonusHP; + _bonusVt = Stats.BonusVT; } public string ItemName => Stats.Name; @@ -37,9 +39,9 @@ public partial class Accessory : Node3D, IAccessory public int BonusLuck { get => _bonusLuck; } - public int BonusHP => Stats.BonusHP; + public int BonusHP { get => _bonusHp; } - public int BonusVT => Stats.BonusVT; + public int BonusVT { get => _bonusVt; } public ElementalResistanceSet ElementalResistance => new ElementalResistanceSet(Stats.AeolicResistance, Stats.HydricResistance, Stats.IgneousResistance, Stats.FerrumResistance, Stats.TelluricResistance, Stats.HolyResistance, Stats.CurseResistance); @@ -57,6 +59,12 @@ public partial class Accessory : Node3D, IAccessory [Save("accessory_bonus_luck")] private int _bonusLuck { get; set; } = 0; + [Save("accessory_bonus_hp")] + private int _bonusHp { get; set; } = 0; + + [Save("accessory_bonus_vt")] + private int _bonusVt { get; set; } = 0; + public void IncreaseAttack(int bonus) => _bonusDamage += bonus; public void SetAttack(int newBonus) => _bonusDamage = newBonus; diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/Ablution.tres b/Zennysoft.Game.Ma/src/items/effect/resources/Ablution.tres new file mode 100644 index 000000000..68cf84480 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/Ablution.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://clmirf817k2ah"] + +[ext_resource type="Texture2D" uid="uid://iadyvwubpm04" path="res://src/items/effect/textures/Ablution.png" id="1_8xvgi"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_cjlom"] + +[resource] +script = ExtResource("2_cjlom") +UsableItemTag = 15 +ElementalDamageType = 0 +Name = "Spell Sign: Ablution" +Description = "Lowers HP to 1." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 0.05 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 0 +ItemTag = 0 +Texture = ExtResource("1_8xvgi") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/Atomization.tres b/Zennysoft.Game.Ma/src/items/effect/resources/Atomization.tres index 1eb88e56e..374943eb6 100644 --- a/Zennysoft.Game.Ma/src/items/effect/resources/Atomization.tres +++ b/Zennysoft.Game.Ma/src/items/effect/resources/Atomization.tres @@ -5,13 +5,13 @@ [resource] script = ExtResource("2_mhyhg") -UsableItemTag = 19 +UsableItemTag = 22 ElementalDamageType = 0 Name = "Spell Sign: Atomization" -Description = "Permanently Lowers DEF by 1." +Description = "Permanently Lowers Defense by 1." SpawnRate = 0.5 BonusAttack = 0 -BonusDefense = -1 +BonusDefense = 1 BonusLuck = 0 BonusHP = 0 BonusVT = 0 diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/CellDegradation.tres b/Zennysoft.Game.Ma/src/items/effect/resources/CellDegradation.tres new file mode 100644 index 000000000..25d78cd50 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/CellDegradation.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://c2r8ds2ejywwq"] + +[ext_resource type="Texture2D" uid="uid://cml5pitheqxs3" path="res://src/items/effect/textures/Cell Degredation.png" id="1_xig8f"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_13loo"] + +[resource] +script = ExtResource("2_13loo") +UsableItemTag = 25 +ElementalDamageType = 0 +Name = "Spell Sign: Cell Degradation" +Description = "Permanently Lowers All Parameters by 1." +SpawnRate = 0.5 +BonusAttack = 1 +BonusDefense = 1 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_xig8f") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/Clone.tres b/Zennysoft.Game.Ma/src/items/effect/resources/Clone.tres new file mode 100644 index 000000000..c64b3aa90 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/Clone.tres @@ -0,0 +1,31 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://c2nhv3dyubv14"] + +[ext_resource type="Texture2D" uid="uid://cjma4goflkwim" path="res://src/items/effect/textures/Spellsign; Clone.png" id="1_j266s"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_b16hc"] + +[resource] +script = ExtResource("2_b16hc") +UsableItemTag = 26 +ElementalDamageType = 0 +Name = "Spell Sign: Clone" +Description = "Creates another enemy when thrown. + +No effect if used." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 0 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 0 +ItemTag = 0 +Texture = ExtResource("1_j266s") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/Dullness.tres b/Zennysoft.Game.Ma/src/items/effect/resources/Dullness.tres new file mode 100644 index 000000000..f7f55ecad --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/Dullness.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://dhsdqjlc5lt84"] + +[ext_resource type="Texture2D" uid="uid://cwksvcn7ggqag" path="res://src/items/effect/textures/Dullness.png" id="1_p3m2a"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_vs32u"] + +[resource] +script = ExtResource("2_vs32u") +UsableItemTag = 24 +ElementalDamageType = 0 +Name = "Spell Sign: Dullness" +Description = "Permanently Lowers Attack by 1." +SpawnRate = 0.5 +BonusAttack = 1 +BonusDefense = 0 +BonusLuck = 0 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_p3m2a") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/Grudge.tres b/Zennysoft.Game.Ma/src/items/effect/resources/Grudge.tres new file mode 100644 index 000000000..99129d28d --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/Grudge.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://6v03c3k4xek2"] + +[ext_resource type="Texture2D" uid="uid://ddw0tkd6bt1rx" path="res://src/items/effect/textures/Grudge.png" id="1_sfn22"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_tlglo"] + +[resource] +script = ExtResource("2_tlglo") +UsableItemTag = 23 +ElementalDamageType = 0 +Name = "Spell Sign: Grudge" +Description = "Permanently Lowers Luck." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_sfn22") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/MelticalWave.tres b/Zennysoft.Game.Ma/src/items/effect/resources/MelticalWave.tres new file mode 100644 index 000000000..e6e07aab0 --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/MelticalWave.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://c3qkrtgmngetc"] + +[ext_resource type="Texture2D" uid="uid://ddw0tkd6bt1rx" path="res://src/items/effect/textures/Grudge.png" id="1_kik76"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_2sema"] + +[resource] +script = ExtResource("2_2sema") +UsableItemTag = 28 +ElementalDamageType = 0 +Name = "Spell Sign: Meltical Wave" +Description = "Melts all currently equipped items." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_kik76") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/effect/resources/Regression.tres b/Zennysoft.Game.Ma/src/items/effect/resources/Regression.tres new file mode 100644 index 000000000..3961a35fa --- /dev/null +++ b/Zennysoft.Game.Ma/src/items/effect/resources/Regression.tres @@ -0,0 +1,29 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://b8g6o1noqxaye"] + +[ext_resource type="Texture2D" uid="uid://ck0i7lgfby0yb" path="res://src/items/effect/textures/Regression.png" id="1_s8s8t"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_nyxl3"] + +[resource] +script = ExtResource("2_nyxl3") +UsableItemTag = 13 +ElementalDamageType = 0 +Name = "Spell Sign: Regression" +Description = "Lowers current Level by 1." +SpawnRate = 0.5 +BonusAttack = 0 +BonusDefense = 0 +BonusLuck = 5 +BonusHP = 0 +BonusVT = 0 +AeolicResistance = 0 +TelluricResistance = 0 +HydricResistance = 0 +IgneousResistance = 0 +FerrumResistance = 0 +HolyResistance = 0 +CurseResistance = 0 +ThrowSpeed = 12.0 +ThrowDamage = 5 +ItemTag = 0 +Texture = ExtResource("1_s8s8t") +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/Zennysoft.Game.Ma/src/items/misc/SetItem.tscn b/Zennysoft.Game.Ma/src/items/misc/SetItem.tscn index 21b7891e5..94c05fa63 100644 --- a/Zennysoft.Game.Ma/src/items/misc/SetItem.tscn +++ b/Zennysoft.Game.Ma/src/items/misc/SetItem.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=22 format=4 uid="uid://uyrqvf38un1w"] +[gd_scene load_steps=24 format=4 uid="uid://uyrqvf38un1w"] [ext_resource type="Script" uid="uid://da8mhruqpgh6r" path="res://src/items/misc/SetItem.cs" id="1_m8dyi"] [ext_resource type="AudioStream" uid="uid://bjcersd5id8ee" path="res://src/audio/sfx/ITEM_PLASTIQUETIMER.ogg" id="2_kgxna"] [ext_resource type="Texture2D" uid="uid://dkqs4x4pi18on" path="res://src/items/assets/plastique_plastique.png" id="2_m8dyi"] +[ext_resource type="AudioStream" uid="uid://ccioacbbqgvjq" path="res://src/audio/sfx/item_explosion.ogg" id="2_v8u1n"] +[ext_resource type="AudioStream" uid="uid://ci5xfc58nbhbk" path="res://src/audio/sfx/item_place.ogg" id="4_8ntcp"] [sub_resource type="Animation" id="Animation_eat5q"] length = 0.001 @@ -69,6 +71,7 @@ tracks/4/keys = { [sub_resource type="Animation" id="Animation_v8u1n"] resource_name = "explode" +length = 4.0 tracks/0/type = "value" tracks/0/imported = false tracks/0/enabled = true @@ -117,10 +120,25 @@ tracks/3/keys = { "update": 1, "values": [false, false] } +tracks/4/type = "audio" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("ExplosionSFX") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("2_v8u1n") +}], +"times": PackedFloat32Array(0) +} +tracks/4/use_blend = true [sub_resource type="Animation" id="Animation_kgxna"] resource_name = "explode" -length = 6.0 +length = 6.2 tracks/0/type = "audio" tracks/0/imported = false tracks/0/enabled = true @@ -133,7 +151,7 @@ tracks/0/keys = { "start_offset": 0.0, "stream": ExtResource("2_kgxna") }], -"times": PackedFloat32Array(0) +"times": PackedFloat32Array(0.0666667) } tracks/0/use_blend = true tracks/1/type = "value" @@ -143,10 +161,10 @@ tracks/1/path = NodePath("Model/Mesh:transparency") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), +"times": PackedFloat32Array(0.0333333, 0.3), +"transitions": PackedFloat32Array(1, 1), "update": 0, -"values": [0.0] +"values": [1.0, 0.0] } tracks/2/type = "value" tracks/2/imported = false @@ -155,11 +173,26 @@ tracks/2/path = NodePath("Model/Mesh:material_overlay:albedo_color") tracks/2/interp = 1 tracks/2/loop_wrap = true tracks/2/keys = { -"times": PackedFloat32Array(0, 0.366667, 0.5, 0.565232, 1.4, 1.53333, 1.59749, 2.4, 2.5572, 2.60183, 3.4, 3.6, 3.63109, 4.43333, 4.6, 4.63377, 5.47862, 5.6), +"times": PackedFloat32Array(0.0666667, 0.433334, 0.566667, 0.631899, 1.46667, 1.6, 1.66416, 2.46667, 2.62387, 2.6685, 3.46667, 3.66667, 3.69776, 4.5, 4.66667, 4.70044, 5.54529, 5.66667), "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), "update": 0, "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 0, 0, 0.439216), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 0, 0, 0.439216), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 0, 0, 0.439216), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 0, 0, 0.439216), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 0, 0, 0.439216), Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 0, 0, 0.439216)] } +tracks/3/type = "audio" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("SetSFX") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource("4_8ntcp") +}], +"times": PackedFloat32Array(0) +} +tracks/3/use_blend = true [sub_resource type="AnimationLibrary" id="AnimationLibrary_eat5q"] _data = { @@ -175,6 +208,7 @@ albedo_color = Color(1, 1, 1, 0) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_omo1p"] resource_name = "Material" cull_mode = 2 +depth_draw_mode = 1 albedo_texture = ExtResource("2_m8dyi") texture_filter = 2 @@ -275,7 +309,16 @@ mesh = SubResource("ArrayMesh_v8u1n") skeleton = NodePath("") [node name="TimerCountdown" type="AudioStreamPlayer3D" parent="."] +process_mode = 1 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00817871, 0) +bus = &"SFX" + +[node name="ExplosionSFX" type="AudioStreamPlayer3D" parent="."] +process_mode = 1 +bus = &"SFX" + +[node name="SetSFX" type="AudioStreamPlayer3D" parent="."] +bus = &"SFX" [node name="AnimationTree" type="AnimationTree" parent="."] unique_name_in_owner = true diff --git a/Zennysoft.Game.Ma/src/items/restorative/Restorative.tscn b/Zennysoft.Game.Ma/src/items/restorative/Restorative.tscn index bfe1c7c35..6ddf953b3 100644 --- a/Zennysoft.Game.Ma/src/items/restorative/Restorative.tscn +++ b/Zennysoft.Game.Ma/src/items/restorative/Restorative.tscn @@ -41,5 +41,6 @@ shape = SubResource("CapsuleShape3D_o8f22") [node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."] billboard = 1 texture_filter = 0 +render_priority = 100 sprite_frames = SubResource("SpriteFrames_mejdx") autoplay = "default" diff --git a/Zennysoft.Game.Ma/src/items/thrown/ThrownItem.cs b/Zennysoft.Game.Ma/src/items/thrown/ThrownItem.cs index d35fdcb5a..64d8d1e16 100644 --- a/Zennysoft.Game.Ma/src/items/thrown/ThrownItem.cs +++ b/Zennysoft.Game.Ma/src/items/thrown/ThrownItem.cs @@ -118,6 +118,9 @@ public partial class ThrownItem : RigidBody3D, IThrownItem case UsableItemTag.TeleportToRandomLocation: _effectService.TeleportToRandomRoom(enemy); break; + case UsableItemTag.Clone: + _effectService.CloneEnemy(enemy); + break; default: var damageDealt = DamageCalculator.CalculateDamage(new AttackData(usableItem.ThrowDamage, ElementType.None), enemy.DefenseComponent.CurrentDefense.Value, enemy.ElementalResistanceSet); enemy.HealthComponent.Damage(damageDealt); diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/BlackPlumeSword.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/BlackPlumeSword.tres index 006dcb4e2..0c28c3804 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/BlackPlumeSword.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/BlackPlumeSword.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 7 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Black Plume Sword" Description = "Deals curse damage." SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Ciello.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Ciello.tres index e66773dba..69236c252 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Ciello.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Ciello.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Ciello" Description = "Triple Strike. Does more damage when thrown." diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/CrossSword.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/CrossSword.tres index 6d8c77db4..574635f40 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/CrossSword.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/CrossSword.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 6 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Cross Sword" Description = "Holy damage." SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Dilemma.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Dilemma.tres index b25c9dc54..8cb651256 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Dilemma.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Dilemma.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 1 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 24 Name = "Dilemma" Description = "Damages self on every swing." SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/GeomanticReactor.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/GeomanticReactor.tres index 75419b635..9841891ff 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/GeomanticReactor.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/GeomanticReactor.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 11 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Geomantic Reactor" Description = "" SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/HopesEdge.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/HopesEdge.tres index 55347562f..03badca03 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/HopesEdge.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/HopesEdge.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 5 SelfDamage = 0 -SoundEffect = 4 +SoundEffect = 23 Name = "Last Reward" Description = "Sword that strikes harder the lower HP you have." SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/HuracansBlade.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/HuracansBlade.tres index 5766eefc3..5e416ccba 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/HuracansBlade.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/HuracansBlade.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 4 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Huracán's Blade" Description = "Igneous damage." SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Katara.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Katara.tres index ee0d656e3..4810e06ef 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Katara.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Katara.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.25 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Katara" Description = "+1 ATK, Fast" SpawnRate = 0.3 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Kubel.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Kubel.tres index 614112629..55af6e9c1 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Kubel.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Kubel.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 5 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 4 +SoundEffect = 24 Name = "Kubel" Description = "+9 ATK A very powerful spear. diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/LoveJudgement.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/LoveJudgement.tres index 448be924a..8075b96e5 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/LoveJudgement.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/LoveJudgement.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Love Judgement" Description = "+12 ATK A mace only wieldable by the stout of heart." diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/MothersSpear.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/MothersSpear.tres index 16f106a48..0a0fe8622 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/MothersSpear.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/MothersSpear.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 2 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Mother's Spear" Description = "\"Earth, When I am about to Die, I Lean on you. Earth, While I am Alive, I Depend on You\"." SpawnRate = 0.01 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/MysteryRod.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/MysteryRod.tres index 69bf3a5fc..7cb200180 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/MysteryRod.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/MysteryRod.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Mystery Rod" Description = "Unidentified rod." SpawnRate = 0.5 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/NaddahaSword.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/NaddahaSword.tres index 2c927e60f..2e73c3967 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/NaddahaSword.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/NaddahaSword.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 3 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Naddaha Sword" Description = "Hydric Damage." SpawnRate = 0.01 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/NebulaChain.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/NebulaChain.tres index 54b7142b2..825965635 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/NebulaChain.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/NebulaChain.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 2 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Nebula Chain" Description = "Chain Whip that strikes through time and dimension." SpawnRate = 0.01 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Palm of Heaven.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Palm of Heaven.tres index 8d7af1837..013a62acc 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Palm of Heaven.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Palm of Heaven.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 7 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Palm of Heaven" Description = "" SpawnRate = 0.01 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Persuader.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Persuader.tres index 80eae8829..15142a34f 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Persuader.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Persuader.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 12 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Persuader" Description = "" SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/PlasmaSword.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/PlasmaSword.tres index 58a9c69bc..243f26570 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/PlasmaSword.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/PlasmaSword.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 7 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 25 Name = "Plasma Sword" Description = "Has the power to occasionally instantly disintegrate an enemy" SpawnRate = 0.5 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Rondo.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Rondo.tres index b5998228f..5b6bf068b 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Rondo.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Rondo.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.333 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Rondo" Description = "+7 ATK An eastern blade outside of time and reproach." diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/RustedBlade.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/RustedBlade.tres index 3d1f40e2b..e807d7a17 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/RustedBlade.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/RustedBlade.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 5 WeaponTag = 6 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Rusted Blade" Description = "Small chance to give enemy and self a lethal infection." SpawnRate = 0.1 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/SealedSword.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/SealedSword.tres index 3b34f90e4..4d687ce0f 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/SealedSword.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/SealedSword.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Sealed Sword" Description = "Weapon cannot pass beyond current floor once equipped." SpawnRate = 0.5 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/ShiningHalberd.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/ShiningHalberd.tres index 685a129ba..948e462dc 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/ShiningHalberd.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/ShiningHalberd.tres @@ -9,7 +9,7 @@ AttackSpeed = 0.75 WeaponElement = 0 WeaponTag = 8 SelfDamage = 0 -SoundEffect = 23 +SoundEffect = 24 Name = "Shining Halberd" Description = "Weapon that gradually becomes weaker." SpawnRate = 0.3 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/SpadedStaff.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/SpadedStaff.tres index 6aebd2915..b1113cff0 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/SpadedStaff.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/SpadedStaff.tres @@ -9,7 +9,7 @@ AttackSpeed = 0.75 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 23 +SoundEffect = 24 Name = "Spaded Staff" Description = "" SpawnRate = 0.3 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Swan Sword Odette.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Swan Sword Odette.tres index f880576a6..a3cb73517 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Swan Sword Odette.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Swan Sword Odette.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.25 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Swan Sword; Odette" Description = "Raises Luck. The blade of a thousand faced heroine." diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/Talwar.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/Talwar.tres index c8e5fb101..dfb3590ef 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/Talwar.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/Talwar.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 0 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Talwar" Description = "" SpawnRate = 0.3 diff --git a/Zennysoft.Game.Ma/src/items/weapons/resources/YansaBlade.tres b/Zennysoft.Game.Ma/src/items/weapons/resources/YansaBlade.tres index 973ea2ca0..108e0d87d 100644 --- a/Zennysoft.Game.Ma/src/items/weapons/resources/YansaBlade.tres +++ b/Zennysoft.Game.Ma/src/items/weapons/resources/YansaBlade.tres @@ -9,7 +9,7 @@ AttackSpeed = 1.0 WeaponElement = 1 WeaponTag = 0 SelfDamage = 0 -SoundEffect = 22 +SoundEffect = 23 Name = "Yansã Blade" Description = "Aeolic damage." SpawnRate = 0.3 diff --git a/Zennysoft.Game.Ma/src/map/dungeon/code/DungeonFloor.cs b/Zennysoft.Game.Ma/src/map/dungeon/code/DungeonFloor.cs index 79109506a..5471ebc7e 100644 --- a/Zennysoft.Game.Ma/src/map/dungeon/code/DungeonFloor.cs +++ b/Zennysoft.Game.Ma/src/map/dungeon/code/DungeonFloor.cs @@ -20,9 +20,9 @@ public partial class DungeonFloor : Node3D, IDungeonFloor public void InitializeDungeon() { - Rooms = []; - Rooms = FindAllDungeonRooms([.. GetChildren()], Rooms); - _playerSpawnPoint = RandomizePlayerSpawnPoint(); + Rooms = []; + Rooms = FindAllDungeonRooms([.. GetChildren()], Rooms); + _playerSpawnPoint = RandomizePlayerSpawnPoint(); } public void FadeOutAudio() @@ -32,27 +32,27 @@ public partial class DungeonFloor : Node3D, IDungeonFloor public void SpawnEnemies(DungeonFloorNode floorNode) { - var enemyOdds = new Godot.Collections.Dictionary - { - { EnemyType.Sproingy, floorNode.Sproingy }, - { EnemyType.Michael, floorNode.Michael }, - { EnemyType.FilthEater, floorNode.FilthEater }, - { EnemyType.Sara, floorNode.Sara }, - { EnemyType.Ballos, floorNode.Ballos }, - { EnemyType.Chariot, floorNode.Chariot }, - { EnemyType.Chinthe, floorNode.Chinthe }, - { EnemyType.AmbassadorGreen, floorNode.GreenAmbassador }, - { EnemyType.AmbassadorRed, floorNode.RedAmbassador }, - { EnemyType.AmbassadorSteel, floorNode.SteelAmbassador }, - { EnemyType.AgniDemon, floorNode.AgniDemon }, - { EnemyType.AqueousDemon, floorNode.AqueosDemon }, - { EnemyType.Palan, floorNode.Palan }, - { EnemyType.ShieldOfHeaven, floorNode.ShieldOfHeaven }, - { EnemyType.GoldSproingy, floorNode.GoldSproingy }, - }; - var monsterRooms = Rooms.OfType(); - foreach (var room in monsterRooms) - room.SpawnEnemies(enemyOdds); + var enemyOdds = new Godot.Collections.Dictionary + { + { EnemyType.Sproingy, floorNode.Sproingy }, + { EnemyType.Michael, floorNode.Michael }, + { EnemyType.FilthEater, floorNode.FilthEater }, + { EnemyType.Sara, floorNode.Sara }, + { EnemyType.Ballos, floorNode.Ballos }, + { EnemyType.Chariot, floorNode.Chariot }, + { EnemyType.Chinthe, floorNode.Chinthe }, + { EnemyType.AmbassadorGreen, floorNode.GreenAmbassador }, + { EnemyType.AmbassadorRed, floorNode.RedAmbassador }, + { EnemyType.AmbassadorSteel, floorNode.SteelAmbassador }, + { EnemyType.AgniDemon, floorNode.AgniDemon }, + { EnemyType.AqueousDemon, floorNode.AqueosDemon }, + { EnemyType.Palan, floorNode.Palan }, + { EnemyType.ShieldOfHeaven, floorNode.ShieldOfHeaven }, + { EnemyType.GoldSproingy, floorNode.GoldSproingy }, + }; + var monsterRooms = Rooms.OfType(); + foreach (var room in monsterRooms) + room.SpawnEnemies(enemyOdds); } public (Vector3 Rotation, Vector3 Position) GetPlayerSpawnPoint() { return (_playerSpawnPoint.Rotation, new Vector3(_playerSpawnPoint.GlobalPosition.X, 0, _playerSpawnPoint.GlobalPosition.Z)); } @@ -60,25 +60,25 @@ public partial class DungeonFloor : Node3D, IDungeonFloor private Marker3D RandomizePlayerSpawnPoint() { - var randomSpawnLocations = Rooms - .OfType() - .Select(x => x.PlayerSpawn); - var godotCollection = new Godot.Collections.Array(randomSpawnLocations); - var result = godotCollection.PickRandom(); - return result; + var randomSpawnLocations = Rooms + .OfType() + .Select(x => x.PlayerSpawn); + var godotCollection = new Godot.Collections.Array(randomSpawnLocations); + var result = godotCollection.PickRandom(); + return result; } private static ImmutableList FindAllDungeonRooms(List nodesToSearch, ImmutableList roomsFound) { - if (nodesToSearch.Count == 0) - return roomsFound; + if (nodesToSearch.Count == 0) + return roomsFound; - foreach (var node in nodesToSearch) - { - if (node is IDungeonRoom dungeonRoom) - roomsFound = roomsFound.Add(dungeonRoom); - } + foreach (var node in nodesToSearch) + { + if (node is IDungeonRoom dungeonRoom) + roomsFound = roomsFound.Add(dungeonRoom); + } - return FindAllDungeonRooms([.. nodesToSearch.SelectMany(x => x.GetChildren())], roomsFound); + return FindAllDungeonRooms([.. nodesToSearch.SelectMany(x => x.GetChildren())], roomsFound); } } diff --git a/Zennysoft.Game.Ma/src/map/dungeon/code/SpecialFloor.cs b/Zennysoft.Game.Ma/src/map/dungeon/code/SpecialFloor.cs index 9861b4d75..8b81ec70d 100644 --- a/Zennysoft.Game.Ma/src/map/dungeon/code/SpecialFloor.cs +++ b/Zennysoft.Game.Ma/src/map/dungeon/code/SpecialFloor.cs @@ -22,7 +22,6 @@ public partial class SpecialFloor : Node3D, IDungeonFloor public virtual void FadeOutAudio() { - } public bool FloorIsLoaded { get; set; } diff --git a/Zennysoft.Game.Ma/src/player/Player.cs b/Zennysoft.Game.Ma/src/player/Player.cs index 950f62947..d36145905 100644 --- a/Zennysoft.Game.Ma/src/player/Player.cs +++ b/Zennysoft.Game.Ma/src/player/Player.cs @@ -190,6 +190,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide HealthComponent.CurrentHP.Changed += InverseHPToAttackPowerSync; HealthComponent.HealthReachedZero += Die; ExperiencePointsComponent.PlayerLevelUp += OnLevelUp; + ExperiencePointsComponent.PlayerLevelDown += OnLevelDown; PlayerFXAnimations.AnimationFinished += PlayerFXAnimations_AnimationFinished; HealthTimer.WaitTime = _healthTimerWaitTime; SetProcessInput(false); @@ -527,6 +528,11 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide BoostPlayerHPFromLevelUp(); } + private void OnLevelDown() + { + LowerPlayerHPFromLevelDown(); + } + private void BoostPlayerHPFromLevelUp() { var rng = new RandomNumberGenerator(); @@ -535,6 +541,14 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide HealthComponent.RaiseMaximumHP(hpIncrease); } + private void LowerPlayerHPFromLevelDown() + { + var rng = new RandomNumberGenerator(); + rng.Randomize(); + var hpIncrease = rng.RandiRange(3, 6); + HealthComponent.LowerMaximumHP(hpIncrease); + } + private static float LeftStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeLeft); private static float RightStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeRight); diff --git a/Zennysoft.Game.Ma/src/ui/inventory_menu/ActionPanel.cs b/Zennysoft.Game.Ma/src/ui/inventory_menu/ActionPanel.cs index 6e85cdc21..9ccdedd81 100644 --- a/Zennysoft.Game.Ma/src/ui/inventory_menu/ActionPanel.cs +++ b/Zennysoft.Game.Ma/src/ui/inventory_menu/ActionPanel.cs @@ -126,12 +126,12 @@ public partial class ActionPanel : Panel { if (_player.EquipmentComponent.IsItemEquipped(equipable)) { - _player.EquipmentComponent.Unequip(equipable); + _player.Unequip(equipable); SfxDatabase.Instance.Play(SoundEffect.Unequip); } else { - _player.EquipmentComponent.Equip(equipable); + _player.Equip(equipable); SfxDatabase.Instance.Play(SoundEffect.Equip); }