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

Allow plant mutants to sleep in planter furniture #36005

Conversation

AlexanderBodnya
Copy link

@AlexanderBodnya AlexanderBodnya commented Dec 10, 2019

Summary

SUMMARY: Features "Allow plant mutants to sleep in planter furniture"

Purpose of change

Currently plant mutants can't sleep anywhere except outside, which could be a little punishing during winter. Also it seems logical to be able to craft something like "soil bed", planter furniture seems ideal for this purpose.

Describe the solution

  1. I've added new conditions when checking for plantsleep locations, to make sure that plant mutant can sleep on diggable soil AND f_planter and not on any other furniture and terrain.

  2. I've added PLOWABLE flag to the f_planter furniture in order to make ROOTS2/3 mutation trigger when standing on planter furniture.

Describe alternatives you've considered

Don't do it.

Testing

  1. I've run unit tests, all checks passed.
  2. I've loaded game, gave myself plant treshold mutation, and Rooter with Chlorophor mutations. I've spawned planter on rock surface and tried to sleep in it - worked well. Tried to sleep on rock surface - was unable to, as expected. Tried to sleep on a diggable ground - works as expected, same goes for Rooter when I've tried to wait while standing on diggable soil(works), rock floor(does not work), planter(works).
  3. Sleeping inside buildings on the planter does not give any benefits, as it required to be outside to receive nutrition.

Additional context

It feels like sleeping in planter should give some benefits, not all of them, but some. Maybe thirst reduction, but no nutrition value? I can make this change if anyone thinks it would be viable.

Feel free to correct my grammar and ask for clarifications, as I understand that my language skills are far from perfect.

Alexander Bodnya added 3 commits December 10, 2019 19:27
to allow roots2/3 mutation use planter
to allow chloromorps to sleep in soil planter
@AlexanderBodnya AlexanderBodnya changed the title SUMMARY: Feature "Allow plant mutants to sleep in planter furniture" SUMMARY: Features "Allow plant mutants to sleep in planter furniture" Dec 10, 2019
@AlexanderBodnya AlexanderBodnya changed the title SUMMARY: Features "Allow plant mutants to sleep in planter furniture" Allow plant mutants to sleep in planter furniture Dec 10, 2019
@Davi-DeGanne
Copy link
Contributor

Feel free to correct my grammar and ask for clarifications, as I understand that my language skills are far from perfect.

Well, you asked for it... 😈

make sure that plant mutant can sleep
make sure that plant mutants can sleep

I've spawned planter on rock surface
I've spawned a planter on a rock surface

Tried to sleep on rock surface
Tried to sleep on a rock surface

as it required to be outside to receive nutrition.
as it is required to be outside to receive nutrition.

It feels like sleeping in planter should give some benefits, not all of them, but some.
It feels like sleeping in a planter should only give partial benefits.

Anyway, these are quibbles, you illustrated all your points well; I wasn't confused by your meaning while reading.

Also -- great work, this sounds like a good change!

src/player.cpp Outdated Show resolved Hide resolved
Alexander Bodnya added 2 commits December 11, 2019 11:57
@AlexanderBodnya
Copy link
Author

Feel free to correct my grammar and ask for clarifications, as I understand that my language skills are far from perfect.

Well, you asked for it... 😈

make sure that plant mutant can sleep
make sure that plant mutants can sleep
I've spawned planter on rock surface
I've spawned a planter on a rock surface
Tried to sleep on rock surface
Tried to sleep on a rock surface
as it required to be outside to receive nutrition.
as it is required to be outside to receive nutrition.
It feels like sleeping in planter should give some benefits, not all of them, but some.
It feels like sleeping in a planter should only give partial benefits.

Anyway, these are quibbles, you illustrated all your points well; I wasn't confused by your meaning while reading.

Also -- great work, this sounds like a good change!

Thanks for the corrections, my article game is worse than I imagined! =)

@Fris0uman
Copy link
Contributor

Could you make a flag like ALLOW_ROOT for exemple to add to furniture instead of making a special case for f_planter?

Alexander Bodnya added 3 commits December 11, 2019 15:52
to represent abulity to root on some
furniture and surface accordingly
@AlexanderBodnya
Copy link
Author

AlexanderBodnya commented Dec 11, 2019

Could you make a flag like ALLOW_ROOT for exemple to add to furniture instead of making a special case for f_planter?

Sure, did as per your request.

@AlexanderBodnya
Copy link
Author

As a side note, CI builds whole project every time from scratch. Seems like a waste, maybe there is some way to improve it? Like having pre-built artifact of the latest master and uploading it on CI machine before building? I'm not familiar with github CI/CD, to confirm it is possible though..

Copy link
Member

@anothersimulacrum anothersimulacrum left a comment

Choose a reason for hiding this comment

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

Please document the flags you added.

Copy link
Author

@AlexanderBodnya AlexanderBodnya left a comment

Choose a reason for hiding this comment

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

Please document the flags you added.

I added it to mapdata.h description. Is this sufficient?

@anothersimulacrum
Copy link
Member

No, they need to be documented in doc/JSON_FLAGS.md.

@AlexanderBodnya
Copy link
Author

No, they need to be documented in doc/JSON_FLAGS.md.

Done

@ifreund ifreund added <Enhancement / Feature> New features, or enhancements on existing Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` labels Dec 11, 2019
@ifreund ifreund added the [JSON] Changes (can be) made in JSON label Dec 11, 2019
@thethunderhawk
Copy link

I’m the long term it’d be super cool to let Plant Mutant players set themselves up with fertilized plant beds and indoor grow lights. Hopefully when someone gets around to working on indoor farming that’ll be more feasible.

@AlexanderBodnya
Copy link
Author

AlexanderBodnya commented Dec 12, 2019

I’m the long term it’d be super cool to let Plant Mutant players set themselves up with fertilized plant beds and indoor grow lights. Hopefully when someone gets around to working on indoor farming that’ll be more feasible.

I'll look into it, but no promises - I've only recently started to look into actual source code of the game and C++ is a new language for me. I saw a hydroponics mod, and as I know there is some kind of interface to load charges of coal into forge, so I might try to combine the two and make hydroponics furniture which require fertilizer and/or water charges, but provide some benefits of sleeping on actual soil + daylight lamp to supplement for sunlight (maybe I could reuse flashlight code, with adjusted power consumption?).

I just really enjoy playing plant, am I strange? 😂

@AlexanderBodnya
Copy link
Author

I've resolved merging conflict, should be all good now.

@ZhilkinSerg ZhilkinSerg added the stale Closed for lack of activity, but still valid. label Apr 30, 2020
@ZhilkinSerg
Copy link
Contributor

Feel free to reopen if you want working on it again.

@worm-girl
Copy link
Contributor

This is a cool idea, was this PR ready to go or did it need more work?

@Zireael07
Copy link
Contributor

Definitely needed more work because it wasn't passing even the basic "does it build" check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants