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

Give AI a Sound Cue when an Antimov board is inserted #32625

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

poklj
Copy link

@poklj poklj commented Oct 3, 2024

About the PR

Added the ability to give a lawboard an Upload sound that gets played for the AI player

Why / Balance

At the moment Subverted AI are only given a Notification via the Chat that their laws have been changed, Something that can be easily missed during highly active comms and might not immediately cause a player to check their laws.

Causing a very recognizable "You are now evil" sound makes it far more likely a player does not miss that their core directive has changed.

Technical details

Added a SoundSpecifier DataField to SiliconLawProviderComponent

Added a check OnUpdaterInsert to check the SiliconLawUpdaterComponent for a defined Sound (in this case it'll just be Antimov) and play it to the associated player

Added a sound to Antimov's law board

Media

Demonstration-compress.mp4

Requirements

Breaking changes

TODO

  • find/make a more appropriate Antimov sound cue

Changelog

🆑 Kickguy223

  • add: As an AI, Having an Antimov Lawboard inserted into your AI Upload Computer will now Play a sound cue

Add Subversion flag and SubversionSound to SiliconLawProviderComponent

Add new Method (OnSubversionInserted)
to SiliconLawSystem to handle a Subversive
SiliconLawProviderComponent and play it's SubversionSound

Add Check for Subversive law provider to OnUpdaterInsert that
calls OnSubversionInserted if the SiliconLawProviderComponent is
Subversive
- Change out Weh sound used to test that subversion sounds can be
changed by prototype for a a not yet present Antimov subversion sound
- Remove OnSubversionInserted and move the MindPlaySound in the
OnUpdaterInsert so long as LawUploadSound exists

- Modify SubversionSound into LawUploadSound

- Remove the Subversion flag

- Just use emagged_borg.ogg until the better one is made
@poklj poklj requested a review from DrSmugleaf as a code owner October 3, 2024 20:54
@github-actions github-actions bot added the Status: Needs Review This PR requires new reviews before it can be merged. label Oct 3, 2024
@muburu
Copy link

muburu commented Oct 3, 2024

a little sound for when your laws are changed in general (regardless of evilness) would be much more useful than a sound specifically playing for when you're going into evil mode

@poklj
Copy link
Author

poklj commented Oct 3, 2024

a little sound for when your laws are changed in general (regardless of evilness) would be much more useful than a sound specifically playing for when you're going into evil mode

If one was available, it could be placed as the default for the LawUploadSound (this was pointed out to me on discord, and i shifted to make the Noise playing not based on how "subversive" the lawset actually is).
It will play a sound so long as there's a Sound associated to the inserted board at the moment, and the default is left empty, but mostly out of a lack of sound rather than a choice to leave it silent.

@ArtisticRoomba
Copy link
Contributor

A squirrel sound for when Nutimov is inserted lmao

I think that you should just have the sound from SS13 when AI's laws are changed, remember that this needs to work for Freeform laws.

@ScarKy0
Copy link
Contributor

ScarKy0 commented Oct 3, 2024

This should affect anything that has silicon laws and any time the laws are changed(updated, ion storms, etc)

@Everturning
Copy link

Make it the malf ai sound from 13

Copy link
Member

@slarticodefast slarticodefast left a comment

Choose a reason for hiding this comment

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

I agree with the others that there should be a sound effect for every law change. Maybe someone can find a cool one from SS13. The emag law change sound does not really fit here since no emag is used and the "death to NT" has nothing to do with antimov. Otherwise this is a great addition in my opinon that keeps you from missing the law change accidentally

/// The sound that plays for the Silicon player
/// when the particular lawboard has been inserted.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]

DataField already includes ReadWrite access nowadays. Old files still do this manually though.

Comment on lines +298 to +303
if (provider.LawUploadSound != null)
{
if (!_mind.TryGetMind(update, out var mindId, out _))
return;
_roles.MindPlaySound(mindId, provider.LawUploadSound);
}
Copy link
Member

@slarticodefast slarticodefast Oct 3, 2024

Choose a reason for hiding this comment

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

Suggested change
if (provider.LawUploadSound != null)
{
if (!_mind.TryGetMind(update, out var mindId, out _))
return;
_roles.MindPlaySound(mindId, provider.LawUploadSound);
}
if (provider.LawUploadSound != null && _mind.TryGetMind(update, out var mindId, out _))
_roles.MindPlaySound(mindId, provider.LawUploadSound);

you can combine the two if conditions

@slarticodefast slarticodefast added Status: Awaiting Changes This PR needs its reviews addressed or changes to be made in order to be merged. and removed Status: Needs Review This PR requires new reviews before it can be merged. labels Oct 3, 2024
@Doru991
Copy link
Contributor

Doru991 commented Oct 3, 2024

Make it the malf ai sound from 13

I'd prefer if the Malf sound was reserved for malf

@Stewie523
Copy link

I'm all for this but it doesn't fit with the law change. It doesn't use an emag (atleast directly) it should have its own unique sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Changes This PR needs its reviews addressed or changes to be made in order to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants