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

Ammo Piles #9195

Merged
merged 4 commits into from
Jul 2, 2020
Merged

Ammo Piles #9195

merged 4 commits into from
Jul 2, 2020

Conversation

Geevies
Copy link
Contributor

@Geevies Geevies commented Jun 23, 2020

  • Added the ability to stack bullets into piles.

Inspired by BoHBranch/BoH-Bay#519

@Geevies
Copy link
Contributor Author

Geevies commented Jun 23, 2020

!review

var/obj/first_round = new ammo_type(get_turf(src))
add_ammo(first_round)
check_name_and_ammo()
for(var/i = 1, i <= max_ammo - 1, i++)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this use the projectile's max_stack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does, check_name_and_ammo sets max_ammo and properly names the pile

Comment on lines +70 to +82
if(istype(W, /obj/item/ammo_casing))
if(W.type != ammo_type)
to_chat(user, SPAN_WARNING("\The [W] has a different type of ammunition!"))
return
if(length(ammo) >= max_ammo)
to_chat(user, SPAN_WARNING("\The [src] is already fully stacked."))
return
var/obj/item/ammo_casing/B = W
if(!B.BB)
to_chat(user, SPAN_WARNING("\The [B] is spent!"))
return
to_chat(user, SPAN_NOTICE("You add \the [W] to \the [src]."))
add_ammo(W)
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't all of these checks already done in add_ammo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorta, the one in add_ammo is a safety measure to prevent spent casings from ever getting in. these have more checks that won't be earth shatteringly bad if they somehow were wrong

@NonQueueingMatt NonQueueingMatt merged commit 5fcfc33 into Aurorastation:master Jul 2, 2020
@Forktress
Copy link

Discovered a bug where 7.62mm can only be stacked into piles of two before it tells you they are "of a different ammo type" also I managed to duplicate ammo from a magazine of 5 bullets to 6 by trying to stack them in a pile while they were within a bag.

@Alberyk
Copy link
Contributor

Alberyk commented Jul 8, 2020

@Forktress make a github report in the issues section, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants