Throwable item rework, increase health on timer timeout, add boss 1 model

This commit is contained in:
2024-09-22 23:05:33 -07:00
parent f490a390aa
commit 59390c04bf
44 changed files with 3373 additions and 101 deletions

View File

@@ -17,7 +17,7 @@ public partial class ThrownItem : RigidBody3D
public void OnResolved()
{
BodyEntered += ThrownItem_BodyEntered;
GlobalPosition = Game.Player.GlobalPosition + new Vector3(0, 1f, 0);
GlobalPosition = Game.Player.GlobalPosition + new Vector3(0, 1.5f, 0);
Sprite.Texture = ThrownItemStats.Texture;
AddCollisionExceptionWith((Node)Game.Player);
}
@@ -26,39 +26,26 @@ public partial class ThrownItem : RigidBody3D
{
if (body is IEnemy enemy)
{
if (ThrownItemStats is ThrowableItemStats throwableItemStats)
enemy.EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(throwableItemStats.Damage));
CalculateEffect(enemy);
}
QueueFree();
}
public void Throw()
{
ThrowInternal((dynamic)ThrownItemStats);
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * ThrownItemStats.ThrowSpeed);
}
private void ThrowInternal(WeaponStats weaponStats)
private void CalculateEffect(IEnemy enemy)
{
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * 12.0f);
}
enemy.EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(ThrownItemStats.ThrowDamage));
private void ThrowInternal(ArmorStats armorStats)
{
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * 12.0f);
}
if (ThrownItemStats is ThrowableItemStats throwableItemStats)
{
if (throwableItemStats.ThrowableItemTags.Contains(ThrowableItemTag.LowerTargetTo1HP))
enemy.EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(enemy.CurrentHP.Value - 1));
enemy.EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(DamageCalculator.CalculateThrownItemDamage(throwableItemStats.ThrowDamage, enemy.EnemyStatResource, throwableItemStats)));
private void ThrowInternal(AccessoryStats accessoryStats)
{
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * 12.0f);
}
private void ThrowInternal(ConsumableItemStats consumableItemStats)
{
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * 12.0f);
}
private void ThrowInternal(ThrowableItemStats throwableItemStats)
{
ApplyCentralImpulse(-Game.Player.GlobalBasis.Z.Normalized() * 20.0f);
}
}
}