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

NPCs can funk out to music, too. #77137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Oct 18, 2024

Summary

Balance "NPCs can funk out to music, too."

Purpose of change

friday_night

...Also NPCs couldn't enjoy music played from vehicle/appliance stereos.

Describe the solution

Properly check for everyone that can hear the music, and make them feel the groove.

Pipe musical_instrument_actor::use through iuse::play_music to minimize code duplication

Describe alternatives you've considered

Ehhh maybe there's a way to do this without lambdas. I know a lot of people don't like lambdas, but I've gotten used to them and these are pretty simple.

vehicle::play_music() probably shouldn't assume the player character and pass it on as Character *p?

Testing

instrument played by the player

2024-10-18.16-32-28.mp4

vehicle/appliance stereo

2024-10-18.16-45-04.mp4

Apparently there may be some way for NPCs to play instruments and for you to listen, but I wasn't able to find out how. Still I structured my changes so that anything that previously worked should continue to work.

Additional context

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions labels Oct 18, 2024
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Oct 19, 2024
@PatrikLundell
Copy link
Contributor

Comment about lambdas:
The part I dislike about lambdas (apart from their weird and non intuitive syntax) is how they break easily resulting in non intuitive error reports in odd places seemingly unrelated to changes made. This behavior can be reduced by not using the failure prone "auto" return typing, but actually stating the type of the return value, as this will flag where the type clashes are rather than the mess this causes otherwise.

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 [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants