Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upIncrease magazine spawns #15472
Conversation
mugling
reviewed
Feb 19, 2016
| @@ -1424,7 +1424,6 @@ void Item_factory::load_item_group(JsonObject &jsobj, const Group_tag &group_id, | |||
| Item_group *ig = dynamic_cast<Item_group *>(isd); | |||
| if (subtype == "old") { | |||
| ig = make_group_or_throw(isd, Item_group::G_DISTRIBUTION); | |||
| ig->with_ammo = jsobj.get_bool("guns_with_ammo", ig->with_ammo); | |||
This comment has been minimized.
This comment has been minimized.
mugling
reviewed
Feb 19, 2016
| @@ -1433,6 +1432,9 @@ void Item_factory::load_item_group(JsonObject &jsobj, const Group_tag &group_id, | |||
| jsobj.throw_error("unknown item group type", "subtype"); | |||
| } | |||
|
|
|||
| ig->with_ammo = jsobj.get_int( "ammo", ig->with_ammo ); | |||
This comment has been minimized.
This comment has been minimized.
mugling
Feb 19, 2016
Author
Contributor
ammo and magazine apply to both collections and distributions
mugling
added some commits
Feb 19, 2016
This comment has been minimized.
This comment has been minimized.
|
Very nice! |
Coolthulhu
self-assigned this
Feb 21, 2016
Coolthulhu
added a commit
that referenced
this pull request
Feb 21, 2016
Coolthulhu
merged commit 2225523
into
CleverRaven:master
Feb 21, 2016
1 check passed
default
This has been rescheduled for testing as the 'master' branch has been updated.
This comment has been minimized.
This comment has been minimized.
|
The ammo spawns could be more random. Currently it's all or nothing. While it makes a lot of sense for someone to die after running out of ammo, those who die from other causes (infection) would probably have less than full magazine too. |
This comment has been minimized.
This comment has been minimized.
|
Yes, this is an intended extension. I also want to eventually update mapgen so that it spawns an equivalent number of empty casings to match the rounds missing from the magazine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
mugling commentedFeb 19, 2016
Starts work on #15443
Extends
item_groupto supportmagazineandammofields specifying percentage chance to spawn reloadable items with a default magazine and/or default ammo. These fields have similar semantics to those provided in the new mapgen function from #15341. Deprecates the now redundantguns_with_ammofield.Most monster drops that include gun drops now have a 100% chance of including a matching magazine and a 30% chance of matching ammo. A further PR will extend this to include optional randomisation of the quantity of ammo.