Implement Kyuuketsuki
This commit is contained in:
@@ -49,6 +49,8 @@ public partial class EffectItem : Node3D, IUsableItem
|
||||
TurnAllEnemiesInRoomIntoHealingItem();
|
||||
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.HealsAllInRoomToMaxHP))
|
||||
HealAllEnemiesAndPlayerInRoomToFull();
|
||||
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.AbsorbHPFromAllEnemiesInRoom))
|
||||
AbsorbHPFromAllEnemiesInRoom();
|
||||
}
|
||||
|
||||
public void SetItemStats(InventoryItemStats inventoryItemStats)
|
||||
@@ -142,4 +144,15 @@ public partial class EffectItem : Node3D, IUsableItem
|
||||
enemy.SetCurrentHP(enemy.GetMaximumHP());
|
||||
Player.Stats.SetCurrentHP(Player.Stats.MaximumHP.Value);
|
||||
}
|
||||
|
||||
private void AbsorbHPFromAllEnemiesInRoom()
|
||||
{
|
||||
var currentRoom = Player.GetCurrentRoom();
|
||||
var currentEnemies = currentRoom.EnemiesInRoom;
|
||||
var hpToAbsorb = 0.0;
|
||||
foreach (var enemy in currentEnemies)
|
||||
hpToAbsorb += enemy.CurrentHP * 0.05;
|
||||
Player.Stats.SetCurrentHP(Player.Stats.CurrentHP.Value + (int)hpToAbsorb);
|
||||
GD.Print("HP to absorb: " + hpToAbsorb);
|
||||
}
|
||||
}
|
||||
|
||||
18
src/items/effect/resources/Kyuuketsuki.tres
Normal file
18
src/items/effect/resources/Kyuuketsuki.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://bldgbv38yplgk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_0tcgy"]
|
||||
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_hxj1b"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_hxj1b")
|
||||
UsableItemTags = Array[int]([7])
|
||||
Name = "Kyuuketsuki"
|
||||
Description = "Absorbs HP from all enemies in the room."
|
||||
Texture = ExtResource("1_0tcgy")
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTags = Array[int]([])
|
||||
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"
|
||||
@@ -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://5tbtsch3qagg" path="res://src/items/effect/resources/HeavensRebellion.tres" id="17_ntxe5"]
|
||||
[ext_resource type="Resource" uid="uid://bldgbv38yplgk" path="res://src/items/effect/resources/Kyuuketsuki.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