Projectile handling
This commit is contained in:
@@ -1132,7 +1132,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
||||
RecoveryChance = ammo.ArrowRecoveryChance,
|
||||
CanHitMobs = true,
|
||||
CanHitPlayers = false, // TODO: PvP support
|
||||
SpriteKey = ammo.SpritePath ?? "projectile_arrow"
|
||||
SpriteKey = ammo.SpritePath ?? "projectile_arrow",
|
||||
IsLinear = ammo.IsLinearProjectile,
|
||||
FrontFrame = ammo.ProjectileFrontFrame,
|
||||
BackFrame = ammo.ProjectileBackFrame
|
||||
};
|
||||
|
||||
dungeon.Simulation.Projectiles.TryAdd(projectile.Id, projectile);
|
||||
@@ -1153,7 +1156,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
||||
y = projectile.Y,
|
||||
vx = projectile.VelocityX,
|
||||
vy = projectile.VelocityY,
|
||||
sprite = projectile.SpriteKey
|
||||
sprite = projectile.SpriteKey,
|
||||
isLinear = projectile.IsLinear,
|
||||
frontFrame = projectile.FrontFrame,
|
||||
backFrame = projectile.BackFrame
|
||||
}, CancellationToken.None);
|
||||
}
|
||||
}
|
||||
@@ -1208,7 +1214,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
||||
RecoveryChance = weapon.ArrowRecoveryChance,
|
||||
CanHitMobs = true,
|
||||
CanHitPlayers = false,
|
||||
SpriteKey = weapon.SpritePath ?? "projectile_knife"
|
||||
SpriteKey = weapon.SpritePath ?? "projectile_knife",
|
||||
IsLinear = weapon.IsLinearProjectile,
|
||||
FrontFrame = weapon.ProjectileFrontFrame,
|
||||
BackFrame = weapon.ProjectileBackFrame
|
||||
};
|
||||
|
||||
dungeon.Simulation.Projectiles.TryAdd(projectile.Id, projectile);
|
||||
@@ -1227,7 +1236,10 @@ public sealed partial class DungeonHandler : IClientMessageHandler
|
||||
y = projectile.Y,
|
||||
vx = projectile.VelocityX,
|
||||
vy = projectile.VelocityY,
|
||||
sprite = projectile.SpriteKey
|
||||
sprite = projectile.SpriteKey,
|
||||
isLinear = projectile.IsLinear,
|
||||
frontFrame = projectile.FrontFrame,
|
||||
backFrame = projectile.BackFrame
|
||||
}, CancellationToken.None);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,21 @@ public class ProjectileInstance
|
||||
|
||||
public string SpriteKey { get; set; } = "projectile_default";
|
||||
|
||||
/// <summary>
|
||||
/// Whether projectile uses linear rendering (front/back frames) or spins
|
||||
/// </summary>
|
||||
public bool IsLinear { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Front frame index for linear projectiles (arrow tip)
|
||||
/// </summary>
|
||||
public int FrontFrame { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Back frame index for linear projectiles (arrow tail)
|
||||
/// </summary>
|
||||
public int BackFrame { get; set; } = 0;
|
||||
|
||||
// Player projectile properties
|
||||
/// <summary>
|
||||
/// Item definition ID of the ammunition used (for recovery)
|
||||
|
||||
Reference in New Issue
Block a user