Implement Heaven's Rebellion

This commit is contained in:
2025-03-03 21:14:09 -08:00
parent f153a53d8d
commit d883b2b05f
7 changed files with 47 additions and 4 deletions

View File

@@ -47,6 +47,8 @@ public partial class EffectItem : Node3D, IUsableItem
KillHalfEnemiesInRoom();
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.TurnAllEnemiesIntoHealingItem))
TurnAllEnemiesInRoomIntoHealingItem();
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.HealsAllInRoomToMaxHP))
HealAllEnemiesAndPlayerInRoomToFull();
}
public void SetItemStats(InventoryItemStats inventoryItemStats)
@@ -131,4 +133,13 @@ public partial class EffectItem : Node3D, IUsableItem
Game.AddChild(consumable);
consumable.GlobalPosition = vector;
}
private void HealAllEnemiesAndPlayerInRoomToFull()
{
var currentRoom = Player.GetCurrentRoom();
var currentEnemies = currentRoom.EnemiesInRoom;
foreach (var enemy in currentEnemies)
enemy.SetCurrentHP(enemy.GetMaximumHP());
Player.Stats.SetCurrentHP(Player.Stats.MaximumHP.Value);
}
}

View File

@@ -0,0 +1,18 @@
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://5tbtsch3qagg"]
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_drp30"]
[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_g0a3x"]
[resource]
script = ExtResource("1_drp30")
UsableItemTags = Array[int]([8])
Name = "Heaven's Rebellion"
Description = "Heals self and all enemies in current room to maximum HP."
Texture = ExtResource("1_g0a3x")
SpawnRate = 0.5
ThrowSpeed = 12.0
HealHPAmount = 0
HealVTAmount = 0
ThrowDamage = 5
ItemTags = Array[int]([])
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"