188 lines
6.7 KiB
Plaintext
188 lines
6.7 KiB
Plaintext
@model DataServer.Data.Entities.DungeonCharacterItem
|
|
@using DataServer.Data.Enums
|
|
|
|
@{
|
|
var def = Model.ItemDefinition;
|
|
if (def == null) return;
|
|
|
|
var rarityColor = def.Rarity switch
|
|
{
|
|
ItemRarity.Uncommon => "text-green-400",
|
|
ItemRarity.Rare => "text-blue-400",
|
|
ItemRarity.Epic => "text-purple-400",
|
|
ItemRarity.Legendary => "text-orange-400",
|
|
_ => "text-gray-300"
|
|
};
|
|
|
|
var rarityBg = def.Rarity switch
|
|
{
|
|
ItemRarity.Uncommon => "border-green-600",
|
|
ItemRarity.Rare => "border-blue-600",
|
|
ItemRarity.Epic => "border-purple-600",
|
|
ItemRarity.Legendary => "border-orange-600",
|
|
_ => "border-gray-600"
|
|
};
|
|
|
|
// Calculate total stats (base + crafted)
|
|
var (totalStr, totalInt, totalWis, totalEnd, totalDex, totalHealth, totalMana) = Model.GetTotalStats(def);
|
|
var craftedItem = Model.CraftedItem;
|
|
var hasCraftedStats = craftedItem != null;
|
|
|
|
int totalMinDamage = def.MinDamage + (craftedItem?.RolledBonusMinDamage ?? 0);
|
|
int totalMaxDamage = def.MaxDamage + (craftedItem?.RolledBonusMaxDamage ?? 0);
|
|
int totalArmor = def.Armor + (craftedItem?.RolledBonusArmor ?? 0);
|
|
}
|
|
|
|
<div class="bg-gray-900 border @rarityBg rounded-lg p-3 w-64 shadow-xl">
|
|
<!-- Header -->
|
|
<div class="mb-2">
|
|
<p class="font-semibold @rarityColor">
|
|
@if (!string.IsNullOrEmpty(craftedItem?.CustomName))
|
|
{
|
|
@craftedItem.CustomName
|
|
}
|
|
else
|
|
{
|
|
@def.Name
|
|
}
|
|
</p>
|
|
<p class="text-xs text-gray-500">@def.Type • @def.Rarity</p>
|
|
@if (hasCraftedStats)
|
|
{
|
|
<p class="text-xs text-cyan-400">⚒️ Crafted (Quality: @craftedItem!.QualityRating%)</p>
|
|
<p class="text-xs text-gray-500">by @craftedItem.CrafterName</p>
|
|
}
|
|
</div>
|
|
|
|
@if (!string.IsNullOrEmpty(def.Description))
|
|
{
|
|
<p class="text-xs text-gray-400 italic mb-2">@def.Description</p>
|
|
}
|
|
|
|
<!-- Weapon Stats -->
|
|
@if (totalMinDamage > 0 || totalMaxDamage > 0)
|
|
{
|
|
<div class="text-sm mb-2">
|
|
<span class="text-white">@totalMinDamage - @totalMaxDamage</span>
|
|
<span class="text-gray-500">@def.DamageTypeKey Damage</span>
|
|
@if (hasCraftedStats && (craftedItem!.RolledBonusMinDamage > 0 || craftedItem.RolledBonusMaxDamage > 0))
|
|
{
|
|
<span class="text-cyan-400 text-xs block">+@craftedItem.RolledBonusMinDamage-@craftedItem.RolledBonusMaxDamage (crafted)</span>
|
|
}
|
|
@if (def.AttackRange > 0)
|
|
{
|
|
<span class="text-gray-500 block text-xs">Range: @def.AttackRange</span>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<!-- Armor Stats -->
|
|
@if (totalArmor > 0)
|
|
{
|
|
<div class="text-sm mb-2 space-y-1">
|
|
<p>
|
|
<span class="text-gray-500">Armor:</span>
|
|
<span class="text-white">@totalArmor</span>
|
|
@if (hasCraftedStats && craftedItem!.RolledBonusArmor > 0)
|
|
{
|
|
<span class="text-cyan-400 text-xs">(+@craftedItem.RolledBonusArmor crafted)</span>
|
|
}
|
|
</p>
|
|
</div>
|
|
}
|
|
|
|
<!-- Stat Bonuses -->
|
|
@{
|
|
var bonuses = new List<(string name, int baseValue, int craftedValue, int total, string color)>();
|
|
if (totalStr != 0) bonuses.Add(("STR", def.BonusStrength, craftedItem?.RolledBonusStrength ?? 0, totalStr, "text-red-400"));
|
|
if (totalInt != 0) bonuses.Add(("INT", def.BonusIntelligence, craftedItem?.RolledBonusIntelligence ?? 0, totalInt, "text-blue-400"));
|
|
if (totalWis != 0) bonuses.Add(("WIS", def.BonusWisdom, craftedItem?.RolledBonusWisdom ?? 0, totalWis, "text-purple-400"));
|
|
if (totalEnd != 0) bonuses.Add(("END", def.BonusEndurance, craftedItem?.RolledBonusEndurance ?? 0, totalEnd, "text-green-400"));
|
|
if (totalDex != 0) bonuses.Add(("DEX", def.BonusDexterity, craftedItem?.RolledBonusDexterity ?? 0, totalDex, "text-yellow-400"));
|
|
if (totalHealth != 0) bonuses.Add(("HP", def.BonusHealth, craftedItem?.RolledBonusHealth ?? 0, totalHealth, "text-green-300"));
|
|
if (totalMana != 0) bonuses.Add(("Mana", def.BonusMana, craftedItem?.RolledBonusMana ?? 0, totalMana, "text-blue-300"));
|
|
}
|
|
@if (bonuses.Any())
|
|
{
|
|
<div class="text-sm mb-2 space-y-0.5">
|
|
@foreach (var bonus in bonuses)
|
|
{
|
|
var sign = bonus.total > 0 ? "+" : "";
|
|
<p class="@bonus.color">
|
|
@sign@bonus.total @bonus.name
|
|
@if (bonus.craftedValue > 0)
|
|
{
|
|
<span class="text-cyan-400 text-xs">(+@bonus.craftedValue crafted)</span>
|
|
}
|
|
</p>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<!-- Consumable Effects -->
|
|
@if (def.HealAmount > 0 || def.ManaRestore > 0 || def.StaminaRestore > 0)
|
|
{
|
|
<div class="text-sm mb-2 space-y-0.5 text-green-400">
|
|
@if (def.HealAmount > 0)
|
|
{
|
|
<p>Restores @def.HealAmount HP</p>
|
|
}
|
|
@if (def.ManaRestore > 0)
|
|
{
|
|
<p>Restores @def.ManaRestore Mana</p>
|
|
}
|
|
@if (def.StaminaRestore > 0)
|
|
{
|
|
<p>Restores @def.StaminaRestore Stamina</p>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
<!-- Requirements -->
|
|
@{
|
|
var reqs = new List<string>();
|
|
if (def.RequiredLevel > 1) reqs.Add($"Level {def.RequiredLevel}");
|
|
if (def.RequiredStrength > 0) reqs.Add($"{def.RequiredStrength} STR");
|
|
if (def.RequiredIntelligence > 0) reqs.Add($"{def.RequiredIntelligence} INT");
|
|
if (def.RequiredWisdom > 0) reqs.Add($"{def.RequiredWisdom} WIS");
|
|
if (def.RequiredDexterity > 0) reqs.Add($"{def.RequiredDexterity} DEX");
|
|
}
|
|
@if (reqs.Any())
|
|
{
|
|
<div class="text-xs text-red-400 mt-2 pt-2 border-t border-gray-700">
|
|
Requires: @string.Join(", ", reqs)
|
|
</div>
|
|
}
|
|
|
|
<!-- Special -->
|
|
@if (def.IsTeleportScroll)
|
|
{
|
|
<p class="text-xs text-cyan-400 mt-1">Teleport Scroll</p>
|
|
}
|
|
@if (def.TeachesSpellId.HasValue)
|
|
{
|
|
<p class="text-xs text-cyan-400 mt-1">Teaches a spell</p>
|
|
}
|
|
|
|
<!-- Stack Info -->
|
|
@if (def.Stackable && Model.Quantity > 1)
|
|
{
|
|
<p class="text-xs text-gray-500 mt-2">Quantity: @Model.Quantity / @def.MaxStack</p>
|
|
}
|
|
|
|
<!-- Equip Slot -->
|
|
@if (def.EquipSlot.HasValue)
|
|
{
|
|
<p class="text-xs text-gray-500 mt-1">Slot: @def.EquipSlot</p>
|
|
}
|
|
|
|
<!-- Item IDs -->
|
|
<p class="text-xs text-gray-600 mt-2">
|
|
Item ID: @Model.Id
|
|
@if (hasCraftedStats)
|
|
{
|
|
<span class="block">Craft ID: @craftedItem!.Id</span>
|
|
}
|
|
</p>
|
|
</div>
|