Working on crafting fixes
This commit is contained in:
@@ -139,8 +139,12 @@
|
||||
{
|
||||
<span class="absolute bottom-0 right-0 bg-black/80 text-white text-[10px] px-0.5 rounded-tl">@item.Quantity</span>
|
||||
}
|
||||
@if (item.CraftedItem != null)
|
||||
{
|
||||
<span class="absolute top-0 left-0 text-cyan-400 text-[10px] font-bold">⚒️</span>
|
||||
}
|
||||
<div class="absolute left-full ml-1 top-0 z-50 hidden group-hover:block">
|
||||
@await Html.PartialAsync("_ItemTooltip", item.ItemDefinition)
|
||||
@await Html.PartialAsync("_CharacterItemTooltip", item)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -221,7 +225,7 @@
|
||||
{
|
||||
var item = Model.EquippedItems.FirstOrDefault(i => i.EquipSlot == slot.Item1);
|
||||
<div class="flex items-center gap-2 p-1.5 bg-gray-800 rounded group relative">
|
||||
<div class="w-8 h-8 bg-gray-900 rounded border border-gray-700 flex items-center justify-center flex-shrink-0">
|
||||
<div class="w-8 h-8 bg-gray-900 rounded border border-gray-700 flex items-center justify-center flex-shrink-0 relative">
|
||||
@if (item?.ItemDefinition != null && !string.IsNullOrEmpty(item.ItemDefinition.SpritePath))
|
||||
{
|
||||
<img src="@Model.CdnBaseUrl/downloads/@item.ItemDefinition.SpritePath" class="w-6 h-6 object-contain" />
|
||||
@@ -230,17 +234,25 @@
|
||||
{
|
||||
<span class="text-gray-600 text-[10px]">@slot.Item2.Substring(0, 1)</span>
|
||||
}
|
||||
@if (item?.CraftedItem != null)
|
||||
{
|
||||
<span class="absolute -top-1 -right-1 text-cyan-400 text-[10px] font-bold">⚒️</span>
|
||||
}
|
||||
</div>
|
||||
<div class="flex-1 min-w-0">
|
||||
<p class="text-[10px] text-gray-500">@slot.Item2</p>
|
||||
<p class="text-xs @(item != null ? "text-white" : "text-gray-600 italic") truncate">
|
||||
@(item?.ItemDefinition?.Name ?? "Empty")
|
||||
@if (item?.CraftedItem != null)
|
||||
{
|
||||
<span class="text-cyan-400 text-[10px]">(Q@(item.CraftedItem.QualityRating)%)</span>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
@if (item?.ItemDefinition != null)
|
||||
{
|
||||
<div class="absolute right-full mr-1 top-0 z-50 hidden group-hover:block">
|
||||
@await Html.PartialAsync("_ItemTooltip", item.ItemDefinition)
|
||||
@await Html.PartialAsync("_CharacterItemTooltip", item)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
@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>
|
||||
Reference in New Issue
Block a user