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 upAdd hand-powered battery charger #30378
Conversation
esotericist
added some commits
May 10, 2019
codemime
added
<Enhancement / Feature>
[C++]
[JSON]
labels
May 10, 2019
Night-Pryanik
reviewed
May 10, 2019
data/json/item_actions.json Outdated
Night-Pryanik
reviewed
May 10, 2019
data/json/items/tools.json Outdated
Night-Pryanik
reviewed
May 10, 2019
|
|
||
| // TODO: This should be 144 seconds, rather than 24 (6-second) turns | ||
| // but we don't have a seconds time macro? | ||
| if( calendar::once_every( 24_turns ) ) { |
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
May 10, 2019
Member
You can change this to
Suggested change
| if( calendar::once_every( 24_turns ) ) { | |
| if( calendar::once_every( 144_seconds ) ) { |
This comment has been minimized.
This comment has been minimized.
esotericist
May 10, 2019
Author
Contributor
I swear I tried that and got an error. Let me try again.
This comment has been minimized.
This comment has been minimized.
esotericist
May 10, 2019
Author
Contributor
src/activity_handlers.cpp:2038:34: error: no matching literal operator for call to 'operator""_seconds' with argument of type 'unsigned long long' or 'const char *', and no matching literal operator template
if( calendar::once_every( 144_seconds ) ) {
^
Both VS Code and clang say this is not legal.
This comment has been minimized.
This comment has been minimized.
esotericist
May 10, 2019
Author
Contributor
That problem is the origin of the comment immediately above the line, btw.
This comment has been minimized.
This comment has been minimized.
Night-Pryanik
reviewed
May 10, 2019
src/iuse.cpp Outdated
esotericist
and others
added some commits
May 10, 2019
kevingranade
merged commit 5a355ee
into
CleverRaven:master
May 11, 2019
This comment was marked as off-topic.
This comment was marked as off-topic.
adamkad1
commented
May 11, 2019
|
I like |
This comment has been minimized.
This comment has been minimized.
JeanLucVanDamme
commented
May 11, 2019
|
Seems like the right balance of useful and annoying-to-use. I'm for it. |
This comment has been minimized.
This comment has been minimized.
|
This pull request has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/how-to-recharge-the-new-battery-cells/20081/2 |
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.
esotericist commentedMay 10, 2019
Summary
SUMMARY: Content "Add hand-powered battery charger"Purpose of change
With the new-found proliferation of rechargeable batteries, players are somewhat stymied by the lack of options for putting more charge into the batteries. Currently the only available option in-game is the vehicle-mounted Recharging Station.
Partially addresses #30256 (I still think we need additional options, so that issue should probably not be closed yet)
Describe the solution
Added a hand-crank charger item, an
iuseactivity, and all the attendant c++ and json plumbing to make it so.My research suggested that hand-crank charger outputs range from 2 watt (very common and easily verified) to 10 watt (claims I could only find from specific manufacturers, with little outside corroboration). I ultimately opted to aim for just under 7 watts of throughput to get 25 kJ / hour.
At this rate one battery charge is produced every 2.4 minutes (24 turns under the current 6-second turn model), and with the fatigue rate available to me, it looks like a 100% fully rested (zero fatigue) player hits 'dead tired' after about 10.5 hours of constant cranking, yielding ~259 charge. This means a player can come reasonably close to filling a medium battery cell in a single day's labor. The right comestibles could extend this.
Is this worthwhile? Probably not outside of emergencies. But it's an option that was missing that we reasonably should have had.
I'm not 100% sure on the recipe requirements. I was aiming for "substantially easier than the vehicle charger, but not trivial". Feedback welcome.
For worldgen, I added this to
supplies_electronics,tools_common,tools_electronics, andtools_survival. I'm not very confident on the weights I used there, either.Basically, if there's any changes someone wants to see on anything except the charge rate (which I'm fairly certain of), I'd be happy to accommodate.
Describe alternatives you've considered
I had originally planning on making a charger that would funnel power from battery magazine A into battery magazine B, but I decided this would be easier to do. I'd still like to get that done at some point.
I considered adding a morale penalty or kcal consumption to this activity, but I decided I just don't have the confidence to work out what those should be.
Additional context