1v1 me first to 31 no powerups [Deathmatch Gamemode] (#19467)
Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -104,7 +104,7 @@ namespace Content.Server.GameTicking
|
||||
RaiseLocalEvent(new RulePlayerJobsAssignedEvent(assignedJobs.Keys.Select(x => _playerManager.GetSessionByUserId(x)).ToArray(), profiles, force));
|
||||
}
|
||||
|
||||
private void SpawnPlayer(IPlayerSession player, EntityUid station, string? jobId = null, bool lateJoin = true)
|
||||
private void SpawnPlayer(IPlayerSession player, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
|
||||
{
|
||||
var character = GetPlayerProfile(player);
|
||||
|
||||
@@ -114,10 +114,10 @@ namespace Content.Server.GameTicking
|
||||
|
||||
if (jobId != null && !_playTimeTrackings.IsAllowed(player, jobId))
|
||||
return;
|
||||
SpawnPlayer(player, character, station, jobId, lateJoin);
|
||||
SpawnPlayer(player, character, station, jobId, lateJoin, silent);
|
||||
}
|
||||
|
||||
private void SpawnPlayer(IPlayerSession player, HumanoidCharacterProfile character, EntityUid station, string? jobId = null, bool lateJoin = true)
|
||||
private void SpawnPlayer(IPlayerSession player, HumanoidCharacterProfile character, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
|
||||
{
|
||||
// Can't spawn players with a dummy ticker!
|
||||
if (DummyTicker)
|
||||
@@ -150,7 +150,7 @@ namespace Content.Server.GameTicking
|
||||
// Do nothing, something else has handled spawning this player for us!
|
||||
if (bev.Handled)
|
||||
{
|
||||
PlayerJoinGame(player);
|
||||
PlayerJoinGame(player, silent);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace Content.Server.GameTicking
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerJoinGame(player);
|
||||
PlayerJoinGame(player, silent);
|
||||
|
||||
var data = player.ContentData();
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
var jobPrototype = _prototypeManager.Index<JobPrototype>(jobId);
|
||||
var job = new JobComponent { PrototypeId = jobId };
|
||||
_roles.MindAddRole(newMind, job);
|
||||
_roles.MindAddRole(newMind, job, silent: silent);
|
||||
var jobName = _jobs.MindTryGetJobName(newMind);
|
||||
|
||||
_playTimeTrackings.PlayerRolesChanged(player);
|
||||
@@ -199,7 +199,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
_mind.TransferTo(newMind, mob);
|
||||
|
||||
if (lateJoin)
|
||||
if (lateJoin && !silent)
|
||||
{
|
||||
_chatSystem.DispatchStationAnnouncement(station,
|
||||
Loc.GetString(
|
||||
@@ -230,7 +230,7 @@ namespace Content.Server.GameTicking
|
||||
_chatManager.DispatchServerMessage(player, Loc.GetString("job-greet-crew-shortages"));
|
||||
}
|
||||
|
||||
if (TryComp(station, out MetaDataComponent? metaData))
|
||||
if (!silent && TryComp(station, out MetaDataComponent? metaData))
|
||||
{
|
||||
_chatManager.DispatchServerMessage(player,
|
||||
Loc.GetString("job-greet-station-name", ("stationName", metaData.EntityName)));
|
||||
@@ -238,7 +238,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
// Arrivals is unable to do this during spawning as no actor is attached yet.
|
||||
// We also want this message last.
|
||||
if (lateJoin && _arrivals.Enabled)
|
||||
if (!silent && lateJoin && _arrivals.Enabled)
|
||||
{
|
||||
var arrival = _arrivals.NextShuttleArrival();
|
||||
if (arrival == null)
|
||||
@@ -269,7 +269,14 @@ namespace Content.Server.GameTicking
|
||||
SpawnPlayer(player, EntityUid.Invalid);
|
||||
}
|
||||
|
||||
public void MakeJoinGame(IPlayerSession player, EntityUid station, string? jobId = null)
|
||||
/// <summary>
|
||||
/// Makes a player join into the game and spawn on a staiton.
|
||||
/// </summary>
|
||||
/// <param name="player">The player joining</param>
|
||||
/// <param name="station">The station they're spawning on</param>
|
||||
/// <param name="jobId">An optional job for them to spawn as</param>
|
||||
/// <param name="silent">Whether or not the player should be greeted upon joining</param>
|
||||
public void MakeJoinGame(IPlayerSession player, EntityUid station, string? jobId = null, bool silent = false)
|
||||
{
|
||||
if (!_playerGameStatuses.ContainsKey(player.UserId))
|
||||
return;
|
||||
@@ -277,7 +284,7 @@ namespace Content.Server.GameTicking
|
||||
if (!_userDb.IsLoadComplete(player))
|
||||
return;
|
||||
|
||||
SpawnPlayer(player, station, jobId);
|
||||
SpawnPlayer(player, station, jobId, silent: silent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user