projectile fix

This commit is contained in:
dingo
2026-01-19 11:07:24 -05:00
parent 11628617ae
commit 01a19056bb
7 changed files with 3514 additions and 32 deletions
+16 -8
View File
@@ -1134,8 +1134,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
CanHitPlayers = false, // TODO: PvP support
SpriteKey = ammo.SpritePath ?? "projectile_arrow",
IsLinear = ammo.IsLinearProjectile,
FrontFrame = ammo.ProjectileFrontFrame,
BackFrame = ammo.ProjectileBackFrame
FrontX = ammo.ProjectileFrontX,
FrontY = ammo.ProjectileFrontY,
BackX = ammo.ProjectileBackX,
BackY = ammo.ProjectileBackY
};
dungeon.Simulation.Projectiles.TryAdd(projectile.Id, projectile);
@@ -1158,8 +1160,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
vy = projectile.VelocityY,
sprite = projectile.SpriteKey,
isLinear = projectile.IsLinear,
frontFrame = projectile.FrontFrame,
backFrame = projectile.BackFrame
frontX = projectile.FrontX,
frontY = projectile.FrontY,
backX = projectile.BackX,
backY = projectile.BackY
}, CancellationToken.None);
}
}
@@ -1216,8 +1220,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
CanHitPlayers = false,
SpriteKey = weapon.SpritePath ?? "projectile_knife",
IsLinear = weapon.IsLinearProjectile,
FrontFrame = weapon.ProjectileFrontFrame,
BackFrame = weapon.ProjectileBackFrame
FrontX = weapon.ProjectileFrontX,
FrontY = weapon.ProjectileFrontY,
BackX = weapon.ProjectileBackX,
BackY = weapon.ProjectileBackY
};
dungeon.Simulation.Projectiles.TryAdd(projectile.Id, projectile);
@@ -1238,8 +1244,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
vy = projectile.VelocityY,
sprite = projectile.SpriteKey,
isLinear = projectile.IsLinear,
frontFrame = projectile.FrontFrame,
backFrame = projectile.BackFrame
frontX = projectile.FrontX,
frontY = projectile.FrontY,
backX = projectile.BackX,
backY = projectile.BackY
}, CancellationToken.None);
}
}
+15 -5
View File
@@ -38,19 +38,29 @@ public class ProjectileInstance
public string SpriteKey { get; set; } = "projectile_default";
/// <summary>
/// Whether projectile uses linear rendering (front/back frames) or spins
/// Whether projectile uses linear rendering (front/back coordinates) or spins
/// </summary>
public bool IsLinear { get; set; } = false;
/// <summary>
/// Front frame index for linear projectiles (arrow tip)
/// X coordinate of arrow tip (front) in sprite
/// </summary>
public int FrontFrame { get; set; } = 0;
public int FrontX { get; set; } = 0;
/// <summary>
/// Back frame index for linear projectiles (arrow tail)
/// Y coordinate of arrow tip (front) in sprite
/// </summary>
public int BackFrame { get; set; } = 0;
public int FrontY { get; set; } = 0;
/// <summary>
/// X coordinate of arrow tail (back) in sprite
/// </summary>
public int BackX { get; set; } = 0;
/// <summary>
/// Y coordinate of arrow tail (back) in sprite
/// </summary>
public int BackY { get; set; } = 0;
// Player projectile properties
/// <summary>