Implement Elemental Caster item
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,7 @@ public partial class EffectItemStats : InventoryItemStats
|
||||
{
|
||||
[Export]
|
||||
public Godot.Collections.Array<UsableItemTag> UsableItemTags { get; set; } = new Godot.Collections.Array<UsableItemTag>();
|
||||
|
||||
[Export]
|
||||
public ElementType ElementalDamageType { get; set; }
|
||||
}
|
||||
|
||||
19
src/items/effect/resources/AeolicCaster.tres
Normal file
19
src/items/effect/resources/AeolicCaster.tres
Normal file
@@ -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"
|
||||
19
src/items/effect/resources/FerrumCaster.tres
Normal file
19
src/items/effect/resources/FerrumCaster.tres
Normal file
@@ -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"
|
||||
19
src/items/effect/resources/HydricCaster.tres
Normal file
19
src/items/effect/resources/HydricCaster.tres
Normal file
@@ -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"
|
||||
19
src/items/effect/resources/IgneousCaster.tres
Normal file
19
src/items/effect/resources/IgneousCaster.tres
Normal file
@@ -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"
|
||||
19
src/items/effect/resources/TelluricCaster.tres
Normal file
19
src/items/effect/resources/TelluricCaster.tres
Normal file
@@ -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"
|
||||
@@ -19,6 +19,7 @@ public enum UsableItemTag
|
||||
KillHalfEnemiesInRoom,
|
||||
AbsorbHPFromAllEnemiesInRoom,
|
||||
HealsAllInRoomToMaxHP,
|
||||
DealElementalDamageToAllEnemiesInRoom,
|
||||
RandomEffect,
|
||||
}
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user