HP Drain sigil (shura) implementation
Drains 15% of damage done but HP isn't restored by VT timer
This commit is contained in:
@@ -11,12 +11,18 @@ public interface ISigil
|
||||
[Export]
|
||||
public double MoveSpeedModifier { get; }
|
||||
|
||||
[Export]
|
||||
public bool AutoRevive { get; }
|
||||
|
||||
[Export]
|
||||
public ElementType ElementType { get; }
|
||||
|
||||
[Export]
|
||||
public ElementalResistanceSet ElementalResistanceSet { get; }
|
||||
|
||||
[Export] public SigilTag SigilTag { get; }
|
||||
}
|
||||
|
||||
public enum SigilTag
|
||||
{
|
||||
None,
|
||||
AutoRevive,
|
||||
HPDrain,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=41 format=3 uid="uid://brgi35xj3b4ud"]
|
||||
[gd_scene load_steps=42 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"]
|
||||
@@ -37,6 +37,7 @@
|
||||
[ext_resource type="AudioStream" uid="uid://bfpxwnxn2o0cy" path="res://src/audio/sfx/general_telluric_damage.ogg" id="24_vn70h"]
|
||||
[ext_resource type="AudioStream" uid="uid://n8anuovfoqmp" path="res://src/audio/sfx/general_holy_damage_2.ogg" id="25_153g4"]
|
||||
[ext_resource type="AudioStream" uid="uid://b4ks6pgrqn0gh" path="res://src/audio/sfx/general_curse_damage.ogg" id="26_je0ug"]
|
||||
[ext_resource type="AudioStream" uid="uid://ba8xendacec6" path="res://src/audio/sfx/item_kyuu_layer_2.ogg" id="28_ur8ax"]
|
||||
[ext_resource type="AudioStream" uid="uid://d2h4l0gxcs5i2" path="res://src/audio/sfx/item_glued.ogg" id="30_cx2n8"]
|
||||
[ext_resource type="AudioStream" uid="uid://dcfqkapxwvmdd" path="res://src/audio/sfx/iTEM_identify_ALL.ogg" id="31_vpeit"]
|
||||
[ext_resource type="AudioStream" uid="uid://bio3xjbanwas1" path="res://src/audio/sfx/player_item_identified.ogg" id="40_rqu44"]
|
||||
@@ -205,6 +206,12 @@ process_mode = 3
|
||||
stream = ExtResource("26_je0ug")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="AbsorbHPSound" type="AudioStreamPlayer" parent="Player"]
|
||||
unique_name_in_owner = true
|
||||
process_mode = 3
|
||||
stream = ExtResource("28_ur8ax")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="Item" type="Node" parent="."]
|
||||
|
||||
[node name="TransferItemSound" type="AudioStreamPlayer" parent="Item"]
|
||||
|
||||
@@ -56,6 +56,7 @@ public partial class SfxDatabase : Node
|
||||
{SoundEffect.EarthDamage, EarthDamageSound},
|
||||
{SoundEffect.HolyDamage, HolyDamageSound},
|
||||
{SoundEffect.CurseDamage, CurseDamageSound },
|
||||
{SoundEffect.AbsorbHP, AbsorbHPSound},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -98,6 +99,7 @@ public partial class SfxDatabase : Node
|
||||
[Node] private AudioStreamPlayer EarthDamageSound { get; set; }
|
||||
[Node] private AudioStreamPlayer HolyDamageSound { get; set; }
|
||||
[Node] private AudioStreamPlayer CurseDamageSound { get; set; }
|
||||
[Node] private AudioStreamPlayer AbsorbHPSound { get; set; }
|
||||
|
||||
private Dictionary<SoundEffect, AudioStreamPlayer> _sfxMap;
|
||||
|
||||
@@ -152,5 +154,6 @@ public enum SoundEffect
|
||||
EarthDamage,
|
||||
HolyDamage,
|
||||
CurseDamage,
|
||||
AbsorbHP,
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
{
|
||||
PlayerFXAnimations.Play("death");
|
||||
|
||||
if (AutoRevive || SigilComponent.Sigil.AutoRevive)
|
||||
if (AutoRevive || SigilComponent.Sigil.SigilTag == SigilTag.AutoRevive)
|
||||
return;
|
||||
|
||||
SetSigil(new NoneSigil());
|
||||
@@ -801,7 +801,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
{
|
||||
if (animName == "death")
|
||||
{
|
||||
if (AutoRevive || SigilComponent.Sigil.AutoRevive)
|
||||
if (AutoRevive || SigilComponent.Sigil.SigilTag == SigilTag.AutoRevive)
|
||||
PlayerFXAnimations.PlayBackwards("revive");
|
||||
else
|
||||
PlayerDied?.Invoke();
|
||||
@@ -903,6 +903,7 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
if (((Accessory)EquipmentComponent.EquippedAccessory.Value).AccessoryTag == AccessoryTag.HalfVTConsumption)
|
||||
_healthTimerActive = !_healthTimerActive;
|
||||
|
||||
if (SigilComponent.Sigil.SigilTag != SigilTag.HPDrain)
|
||||
HealthComponent.Heal(HealthTimerHPRate);
|
||||
|
||||
if (_healthTimerActive)
|
||||
@@ -965,6 +966,13 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
enemy.StatusEffectComponent.Rust.OnNext(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (SigilComponent.Sigil.SigilTag == SigilTag.HPDrain)
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.AbsorbHP);
|
||||
var hpToDrain = Mathf.RoundToInt(totalDamage * 0.15f);
|
||||
HealthComponent.Heal(hpToDrain);
|
||||
}
|
||||
}
|
||||
|
||||
private async void CollisionDetector_AreaEntered(Area3D area)
|
||||
|
||||
@@ -23,6 +23,8 @@ public partial class NoneSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.None;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => ElementalResistanceSet.None;
|
||||
|
||||
public SigilTag SigilTag => SigilTag.None;
|
||||
}
|
||||
|
||||
public partial class AeolicSigil : ISigil
|
||||
@@ -36,6 +38,8 @@ public partial class AeolicSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Aeolic;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(0.25, 0, -0.25, 0, 0, 0, 0);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.None;
|
||||
}
|
||||
|
||||
public partial class IgneousSigil : ISigil
|
||||
@@ -48,6 +52,8 @@ public partial class IgneousSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Igneous;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(0, -0.25, 0.25, 0, 0, 0, 0);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.None;
|
||||
}
|
||||
|
||||
public partial class TelluricSigil : ISigil
|
||||
@@ -61,6 +67,8 @@ public partial class TelluricSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Telluric;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(-0.25, 0, 0, 0, 0.25, 0, 0);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.None;
|
||||
}
|
||||
|
||||
public partial class HydricSigil : ISigil
|
||||
@@ -74,6 +82,8 @@ public partial class HydricSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Hydric;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(0, 0.25, 0, 0, -0.25, 0, 0);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.None;
|
||||
}
|
||||
|
||||
public partial class FerrumSigil : ISigil
|
||||
@@ -87,6 +97,8 @@ public partial class FerrumSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Ferrum;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(-0.25, -0.25, -0.25, 0.25, -0.25, -0.25, -0.25);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.None;
|
||||
}
|
||||
|
||||
public partial class SanktaSigil : ISigil
|
||||
@@ -100,6 +112,8 @@ public partial class SanktaSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Sankta;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(0, 0, 0, 0, 0, 0.25, -0.25);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.AutoRevive;
|
||||
}
|
||||
|
||||
public partial class ShuraSigil : ISigil
|
||||
@@ -113,4 +127,6 @@ public partial class ShuraSigil : ISigil
|
||||
public ElementType ElementType { get; } = ElementType.Shura;
|
||||
|
||||
public ElementalResistanceSet ElementalResistanceSet => new ElementalResistanceSet(0, 0, 0, 0, 0, -0.25, 0.25);
|
||||
|
||||
public SigilTag SigilTag => SigilTag.HPDrain;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user