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

Generic ammo boxes and printable ammo cans #2940

Merged
merged 17 commits into from
May 27, 2024

Conversation

Gristlebee
Copy link
Contributor

@Gristlebee Gristlebee commented Apr 26, 2024

About The Pull Request

Adds generic ammo boxes, printable in the autolathe. They can be set to hold any ammo type by using a bullet on it, and the capacity changes depending on the bullet type.

Also makes ammo cans autolathe printable.

Replaces a few instances of update_appearence with update_ammo_count in ammo box code so the materials properly update.

Thanks to FalloutFalcon for the idea

Why It's Good For The Game

Basically a redo of my other PR, #2868 intentwise. This PR aims to make ammo storage more practical by adding these generic ammo boxes to prevent having loose rounds everywhere if you don't have a compatible ammo box with space. Ammo cans are basically just themed toolboxes, so they're just nice to have thematically as well.

Also some bug fixes I guess, that's good.

Changelog

🆑
add: Generic Ammo Boxes, printable in the autolathe
add: Ammo cans are printable in the autolathe
fix: Ammo boxes sometimes not properly updating their materials
/:cl:

@Gristlebee Gristlebee requested a review from a team as a code owner April 26, 2024 04:03
@github-actions github-actions bot added DME Edit Sprites A bikeshed full of soulless bikes. Code change Watch something violently break. labels Apr 26, 2024
@Anticept
Copy link
Contributor

You're doing awesome work.

Curious if there's room to consider the size of the round having an effect on how much the box holds?

@Gristlebee
Copy link
Contributor Author

You're doing awesome work.

Curious if there's room to consider the size of the round having an effect on how much the box holds?

The thing is, all bullets with a few exceptions like grenades are code-wise all the same size. There's no real elegant way to check for it in the variables as far as I'm aware.

@Anticept
Copy link
Contributor

Got it. Sounds like a QOL for me down the road then to add something to each round type so they would have a size as well, and revisit these boxes.

@Apogee-dev
Copy link
Contributor

You're doing awesome work.
Curious if there's room to consider the size of the round having an effect on how much the box holds?

The thing is, all bullets with a few exceptions like grenades are code-wise all the same size. There's no real elegant way to check for it in the variables as far as I'm aware.

There’s no especially elegant solution to this right now afaik, but it’s not the end of the world if you just have to write a big dumb if-else chain to check the caliber of the round being added and define capacity based on that. if(cartridge.caliber = list(“9mm”, “.45”, “10mm”, etc)) capacity = 20 or whatever.

@Gristlebee
Copy link
Contributor Author

There’s no especially elegant solution to this right now afaik, but it’s not the end of the world if you just have to write a big dumb if-else chain to check the caliber of the round being added and define capacity based on that. if(cartridge.caliber = list(“9mm”, “.45”, “10mm”, etc)) capacity = 20 or whatever.

Would you prefer it with the list, or is it fine as is?

@Apogee-dev
Copy link
Contributor

Apogee-dev commented Apr 30, 2024

There’s no especially elegant solution to this right now afaik, but it’s not the end of the world if you just have to write a big dumb if-else chain to check the caliber of the round being added and define capacity based on that. if(cartridge.caliber = list(“9mm”, “.45”, “10mm”, etc)) capacity = 20 or whatever.

Would you prefer it with the list, or is it fine as is?

I’d prefer the list personally- It’s extra functionality, and if/when cartridges are updated with some kind of cartridge size/category variable it’ll be fairly easy to update the code here

@Gristlebee
Copy link
Contributor Author

There’s no especially elegant solution to this right now afaik, but it’s not the end of the world if you just have to write a big dumb if-else chain to check the caliber of the round being added and define capacity based on that. if(cartridge.caliber = list(“9mm”, “.45”, “10mm”, etc)) capacity = 20 or whatever.

Would you prefer it with the list, or is it fine as is?

I’d prefer the list personally- It’s extra functionality, and if/when cartridges are updated with some kind of cartridge size/category variable it’ll be fairly easy to update the code here

It's been implemented. Max ammo values are open to be adjusted if needed.

@FalloutFalcon
Copy link
Member

oh you could just had var/ammo_per_box in the bullet itself

@FalloutFalcon
Copy link
Member

also we really should define our calibers.. i got that tho remind me if i forgrt

@Anticept
Copy link
Contributor

Anticept commented May 1, 2024

oh you could just had var/ammo_per_box in the bullet itself

this is how I had thought about doing it in the future.

Apogee's list method certainly is simple, but if we ever do things like implement larger vs smaller boxes or other means of storing these, having vars for the individual bullets is more future proof.

@github-actions github-actions bot added the Merge Conflict Use Git Hooks, you're welcome. label May 8, 2024
Copy link
Contributor

github-actions bot commented May 8, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the Merge Conflict Use Git Hooks, you're welcome. label May 21, 2024
Copy link
Member

@FalloutFalcon FalloutFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else looks good.

@FalloutFalcon FalloutFalcon added this pull request to the merge queue May 27, 2024
Merged via the queue into shiptest-ss13:master with commit 01cb1c1 May 27, 2024
14 checks passed
MysticalFaceLesS pushed a commit to CeladonSS13/Shiptest that referenced this pull request Jun 1, 2024
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

Adds generic ammo boxes, printable in the autolathe. They can be set to
hold any ammo type by using a bullet on it, and the capacity changes
depending on the bullet type.

Also makes ammo cans autolathe printable.

Replaces a few instances of update_appearence with update_ammo_count in
ammo box code so the materials properly update.

Thanks to FalloutFalcon for the idea

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

Basically a redo of my other PR, shiptest-ss13#2868 intentwise. This PR aims to make
ammo storage more practical by adding these generic ammo boxes to
prevent having loose rounds everywhere if you don't have a compatible
ammo box with space. Ammo cans are basically just themed toolboxes, so
they're just nice to have thematically as well.

Also some bug fixes I guess, that's good.

:cl:
add: Generic Ammo Boxes, printable in the autolathe
add: Ammo cans are printable in the autolathe
fix: Ammo boxes sometimes not properly updating their materials
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code change Watch something violently break. DME Edit Sprites A bikeshed full of soulless bikes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants