Wave of item effects and implementation

This commit is contained in:
2026-02-15 22:44:43 -08:00
parent 5233da4225
commit f09d6ac8e8
57 changed files with 508 additions and 86 deletions

View File

@@ -15,4 +15,6 @@ 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,4 +15,6 @@ 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

@@ -20,5 +20,9 @@ public interface IExperiencePointsComponent : IEntityComponent
public void LevelUp(); public void LevelUp();
public void LevelDown();
public event Action PlayerLevelUp; public event Action PlayerLevelUp;
public event Action PlayerLevelDown;
} }

View File

@@ -22,4 +22,6 @@ 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

@@ -7,4 +7,6 @@ public interface ILuckComponent : IEntityComponent
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

@@ -15,6 +15,7 @@ public enum UsableItemTag
RaiseCurrentWeaponAttack, RaiseCurrentWeaponAttack,
RaiseCurrentDefenseArmor, RaiseCurrentDefenseArmor,
RaiseLevel, RaiseLevel,
LowerLevel,
RandomEffect, RandomEffect,
DoubleExp, DoubleExp,
LowerTargetTo1HP, LowerTargetTo1HP,
@@ -26,5 +27,8 @@ public enum UsableItemTag
IncreaseAttack, IncreaseAttack,
DecreaseDefense, DecreaseDefense,
DecreaseLuck, DecreaseLuck,
DecreaseAttack DecreaseAttack,
DecreaseAllStats,
Clone,
MeltAllEquipment
} }

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;
@@ -24,6 +25,8 @@ 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);
@@ -73,6 +76,21 @@ 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,4 +1,5 @@
using Chickensoft.Collections; using Chickensoft.Collections;
using Godot;
using System; using System;
using Zennysoft.Ma.Adapter; using Zennysoft.Ma.Adapter;
@@ -77,4 +78,11 @@ 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,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="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,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://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"]
@@ -74,6 +75,11 @@ unique_name_in_owner = true
stream = ExtResource("13_fa8i8") stream = ExtResource("13_fa8i8")
bus = &"SFX" 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"] [node name="WeaponSlowSlashSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true unique_name_in_owner = true
stream = ExtResource("10_vyvit") stream = ExtResource("10_vyvit")

View File

@@ -44,6 +44,7 @@ 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 },
}; };
} }
@@ -55,6 +56,7 @@ public partial class SfxDatabase : Node
[Node] private AudioStreamPlayer DecreaseStatSound { 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; }
@@ -111,5 +113,6 @@ public enum SoundEffect
TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItems,
WeaponQuickSlash, WeaponQuickSlash,
WeaponSlowSlash, WeaponSlowSlash,
WeaponPlasmaSword
} }

View File

@@ -1,5 +1,7 @@
using Godot; using Godot;
using System; using System;
using System.Collections.Generic;
using Zennysoft.Ma.Adapter.Entity;
namespace Zennysoft.Game.Ma; 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) private static Enemy InstantiateFromPath(string scenePath)
{ {
var enemyScene = GD.Load<PackedScene>(scenePath); var enemyScene = GD.Load<PackedScene>(scenePath);

View File

@@ -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="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" 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://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="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"] [ext_resource type="AudioStream" uid="uid://ba8xendacec6" path="res://src/audio/sfx/item_kyuu_layer_2.ogg" id="6_sjoyv"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=15 format=3 uid="uid://dxxs80o40exdi"] [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="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="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="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"] [ext_resource type="PackedScene" uid="uid://cve5oouhowtff" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_v4xmn"]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=15 format=3 uid="uid://dbgecijg766m6"] [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="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="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="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"] [ext_resource type="PackedScene" uid="uid://cve5oouhowtff" path="res://src/enemy/behaviors/FollowBehavior.tscn" id="6_g5uri"]

View File

@@ -546,6 +546,9 @@ public partial class Game : Node3D, IGame
case UsableItemTag.RaiseLevel: case UsableItemTag.RaiseLevel:
_effectService.RaiseLevel(); _effectService.RaiseLevel();
break; break;
case UsableItemTag.LowerLevel:
_effectService.LowerLevel();
break;
case UsableItemTag.RandomEffect: case UsableItemTag.RandomEffect:
_effectService.RandomEffect(effectItem); _effectService.RandomEffect(effectItem);
break; break;
@@ -574,15 +577,25 @@ public partial class Game : Node3D, IGame
SfxDatabase.Instance.Play(SoundEffect.IncreaseStat); SfxDatabase.Instance.Play(SoundEffect.IncreaseStat);
break; break;
case UsableItemTag.DecreaseAttack: case UsableItemTag.DecreaseAttack:
_player.AttackComponent.RaiseMaximumAttack(effectItem.Stats.BonusAttack); _player.AttackComponent.LowerMaximumAttack(effectItem.Stats.BonusAttack);
SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); SfxDatabase.Instance.Play(SoundEffect.DecreaseStat);
break; break;
case UsableItemTag.DecreaseDefense: case UsableItemTag.DecreaseDefense:
_player.DefenseComponent.RaiseMaximumDefense(effectItem.Stats.BonusDefense); _player.DefenseComponent.LowerMaximumDefense(effectItem.Stats.BonusDefense);
SfxDatabase.Instance.Play(SoundEffect.DecreaseStat); SfxDatabase.Instance.Play(SoundEffect.DecreaseStat);
break; break;
case UsableItemTag.DecreaseLuck: 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); SfxDatabase.Instance.Play(SoundEffect.DecreaseStat);
break; break;
} }

View File

@@ -178,6 +178,12 @@ public class EffectService
_player.ExperiencePointsComponent.GainUnmodified(expToNextLevel); _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) public void TeleportToRandomRoom(IEnemy enemy)
{ {
var currentFloor = _game.CurrentFloor; var currentFloor = _game.CurrentFloor;
@@ -196,6 +202,44 @@ public class EffectService
enemy.MoveEnemyToNewRoom(randomRoom); 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) public void TeleportToRandomRoom(IPlayer player)
{ {
var currentFloor = _game.CurrentFloor; var currentFloor = _game.CurrentFloor;

View File

@@ -20,6 +20,8 @@ public partial class Accessory : Node3D, IAccessory
_bonusDamage = Stats.BonusAttack; _bonusDamage = Stats.BonusAttack;
_bonusDefense = Stats.BonusDefense; _bonusDefense = Stats.BonusDefense;
_bonusLuck = Stats.BonusLuck; _bonusLuck = Stats.BonusLuck;
_bonusHp = Stats.BonusHP;
_bonusVt = Stats.BonusVT;
} }
public string ItemName => Stats.Name; public string ItemName => Stats.Name;
@@ -37,9 +39,9 @@ public partial class Accessory : Node3D, IAccessory
public int BonusLuck { get => _bonusLuck; } 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); 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")] [Save("accessory_bonus_luck")]
private int _bonusLuck { get; set; } = 0; 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 IncreaseAttack(int bonus) => _bonusDamage += bonus;
public void SetAttack(int newBonus) => _bonusDamage = newBonus; public void SetAttack(int newBonus) => _bonusDamage = newBonus;

View File

@@ -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"

View File

@@ -5,13 +5,13 @@
[resource] [resource]
script = ExtResource("2_mhyhg") script = ExtResource("2_mhyhg")
UsableItemTag = 19 UsableItemTag = 22
ElementalDamageType = 0 ElementalDamageType = 0
Name = "Spell Sign: Atomization" Name = "Spell Sign: Atomization"
Description = "Permanently Lowers DEF by 1." Description = "Permanently Lowers Defense by 1."
SpawnRate = 0.5 SpawnRate = 0.5
BonusAttack = 0 BonusAttack = 0
BonusDefense = -1 BonusDefense = 1
BonusLuck = 0 BonusLuck = 0
BonusHP = 0 BonusHP = 0
BonusVT = 0 BonusVT = 0

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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="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="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="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"] [sub_resource type="Animation" id="Animation_eat5q"]
length = 0.001 length = 0.001
@@ -69,6 +71,7 @@ tracks/4/keys = {
[sub_resource type="Animation" id="Animation_v8u1n"] [sub_resource type="Animation" id="Animation_v8u1n"]
resource_name = "explode" resource_name = "explode"
length = 4.0
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
@@ -117,10 +120,25 @@ tracks/3/keys = {
"update": 1, "update": 1,
"values": [false, false] "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"] [sub_resource type="Animation" id="Animation_kgxna"]
resource_name = "explode" resource_name = "explode"
length = 6.0 length = 6.2
tracks/0/type = "audio" tracks/0/type = "audio"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
@@ -133,7 +151,7 @@ tracks/0/keys = {
"start_offset": 0.0, "start_offset": 0.0,
"stream": ExtResource("2_kgxna") "stream": ExtResource("2_kgxna")
}], }],
"times": PackedFloat32Array(0) "times": PackedFloat32Array(0.0666667)
} }
tracks/0/use_blend = true tracks/0/use_blend = true
tracks/1/type = "value" tracks/1/type = "value"
@@ -143,10 +161,10 @@ tracks/1/path = NodePath("Model/Mesh:transparency")
tracks/1/interp = 1 tracks/1/interp = 1
tracks/1/loop_wrap = true tracks/1/loop_wrap = true
tracks/1/keys = { tracks/1/keys = {
"times": PackedFloat32Array(0), "times": PackedFloat32Array(0.0333333, 0.3),
"transitions": PackedFloat32Array(1), "transitions": PackedFloat32Array(1, 1),
"update": 0, "update": 0,
"values": [0.0] "values": [1.0, 0.0]
} }
tracks/2/type = "value" tracks/2/type = "value"
tracks/2/imported = false tracks/2/imported = false
@@ -155,11 +173,26 @@ tracks/2/path = NodePath("Model/Mesh:material_overlay:albedo_color")
tracks/2/interp = 1 tracks/2/interp = 1
tracks/2/loop_wrap = true tracks/2/loop_wrap = true
tracks/2/keys = { 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), "transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 0, "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)] "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"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_eat5q"]
_data = { _data = {
@@ -175,6 +208,7 @@ albedo_color = Color(1, 1, 1, 0)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_omo1p"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_omo1p"]
resource_name = "Material" resource_name = "Material"
cull_mode = 2 cull_mode = 2
depth_draw_mode = 1
albedo_texture = ExtResource("2_m8dyi") albedo_texture = ExtResource("2_m8dyi")
texture_filter = 2 texture_filter = 2
@@ -275,7 +309,16 @@ mesh = SubResource("ArrayMesh_v8u1n")
skeleton = NodePath("") skeleton = NodePath("")
[node name="TimerCountdown" type="AudioStreamPlayer3D" parent="."] [node name="TimerCountdown" type="AudioStreamPlayer3D" parent="."]
process_mode = 1
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00817871, 0) 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="."] [node name="AnimationTree" type="AnimationTree" parent="."]
unique_name_in_owner = true unique_name_in_owner = true

View File

@@ -41,5 +41,6 @@ shape = SubResource("CapsuleShape3D_o8f22")
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."] [node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
billboard = 1 billboard = 1
texture_filter = 0 texture_filter = 0
render_priority = 100
sprite_frames = SubResource("SpriteFrames_mejdx") sprite_frames = SubResource("SpriteFrames_mejdx")
autoplay = "default" autoplay = "default"

View File

@@ -118,6 +118,9 @@ public partial class ThrownItem : RigidBody3D, IThrownItem
case UsableItemTag.TeleportToRandomLocation: case UsableItemTag.TeleportToRandomLocation:
_effectService.TeleportToRandomRoom(enemy); _effectService.TeleportToRandomRoom(enemy);
break; break;
case UsableItemTag.Clone:
_effectService.CloneEnemy(enemy);
break;
default: default:
var damageDealt = DamageCalculator.CalculateDamage(new AttackData(usableItem.ThrowDamage, ElementType.None), enemy.DefenseComponent.CurrentDefense.Value, enemy.ElementalResistanceSet); var damageDealt = DamageCalculator.CalculateDamage(new AttackData(usableItem.ThrowDamage, ElementType.None), enemy.DefenseComponent.CurrentDefense.Value, enemy.ElementalResistanceSet);
enemy.HealthComponent.Damage(damageDealt); enemy.HealthComponent.Damage(damageDealt);

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 7 WeaponElement = 7
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Black Plume Sword" Name = "Black Plume Sword"
Description = "Deals curse damage." Description = "Deals curse damage."
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Ciello" Name = "Ciello"
Description = "Triple Strike. Description = "Triple Strike.
Does more damage when thrown." Does more damage when thrown."

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 6 WeaponElement = 6
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Cross Sword" Name = "Cross Sword"
Description = "Holy damage." Description = "Holy damage."
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 1 WeaponTag = 1
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 24
Name = "Dilemma" Name = "Dilemma"
Description = "Damages self on every swing." Description = "Damages self on every swing."
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 11 WeaponTag = 11
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Geomantic Reactor" Name = "Geomantic Reactor"
Description = "" Description = ""
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 5 WeaponTag = 5
SelfDamage = 0 SelfDamage = 0
SoundEffect = 4 SoundEffect = 23
Name = "Last Reward" Name = "Last Reward"
Description = "Sword that strikes harder the lower HP you have." Description = "Sword that strikes harder the lower HP you have."
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 4 WeaponElement = 4
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Huracán's Blade" Name = "Huracán's Blade"
Description = "Igneous damage." Description = "Igneous damage."
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.25
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Katara" Name = "Katara"
Description = "+1 ATK, Fast" Description = "+1 ATK, Fast"
SpawnRate = 0.3 SpawnRate = 0.3

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 5 WeaponElement = 5
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 4 SoundEffect = 24
Name = "Kubel" Name = "Kubel"
Description = "+9 ATK Description = "+9 ATK
A very powerful spear. A very powerful spear.

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Love Judgement" Name = "Love Judgement"
Description = "+12 ATK Description = "+12 ATK
A mace only wieldable by the stout of heart." A mace only wieldable by the stout of heart."

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 2 WeaponElement = 2
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Mother's Spear" 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\"." Description = "\"Earth, When I am about to Die, I Lean on you. Earth, While I am Alive, I Depend on You\"."
SpawnRate = 0.01 SpawnRate = 0.01

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Mystery Rod" Name = "Mystery Rod"
Description = "Unidentified rod." Description = "Unidentified rod."
SpawnRate = 0.5 SpawnRate = 0.5

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 3 WeaponElement = 3
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Naddaha Sword" Name = "Naddaha Sword"
Description = "Hydric Damage." Description = "Hydric Damage."
SpawnRate = 0.01 SpawnRate = 0.01

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 2 WeaponTag = 2
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Nebula Chain" Name = "Nebula Chain"
Description = "Chain Whip that strikes through time and dimension." Description = "Chain Whip that strikes through time and dimension."
SpawnRate = 0.01 SpawnRate = 0.01

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 7 WeaponElement = 7
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Palm of Heaven" Name = "Palm of Heaven"
Description = "" Description = ""
SpawnRate = 0.01 SpawnRate = 0.01

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 12 WeaponTag = 12
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Persuader" Name = "Persuader"
Description = "" Description = ""
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 7 WeaponTag = 7
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 25
Name = "Plasma Sword" Name = "Plasma Sword"
Description = "Has the power to occasionally instantly disintegrate an enemy" Description = "Has the power to occasionally instantly disintegrate an enemy"
SpawnRate = 0.5 SpawnRate = 0.5

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.333
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Rondo" Name = "Rondo"
Description = "+7 ATK Description = "+7 ATK
An eastern blade outside of time and reproach." An eastern blade outside of time and reproach."

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 5 WeaponElement = 5
WeaponTag = 6 WeaponTag = 6
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Rusted Blade" Name = "Rusted Blade"
Description = "Small chance to give enemy and self a lethal infection." Description = "Small chance to give enemy and self a lethal infection."
SpawnRate = 0.1 SpawnRate = 0.1

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Sealed Sword" Name = "Sealed Sword"
Description = "Weapon cannot pass beyond current floor once equipped." Description = "Weapon cannot pass beyond current floor once equipped."
SpawnRate = 0.5 SpawnRate = 0.5

View File

@@ -9,7 +9,7 @@ AttackSpeed = 0.75
WeaponElement = 0 WeaponElement = 0
WeaponTag = 8 WeaponTag = 8
SelfDamage = 0 SelfDamage = 0
SoundEffect = 23 SoundEffect = 24
Name = "Shining Halberd" Name = "Shining Halberd"
Description = "Weapon that gradually becomes weaker." Description = "Weapon that gradually becomes weaker."
SpawnRate = 0.3 SpawnRate = 0.3

View File

@@ -9,7 +9,7 @@ AttackSpeed = 0.75
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 23 SoundEffect = 24
Name = "Spaded Staff" Name = "Spaded Staff"
Description = "" Description = ""
SpawnRate = 0.3 SpawnRate = 0.3

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.25
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Swan Sword; Odette" Name = "Swan Sword; Odette"
Description = "Raises Luck. Description = "Raises Luck.
The blade of a thousand faced heroine." The blade of a thousand faced heroine."

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 0 WeaponElement = 0
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Talwar" Name = "Talwar"
Description = "" Description = ""
SpawnRate = 0.3 SpawnRate = 0.3

View File

@@ -9,7 +9,7 @@ AttackSpeed = 1.0
WeaponElement = 1 WeaponElement = 1
WeaponTag = 0 WeaponTag = 0
SelfDamage = 0 SelfDamage = 0
SoundEffect = 22 SoundEffect = 23
Name = "Yansã Blade" Name = "Yansã Blade"
Description = "Aeolic damage." Description = "Aeolic damage."
SpawnRate = 0.3 SpawnRate = 0.3

View File

@@ -22,7 +22,6 @@ public partial class SpecialFloor : Node3D, IDungeonFloor
public virtual void FadeOutAudio() public virtual void FadeOutAudio()
{ {
} }
public bool FloorIsLoaded { get; set; } public bool FloorIsLoaded { get; set; }

View File

@@ -190,6 +190,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
HealthComponent.CurrentHP.Changed += InverseHPToAttackPowerSync; HealthComponent.CurrentHP.Changed += InverseHPToAttackPowerSync;
HealthComponent.HealthReachedZero += Die; HealthComponent.HealthReachedZero += Die;
ExperiencePointsComponent.PlayerLevelUp += OnLevelUp; ExperiencePointsComponent.PlayerLevelUp += OnLevelUp;
ExperiencePointsComponent.PlayerLevelDown += OnLevelDown;
PlayerFXAnimations.AnimationFinished += PlayerFXAnimations_AnimationFinished; PlayerFXAnimations.AnimationFinished += PlayerFXAnimations_AnimationFinished;
HealthTimer.WaitTime = _healthTimerWaitTime; HealthTimer.WaitTime = _healthTimerWaitTime;
SetProcessInput(false); SetProcessInput(false);
@@ -527,6 +528,11 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
BoostPlayerHPFromLevelUp(); BoostPlayerHPFromLevelUp();
} }
private void OnLevelDown()
{
LowerPlayerHPFromLevelDown();
}
private void BoostPlayerHPFromLevelUp() private void BoostPlayerHPFromLevelUp()
{ {
var rng = new RandomNumberGenerator(); var rng = new RandomNumberGenerator();
@@ -535,6 +541,14 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
HealthComponent.RaiseMaximumHP(hpIncrease); 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 LeftStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeLeft);
private static float RightStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeRight); private static float RightStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeRight);

View File

@@ -126,12 +126,12 @@ public partial class ActionPanel : Panel
{ {
if (_player.EquipmentComponent.IsItemEquipped(equipable)) if (_player.EquipmentComponent.IsItemEquipped(equipable))
{ {
_player.EquipmentComponent.Unequip(equipable); _player.Unequip(equipable);
SfxDatabase.Instance.Play(SoundEffect.Unequip); SfxDatabase.Instance.Play(SoundEffect.Unequip);
} }
else else
{ {
_player.EquipmentComponent.Equip(equipable); _player.Equip(equipable);
SfxDatabase.Instance.Play(SoundEffect.Equip); SfxDatabase.Instance.Play(SoundEffect.Equip);
} }