projectiles
This commit is contained in:
@@ -203,6 +203,73 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Projectile/Ranged Weapon Properties -->
|
||||
<div id="projectileSection" class="card" style="display: @(isWeapon ? "block" : "none")">
|
||||
<div class="p-4 border-b border-gray-700">
|
||||
<h2 class="text-lg font-semibold text-white">Projectile & Ranged Weapon Properties</h2>
|
||||
<p class="text-sm text-gray-400 mt-1">Configuration for bows, crossbows, and throwable weapons</p>
|
||||
</div>
|
||||
<div class="p-6 space-y-6">
|
||||
<!-- Basic Projectile Settings -->
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div class="flex items-center pt-6">
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" id="requiresAmmoCheck" name="Item.RequiresAmmunition" value="true" checked="@Model.Item.RequiresAmmunition" class="w-4 h-4 rounded border-gray-600 bg-gray-800 text-indigo-600" onchange="toggleAmmoFields()" />
|
||||
<span class="text-gray-300">Requires Ammunition</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="flex items-center pt-6">
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input type="checkbox" name="Item.IsThrowable" value="true" checked="@Model.Item.IsThrowable" class="w-4 h-4 rounded border-gray-600 bg-gray-800 text-indigo-600" />
|
||||
<span class="text-gray-300">Is Throwable</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Ammunition Type -->
|
||||
<div id="ammoTypeSection" style="display: @(Model.Item.RequiresAmmunition ? "block" : "none")">
|
||||
<label class="label">Ammunition Type</label>
|
||||
<input type="text" name="Item.AmmunitionType" value="@Model.Item.AmmunitionType" class="input" maxlength="32" placeholder="e.g., arrow, bolt" />
|
||||
<p class="text-xs text-gray-500 mt-1">Must match the AmmunitionType of ammo items (e.g., "arrow" for bows, "bolt" for crossbows)</p>
|
||||
</div>
|
||||
|
||||
<!-- Projectile Physics -->
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div>
|
||||
<label class="label">Projectile Speed (px/s)</label>
|
||||
<input type="number" name="Item.ProjectileSpeed" value="@Model.Item.ProjectileSpeed" class="input" min="0" step="1" />
|
||||
<p class="text-xs text-gray-500 mt-1">0 = melee only</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">Max Range (pixels)</label>
|
||||
<input type="number" name="Item.ProjectileRange" value="@Model.Item.ProjectileRange" class="input" min="0" step="1" />
|
||||
<p class="text-xs text-gray-500 mt-1">Distance before projectile expires</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">Recovery Chance (%)</label>
|
||||
<input type="number" name="Item.ArrowRecoveryChance" value="@((Model.Item.ArrowRecoveryChance * 100).ToString("0.##"))" class="input" min="0" max="100" step="0.1" oninput="this.form.elements['Item.ArrowRecoveryChance'].value = this.value / 100" />
|
||||
<input type="hidden" name="Item.ArrowRecoveryChance" value="@Model.Item.ArrowRecoveryChance" />
|
||||
<p class="text-xs text-gray-500 mt-1">Chance to recover ammo after hit (for ammunition items)</p>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">Quiver Capacity</label>
|
||||
<input type="number" name="Item.QuiverCapacity" value="@Model.Item.QuiverCapacity" class="input" min="0" max="10" />
|
||||
<p class="text-xs text-gray-500 mt-1">Number of ammo slots (0 = not a quiver container)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-blue-900/20 border border-blue-700 rounded-lg p-4 text-sm text-blue-200">
|
||||
<strong>Weapon Types:</strong>
|
||||
<ul class="mt-2 space-y-1 ml-4">
|
||||
<li><strong>Bows/Crossbows:</strong> Enable "Requires Ammunition", set AmmunitionType, ProjectileSpeed, Range</li>
|
||||
<li><strong>Throwables (knives, javelins):</strong> Enable "Is Throwable", set ProjectileSpeed, Range (no ammo required - consumes from inventory)</li>
|
||||
<li><strong>Quiver Containers:</strong> Set QuiverCapacity > 0, equip to Quiver slot</li>
|
||||
<li><strong>Ammunition (arrows, bolts):</strong> Set Recovery Chance, make Stackable, set EquipSlot to Quiver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Resistances (Equipment) -->
|
||||
<div id="resistancesSection" class="card" style="display: @(isEquipment ? "block" : "none")">
|
||||
<div class="p-4 border-b border-gray-700">
|
||||
@@ -292,6 +359,7 @@
|
||||
else { img.classList.add('hidden'); placeholder.classList.remove('hidden'); }
|
||||
}
|
||||
function toggleMaxStack() { const cb = document.getElementById('stackableCheck'); const input = document.getElementById('maxStackInput'); input.disabled = !cb.checked; if (!cb.checked) input.value = 1; }
|
||||
function toggleAmmoFields() { const cb = document.getElementById('requiresAmmoCheck'); const section = document.getElementById('ammoTypeSection'); section.style.display = cb.checked ? 'block' : 'none'; }
|
||||
function updateSections() {
|
||||
const type = document.getElementById('itemType').value;
|
||||
const isEquipment = ['Weapon', 'Armor', 'Accessory'].includes(type);
|
||||
@@ -308,6 +376,7 @@
|
||||
document.getElementById('damageTypeSection').style.display = isWeapon ? 'block' : 'none';
|
||||
document.getElementById('minDamageRangeSection').style.display = isWeapon ? 'block' : 'none';
|
||||
document.getElementById('maxDamageRangeSection').style.display = isWeapon ? 'block' : 'none';
|
||||
document.getElementById('projectileSection').style.display = isWeapon ? 'block' : 'none';
|
||||
document.getElementById('consumableSection').style.display = isConsumable ? 'block' : 'none';
|
||||
}
|
||||
function addResistance() {
|
||||
|
||||
Reference in New Issue
Block a user