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

Magazine implementation: weapons added by Chaosvolt #15002

Closed
wants to merge 10 commits into from
Closed

Magazine implementation: weapons added by Chaosvolt #15002

wants to merge 10 commits into from

Conversation

chaosvolt
Copy link
Contributor

Now that #14949 is a thing, went ahead and started expanding on the magazine options, focusing on weapons I've added. It's a start, so far. o3o

  • Adds magazines for the Browning Automatic Rifle. Standard capacity is 20 rounds, and 30-round variants exist as well.
  • Magazines added for AK-74 and AN-94. Currently has the standard 30-rounder and the RPK-74 45-round mag. Which will also be useful if we ever add RPKs.
  • M60 and M240 given the M13 link, disintegrating belt. DM1 belt also given to the M240 as a reusable alternative.
  • Makarov given the classic 8-round mag. 10 and 12-round magazines are made for the newer PMM, so for now there's only PM mags.
  • Magazines given to both variants of the Skorpion.
  • Thompson given 20, 30, and 50-round magazines. Note the what model the game's Thompson is based off of is vague, and note that M1 and M1A1 Thompsons did not accept drum mags.
  • Sten given its standard 32-round mag, along with a craftable magazine in the same vein as the survivor .223 magazine. Reduced capacity as it isn't double-column, but still lower reliability. If we ever have makeshift, magazine-fed 9mm weapons, this might be the logical choice for it.
  • Itemgroup patterns established based on PRs adding mags to item groups. Not entirely sure where else they might go, or exact recommended odds.

M1 Garand left untouched because we don't yet have a way to make a gun automatically unload an en-bloc clip when emptied.

A couple flags will be unused until #14972 is merged, but it isn't a strict prerequisite to this PR.

Chaosvolt added 2 commits January 24, 2016 15:22
* Adds magazines for the Browning Automatic Rifle. Standard capacity is
20 rounds, and 30-round variants exist as well.
* Magazines added for AK-74 and AN-94. Currently has the standard
30-rounder and the RPK-74 45-round mag. Which will also be useful if we
ever add RPKs.
* M60 and M240 given the M13 link, disintegrating belt.
* Makarov given the classic 8-round mag. If I could find any sign that
10 or 12 round PMM magazines were compatible with the standard PM, I'd
add them.
* Magazines given to both variants of the Skorpion.
* Thompson given 20, 30, and 50-round magazines. Note the what model the
game's Thompson is based off of is vague, and note that M1 and M1A1
Thompsons did not accept drum mags.
* Sten given its standard 32-round mag, along with a craftable magazine
in the same vein as the survivor .223 magazine. Reduced capcity as it
isn't double-column, but still lower reliablity. If we ever have
makeshift, magazine-fed 9mm weapons, this might be the logical choice
for it.
* Itemgroup patterns established based on PRs adding mags to item
groups. Not entirely sure where else they might go, or exact reccomended
odds.

M1 Garand left unotuched because we don't yet have a way to make a gun
automatically unload a magazine when emptied.
* Derp. I knew I forgot something
"to_hit" : -2,
"ammo_type" : "3006",
"capacity" : 30,
"reliability" : 8,
Copy link
Contributor

Choose a reason for hiding this comment

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

Aftermarket should be less reliable, maybe 7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, possibly. It is 1 less than the 20-round, but bumping it down to 7 might be acceptable.

@chaosvolt
Copy link
Contributor Author

Oh wait, quick question. Is the reload_time for the magazines to load the magazines themselves, or to load them into the guns? That would be a fail on my part.

"ammo_type" : "3006",
"capacity" : 20,
"reliability" : 9,
"reload_time" : 30
Copy link
Contributor

Choose a reason for hiding this comment

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

specify alternatives if for 223 if you want this to work with ammo conversions. Probably stanag30 for both this and m1918mag_30

@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

Oh wait, quick question. Is the reload_time for the magazines to load the magazines themselves, or to load them into the guns? That would be a fail on my part.

Both. reload_time on a magazine is per round and on a gun is the time taken to insert the magazine and ready the first round. In both cases default to 100 unless you have a specific reason otherwise.

@chaosvolt
Copy link
Contributor Author

Ah, I see.

* Reload figures for magazines increased overall. Apparently this wolud
be the time taken to load the magazine itself.
* Reload time changed for the BAR. Unsure where I got that obscenely
huge number.
* Small reliability nerfs for 7.62x51mm belt and 30-round BAR magazine.
@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

When you're ready do you want to compile the results in the same table format as #14981 so I can paste them in to the header of that PR.

@chaosvolt
Copy link
Contributor Author

Went with 100 for most of the magazines, with further increases for higher-capacity versions. One thing I'm pondering is how will the belts work. I assume they're meant to come pre-loaded?

And ah, sure. I'll need to assemble a table for it.

Other possible ideas:

  • M240s can also use a DM1 non-disintegrating belt, which might be good as a more sustainable option once the player runs out of M13 belts. Not sure about the M60 though.
  • Once magazines are added for the AKM, I assume alternative will make sense to link the AKM and AK-74M magazines.

@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

One thing I'm pondering is how will the belts work. I assume they're meant to come pre-loaded?

Craftable from individual rounds (once I work out the code)

@chaosvolt
Copy link
Contributor Author

Ah, I see. o.o

I might suggest handling it like the LAW, make the crafted/found item a tool that, when used, transforms into the desired item with the desired number of charges.

"valid_mod_locations": [[ "accessories", 4 ],[ "barrel", 1 ],[ "bore", 1 ],[ "conversion", 1 ],[ "grip", 1 ],[ "magazine", 2 ],[ "mechanism", 4 ],[ "muzzle", 1 ],[ "rail", 1 ],[ "sights", 1 ],[ "stock", 1 ],[ "underbarrel", 1 ]]
"magazines": [ "m1918mag", "m1918mag_30" ],
"valid_mod_locations": [[ "accessories", 4 ],[ "barrel", 1 ],[ "bore", 1 ],[ "conversion", 1 ],[ "grip", 1 ],[ "mechanism", 4 ],[ "muzzle", 1 ],[ "rail", 1 ],[ "sights", 1 ],[ "stock", 1 ],[ "underbarrel", 1 ]],
"default_mods": [ "m1918mag" ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't specify defaults as this support is likely to be deprecated. Please be creative instead with item_groups to ensure the magazine is common or rare.

A future PR will likely implement a percentage chance to spawn an a magazine which would make this redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, okay. Will be nice to see a feature that allows for random chances of having the mag in it instead.

* Can always be re-implemented via whatever future feature might allow different odds of spawning a weapon with a magazine in it.
@Rivet-the-Zombie
Copy link
Member

M1 Garand left untouched because we don't yet have a way to make a gun automatically unload a magazine when emptied.

Clip. This is one of the occasions where it's correct to say clip.

Sorry, couldn't help myself.

@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

It might be worth adding this now as I can add a flag supporting automatic unloading later

@chaosvolt
Copy link
Contributor Author

Clip. This is one of the occasions where it's correct to say clip.

Doh. I thought mentioning that was my shtick. o3o

And ooh, if we're able to add automatic ejection of clips/magazines/clipazines...no idea if any other weapons would be able to make use of it.

@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

The code already exists for destroying consumed ammo belts so shouldn't be too tricky

@chaosvolt
Copy link
Contributor Author

Ah, interesting. Had forgot about that.

"type" : "MAGAZINE",
"id" : "sten_mag",
"price" : 4000,
"name" : "STEN 32-round magazine",
Copy link
Contributor

Choose a reason for hiding this comment

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

STEN magazine is more concise

@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

Consider adding COMPACT_MAG or BULKY_MAG as per #14972 if you want the magazines to work with ammo pouches. Don't label belts at all as these will later become wearable anyway.

@chaosvolt
Copy link
Contributor Author

Ah right, hmm. Had almost forgot about that.

* Sten magazine renamed to be more concise.
* Flags added to the magazines for ammo pouches.
@mugling
Copy link
Contributor

mugling commented Jan 24, 2016

Add the magazine_well property to the appropriate items. This is the amount of space inside the magazine that a magazine can consume before it sticks out and adds to the weapons volume. It most commonly needs to be set on handguns and smgs.

You also need to reduce the volume of each weapon now we have detachable magazines.

EDIT:
For a handgun with volume 2 and magazine_well 1 you can load a volume 1 magazine without increasing the overall size but it you load an extended volume 2 magazine the total size will now be volume 3.

@stk2008
Copy link

stk2008 commented Jan 24, 2016

This is fing awesome i love the detail and depth you lot go to in cdda not
just for guns but pretty much the whole simulator :)
On 24 Jan 2016 22:51, "mugling" notifications@github.com wrote:

Add the magazine_well property to the appropriate items. This is the
amount of space inside the magazine that a magazine can consume before it
sticks out and adds to the weapons volume. It most commonly needs to be set
on handguns and smgs.

You also need to reduce the volume of each weapon now we have detachable
magazines.


Reply to this email directly or view it on GitHub
#15002 (comment)
.

@chaosvolt
Copy link
Contributor Author

Ah right, very well. Back, was out again earlier.

Chaosvolt added 2 commits January 24, 2016 18:02
* Magazine well properties added to the changed guns.
* Skorpion volumes have been altered, as they might've been a tad on the diminutive side.
"type" : "MAGAZINE",
"id" : "thompson_mag_30",
"price" : 4000,
"name" : "Thompson 20-round magazine",
Copy link
Contributor

Choose a reason for hiding this comment

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

copy-paste typo
consider also Thompson extended mag for consistency with the other names

Chaosvolt and others added 3 commits January 25, 2016 11:11
* Fixed 30-round Thompson magazine name.
* Removed mention of capacity from magazine names, instead given in description and named to be consistent with magazine names in other PRs.
* Beefed up weight of drum magazine. I might have to find some more field manuals, as the bog-standard BAR mag was the only one I could get real-world weight data for.
* Forgot the 30-round Thompson mag
* Also beefed up Sten magazine volume.
* Adds a reusable option for M240 belts.
* Adds more conversion logic for the different weapons. Not sure if I
have it formatted right.
@chaosvolt
Copy link
Contributor Author

So, this is a thing I'm pondering.

Let say I want to add conversion logic from the Skorpion (either model), to .45 ACP Thompson magazines.

For the first, we only have 1 magazine option. For the second, there are 3. How should alternatives be defined in each of the 4 magazines?

@mugling
Copy link
Contributor

mugling commented Jan 27, 2016

"alternatives" : [ [ "45", [ "firstmag", "secondmag", "thirdmag" ] ] ]

@chaosvolt
Copy link
Contributor Author

Ah, I see. And what about when, for example, converting 2 magazines to 3?

@mugling
Copy link
Contributor

mugling commented Jan 27, 2016

"alternatives" : [
[ "45", [ "firstmag", "secondmag", "thirdmag" ] ],
[ "9mm", [ "firstmag", "secondmag" ] ],
[ "223", [ "firstmag", ] ]
]

@chaosvolt
Copy link
Contributor Author

Hmm. And that is added to both magazines? Like for example, converting the 2 Sten mags to 3 Thompson mags. owo

@mugling
Copy link
Contributor

mugling commented Jan 27, 2016

No, to the individual guns themelves

@chaosvolt
Copy link
Contributor Author

Oh right. I could've sworn they were added to the magazine, not the gun. >.<

EDIT: Yeah, I got that from you. See the USP 9mm and .45 magazines in https://github.com/CleverRaven/Cataclysm-DDA/pull/15003/files for example.

@mugling
Copy link
Contributor

mugling commented Jan 28, 2016

Yup, sorry my bad, you need to add alternatives to the magazines

@chaosvolt
Copy link
Contributor Author

Ah. Much confuseddragon. So that still leaves me unsure how to handle a 2-3 magazine option conversion.

@mugling
Copy link
Contributor

mugling commented Jan 28, 2016

Can you give me the exact example?

@chaosvolt
Copy link
Contributor Author

Ah, very well.

Entries for the sten magazines, where 2 options are converted into 3. This shows the way they are now, for the regular and makeshift ones respectively:

         "alternatives" : [
            [ "32", [ "skorpion_61_mag" ] ],
            [ "9x18", [ "skorpion_82_mag" ] ],
            [ "45", [ "thompson_mag" ] ]

        "alternatives" : [
            [ "32", [ "skorpion_61_mag" ] ],
            [ "9x18", [ "skorpion_82_mag" ] ],
            [ "45", [ "thompson_mag_30", "thompson_drum" ] ]

The last bit in both cases, the conversion to .45 ACP, is where I'm unsure.

@chaosvolt
Copy link
Contributor Author

Superceded by #15072, so it's officially out of my hands for the time being.

@chaosvolt chaosvolt closed this Jan 29, 2016
@chaosvolt chaosvolt deleted the chaosvolt-gunazines branch January 30, 2016 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants