forked from space-wizards/space-station-14
-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from impstation/master
Please fix
- Loading branch information
Showing
24 changed files
with
97 additions
and
29 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
Content.IntegrationTests/Tests/_Impstation/VoiceMaskTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Content.Server.VoiceMask; | ||
using Content.Shared.Chat; | ||
using Content.Shared.Inventory; | ||
using Robust.Shared.GameObjects; | ||
|
||
namespace Content.IntegrationTests.Tests._Impstation; | ||
|
||
[TestFixture, TestOf(typeof(VoiceMaskSystem))] | ||
public sealed class VoiceMaskTests | ||
{ | ||
[Test] | ||
public async Task TestVoiceMaskTransform() | ||
{ | ||
await using var pair = await PoolManager.GetServerClient(); | ||
var server = pair.Server; | ||
var entMan = server.ResolveDependency<IEntityManager>(); | ||
|
||
var invSys = entMan.System<InventorySystem>(); | ||
|
||
await server.WaitAssertion(() => | ||
{ | ||
var urist = entMan.Spawn("MobHuman"); | ||
var meta = (MetaDataComponent)entMan.GetComponent(urist, typeof(MetaDataComponent)); | ||
var mask = entMan.Spawn("ClothingMaskGasVoiceChameleon"); | ||
var maskVoice = entMan.GetComponent<VoiceMaskComponent>(mask); | ||
maskVoice.VoiceMaskName = "Urist McVoicemask"; | ||
|
||
// Fire a transform name event | ||
var nameEv = new TransformSpeakerNameEvent(urist, meta.EntityName); | ||
entMan.EventBus.RaiseLocalEvent(urist, nameEv, false); | ||
|
||
// Mask has not been equipped, name should be same as entity name | ||
Assert.That(nameEv.VoiceName, Is.EqualTo(meta.EntityName)); | ||
|
||
// Equip the voice mask | ||
Assert.That(invSys.TryEquip(urist, mask, "head", force: true), Is.True); | ||
|
||
// Fire another transform name event | ||
nameEv = new TransformSpeakerNameEvent(urist, meta.EntityName); | ||
entMan.EventBus.RaiseLocalEvent(urist, nameEv, false); | ||
|
||
// Mask is equipped, name should be transformed to mask name | ||
Assert.That(nameEv.VoiceName, Is.EqualTo(maskVoice.VoiceMaskName)); | ||
}); | ||
|
||
await pair.CleanReturnAsync(); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
- type: speechSounds | ||
id: Finfin | ||
saySound: | ||
path: /Audio/Animals/finfin1.ogg | ||
askSound: | ||
path: /Audio/Animals/finfin2.ogg | ||
exclaimSound: | ||
path: /Audio/Animals/finfin3.ogg | ||
|
||
- type: speechSounds | ||
id: Bros | ||
saySound: | ||
path: /Audio/Animals/bros_hit.ogg | ||
askSound: | ||
path: /Audio/Animals/bros_hit.ogg | ||
exclaimSound: | ||
path: /Audio/Animals/bros_hit.ogg | ||
|
||
- type: speechSounds | ||
id: Plushie | ||
saySound: | ||
collection: ToySqueak | ||
askSound: | ||
collection: ToySqueak | ||
exclaimSound: | ||
collection: ToySqueak |