Orcpub / orcpub

Code for Dungeon Master's Vault Community Edition
https://www.dungeonmastersvault.com/
Eclipse Public License 2.0
212 stars 106 forks source link

Bug: Searching anything in the Item List brings up entries for Longswords #411

Closed DivertedCircle closed 3 years ago

DivertedCircle commented 4 years ago

Describe the bug Searching anything in the Item List brings up entries for various Longswords. These entries do not expand when clicked on like a proper entry does.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Item List menu.
  2. Enter a weapon name, like 'mace'.
  3. See error.

Expected behavior Only weapons that fit the search criteria should appear.

Screenshots image

Additional context Suspect it is related to the fix applied for #334.

codeGlaze commented 4 years ago

This is happening incognito and logged out?

DivertedCircle commented 4 years ago

Yes, it happens there as well.

datdamnzotz commented 3 years ago

Ok after messing around with this - the Duplicate Longsword is coming from the weapons definitions which I added in an attempt to fix the Sun Blade.

That was a mistake.

Larry is looping through the magic items of types eg swords (which there are two long sword defined) and adding each type to the list.

I've removed the duplicate longsword definition, and reworked the Sun Blade so it inherits the attributes from the type of sword it is. image

Also fixes duplicate items we were seeing the the search results

Still searching to force it to finesse?

datdamnzotz commented 3 years ago

Latest update allows magic weapons to be over written for damage type and finesse?

Add to a magical weapon:

     ::magical-damage-type :damage-type
     ::magical-finesse? true

eg

{
     name-key "Sun Blade"
     ::type :weapon
     ::item-subtype sword?
     ::rarity :rare
     ::attunement [:any]
     ::magical-attack-bonus 2
     ::magical-damage-bonus 2
     ::magical-damage-type :radiant
     ::magical-finesse? true

     ::description "This item appears to be a longsword hilt. While grasping the hilt, you can use a bonus action to cause a blade of pure radiance to spring into existence, or make the blade disappear. While the blade exists, this magic longsword has the finesse property. If you are proficient with shortswords or longswords, you are proficient with the sun blade.
You gain a +2 bonus to attack and damage rolls made with this weapon, which deals radiant damage instead of slashing damage. When you hit an undead with it, that target takes an extra 1d8 radiant damage.
The sword’s luminous blade emits bright light in a 15-foot radius and dim light for an additional 15 feet. The light is sunlight. While the blade persists, you can use an action to expand or reduce its radius of bright and dim light by 5 feet each, to a maximum of 30 feet each or a minimum of 10 feet each."
     }

image

datdamnzotz commented 3 years ago

Fixes search image

codeGlaze commented 3 years ago

Oh nice, clever solution! Recharging a bit now that the nice weather is over?

datdamnzotz commented 3 years ago

yah feels kluge to do it that way but to truly fix it would require all weapons to be just weapons then add their magic modifiers as needed - that would require all weapons to be redefined.