Fix texture stuff
This commit is contained in:
@@ -1,38 +1,49 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Godot.Adapter;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta, Id("throwable_item")]
|
||||
[Meta(typeof(IAutoNode)), Id("throwable_item")]
|
||||
public partial class ThrowableItem : InventoryItem
|
||||
{
|
||||
[Export]
|
||||
private ThrowableItemStats _throwableItemStats { get; set; }
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
public override string ItemName => _throwableItemStats.Name;
|
||||
[Node] private Sprite3D _sprite { get; set; } = default!;
|
||||
|
||||
public override string Description => _throwableItemStats.Description;
|
||||
public override void _Ready()
|
||||
{
|
||||
_sprite.Texture = Stats.Texture;
|
||||
}
|
||||
|
||||
public override float SpawnRate => _throwableItemStats.SpawnRate;
|
||||
public override string ItemName => Stats.Name;
|
||||
|
||||
public override double ThrowDamage => _throwableItemStats.ThrowDamage;
|
||||
public override string Description => Stats.Description;
|
||||
|
||||
public override float ThrowSpeed => _throwableItemStats.ThrowSpeed;
|
||||
public override float SpawnRate => Stats.SpawnRate;
|
||||
|
||||
public ElementType ElementType => _throwableItemStats.ElementType;
|
||||
public override double ThrowDamage => Stats.ThrowDamage;
|
||||
|
||||
public ThrowableItemTag ThrowableItemTag => _throwableItemStats.ThrowableItemTag;
|
||||
public override float ThrowSpeed => Stats.ThrowSpeed;
|
||||
|
||||
public int HealHPAmount => _throwableItemStats.HealHPAmount;
|
||||
public ElementType ElementType => Stats.ElementType;
|
||||
|
||||
public int HealVTAmount => _throwableItemStats.HealVTAmount;
|
||||
public ThrowableItemTag ThrowableItemTag => Stats.ThrowableItemTag;
|
||||
|
||||
public void SetElementType(ElementType elementType) => _throwableItemStats.ElementType = elementType;
|
||||
public int HealHPAmount => Stats.HealHPAmount;
|
||||
|
||||
public void SetDescription(string description) => _throwableItemStats.Description = description;
|
||||
public int HealVTAmount => Stats.HealVTAmount;
|
||||
|
||||
public void SetElementType(ElementType elementType) => Stats.ElementType = elementType;
|
||||
|
||||
public void SetDescription(string description) => Stats.Description = description;
|
||||
|
||||
public int Count { get; }
|
||||
|
||||
public override InventoryItemStats ItemStats { get => _throwableItemStats; set => _throwableItemStats = (ThrowableItemStats)value; }
|
||||
[Export]
|
||||
[Save("throwable_item_stats")]
|
||||
public ThrowableItemStats Stats { get; set; }
|
||||
public override Texture2D GetTexture() => Stats.Texture;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Chickensoft.Introspection;
|
||||
using Chickensoft.Serialization;
|
||||
using Godot;
|
||||
using Zennysoft.Ma.Godot.Adapter;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
@@ -9,6 +9,14 @@ namespace Zennysoft.Game.Ma;
|
||||
[Meta, Id("throwable_item_stats")]
|
||||
public partial class ThrowableItemStats : InventoryItemStats
|
||||
{
|
||||
[Export]
|
||||
[Save("throwable_item_name")]
|
||||
public override string Name { get; set; } = default!;
|
||||
|
||||
[Export(PropertyHint.MultilineText)]
|
||||
[Save("throwable_item_description")]
|
||||
public override string Description { get; set; } = default!;
|
||||
|
||||
[Export]
|
||||
[Save("throwable_item_tag")]
|
||||
public ThrowableItemTag ThrowableItemTag { get; set; } = ThrowableItemTag.None;
|
||||
|
||||
@@ -10,10 +10,10 @@ ElementType = 0
|
||||
UsableItemTag = 0
|
||||
Name = "Gospel of Dimension"
|
||||
Description = "Teleports target to a random location."
|
||||
Texture = ExtResource("1_xt2mp")
|
||||
SpawnRate = 0.1
|
||||
ThrowSpeed = 20.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 20
|
||||
ItemTag = 0
|
||||
Texture = ExtResource("1_xt2mp")
|
||||
|
||||
@@ -10,11 +10,11 @@ ElementType = 0
|
||||
UsableItemTag = 0
|
||||
Name = "Gospel of Escape"
|
||||
Description = "Warps target to the exit. No effect on player if exit has not been found."
|
||||
Texture = ExtResource("1_26kno")
|
||||
SpawnRate = 0.5
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 0
|
||||
Texture = ExtResource("1_26kno")
|
||||
metadata/_custom_type_script = "uid://d3wlunkcuv2w2"
|
||||
|
||||
@@ -5,15 +5,17 @@
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_s3pq7")
|
||||
Name = "Spell Sign: Knowledge"
|
||||
Description = "Doubles experience points earned. Effect is temporary."
|
||||
ThrowableItemTag = 1
|
||||
ElementType = 0
|
||||
UsableItemTag = 0
|
||||
Name = "Spell Sign: Knowledge"
|
||||
Description = "Doubles experience points earned. Effect is temporary."
|
||||
Texture = ExtResource("1_3605p")
|
||||
SpawnRate = 0.1
|
||||
ThrowSpeed = 12.0
|
||||
HealHPAmount = 0
|
||||
HealVTAmount = 0
|
||||
ThrowDamage = 5
|
||||
ItemTag = 0
|
||||
Texture = ExtResource("1_3605p")
|
||||
|
||||
Reference in New Issue
Block a user