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

Scrap Trader Inventory Expansion and QoL Update #59805

Conversation

Merikona
Copy link
Contributor

@Merikona Merikona commented Aug 1, 2022

Summary

Features "Scrap trader now sells bronze and aluminum and is no longer limited by pocket size when trading"

Purpose of change

I made an issue a couple days ago, here #59749, because I realized that it made little sense that someone who is sedentary is restricted by their pocket size when trading, and furthermore, that there should be plenty of metals beyond steel that he should have access to in a scrap yard.

Edit: I didn't realize at the time of making this PR that spoiler ahead some specialty metals are locked behind a quest-chain. This means I'll have to revise a bit of my intended changes. I still want to add bronze and aluminum though.

Describe the solution

Allows scrap trader to accept larger volume items and gives 2 additional dialogue options for buying aluminum and bronze when trading. I consulted some real-world pricing for various metals here, https://rockawayrecycling.com/scrap-metal-prices/, but ultimately determined that the pricing would change for a post-apocalyptic scenario. e.g. bronze would be higher-valued than copper because it's more durable and can be reforged into armor.

Edit: Also changes to the mapgen, including a tow truck and shed.

Describe alternatives you've considered

Considered adding wood to the scrap trader's inventory as well since it made sense to me he'd have plenty of access to scrap wood, but figured I'll wait on that bit and maybe ask for feedback first.

Testing

Created a world and character in my branched version of CDDA. Teleported to a scrap trader. Traded him a log in exchange for his goods to test his volume limits. Used the three new dialogue options to obtain scrap aluminum, scrap copper, and bronze.

Additional context

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON NPC / Factions NPCs, AI, Speech, Factions, Ownership <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Aug 1, 2022
@Merikona Merikona marked this pull request as draft August 1, 2022 06:32
@Merikona
Copy link
Contributor Author

Merikona commented Aug 1, 2022

Ran into a curious problem testing. Items you trade to scrapper do not disappear over time. I've found a solution but have yet to implement it. Going to rework this NPC to have a weekly stock as well when I do. So marked as draft for now. To be continued.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 1, 2022
@MNG-cataclysm
Copy link
Contributor

I don't think the scrap trader should sell wood; the lumber merchants already do that.

@Merikona
Copy link
Contributor Author

Merikona commented Aug 2, 2022

I don't think the scrap trader should sell wood; the lumber merchants already do that.

Sounds good. I'll rein it in then.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 2, 2022
@github-actions github-actions bot removed the json-styled JSON lint passed, label assigned by github actions label Aug 2, 2022
@Kywi001
Copy link

Kywi001 commented Aug 2, 2022

Additional on the #59749
The pocket size issue also exists on all trader in the location, such as the nurse and doctor, both won't accept even Merch due to them having 0 pocket size, I had to debug equip them with duffel bags so that they would accept the trade.

@Merikona
Copy link
Contributor Author

Merikona commented Aug 2, 2022

Additional on the #59749 The pocket size issue also exists on all trader in the location, such as the nurse and doctor, both won't accept even Merch due to them having 0 pocket size, I had to debug equip them with duffel bags so that they would accept the trade.

I can take a look at this as well.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs labels Aug 4, 2022
@github-actions github-actions bot added the <Bugfix> This is a fix for a bug (or closes open issue) label Sep 21, 2022
@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Sep 21, 2022
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 4, 2022
@Merikona
Copy link
Contributor Author

Merikona commented Oct 5, 2022

Whew, took me a while to get this done, but I think it's finally ready. Learned a fair bit about mapgen and npcs on the way.

If there's a way to set explicit trade zones, please let me know. For some reason, items in the fridge 2 tiles away from the scrapper is still in the trade menu, so I had to make them specifically not for sale.

A tow truck spawns here 100% of the time in perfect condition with a good amount of gas. I've removed items that generate inside the truck and placed them indoors instead so players can't easily steal them. There's even a chance for a town map to spawn. To make sure the players can't abuse our poor scrapper by driving his car away, I've made it so 4 of the 6 wheels are removed and sitting in his office instead. Unfortunately, I don't think he will react if you sneak up to his car and siphon some gas. But try touching any of his belongings and you'll have a few homemade grenades chucked your way and maybe eat a few bullets from his AR15. Nobody gets to bully my NPCs!

But feel free to stay the night in the cozy shed, do missions for him, and trade with him.

@Merikona Merikona marked this pull request as ready for review October 5, 2022 04:52
@andrei8l
Copy link
Contributor

andrei8l commented Oct 5, 2022

Instead of blocking the fridge items, just make the loot zones not cover the fridge. One of your loot zones is over a wall and out of range too. You can verify the placements with debug mode (action menu->debug->toggle debug mode, then open the zone manager and change Faction).

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 5, 2022
{ "trait": "ADRENALINE" },
{ "trait": "NARCOLEPTIC" },
{ "trait": "PROJUNK" },
{ "trait": "MOODSWINGS" }
Copy link
Contributor Author

@Merikona Merikona Oct 5, 2022

Choose a reason for hiding this comment

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

Why is it problematic? It's just there for flavor.

Edit: I actually think narcolepsy would be the more problematic one, if there was a problematic trait. I wasn't sure if it would make the scrapper sometimes doze off while you're trying to talk to him, so you couldn't trade with him. Or if him dozing off meant you could take his stuff for free.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 6, 2022
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 6, 2022
@Merikona Merikona force-pushed the Expands-Scrapper-Inventory-and-Allows-Trading-Items-Larger-Than-Pocket-Size branch from 0d12c9d to 2177ded Compare October 7, 2022 04:36
@MNG-cataclysm
Copy link
Contributor

You should probably mention that this PR will fix issue #61295.

@MNG-cataclysm MNG-cataclysm mentioned this pull request Oct 8, 2022
…Inventory-and-Allows-Trading-Items-Larger-Than-Pocket-Size
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 9, 2022
src/npc.cpp Show resolved Hide resolved
@Fris0uman Fris0uman merged commit 297840d into CleverRaven:master Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants