Add implementation for box item

This commit is contained in:
2026-02-04 02:11:00 -08:00
23 changed files with 422 additions and 202 deletions
@@ -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("box_item")]
public partial class BoxItem : InventoryItem
{
public override void _Notification(int what) => this.Notify(what);
[Node] private Sprite3D _sprite { get; set; }
[Export]
[Save("box_stats")]
public BoxItemStats Stats { get; set; } = new BoxItemStats();
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;
public void OnReady()
{
_sprite.Texture = Stats.Texture;
}
}
@@ -0,0 +1 @@
uid://cqqqj4hgywst4
+1 -2
View File
@@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://bguomljidwgto"]
[ext_resource type="Script" path="res://src/items/box/BoxItem.cs" id="1_holk0"]
[ext_resource type="Script" uid="uid://cqqqj4hgywst4" path="res://src/items/box/BoxItem.cs" id="1_holk0"]
[ext_resource type="Texture2D" uid="uid://bg47n2tmintm0" path="res://src/items/consumable/textures/past self remnant.PNG" id="2_holk0"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_x6u08"]
@@ -17,7 +17,6 @@ axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1_holk0")
Stats = null
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.00908482, 0)
@@ -0,0 +1,25 @@
[gd_resource type="Resource" script_class="BoxItemStats" load_steps=3 format=3 uid="uid://cgkorwblwr12t"]
[ext_resource type="Texture2D" uid="uid://bg47n2tmintm0" path="res://src/items/consumable/textures/past self remnant.PNG" id="1_650jj"]
[ext_resource type="Script" uid="uid://vuavr681au06" path="res://src/items/accessory/BoxItemStats.cs" id="1_i336w"]
[resource]
script = ExtResource("1_i336w")
Name = "Empty Promise"
Description = "An empty box."
SpawnRate = 0.5
BonusAttack = 0
BonusDefense = 0
BonusLuck = 0.05
BonusHP = 0
BonusVT = 0
AeolicResistance = 0
TelluricResistance = 0
HydricResistance = 0
IgneousResistance = 0
FerrumResistance = 0
ThrowSpeed = 12.0
ThrowDamage = 5
ItemTag = 0
Texture = ExtResource("1_650jj")
metadata/_custom_type_script = "uid://vuavr681au06"