Implement Perspective
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
19
src/items/effect/resources/Perspective.tres
Normal file
19
src/items/effect/resources/Perspective.tres
Normal 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"
|
||||
@@ -13,7 +13,7 @@ public enum UsableItemTag
|
||||
DoubleEXP,
|
||||
IdentifyAllItemsCostHP,
|
||||
BriefImmunity,
|
||||
SwapHPandVTWithEntitiesInRoom,
|
||||
SwapHPAndVT,
|
||||
TeleportAllEnemiesToRoom,
|
||||
TurnAllEnemiesIntoHealingItem,
|
||||
KillHalfEnemiesInRoom,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://4k6vtn4oip5f" path="res://src/map/dungeon/models/Set A/02. Altar/02_ALTAR_FLOOR_ZER0_VER_TILE4.png" id="14_qqc7i"]
|
||||
[ext_resource type="Texture2D" uid="uid://cururtxtgylxf" path="res://src/map/dungeon/models/Set A/02. Altar/02_ALTAR_FLOOR_ZER0_VER_COLUMN.jpg" id="15_ojbcg"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0pl1n1jf77jm" path="res://src/items/effect/EffectItem.tscn" id="16_aqomv"]
|
||||
[ext_resource type="Resource" uid="uid://bgqu6jsadtqjq" path="res://src/items/effect/resources/HydricCaster.tres" id="17_ntxe5"]
|
||||
[ext_resource type="Resource" uid="uid://b44v3y1okrj1s" path="res://src/items/effect/resources/Perspective.tres" id="17_ntxe5"]
|
||||
[ext_resource type="Resource" uid="uid://bptg6eybj5dxk" path="res://src/items/effect/resources/DevicRecall.tres" id="18_ntxe5"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3ubi4"]
|
||||
|
||||
Reference in New Issue
Block a user