collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
884 stars 101 forks source link

Certain special unique items don't use correct image/sounds #10

Closed collinsmith closed 5 years ago

collinsmith commented 5 years ago

Some items, e.g., Annihilus and Hellfire Torch, use a base item type that does not match their appearance/sound set. These appear to be hardcoded in the client. Changing the item base to the matching one (e.g., set Annihilus to mss base from cm1) is not sufficient, as this changes other properties of the items which are normally retrieved via item.base. fields. I think the proper fix would be to remove references to affected fields and implement methods in Item itself. Other items that typically have this kind of behavior only change the image and have separate entries (e.g., Viper Amulet, Staff of Kings, Hellforge Hammer, etc). It's possible this is the way it is because these items are uniquely identifiable, and thus when unidentified need to appear for all intents and purposes as their normal counterparts, sounds and all.

Affected fields: flippyfile, invfile, uniqueinvfile, dropsound, dropsfxframe, usesound

collinsmith commented 5 years ago

I moved references from the item.base fields to item methods. I left out any special implementation for usesound since the affected items are not usable, however if any items in the future are, it shouldn't be a big deal. I may mark the ItemEntry fields as deprecated to discourage direct use in the future.