Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equipment implementation ideas #53

Closed
VedVid opened this issue Dec 18, 2018 · 6 comments
Closed

equipment implementation ideas #53

VedVid opened this issue Dec 18, 2018 · 6 comments
Labels
enhancement New feature or request high [priority]

Comments

@VedVid
Copy link
Owner

VedVid commented Dec 18, 2018

So, instead of lots of different fields as now:
type EquipmentComponent struct {
Slot1 *Object
Slot2 *Object
Slot3 *Object
}

Use something different.

At first, I had some ideas (hashmaps, embedded structs, etc) but all of them have major flaws.

@VedVid VedVid changed the title equipment implementation idea equipment implementation ideas Dec 18, 2018
@VedVid
Copy link
Owner Author

VedVid commented Dec 18, 2018

Reworking Objects ( see #42 ) will help with this issue

@VedVid VedVid added enhancement New feature or request help wanted Extra attention is needed high [priority] labels Dec 18, 2018
@VedVid
Copy link
Owner Author

VedVid commented Dec 18, 2018

equippable is for something. this could be used for automatic detection if it's equipment or consumable

@VedVid
Copy link
Owner Author

VedVid commented Dec 18, 2018

Add an iota for slots.
SlotNA = iota
SlotWeapon
SlotHead
(...)

Keep objects unified. So, dungeon features like barrels and items like cake or sword are Objects.

But test booleans with slots. Like, if it's not equippable, it has to slot set to SlotNA.

This comment will be posted in #42 as well.

@VedVid
Copy link
Owner Author

VedVid commented Dec 18, 2018

In that case, small rework of inventory will be necessary. For now, EquipmentComponent takes consumables (Objects pickable but not equippable) into slice of *Object (ie Objects), and Slot takes single *Object.

It has to match Slot(s) in Eq with Object property Slot.

@VedVid
Copy link
Owner Author

VedVid commented Dec 25, 2018

Equipment could be just slice with fixed number of fields. Then it would be possible to use already implemented iotas for EQ-related stuff. Like, Equipment[1] is always weapon, because SlotWeapon == 1.

@VedVid VedVid removed the help wanted Extra attention is needed label Dec 30, 2018
@VedVid
Copy link
Owner Author

VedVid commented Feb 11, 2019

It will differ in various implementation. For now (looking at ed730d9 ) it works like that:

  • there is MaxSlot value; it is impossible to equip more items than MaxSlot
  • every equipment has its own slot, defined in the same place
  • Inventory is undefined (yet)

@VedVid VedVid closed this as completed Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high [priority]
Projects
None yet
Development

No branches or pull requests

1 participant