diff --git a/src/items/effect/EffectItem.cs b/src/items/effect/EffectItem.cs index 0c05ee34..79bbc2ee 100644 --- a/src/items/effect/EffectItem.cs +++ b/src/items/effect/EffectItem.cs @@ -2,7 +2,6 @@ using Chickensoft.Introspection; using Godot; using System; -using System.Collections.Generic; using System.Linq; namespace GameJamDungeon; @@ -51,6 +50,8 @@ public partial class EffectItem : Node3D, IUsableItem HealAllEnemiesAndPlayerInRoomToFull(); if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.AbsorbHPFromAllEnemiesInRoom)) AbsorbHPFromAllEnemiesInRoom(); + if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.DealElementalDamageToAllEnemiesInRoom)) + DealElementalDamageToAllEnemiesInRoom(ElementType.Hydric); } public void SetItemStats(InventoryItemStats inventoryItemStats) @@ -155,4 +156,12 @@ public partial class EffectItem : Node3D, IUsableItem Player.Stats.SetCurrentHP(Player.Stats.CurrentHP.Value + (int)hpToAbsorb); GD.Print("HP to absorb: " + hpToAbsorb); } + + private void DealElementalDamageToAllEnemiesInRoom(ElementType elementType) + { + var currentRoom = Player.GetCurrentRoom(); + var currentEnemies = currentRoom.EnemiesInRoom; + foreach (var enemy in currentEnemies) + enemy.TakeDamage(20, elementType); + } } diff --git a/src/items/effect/EffectItemStats.cs b/src/items/effect/EffectItemStats.cs index 8a7a171c..477467e4 100644 --- a/src/items/effect/EffectItemStats.cs +++ b/src/items/effect/EffectItemStats.cs @@ -7,4 +7,7 @@ public partial class EffectItemStats : InventoryItemStats { [Export] public Godot.Collections.Array UsableItemTags { get; set; } = new Godot.Collections.Array(); + + [Export] + public ElementType ElementalDamageType { get; set; } } diff --git a/src/items/effect/resources/AeolicCaster.tres b/src/items/effect/resources/AeolicCaster.tres new file mode 100644 index 00000000..ea539e87 --- /dev/null +++ b/src/items/effect/resources/AeolicCaster.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://crvn3srgpj2fh"] + +[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_u0h2q"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_yytis"] + +[resource] +script = ExtResource("2_yytis") +UsableItemTags = Array[int]([9]) +ElementalDamageType = 1 +Name = "Aeolic Caster" +Description = "Deal Aeolic Damage to all enemies in the room." +Texture = ExtResource("1_u0h2q") +SpawnRate = 0.5 +ThrowSpeed = 12.0 +HealHPAmount = 0 +HealVTAmount = 0 +ThrowDamage = 5 +ItemTags = Array[int]([]) +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/src/items/effect/resources/FerrumCaster.tres b/src/items/effect/resources/FerrumCaster.tres new file mode 100644 index 00000000..447723d9 --- /dev/null +++ b/src/items/effect/resources/FerrumCaster.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://d3to07qm7fm4"] + +[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_xsfvc"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_i4na1"] + +[resource] +script = ExtResource("2_i4na1") +UsableItemTags = Array[int]([9]) +ElementalDamageType = 5 +Name = "Ferrum Caster" +Description = "Deal Ferrum Damage to all enemies in the room." +Texture = ExtResource("1_xsfvc") +SpawnRate = 0.5 +ThrowSpeed = 12.0 +HealHPAmount = 0 +HealVTAmount = 0 +ThrowDamage = 5 +ItemTags = Array[int]([]) +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/src/items/effect/resources/HydricCaster.tres b/src/items/effect/resources/HydricCaster.tres new file mode 100644 index 00000000..d840b933 --- /dev/null +++ b/src/items/effect/resources/HydricCaster.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://bgqu6jsadtqjq"] + +[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_8v5wn"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_mj844"] + +[resource] +script = ExtResource("1_mj844") +UsableItemTags = Array[int]([9]) +ElementalDamageType = 3 +Name = "Hydric Caster" +Description = "Deal Hydric Damage to all enemies in the room." +Texture = ExtResource("1_8v5wn") +SpawnRate = 0.5 +ThrowSpeed = 12.0 +HealHPAmount = 0 +HealVTAmount = 0 +ThrowDamage = 5 +ItemTags = Array[int]([]) +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/src/items/effect/resources/IgneousCaster.tres b/src/items/effect/resources/IgneousCaster.tres new file mode 100644 index 00000000..fb87e173 --- /dev/null +++ b/src/items/effect/resources/IgneousCaster.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://brj7h6tgifa5n"] + +[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_3iam5"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_cl8lc"] + +[resource] +script = ExtResource("2_cl8lc") +UsableItemTags = Array[int]([9]) +ElementalDamageType = 4 +Name = "Igneous Caster" +Description = "Deal Igneous Damage to all enemies in the room." +Texture = ExtResource("1_3iam5") +SpawnRate = 0.5 +ThrowSpeed = 12.0 +HealHPAmount = 0 +HealVTAmount = 0 +ThrowDamage = 5 +ItemTags = Array[int]([]) +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/src/items/effect/resources/TelluricCaster.tres b/src/items/effect/resources/TelluricCaster.tres new file mode 100644 index 00000000..0cf7e249 --- /dev/null +++ b/src/items/effect/resources/TelluricCaster.tres @@ -0,0 +1,19 @@ +[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://dw26l3f3hd2sq"] + +[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_x62ct"] +[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="2_38yjb"] + +[resource] +script = ExtResource("2_38yjb") +UsableItemTags = Array[int]([9]) +ElementalDamageType = 2 +Name = "Telluric Caster" +Description = "Deal Telluric Damage to all enemies in the room." +Texture = ExtResource("1_x62ct") +SpawnRate = 0.5 +ThrowSpeed = 12.0 +HealHPAmount = 0 +HealVTAmount = 0 +ThrowDamage = 5 +ItemTags = Array[int]([]) +metadata/_custom_type_script = "uid://b5w4iw4iqmxtn" diff --git a/src/items/throwable/ThrowableItemTag.cs b/src/items/throwable/ThrowableItemTag.cs index ccb617b6..161ecd59 100644 --- a/src/items/throwable/ThrowableItemTag.cs +++ b/src/items/throwable/ThrowableItemTag.cs @@ -19,6 +19,7 @@ public enum UsableItemTag KillHalfEnemiesInRoom, AbsorbHPFromAllEnemiesInRoom, HealsAllInRoomToMaxHP, + DealElementalDamageToAllEnemiesInRoom, RandomEffect, } diff --git a/src/map/dungeon/floors/Floor00.tscn b/src/map/dungeon/floors/Floor00.tscn index 7a9e123d..b380cea0 100644 --- a/src/map/dungeon/floors/Floor00.tscn +++ b/src/map/dungeon/floors/Floor00.tscn @@ -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://bldgbv38yplgk" path="res://src/items/effect/resources/Kyuuketsuki.tres" id="17_ntxe5"] +[ext_resource type="Resource" uid="uid://bgqu6jsadtqjq" path="res://src/items/effect/resources/HydricCaster.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"]