Fix texture stuff

This commit is contained in:
2025-03-09 12:24:30 -07:00
parent b93630756c
commit d8c5bc8f78
112 changed files with 671 additions and 355 deletions

View File

@@ -1,8 +1,7 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Ma.Godot.Adapter;
using Zennysoft.Game.Abstractions;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
@@ -15,7 +14,7 @@ public partial class ThrownItem : RigidBody3D
[Dependency] public IGame Game => this.DependOn<IGame>();
public IInventoryItem ItemThatIsThrown;
public InventoryItem ItemThatIsThrown;
private EffectService _effectService;
@@ -25,7 +24,7 @@ public partial class ThrownItem : RigidBody3D
{
BodyEntered += ThrownItem_BodyEntered;
GlobalPosition = Player.CurrentPosition;
Sprite.Texture = ((InventoryItem)ItemThatIsThrown).ItemStats.Texture;
Sprite.Texture = ItemThatIsThrown.GetTexture();
AddCollisionExceptionWith((Node)Player);
}
@@ -39,7 +38,7 @@ public partial class ThrownItem : RigidBody3D
public void Throw(EffectService effectService)
{
_effectService = effectService;
ApplyCentralImpulse(-Player.CurrentBasis.Z.Normalized() * ((InventoryItem)ItemThatIsThrown).ThrowSpeed);
ApplyCentralImpulse(-Player.CurrentBasis.Z.Normalized() * ItemThatIsThrown.ThrowSpeed);
}
public void RescueItem()