projectiles
This commit is contained in:
@@ -64,7 +64,10 @@ public sealed class GameDbContext : DbContext
|
||||
|
||||
// Damage system
|
||||
public DbSet<DamageResistanceType> DamageResistanceTypes => Set<DamageResistanceType>();
|
||||
|
||||
|
||||
// Projectile/Quiver system
|
||||
public DbSet<DungeonQuiverAmmoSlot> DungeonQuiverAmmoSlots => Set<DungeonQuiverAmmoSlot>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder b)
|
||||
{
|
||||
b.ApplyConfigurationsFromAssembly(typeof(GameDbContext).Assembly);
|
||||
|
||||
@@ -59,7 +59,10 @@ public class DungeonCharacter
|
||||
public ulong? EquippedLegs { get; set; }
|
||||
public ulong? EquippedBoots { get; set; }
|
||||
public ulong? EquippedGloves { get; set; }
|
||||
public ulong? EquippedAccessory { get; set; }
|
||||
public ulong? EquippedNecklace { get; set; }
|
||||
public ulong? EquippedRing1 { get; set; }
|
||||
public ulong? EquippedRing2 { get; set; }
|
||||
public ulong? EquippedQuiver { get; set; }
|
||||
|
||||
// Lifetime stats
|
||||
public int TotalKills { get; set; }
|
||||
|
||||
@@ -124,7 +124,49 @@ public class DungeonItemDefinition
|
||||
// Stacking
|
||||
public bool Stackable { get; set; } = false;
|
||||
public int MaxStack { get; set; } = 1;
|
||||
|
||||
|
||||
// Projectile/Ranged Weapon Properties
|
||||
/// <summary>
|
||||
/// Whether this weapon requires ammunition to fire (bows, crossbows)
|
||||
/// Throwable weapons (knives, javelins) don't require ammo but consume themselves
|
||||
/// </summary>
|
||||
public bool RequiresAmmunition { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Type of ammunition required (e.g., "arrow", "bolt")
|
||||
/// Null for melee weapons and throwables
|
||||
/// </summary>
|
||||
[MaxLength(32)]
|
||||
public string? AmmunitionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Projectile speed in pixels per second (0 = melee weapon)
|
||||
/// </summary>
|
||||
public float ProjectileSpeed { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Max range in pixels before projectile expires (0 = melee weapon)
|
||||
/// </summary>
|
||||
public int ProjectileRange { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Chance (0.0 to 1.0) to recover this ammunition after hitting a target
|
||||
/// 0.05 = 5%, 0.20 = 20%, etc.
|
||||
/// Only applies to ammunition items
|
||||
/// </summary>
|
||||
public float ArrowRecoveryChance { get; set; } = 0.05f;
|
||||
|
||||
/// <summary>
|
||||
/// For quiver containers: number of ammo slots available
|
||||
/// 0 = not a container
|
||||
/// </summary>
|
||||
public int QuiverCapacity { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this item is throwable (consumes from inventory)
|
||||
/// </summary>
|
||||
public bool IsThrowable { get; set; } = false;
|
||||
|
||||
// Visuals
|
||||
/// <summary>
|
||||
/// Path to the item's sprite image on CDN (e.g., "textures/items/sword_iron.png")
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DataServer.Data.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an ammunition slot within a quiver container
|
||||
/// Each equipped quiver can hold multiple types of ammunition
|
||||
/// </summary>
|
||||
[Table("dungeon_quiver_ammo_slots")]
|
||||
public class DungeonQuiverAmmoSlot
|
||||
{
|
||||
[Key]
|
||||
public ulong Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The character item ID of the equipped quiver container
|
||||
/// This links to the actual quiver item in the character's equipment
|
||||
/// </summary>
|
||||
[Required]
|
||||
public ulong QuiverCharacterItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Slot index within the quiver (0 to QuiverCapacity-1)
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int SlotIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The item definition ID of the ammunition in this slot
|
||||
/// References DungeonItemDefinition.Id
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int ItemDefinitionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Current quantity of this ammunition type in the slot
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int Quantity { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum quantity allowed in this slot (from item definition's MaxStack)
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int MaxQuantity { get; set; } = 100;
|
||||
|
||||
// Navigation properties
|
||||
public virtual DungeonCharacterItem? QuiverItem { get; set; }
|
||||
public virtual DungeonItemDefinition? ItemDefinition { get; set; }
|
||||
}
|
||||
@@ -9,6 +9,8 @@ public enum DungeonEquipmentSlot
|
||||
Legs,
|
||||
Boots,
|
||||
Gloves,
|
||||
Accessory1,
|
||||
Accessory2,
|
||||
Necklace,
|
||||
Ring1,
|
||||
Ring2,
|
||||
Quiver
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user