Entropic seal implemented
This commit is contained in:
@@ -55,6 +55,9 @@ public partial class EffectItem : Node3D, IUsableItem
|
||||
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.SwapHPAndVT))
|
||||
SwapHPandVT();
|
||||
|
||||
if (_effectItemStats.UsableItemTags.Contains(UsableItemTag.RandomEffect))
|
||||
RandomEffect();
|
||||
|
||||
}
|
||||
|
||||
public void SetItemStats(InventoryItemStats inventoryItemStats)
|
||||
@@ -176,4 +179,14 @@ public partial class EffectItem : Node3D, IUsableItem
|
||||
Player.Stats.SetCurrentHP(oldVt);
|
||||
Player.Stats.SetCurrentVT(oldHp);
|
||||
}
|
||||
|
||||
private void RandomEffect()
|
||||
{
|
||||
var itemEffects = Enum.GetValues<UsableItemTag>().ToList();
|
||||
itemEffects.Remove(UsableItemTag.RandomEffect);
|
||||
var randomEffect = new Godot.Collections.Array<UsableItemTag>(itemEffects).PickRandom();
|
||||
_effectItemStats.UsableItemTags.Clear();
|
||||
_effectItemStats.UsableItemTags.Add(randomEffect);
|
||||
Use();
|
||||
}
|
||||
}
|
||||
|
||||
19
src/items/effect/resources/EntropicSeal.tres
Normal file
19
src/items/effect/resources/EntropicSeal.tres
Normal file
@@ -0,0 +1,19 @@
|
||||
[gd_resource type="Resource" script_class="EffectItemStats" load_steps=3 format=3 uid="uid://c6ecr2cquav3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b5w4iw4iqmxtn" path="res://src/items/effect/EffectItemStats.cs" id="1_3l06v"]
|
||||
[ext_resource type="Texture2D" uid="uid://c7v5pm32sedkg" path="res://src/items/effect/textures/entropic seal.PNG" id="1_dbua5"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_3l06v")
|
||||
UsableItemTags = Array[int]([10])
|
||||
ElementalDamageType = 0
|
||||
Name = "Entropic Seal"
|
||||
Description = "Random effect."
|
||||
Texture = ExtResource("1_dbua5")
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTags = Array[int]([])
|
||||
metadata/_custom_type_script = "uid://b5w4iw4iqmxtn"
|
||||
Reference in New Issue
Block a user