Additional refactoring and fixing of equipment data

Add attack data to enemy attacks (might need to rework a little bit for primary/secondary attacks)
This commit is contained in:
2025-10-23 00:05:44 -07:00
parent f0c4e65783
commit bc161a58b3
73 changed files with 641 additions and 641 deletions

View File

@@ -1,7 +1,6 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Game.Implementation;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
@@ -28,7 +27,7 @@ public partial class ThrownItem : RigidBody3D
{
BodyEntered += ThrownItem_BodyEntered;
Collision.AreaEntered += Collision_AreaEntered;
GlobalPosition = Player.CurrentPosition;
GlobalPosition = Player.GlobalPosition;
Sprite.Texture = ItemThatIsThrown.GetTexture();
AddCollisionExceptionWith((Node)Player);
Collision.SetCollisionLayerValue(3, false);
@@ -60,7 +59,7 @@ public partial class ThrownItem : RigidBody3D
public void Throw(EffectService effectService)
{
_effectService = effectService;
ApplyCentralImpulse(-Player.CurrentBasis.Z.Normalized() * ItemThatIsThrown.ThrowSpeed);
ApplyCentralImpulse(-Player.GlobalBasis.Z.Normalized() * ItemThatIsThrown.ThrowSpeed);
}
public void RescueItem()
@@ -116,14 +115,14 @@ public partial class ThrownItem : RigidBody3D
_effectService.TeleportToRandomRoom(enemy);
break;
default:
var damageDealt = DamageCalculator.CalculateDamage(new Damage(throwableItem.ThrowDamage, throwableItem.ElementType, false, false, false), 10, new ElementalResistanceSet(0, 0, 0, 0, 0));
var damageDealt = DamageCalculator.CalculateDamage(new AttackData(throwableItem.ThrowDamage, throwableItem.ElementType), 10, ElementalResistanceSet.None);
enemy.HealthComponent.Damage(damageDealt);
break;
}
}
else
{
var damageDealt = DamageCalculator.CalculateDamage(new Damage(ItemThatIsThrown.ThrowDamage, ElementType.None, false, false, false), 10, new ElementalResistanceSet(0, 0, 0, 0, 0));
var damageDealt = DamageCalculator.CalculateDamage(new AttackData(ItemThatIsThrown.ThrowDamage, ElementType.None), 10, ElementalResistanceSet.None);
enemy.HealthComponent.Damage(damageDealt);
}
}