Refactoring of roles and notifications about antagonist assignment (#16864)

* Refactoring of antagonist roles and notifications about antagonist role assignment.
Refactoring of traitor assignment methods and bug fixing.

* Announcement files moved, code is adjusted to new revision

* Play to entity changed to play to global cause of mono audio restrictions.

* Path to audio files changed to sound specifiers, unique alerts for each role.

* Uncommited changes

* New alert sounds for each antag role.

* PR review fixes

* Antagonist role assignment sound notifications moved to Systems, sounds moved to Components.

* License update

* Fixed naming and redundant parameters

---------

Co-authored-by: Титов Вячеслав Витальевич <rincew1nd@yandex.ru>
This commit is contained in:
Vyacheslav Titov
2023-06-07 10:15:22 +03:00
committed by GitHub
parent f5d2b0e284
commit 2e241691aa
25 changed files with 187 additions and 87 deletions

View File

@@ -13,6 +13,7 @@ using Content.Server.Mind.Commands;
using Content.Server.Mind.Components;
using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Server.Roles;
using Content.Server.Speech.Components;
using Content.Server.Temperature.Components;
using Content.Server.Traitor;
@@ -58,6 +59,7 @@ namespace Content.Server.Zombies
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly MobThresholdSystem _mobThreshold = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
public override void Initialize()
{
@@ -207,9 +209,12 @@ namespace Content.Server.Zombies
if (mindcomp.Mind != null && mindcomp.Mind.TryGetSession(out var session))
{
//Zombie role for player manifest
mindcomp.Mind.AddRole(new TraitorRole(mindcomp.Mind, _proto.Index<AntagPrototype>(zombiecomp.ZombieRoleId)));
mindcomp.Mind.AddRole(new ZombieRole(mindcomp.Mind, _proto.Index<AntagPrototype>(zombiecomp.ZombieRoleId)));
//Greeting message for new bebe zombers
_chatMan.DispatchServerMessage(session, Loc.GetString("zombie-infection-greeting"));
// Notificate player about new role assignment
_audioSystem.PlayGlobal(zombiecomp.GreetSoundNotification, session);
}
if (!HasComp<GhostRoleMobSpawnerComponent>(target) && !mindcomp.HasMind) //this specific component gives build test trouble so pop off, ig