Redesign and reimplement inventory menu

Add jewels but no implementation yet (needed redesign of inventory menu to function correctly)
This commit is contained in:
2026-02-11 04:08:42 -08:00
parent 5451f0b31f
commit 8ce38c3c13
51 changed files with 1695 additions and 256 deletions

View File

@@ -213,20 +213,6 @@ public class EffectService
SfxDatabase.Instance.Play(SoundEffect.TeleportToRandomRoom);
}
public void ChangeAffinity(ThrowableItem throwableItem)
{
var maximumElements = Enum.GetNames(typeof(ElementType)).Length;
var newElement = ((int)throwableItem.ElementType + 1) % maximumElements;
throwableItem.SetElementType((ElementType)newElement);
// TODO: Make this an inventory animation to cycle through elements.
throwableItem.SetDescription(
$"Inflicts {throwableItem.ElementType} damage when thrown." +
$"{System.Environment.NewLine}Use item to change Affinity.");
throwableItem.SetCount(throwableItem.Count + 1);
}
public void WarpToExit()
{
var exitRoom = _game.CurrentFloor.Rooms.OfType<ExitRoom>().Single();

View File

@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -96,9 +97,10 @@ public partial class Inventory : Node, IInventory
foreach (var itemStack in itemsToStack)
{
var firstItem = itemStack.First();
firstItem.SetCount(itemStack.Count());
firstItem.SetCount(itemStack.Sum(x => x.Count.Value));
var itemsToRemove = itemStack.Except([firstItem]).Cast<InventoryItem>();
Items = [.. Items.Except(itemsToRemove)];
foreach (var item in itemsToRemove)
Remove(item);
}
return !Items.SequenceEqual(initialList);

View File

@@ -49,9 +49,6 @@ public class ItemDatabase
var weights = itemsToSelectFrom.Select(x => x.SpawnRate).ToArray();
var selectedItem = itemsToSelectFrom.ToArray()[rng.RandWeighted(weights)];
if (selectedItem is ThrowableItem throwableItem)
throwableItem.SetCount(rng.RandiRange(throwableItem.Stats.MinimumCount, throwableItem.Stats.MaximumCount));
return selectedItem;
}
@@ -140,14 +137,14 @@ public class ItemDatabase
database.Add(ammoItemScene);
}
//foreach (var jewelItem in jewelResources)
//{
// var jewelItemInfo = GD.Load<JewelStats>($"res://src/items/jewel/resources/{jewelItem}".TrimSuffix(".remap"));
// var jewelItemScene = ResourceLoader.Load<PackedScene>("res://src/items/jewel/Jewel.tscn").Instantiate<Jewels>();
// jewelItemScene.Stats = jewelItemInfo;
// if (!database.Contains(jewelItemScene))
// database.Add(jewelItemScene);
//}
foreach (var jewelItem in jewelResources)
{
var jewelItemInfo = GD.Load<JewelStats>($"res://src/items/jewels/resources/{jewelItem}".TrimSuffix(".remap"));
var jewelItemScene = ResourceLoader.Load<PackedScene>("res://src/items/jewels/Jewel.tscn").Instantiate<Jewel>();
jewelItemScene.Stats = jewelItemInfo;
if (!database.Contains(jewelItemScene))
database.Add(jewelItemScene);
}
Items = [.. database];
}

View File

@@ -1,8 +1,9 @@
using Chickensoft.AutoInject;
using Chickensoft.Collections;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Implementation;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
@@ -11,13 +12,11 @@ public partial class Ammo : EquipableItem, IStackable
{
public override void _Notification(int what) => this.Notify(what);
private int _count;
[Node] private Sprite3D _sprite { get; set; }
public void OnReady()
{
_count = Stats.InitialCount;
Count = new AutoProp<int>(Stats.InitialCount);
_sprite.Texture = Stats.Texture;
}
@@ -37,8 +36,9 @@ public partial class Ammo : EquipableItem, IStackable
public override Texture2D GetTexture() => Stats.Texture;
[Save("ammo_item_count")]
public int Count { get => _count; }
public void SetCount(int count) => _count = count;
public AutoProp<int> Count { get; private set; }
public void SetCount(int count) => Count.OnNext(count);
[Save("ammo_element")]
public ElementType AmmoElement => Stats.AmmoElement;

View File

@@ -0,0 +1,37 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode)), Id("jewel")]
public partial class Jewel : InventoryItem
{
public override void _Notification(int what) => this.Notify(what);
[Node] private Sprite3D _sprite { get; set; }
public void OnReady()
{
_sprite.Texture = Stats.Texture;
}
public override string ItemName => Stats.Name;
public override string Description => Stats.Description;
public override float SpawnRate => Stats.SpawnRate;
public override int ThrowDamage => Stats.ThrowDamage;
public override float ThrowSpeed => Stats.ThrowSpeed;
public override ItemTag ItemTag => Stats.ItemTag;
public override Texture2D GetTexture() => Stats.Texture;
[Export]
[Save("jewel_stats")]
public JewelStats Stats { get; set; } = new JewelStats();
}

View File

@@ -0,0 +1,38 @@
[gd_scene load_steps=4 format=3 uid="uid://dqlbkyxqhyqtl"]
[ext_resource type="Script" uid="uid://bou7fk1evvet" path="res://src/items/jewels/Jewel.cs" id="1_sedqc"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_40de3"]
[sub_resource type="BoxShape3D" id="BoxShape3D_qdeu2"]
size = Vector3(0.898941, 2.34974, 0.86676)
[node name="Jewel" type="RigidBody3D"]
collision_layer = 0
axis_lock_linear_x = true
axis_lock_linear_z = true
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_sedqc")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.720724, 0)
shape = SubResource("CapsuleShape3D_40de3")
[node name="Pickup" type="Area3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.49274, 0)
collision_layer = 4
collision_mask = 0
[node name="Sprite" type="Sprite3D" parent="Pickup"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.370004, 0)
pixel_size = 0.025
billboard = 2
texture_filter = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00804907, 0.709896, 0.0675965)
shape = SubResource("BoxShape3D_qdeu2")

View File

@@ -1,4 +1,5 @@
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
namespace Zennysoft.Game.Ma;
@@ -7,4 +8,7 @@ namespace Zennysoft.Game.Ma;
[Meta, Id("jewel_stat_type")]
public partial class JewelStats : InventoryItemStats
{
[Save("jewel_tag")]
[Export]
public JewelTags JewelTag { get; set; }
}

View File

@@ -0,0 +1,19 @@
public enum JewelTags
{
None,
AeolicElement,
IncreaseHPRecovery,
HastenVT,
LowerEXPGain,
Glue,
ItemRescue,
HydricElement,
IgneousElement,
IncreaseEXPGain,
LowerHPRecovery,
SlowVTReduction,
AutoIdentifyAllItems,
ReviveUserOnce,
TelluricElement
}

View File

@@ -0,0 +1 @@
uid://hm03eov1reaj

View File

@@ -1,18 +0,0 @@
using Godot;
using System;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
public partial class Jewels : InventoryItem
{
public override string ItemName { get; }
public override string Description { get; }
public override float SpawnRate { get; }
public override int ThrowDamage { get; }
public override float ThrowSpeed { get; }
public override ItemTag ItemTag { get; }
public override Texture2D GetTexture() => throw new NotImplementedException();
public JewelStats Stats { get; set; } = new JewelStats();
}

View File

@@ -0,0 +1,28 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bxen2ertkxmwo"]
[ext_resource type="Texture2D" uid="uid://c47igpgj02war" path="res://src/items/jewels/texture/Aeollic Jewel.png" id="1_p3ar8"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_u0a3e"]
[resource]
script = ExtResource("1_u0a3e")
JewelTag = 1
Name = "Aeolic Jewel"
Description = "Add Aeolic damage to Weapon or Aeolic resistance to Armor."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_p3ar8")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,28 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://b8f23e2kay1cr"]
[ext_resource type="Texture2D" uid="uid://cdq12s3k2oemt" path="res://src/items/jewels/texture/Anabolic.png" id="1_6jhk1"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_6xlbl"]
[resource]
script = ExtResource("1_6xlbl")
JewelTag = 2
Name = "Anabolic Jewel"
Description = "Increase HP regen speed."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_6jhk1")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://ciejgco24n0qo"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_dxj8h"]
[ext_resource type="Texture2D" uid="uid://bjpp5hp78g2w6" path="res://src/items/jewels/texture/Black Egg.png" id="1_rbr4o"]
[resource]
script = ExtResource("1_dxj8h")
Name = "Black Egg"
Description = "Increase Attack, Defense, and Luck."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_rbr4o")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://d8186oeld7up"]
[ext_resource type="Texture2D" uid="uid://bnno0bwaxvvq4" path="res://src/items/jewels/texture/Cats Eye.png" id="1_a82hi"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_vvfsu"]
[resource]
script = ExtResource("1_vvfsu")
Name = "Cat's Eye"
Description = "Dramatically increases Luck."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_a82hi")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bfmujwmg1iehy"]
[ext_resource type="Texture2D" uid="uid://b2tnug7fnsqor" path="res://src/items/jewels/texture/Cinnabar Structure.png" id="1_fc5tr"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_k60ln"]
[resource]
script = ExtResource("1_k60ln")
Name = "Cinnabar Structure"
Description = "Hastens VT, adds or improves Rust."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_fc5tr")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://cdygc6sdh0oki"]
[ext_resource type="Texture2D" uid="uid://dqqyx7usmyo1k" path="res://src/items/jewels/texture/Foolish Orb.png" id="1_ltr3k"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_pn071"]
[resource]
script = ExtResource("1_pn071")
Name = "Foolish Orb"
Description = "Lowers EXP gain."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_ltr3k")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://b00agx6qy6yhv"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_c23yr"]
[ext_resource type="Texture2D" uid="uid://d3vv6ea17uifk" path="res://src/items/jewels/texture/Glue Orb.png" id="1_sww4k"]
[resource]
script = ExtResource("1_c23yr")
Name = "Glue Orb"
Description = "Prevents item from being unequipped."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_sww4k")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bxq5xnxfhatpi"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_7gwjj"]
[ext_resource type="Texture2D" uid="uid://4247dwj5g705" path="res://src/items/jewels/texture/Heirloom Stone.png" id="1_gk4x7"]
[resource]
script = ExtResource("1_7gwjj")
Name = "Heirloom Stone"
Description = "Returns item to the surface world."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_gk4x7")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://c65jk6stksnai"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_cyti8"]
[ext_resource type="Texture2D" uid="uid://brx581xmqv54k" path="res://src/items/jewels/texture/Hydric Jewel.png" id="1_fdjqp"]
[resource]
script = ExtResource("1_cyti8")
Name = "Hydric Jewel"
Description = "Hydric e"
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_fdjqp")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://duk8un4sdv0cs"]
[ext_resource type="Texture2D" uid="uid://d3bx1j5irhdes" path="res://src/items/jewels/texture/Igneous Jewel.png" id="1_knm0p"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_qh03l"]
[resource]
script = ExtResource("1_qh03l")
Name = "Igneous Jewel"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_knm0p")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://d2rdaghcccw0f"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_6e2y5"]
[ext_resource type="Texture2D" uid="uid://drfx1s7mc3j0h" path="res://src/items/jewels/texture/Meditative Stone.png" id="1_cyim2"]
[resource]
script = ExtResource("1_6e2y5")
Name = "Meditative Stone"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_cyim2")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://djim1rdpt03ai"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_ivvck"]
[ext_resource type="Texture2D" uid="uid://rl6df2udk2ui" path="res://src/items/jewels/texture/Mercury.png" id="1_rw1fk"]
[resource]
script = ExtResource("1_ivvck")
Name = "Mercury Prism"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_rw1fk")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://dd5stvt4g531e"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_cabnq"]
[ext_resource type="Texture2D" uid="uid://vxeil6eo3hdp" path="res://src/items/jewels/texture/Metabolic Jewel.png" id="1_pscn1"]
[resource]
script = ExtResource("1_cabnq")
Name = "Metabolic Jewel"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_pscn1")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://bdd7xh6v03xul"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_75k4l"]
[ext_resource type="Texture2D" uid="uid://bxa1kqlqhbyi3" path="res://src/items/jewels/texture/Ossified Cortex.png" id="1_cq6jp"]
[resource]
script = ExtResource("1_75k4l")
Name = "Ossified Cortex"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_cq6jp")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://byufike6hontv"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_fkhpb"]
[ext_resource type="Texture2D" uid="uid://c6fu3kd5yelwi" path="res://src/items/jewels/texture/Rejection Stone.png" id="1_rh6wh"]
[resource]
script = ExtResource("1_fkhpb")
Name = "Rejection Stone"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_rh6wh")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://blghjvef7p6fm"]
[ext_resource type="Texture2D" uid="uid://cgs0hr24h5g6q" path="res://src/items/jewels/texture/Tarnished Jewel.png" id="1_6qtep"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="1_868vv"]
[resource]
script = ExtResource("1_868vv")
Name = "Tarnished Jewel"
Description = ""
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_6qtep")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -0,0 +1,27 @@
[gd_resource type="Resource" script_class="JewelStats" load_steps=3 format=3 uid="uid://d3fipjd8sayiw"]
[ext_resource type="Texture2D" uid="uid://r36ecoqigs2o" path="res://src/items/jewels/texture/Telleric Jewel.png" id="1_yooxp"]
[ext_resource type="Script" uid="uid://btikba31yb0tl" path="res://src/items/jewels/JewelStats.cs" id="2_c8kww"]
[resource]
script = ExtResource("2_c8kww")
Name = "Telluric Jewel"
Description = "Add Telluric damage to Weapon or Telluric resistance to Armor."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 5
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
HolyResistance = 0
CurseResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_yooxp")
metadata/_custom_type_script = "uid://btikba31yb0tl"

View File

@@ -1,8 +1,9 @@
using Chickensoft.AutoInject;
using Chickensoft.Collections;
using Chickensoft.Introspection;
using Chickensoft.Serialization;
using Godot;
using Zennysoft.Game.Abstractions;
using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -17,6 +18,9 @@ public partial class ThrowableItem : InventoryItem, IStackable
public override void _Ready()
{
_sprite.Texture = Stats.Texture;
var rng = new RandomNumberGenerator();
rng.Randomize();
Count = new AutoProp<int>(rng.RandiRange(Stats.MinimumCount, Stats.MaximumCount));
}
public override string ItemName => Stats.Name;
@@ -45,7 +49,7 @@ public partial class ThrowableItem : InventoryItem, IStackable
public void SetDescription(string description) => Stats.Description = description;
[Save("throwable_item_count")]
public int Count { get; private set; } = 1;
public AutoProp<int> Count { get; private set; }
[Export]
[Save("throwable_item_stats")]
@@ -53,5 +57,5 @@ public partial class ThrowableItem : InventoryItem, IStackable
public override Texture2D GetTexture() => Stats.Texture;
public void SetCount(int count) => Count = count;
public void SetCount(int count) => Count.OnNext(count);
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=63 format=3 uid="uid://nnns2ade62al"]
[gd_scene load_steps=64 format=3 uid="uid://nnns2ade62al"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_xt24t"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_yf47k"]
@@ -516,6 +516,8 @@ _data = {
&"RESET": SubResource("Animation_8qeb2")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_xt24t"]
[node name="AirReactor" type="Node3D"]
script = ExtResource("1_xt24t")
AttackData = SubResource("Resource_kcnxw")
@@ -550,3 +552,9 @@ root_node = NodePath("../AnimatedSprite3D")
libraries = {
&"": SubResource("AnimationLibrary_q8n6h")
}
[node name="WallCollision" type="RigidBody3D" parent="Bullet"]
unique_name_in_owner = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/WallCollision"]
shape = SubResource("SphereShape3D_xt24t")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=67 format=3 uid="uid://igpvnbi8qi6e"]
[gd_scene load_steps=68 format=3 uid="uid://igpvnbi8qi6e"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_pk6yq"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_d874y"]
@@ -547,6 +547,8 @@ _data = {
&"RESET": SubResource("Animation_8qeb2")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_pk6yq"]
[node name="FireReactor" type="Node3D"]
script = ExtResource("1_pk6yq")
AttackData = SubResource("Resource_14f5p")
@@ -581,3 +583,9 @@ root_node = NodePath("../AnimatedSprite3D")
libraries = {
&"": SubResource("AnimationLibrary_q8n6h")
}
[node name="WallCollision" type="RigidBody3D" parent="Bullet"]
unique_name_in_owner = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/WallCollision"]
shape = SubResource("SphereShape3D_pk6yq")

View File

@@ -1,8 +1,9 @@
[gd_scene load_steps=72 format=3 uid="uid://d3nx0suvhbcda"]
[gd_scene load_steps=73 format=3 uid="uid://d3nx0suvhbcda"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_7ykt2"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_3v8me"]
[ext_resource type="Texture2D" uid="uid://c1x4iaqgj2rur" path="res://src/vfx/Items Etc/smokepuff.png" id="3_7ykt2"]
[ext_resource type="AudioStream" uid="uid://bgvt4kqyvl5gp" path="res://src/audio/sfx/ENEMY_EDEN_FIRE.ogg" id="4_3v8me"]
[sub_resource type="Resource" id="Resource_14f5p"]
script = ExtResource("2_3v8me")
@@ -456,8 +457,7 @@ animations = [{
[sub_resource type="Animation" id="Animation_xrn7e"]
resource_name = "fire"
length = 1.11667
step = 0.0166667
length = 0.66667
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
@@ -477,10 +477,10 @@ tracks/1/path = NodePath(".:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.416667),
"times": PackedFloat32Array(0.2, 0.666667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [1, 67]
"values": [0, 67]
}
tracks/2/type = "value"
tracks/2/imported = false
@@ -489,7 +489,7 @@ tracks/2/path = NodePath("%ProjectileHitbox:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 1.1),
"times": PackedFloat32Array(0, 0.666667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(0, 2.1, 0), Vector3(0, 2.1, -40)]
@@ -501,11 +501,35 @@ tracks/3/path = NodePath("%ProjectileHitbox/CollisionShape3D:disabled")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.0166667, 1.11667),
"times": PackedFloat32Array(0, 0.0166667, 0.666667),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, false, true]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("../Bullet/ProjectileHitbox/AudioStreamPlayer3D:stream")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [ExtResource("4_3v8me")]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("../Bullet/ProjectileHitbox/AudioStreamPlayer3D:playing")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0.0333333),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_8qeb2"]
length = 0.001
@@ -557,6 +581,18 @@ tracks/3/keys = {
"update": 1,
"values": [true]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("%AudioStreamPlayer3D:playing")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_q8n6h"]
_data = {
@@ -578,16 +614,16 @@ sprite_frames = SubResource("SpriteFrames_pck2g")
[node name="ProjectileHitbox" type="Area3D" parent="Bullet"]
unique_name_in_owner = true
collision_layer = 0
collision_mask = 2048
monitorable = false
collision_mask = 2049
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/ProjectileHitbox"]
shape = SubResource("SphereShape3D_kct8n")
disabled = true
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Bullet"]
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Bullet/ProjectileHitbox"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -2.1, 5.8557)
stream = ExtResource("4_3v8me")
[node name="AnimationPlayer" type="AnimationPlayer" parent="Bullet"]
unique_name_in_owner = true

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=78 format=3 uid="uid://7p2sh52lj42o"]
[gd_scene load_steps=79 format=3 uid="uid://7p2sh52lj42o"]
[ext_resource type="Script" uid="uid://cqm6u7qa8japr" path="res://src/system/Projectile.cs" id="1_n88a7"]
[ext_resource type="Script" uid="uid://ctshiyffvt4y5" path="res://src/system/AttackDataResource.cs" id="2_er0le"]
@@ -621,6 +621,8 @@ _data = {
&"RESET": SubResource("Animation_8qeb2")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_n88a7"]
[node name="WaterReactor" type="Node3D"]
script = ExtResource("1_n88a7")
AttackData = SubResource("Resource_k6pkx")
@@ -655,3 +657,9 @@ root_node = NodePath("../AnimatedSprite3D")
libraries = {
&"": SubResource("AnimationLibrary_q8n6h")
}
[node name="WallCollision" type="RigidBody3D" parent="Bullet"]
unique_name_in_owner = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Bullet/WallCollision"]
shape = SubResource("SphereShape3D_n88a7")