-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Rework monster equipment #36377
Rework monster equipment #36377
Conversation
This should be ready now. I'm postponing the monster inventory menu objectives for another PR because that one will probably be a few hundred lines on its own. |
@@ -685,7 +685,8 @@ void Creature::deal_projectile_attack( Creature *source, dealt_projectile_attack | |||
if( z ) { | |||
if( !proj.get_drop().is_null() ) { | |||
z->add_effect( effect_tied, 1_turns, num_bp, true ); | |||
z->tied_item = proj.get_drop(); | |||
item drop_item = proj.get_drop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop_item
is not used at all (see #37053)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably got lost in the refactor for value pointers.
Summary
SUMMARY: Infrastructure "Rework monster equipment handling"
Purpose of change
Fixes #36312
The code for monster inventories needs cleaning up and some of the interaction menus feel janky. Weight and volume checks are inconsistent. Animal equipment stats are not properly communicated to the player.
Describe the solution
Use
cata::value_ptr<item>
s for specific use items that a monster can only have one of at once so we don't have to do weird stuff tracking item positions in its inventory.cata::value_ptr<item>
for armor, tack, and storage itemsAllow checking current volume and weight of stored items on animalAllow removing selected items from animal's packTesting
Game compiles, menus and item interactions behave as intended. Correct items are dropped when the horse dies.