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

Implement integral magazines as magazine items #32331

Closed
wants to merge 68 commits into from

Conversation

ymber
Copy link
Member

@ymber ymber commented Jul 12, 2019

Summary

SUMMARY: Infrastructure "Reimplement integral magazines as MAGAZINE items"

Purpose of change

Several areas of code can be simplified if they only have to consider magazines as ammo sources.

Part of #32227.

Describe the solution

Integral magazine loadables are defined for an object as described in #32227. While new code in this branch is written to support more than one magazine, most of the existing code is not so until all relevant code is updated no more than one integral magazine should be defined per item. There should be no significant player visible changes from this PR.

  • Define integral magazine loadables
  • Generate integral magazines in item's contents when it is created
  • Update item::info to display information appropriately for integral magazines
  • Update relevant reloading code for new system
  • Update unloading code to block removing integrals
  • Respect RELOAD_ONE for magazines
  • Update reloading code to allow speedloaders and clips to be used for reloading magazines
  • Ensure STR_RELOAD and RELOAD_EJECT work with integral magazine items
  • Implement integral magazines in gunmods as in guns
  • Implement integral magazines in tools as in guns
  • Write unit tests for reloading and magazine handling code
  • Document new JSON

ymber added 12 commits July 12, 2019 09:07
item::is_reloadable_helper should only be checking whether the itype_id
it is given can be reloaded into the specific item it is called from
and not any items in that item's contents. As integral magazines are
now separate items to the items they provide ammo for, the only
reloadable item types are now watertight containers and magazines,
as well as items that can be reloaded with detachable magazines.
item::is_reloadable_helper now handles these three cases.
@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Items: Magazines Ammo holding items and objects. labels Jul 12, 2019
src/item_factory.cpp Outdated Show resolved Hide resolved
src/item_factory.cpp Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
@tenmillimaster
Copy link
Member

Excited for this since as you'd mentioned on discord, this should let many guns fire without magazines (emulating the chamber)

@kevingranade
Copy link
Member

This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there:

https://discourse.cataclysmdda.org/t/pressure-for-pneumatic-weapons/21289/13

@stale
Copy link

stale bot commented Oct 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Oct 10, 2019
@stale
Copy link

stale bot commented Nov 9, 2019

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

@stale stale bot closed this Nov 9, 2019
@misterprimus
Copy link
Contributor

misterprimus commented Dec 9, 2019

Is this thing dead for good, superseded by another solution, or just on hold? Seems like it will take forever to work through all of the conflicts that accumulated over half a year.

@ymber
Copy link
Member Author

ymber commented Dec 9, 2019

I intend to get back on it but I couldn't say when. Having done this once I'll probably go from scratch and do some things differently.

@misterprimus misterprimus mentioned this pull request Mar 5, 2020
@ymber ymber deleted the integral_mags branch May 7, 2020 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Items: Magazines Ammo holding items and objects. [JSON] Changes (can be) made in JSON stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants