Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[CR] Implement item type slots for items to be of multiple types. #10402
Conversation
This comment has been minimized.
This comment has been minimized.
|
This looks like the first step to item composition, likely a very good and useful thing. I don't really find the I have one minor quibble: I'd drop the "_slot" from the name. They're armor properties, you may as well be accessing them as P.S.: Fix yo' compile errors. ;) |
BevapDin
force-pushed the
BevapDin:armor-slot
branch
Dec 9, 2014
BevapDin
added some commits
Dec 9, 2014
BevapDin
force-pushed the
BevapDin:armor-slot
branch
Dec 9, 2014
BevapDin
added some commits
Dec 9, 2014
BevapDin
force-pushed the
BevapDin:armor-slot
branch
to
ec63577
Dec 9, 2014
This comment has been minimized.
This comment has been minimized.
|
Compiler errors? What compiler errors. There are now compile errors. (fixed and rebased) I also renamed the
That's the goal. |
This comment has been minimized.
This comment has been minimized.
|
This ready to go? |
This comment has been minimized.
This comment has been minimized.
|
Awesome, just what I was hoping for. |
BevapDin
added some commits
Dec 10, 2014
This comment has been minimized.
This comment has been minimized.
|
I added documentation and moved the container flags into boolean members. Those container flags are now shown in the item description, along with the content size of the container (this already included in some item descriptions but not in all and getting the content size from the item type directly makes sure it's always correct). And I declare this ready. |
BevapDin commentedDec 9, 2014
Item slots replace (partially) the specific item subtypes: instead of an item type being
it_armor, it is now of the baseitypeplus an armor slot. The armor slot contains the properties that have previously been stored in theit_armor.This allows all items types to have armor properties, as all item types can have an armor slot. Access to the armor slot is wrapped in the item class (as was access to members of
it_armor).The same is done for containers.
I added the armor slot to all bows in archery.json, so they can be worn without modifications, but I'm not a bow person, so this is very much open for discussion. I also added the armor slot the wearable containers.
See #4189
TODO: document the stuffSome things to consider:
I'd like to move the flags SEALS, WATERTIGHT, PRESERVES, RIGID into boolean properties of the container slot. They are of no use and no meaning outside of it (on non-container items).item::chargesfor the very same thing (chapters for books, amount of loaded ammo for guns and tools, number of items for ammo and food). This limits the the compatibility: an item can not be a book and a tool (with charges).