Implement Perspective

This commit is contained in:
2025-03-03 21:41:22 -08:00
parent 4363c4d2eb
commit 4baa492ab1
4 changed files with 33 additions and 2 deletions

View File

@@ -52,6 +52,9 @@ public partial class EffectItem : Node3D, IUsableItem
AbsorbHPFromAllEnemiesInRoom();
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.DealElementalDamageToAllEnemiesInRoom))
DealElementalDamageToAllEnemiesInRoom(ElementType.Hydric);
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.SwapHPAndVT))
SwapHPandVT();
}
public void SetItemStats(InventoryItemStats inventoryItemStats)
@@ -164,4 +167,13 @@ public partial class EffectItem : Node3D, IUsableItem
foreach (var enemy in currentEnemies)
enemy.TakeDamage(20, elementType);
}
private void SwapHPandVT()
{
var oldHp = Player.Stats.CurrentHP.Value;
var oldVt = Player.Stats.CurrentVT.Value;
Player.Stats.SetCurrentHP(oldVt);
Player.Stats.SetCurrentVT(oldHp);
}
}

View File

@@ -0,0 +1,19 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://b44v3y1okrj1s"]
[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_31uf7"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_lq0bc"]
[resource]
script = ExtResource("1_lq0bc")
UsableItemTags = Array[int]([3])
ElementalDamageType = 0
Name = "Perspective"
Description = "Swap current HP and VT."
Texture = ExtResource("1_31uf7")
SpawnRate = 0.5
ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"

View File

@@ -13,7 +13,7 @@ public enum UsableItemTag
DoubleEXP,
IdentifyAllItemsCostHP,
BriefImmunity,
SwapHPandVTWithEntitiesInRoom,
SwapHPAndVT,
TeleportAllEnemiesToRoom,
TurnAllEnemiesIntoHealingItem,
KillHalfEnemiesInRoom,